rivet-design 0.27.1 → 0.28.1

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.
@@ -1,497 +0,0 @@
1
- var ZC=t=>{throw TypeError(t)};var q_=(t,e,n)=>e.has(t)||ZC("Cannot "+n);var W=(t,e,n)=>(q_(t,e,"read from private field"),n?n.call(t):e.get(t)),rt=(t,e,n)=>e.has(t)?ZC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Me=(t,e,n,r)=>(q_(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Et=(t,e,n)=>(q_(t,e,"access private method"),n);var B0=(t,e,n,r)=>({set _(s){Me(t,e,s,n)},get _(){return W(t,e,r)}});function mH(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const gH="modulepreload",vH=function(t){return"/"+t},WC={},J4=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=vH(d),d in WC)return;WC[d]=!0;const f=d.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":gH,f||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),f)return new Promise((v,y)=>{m.addEventListener("load",v),m.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};function R1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var G_={exports:{}},Ih={},Y_={exports:{}},Ot={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var KC;function yH(){if(KC)return Ot;KC=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function m(D){return D===null||typeof D!="object"?null:(D=h&&D[h]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,_={};function b(D,G,fe){this.props=D,this.context=G,this.refs=_,this.updater=fe||v}b.prototype.isReactComponent={},b.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,G,"setState")},b.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function x(){}x.prototype=b.prototype;function k(D,G,fe){this.props=D,this.context=G,this.refs=_,this.updater=fe||v}var C=k.prototype=new x;C.constructor=k,y(C,b.prototype),C.isPureReactComponent=!0;var P=Array.isArray,R=Object.prototype.hasOwnProperty,O={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function A(D,G,fe){var ie,ue={},he=null,_e=null;if(G!=null)for(ie in G.ref!==void 0&&(_e=G.ref),G.key!==void 0&&(he=""+G.key),G)R.call(G,ie)&&!I.hasOwnProperty(ie)&&(ue[ie]=G[ie]);var le=arguments.length-2;if(le===1)ue.children=fe;else if(1<le){for(var ne=Array(le),be=0;be<le;be++)ne[be]=arguments[be+2];ue.children=ne}if(D&&D.defaultProps)for(ie in le=D.defaultProps,le)ue[ie]===void 0&&(ue[ie]=le[ie]);return{$$typeof:t,type:D,key:he,ref:_e,props:ue,_owner:O.current}}function M(D,G){return{$$typeof:t,type:D.type,key:G,ref:D.ref,props:D.props,_owner:D._owner}}function L(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function z(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(fe){return G[fe]})}var $=/\/+/g;function q(D,G){return typeof D=="object"&&D!==null&&D.key!=null?z(""+D.key):G.toString(36)}function X(D,G,fe,ie,ue){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var _e=!1;if(D===null)_e=!0;else switch(he){case"string":case"number":_e=!0;break;case"object":switch(D.$$typeof){case t:case e:_e=!0}}if(_e)return _e=D,ue=ue(_e),D=ie===""?"."+q(_e,0):ie,P(ue)?(fe="",D!=null&&(fe=D.replace($,"$&/")+"/"),X(ue,G,fe,"",function(be){return be})):ue!=null&&(L(ue)&&(ue=M(ue,fe+(!ue.key||_e&&_e.key===ue.key?"":(""+ue.key).replace($,"$&/")+"/")+D)),G.push(ue)),1;if(_e=0,ie=ie===""?".":ie+":",P(D))for(var le=0;le<D.length;le++){he=D[le];var ne=ie+q(he,le);_e+=X(he,G,fe,ne,ue)}else if(ne=m(D),typeof ne=="function")for(D=ne.call(D),le=0;!(he=D.next()).done;)he=he.value,ne=ie+q(he,le++),_e+=X(he,G,fe,ne,ue);else if(he==="object")throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return _e}function K(D,G,fe){if(D==null)return D;var ie=[],ue=0;return X(D,ie,"","",function(he){return G.call(fe,he,ue++)}),ie}function H(D){if(D._status===-1){var G=D._result;G=G(),G.then(function(fe){(D._status===0||D._status===-1)&&(D._status=1,D._result=fe)},function(fe){(D._status===0||D._status===-1)&&(D._status=2,D._result=fe)}),D._status===-1&&(D._status=0,D._result=G)}if(D._status===1)return D._result.default;throw D._result}var ee={current:null},V={transition:null},Q={ReactCurrentDispatcher:ee,ReactCurrentBatchConfig:V,ReactCurrentOwner:O};function B(){throw Error("act(...) is not supported in production builds of React.")}return Ot.Children={map:K,forEach:function(D,G,fe){K(D,function(){G.apply(this,arguments)},fe)},count:function(D){var G=0;return K(D,function(){G++}),G},toArray:function(D){return K(D,function(G){return G})||[]},only:function(D){if(!L(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Ot.Component=b,Ot.Fragment=n,Ot.Profiler=s,Ot.PureComponent=k,Ot.StrictMode=r,Ot.Suspense=c,Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,Ot.act=B,Ot.cloneElement=function(D,G,fe){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var ie=y({},D.props),ue=D.key,he=D.ref,_e=D._owner;if(G!=null){if(G.ref!==void 0&&(he=G.ref,_e=O.current),G.key!==void 0&&(ue=""+G.key),D.type&&D.type.defaultProps)var le=D.type.defaultProps;for(ne in G)R.call(G,ne)&&!I.hasOwnProperty(ne)&&(ie[ne]=G[ne]===void 0&&le!==void 0?le[ne]:G[ne])}var ne=arguments.length-2;if(ne===1)ie.children=fe;else if(1<ne){le=Array(ne);for(var be=0;be<ne;be++)le[be]=arguments[be+2];ie.children=le}return{$$typeof:t,type:D.type,key:ue,ref:he,props:ie,_owner:_e}},Ot.createContext=function(D){return D={$$typeof:o,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},Ot.createElement=A,Ot.createFactory=function(D){var G=A.bind(null,D);return G.type=D,G},Ot.createRef=function(){return{current:null}},Ot.forwardRef=function(D){return{$$typeof:l,render:D}},Ot.isValidElement=L,Ot.lazy=function(D){return{$$typeof:f,_payload:{_status:-1,_result:D},_init:H}},Ot.memo=function(D,G){return{$$typeof:d,type:D,compare:G===void 0?null:G}},Ot.startTransition=function(D){var G=V.transition;V.transition={};try{D()}finally{V.transition=G}},Ot.unstable_act=B,Ot.useCallback=function(D,G){return ee.current.useCallback(D,G)},Ot.useContext=function(D){return ee.current.useContext(D)},Ot.useDebugValue=function(){},Ot.useDeferredValue=function(D){return ee.current.useDeferredValue(D)},Ot.useEffect=function(D,G){return ee.current.useEffect(D,G)},Ot.useId=function(){return ee.current.useId()},Ot.useImperativeHandle=function(D,G,fe){return ee.current.useImperativeHandle(D,G,fe)},Ot.useInsertionEffect=function(D,G){return ee.current.useInsertionEffect(D,G)},Ot.useLayoutEffect=function(D,G){return ee.current.useLayoutEffect(D,G)},Ot.useMemo=function(D,G){return ee.current.useMemo(D,G)},Ot.useReducer=function(D,G,fe){return ee.current.useReducer(D,G,fe)},Ot.useRef=function(D){return ee.current.useRef(D)},Ot.useState=function(D){return ee.current.useState(D)},Ot.useSyncExternalStore=function(D,G,fe){return ee.current.useSyncExternalStore(D,G,fe)},Ot.useTransition=function(){return ee.current.useTransition()},Ot.version="18.3.1",Ot}var qC;function zS(){return qC||(qC=1,Y_.exports=yH()),Y_.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var GC;function _H(){if(GC)return Ih;GC=1;var t=zS(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,d){var f,h={},m=null,v=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(v=c.ref);for(f in c)r.call(c,f)&&!i.hasOwnProperty(f)&&(h[f]=c[f]);if(l&&l.defaultProps)for(f in c=l.defaultProps,c)h[f]===void 0&&(h[f]=c[f]);return{$$typeof:e,type:l,key:m,ref:v,props:h,_owner:s.current}}return Ih.Fragment=n,Ih.jsx=o,Ih.jsxs=o,Ih}var YC;function wH(){return YC||(YC=1,G_.exports=_H()),G_.exports}var S=wH();const bH="x-rivet-editor-token",XC="editorToken",xH=["/api/account","/api/config","/api/auth/store","/api/auth/logout","/api/library/browser-launches","/api/integrations","/api/reference-profiles"],SH=/^\/api\/variants\/(?:[^/]+\/static\/|history\/[^/]+\/[^/]+\/(?:preview(?:\/|$)|site\/)|[^/]+\/[^/]+\/references\/[^/]+\/image\/?$)/,kH=(t,e="GET")=>{const n=t.split(/[?#]/)[0].toLowerCase();return/^\/api\/variants(?:\/|$)/.test(n)?!["GET","HEAD"].includes(e.toUpperCase())||!SH.test(n):xH.some(r=>n===r||n.startsWith(`${r}/`))},eb="rivet_editor_token";let tb;const EH=()=>{if(window.location.pathname.startsWith("/rivet/library"))return;const t=new URLSearchParams(window.location.hash.slice(1)),e=t.get(XC);if(e===null)return;tb=e||null,t.delete(XC);const n=t.toString();window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${n?`#${n}`:""}`);try{e?window.sessionStorage.setItem(eb,e):window.sessionStorage.removeItem(eb)}catch{}},CH=()=>{if(tb!==void 0)return tb;try{return window.sessionStorage.getItem(eb)}catch{return null}};var g=zS();const Ee=R1(g),Zf=mH({__proto__:null,default:Ee},[g]);var PH={};const ce="u">typeof window?window:void 0,ys="u">typeof globalThis?globalThis:ce,Qr=ys==null?void 0:ys.navigator,Oe=ys==null?void 0:ys.document,fn=ys==null?void 0:ys.location,Dp=ys==null?void 0:ys.fetch,VS=ys!=null&&ys.XMLHttpRequest&&"withCredentials"in new ys.XMLHttpRequest?ys.XMLHttpRequest:void 0,QC=ys==null?void 0:ys.AbortController,TH=ys==null?void 0:ys.CompressionStream,As=Qr==null?void 0:Qr.userAgent,Oh=typeof globalThis<"u"?globalThis:ce;Oh&&typeof self>"u"&&(Oh.self=Oh),Oh&&typeof File>"u"&&(Oh.File=function(){});const tt=ce??{},RH="0.10.7",Za={DEBUG:!1,LIB_VERSION:RH,LIB_NAME:"browser-common"};var Uo=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),nb=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const AH=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],IH=["token"];function Ke(t,e){return t.indexOf(e)!==-1}const yf=function(t){return t.trim()},rb=function(t){return t.replace(/^\$/,"")};function e5(t){var e;const n=[];return(e=JSON.stringify(t,function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}}))!==null&&e!==void 0?e:"null"}const t5=Object.prototype,HS=t5.hasOwnProperty,A1=t5.toString,Ue=Array.isArray||function(t){return A1.call(t)==="[object Array]"},Vn=t=>typeof t=="function",ut=t=>t===Object(t)&&!Ue(t),Ws=t=>{if(ut(t)){for(const e in t)if(HS.call(t,e))return!1;return!0}return!1},de=t=>t===void 0,ft=t=>A1.call(t)=="[object String]",fp=t=>ft(t)&&t.trim().length===0,Nn=t=>t===null,at=t=>de(t)||Nn(t),Yn=t=>A1.call(t)=="[object Number]"&&t==t,Oa=t=>Yn(t)&&t>0,Os=t=>A1.call(t)==="[object Boolean]",OH=t=>Ke(AH,t),MH=t=>Ke(IH,t);function n5(t){return t===null||typeof t!="object"}function yv(t,e){return{}.toString.call(t)===`[object ${e}]`}function Wf(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return r5(t,Error)}}function US(t){return"u">typeof Event&&r5(t,Event)}function r5(t,e){try{return t instanceof e}catch{return!1}}const NH=[!0,"true",1,"1","yes"],X_=t=>Ke(NH,t),LH=[!1,"false",0,"0","no"];function JC(t,e,n,r,s,i,o){try{var l=t[i](o),c=l.value}catch(d){return void n(d)}l.done?e(c):Promise.resolve(c).then(r,s)}function pn(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(c){JC(i,r,s,o,l,"next",c)}function l(c){JC(i,r,s,o,l,"throw",c)}o(void 0)})}}const DH=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","lightpanda","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Z0=new Map,e3=function(t,e=[]){if(!t)return!1;const n=(function(o,l){let c="";for(let d=0;l.length>d;d++){const f=l[d];c+=f.length+":"+f}return o.length+":"+o+"|"+l.length+":"+c})(t,e),r=Z0.get(n);if(r!==void 0)return r;const s=t.toLowerCase(),i=DH.concat(e).some(o=>s.indexOf(o.toLowerCase())!==-1);return 256>Z0.size||Z0.clear(),Z0.set(n,i),i};function Jo(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Yn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),Jo(s??n,e,n,r))}var $H=class{constructor(t){this.C={},this.I=t.I,this.A=Jo(t.bucketSize,0,100,t.R),this.O=Jo(t.refillRate,0,this.A,t.R),this.$=Jo(t.refillInterval,0,864e5,t.R)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.A),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),r=String(t);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.A,lastAccess:n},this.C[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((e=this.I)===null||e===void 0||e.call(this,t)),s.tokens===0)}stop(){this.C={}}};const $p="Mobile",Fp="Android",sb="Tablet",s5="Android Tablet",i5="iPad",o5="Apple Watch",Lg="Safari",I1="BlackBerry",a5="Samsung Internet",Dg="Chrome",l5="Chrome iOS",c5="Internet Explorer",u5="Internet Explorer Mobile",d5="Opera",f5="Microsoft Edge",$g="Firefox",h5="Firefox iOS",_v="Nintendo",wv="PlayStation",O1="Xbox",p5="Android Mobile",m5="Mobile Safari",Q_="Windows",g5="Windows Phone",t3="Nokia",ib="Ouya",v5="Generic tablet",ob="Konqueror",y5="Oculus Browser",_5="Vivaldi",w5="Yandex",b5="Whale",x5="DuckDuckGo",S5="Pale Moon",k5="Waterfox",ab="Brave",E5="Claude",C5="Codex",P5="ChatGPT",T5="Google Search App",J_=new RegExp("Version/(\\d+(\\.\\d+)?)"),e2=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),FH=new RegExp(O1,"i"),jH=new RegExp("PlayStation \\w+","i"),zH=new RegExp("Nintendo \\w+","i"),BS=new RegExp("BlackBerry|PlayBook|BB10","i"),VH={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},R5=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?ab:null})(n)||(r!=null&&r.detectGoogleSearchApp&&Ke(t,"GSA/")?T5:Ke(t," OPR/")&&Ke(t,"Mini")?"Opera Mini":Ke(t," OPR/")?d5:BS.test(t)?I1:Ke(t,"IEMobile")||Ke(t,"WPDesktop")?u5:Ke(t,"OculusBrowser")?y5:Ke(t,"SamsungBrowser")?a5:Ke(t,"Edge")||Ke(t,"Edg/")?f5:Ke(t,"Vivaldi/")?_5:Ke(t,"YaBrowser/")?w5:Ke(t,"Whale/")?b5:Ke(t,"DuckDuckGo/")||Ke(t,"Ddg/")?x5:Ke(t,"Claude/")?E5:Ke(t,"Codex/")?C5:Ke(t,"ChatGPT/")?P5:Ke(t,"FBIOS")?"Facebook Mobile":Ke(t,"UCWEB")||Ke(t,"UCBrowser")?"UC Browser":Ke(t,"CriOS")?l5:Ke(t,"CrMo")||Ke(t,Dg)?Dg:Ke(t,Fp)&&Ke(t,Lg)?p5:Ke(t,"FxiOS")?h5:Ke(t.toLowerCase(),ob.toLowerCase())?ob:Ke(t,"Brave/")?ab:((i,o)=>o&&Ke(o,"Apple")||(function(l){return Ke(l,Lg)&&!Ke(l,Dg)&&!Ke(l,Fp)})(i))(t,e)?Ke(t,$p)?m5:Lg:Ke(t,"PaleMoon/")?S5:Ke(t,"Waterfox/")?k5:Ke(t,$g)?$g:Ke(t,"MSIE")||Ke(t,"Trident/")?c5:Ke(t,"Gecko")?$g:"")},HH={[u5]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[f5]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[Dg]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[l5]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[Lg]:[J_],[m5]:[J_],[d5]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[$g]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[h5]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[ob]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[I1]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),J_],[p5]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[a5]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[y5]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[_5]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[w5]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[b5]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[ab]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[E5]:[e2],[C5]:[e2],[P5]:[e2],[x5]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[S5]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[k5]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[T5]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[c5]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},UH=function(t,e,n,r){const s=R5(t,e,n,r),i=HH[s];if(de(i))return null;for(let o=0;i.length>o;o++){const l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},n3=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[O1,t&&t[1]||""]],[new RegExp(_v,"i"),[_v,""]],[new RegExp(wv,"i"),[wv,""]],[BS,[I1,""]],[new RegExp(Q_,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[g5,""];if(new RegExp($p).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=VH[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[Q_,r]}return[Q_,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=de(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Fp,[t[2],t[3],t[4]||"0"].join(".")]:[Fp,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],A5=function(t){for(let e=0;n3.length>e;e++){const[n,r]=n3[e],s=n.exec(t),i=s&&(Vn(r)?r(s,t):r);if(i)return i}return["",""]},I5=function(t){return zH.test(t)?_v:jH.test(t)?wv:FH.test(t)?O1:new RegExp(ib,"i").test(t)?ib:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?g5:/iPad/.test(t)?i5:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?o5:BS.test(t)?I1:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(t3,"i").test(t)?t3:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp($p).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Fp:s5:new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(sb,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?v5:""},BH=function(t,e){var n;const r=I5(t);return r===i5||r===s5||r==="Kobo"||r==="Kindle Fire"||r===v5?sb:r===_v||r===O1||r===wv||r===ib?"Console":r===o5?"Wearable":r?$p:(e==null?void 0:e.userAgentDataPlatform)==="Android"&&((n=e==null?void 0:e.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=e==null?void 0:e.screenWidth)!==null&&s!==void 0?s:0,(i=e==null?void 0:e.screenHeight)!==null&&i!==void 0?i:0)/((o=e==null?void 0:e.devicePixelRatio)!==null&&o!==void 0?o:1)?$p:sb:"Desktop";var s,i,o},t2=/\bFBAV\/(\d+(?:\.\d+)*)/i,r3=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",t2],[/\bFBAN\/EMA\b/i,"Facebook Lite",t2],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",t2],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],lb="[Truncated]",Rm="[Unserializable]";function Kd(t){let e="";for(let n=0;t.length>n;n++){const r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{const s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function O5(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const r of n){let s;try{s=e[r]}catch{s=Rm}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const n2=3e5;var M5=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;const e=this.isOpen(),n=Date.now(),r=Math.min(t.retryAfterMs,n2);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+n2))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(n2,Math.max(0,this.es-t));return e===0&&this.reset(),e}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const ZH=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function s3(t,e){return typeof(n=t)=="string"&&ZH.test(n)?t:e();var n}function N5(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function Ql(t){return t&&t.split("#")[0]}function i3(t){try{return t()}catch{return}}function L5(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function o3(t,e,n){return D5.apply(this,arguments)}function D5(){return(D5=pn(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=L5(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function hp(t){return hp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hp(t)}function WH(t,e,n){return(e=(function(r){var s=(function(i){if(hp(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(hp(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return hp(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function j(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?a3(Object(n),!0).forEach(function(r){WH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}let Mh,l3,c3,md;function KH(t){var e;const n=globalThis._posthogChunkIds,r=globalThis._debugIds;if(!n&&!r)return;const s=n?Object.keys(n):[],i=r?Object.keys(r):[];if(md&&u3(n,s,l3)&&u3(r,i,c3))return md;l3=n?j({},n):void 0,c3=r?j({},r):void 0,md={},(e=Mh)!==null&&e!==void 0||(Mh={});const o=(l,c)=>{for(const f of l){const h=c[f];if(!h)continue;const m=Mh==null?void 0:Mh[f];if(m){md[m]=h;continue}const v=t(f);for(let y=v.length-1;y>=0;y--){var d;const _=(d=v[y])===null||d===void 0?void 0:d.filename;if(_){md[_]=h,Mh[f]=_;break}}}};return r&&o(i,r),n&&o(s,n),md}function u3(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(r=>t[r]===n[r]):t===n}var qH=class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,e,0).apply(t),s=this.buildParsingContext(e),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(t){var e=this;return pn(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&Ue(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:(e=t.syntheticException)===null||e===void 0?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let r,s;if(t.cause!=null&&(r=this.parseStacktrace(t.cause,e)),t.stack!=""&&t.stack!=null)try{s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch{}return j(j({},t),{},{cause:r,stack:s,errors:(n=t.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,e))})}applyChunkIds(t,e){return t.map(n=>(n.filename&&e&&(n.chunk_id=e[n.filename]),n))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return pn(function*(){let n=t;for(const r of e.modifiers)n=yield r(n);return n})()}convertToExceptionList(t,e){const n=[],r=(s,i,o)=>{var l;const c=n.length,d=i===void 0?j(j({type:typeof e.type=="string"&&e.type.length>0?e.type:"generic"},typeof e.handled=="boolean"?{handled:e.handled}:e.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof e.synthetic=="boolean"?e.synthetic:s.synthetic,exception_id:c}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:c,parent_id:i},f={type:s.type,value:s.value,mechanism:d};s.stack&&(f.stacktrace={type:"raw",frames:s.stack}),n.push(f),s.cause&&r(s.cause,c,"cause");for(const h of(l=s.errors)!==null&&l!==void 0?l:[])r(h,c,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:KH(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(Wf(t)){let n=Object.getPrototypeOf(t);for(let r=0;n&&100>r;r++){var e;const s=(e=Object.getOwnPropertyDescriptor(n,"constructor"))===null||e===void 0?void 0:e.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=t.errors;return Ue(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(t,e,n=0){let r=0,s=0,i=!1;const o=new Set,l=[],c={},d=(m,v,y=0)=>{const _=f(v,y),b=_.apply;if(_.apply=O=>{l.push(m);try{return b(O)}finally{l.pop()}},y>4||y>0&&l.indexOf(m)!==-1)return this.coerceFallback(_);const x=typeof m=="object"&&m!==null||typeof m=="function";if(y===0&&r>=50||x&&o.has(m))return;x&&o.add(m),y===0&&r++;const k=this.getAggregateErrors(m);let C,P;i||(i=!!k);try{if(C=this.applyCoercers(m,_),!C)throw c}catch(O){if(O===c)return void(y===0&&r--);if(!i)throw O;C=this.coerceFallback(_)}if(!k||r>=50)return C;try{P=k.length}catch{return C}if(!Number.isInteger(P)||0>P||P>4294967295)return C;const R=[];for(let O=0;50>r&&1e3>s&&P>O;O++){let I;s++;try{I=_.next(k[O])}catch{r++,I=this.coerceFallback(f(v+1))}I&&R.push(I)}return j(j({},C),{},{errors:R})},f=(m,v=0)=>j(j({},e),{},{syntheticException:m==0?e.syntheticException:void 0,mechanism:m==0?t:{},apply(y){const _=d(y,m,v+1);if(!_)throw c;return _},next:y=>d(y,m+1)}),h=f(n);return j(j({},h),{},{apply:m=>{var v;return(v=d(m,n))!==null&&v!==void 0?v:this.coerceFallback(h)}})}};const GH=/^([a-z][a-z0-9.+-]+):/i,YH=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function XH(t){if(!t||t==="<anonymous>")return!1;const e=GH.exec(t);return!e||YH.includes(e[1].toLowerCase())}function cb(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:XH(e)};return de(r)||(i.lineno=r),de(s)||(i.colno=s),i}const $5=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},QH=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,JH=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,eU=/\((\S*)(?::(\d+))(?::(\d+))\)/,tU=(t,e)=>{const n=QH.exec(t);if(n){const[,s,i,o]=n;return cb(e,s,"?",+i,+o)}const r=JH.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=eU.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=$5(r[1]||"?",r[2]);return cb(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},nU=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,rU=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,sU=(t,e)=>{const n=nU.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=rU.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}let r=n[3],s=n[1]||"?";return[s,r]=$5(s,r),cb(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},d3=/\(error: (.*)\)/;function ZS(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function iU(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let r=!0;for(let s=0;e>s;s++)if(!ZS(t[n+s],t[n+e+s])){r=!1;break}if(r){for(let s=0;e>s;s++)t[n+s]=t[n+e+s];return t.length=n+e,{start:n,length:e}}}}function oU(t,e){const n=e.start+e.length,r=j5(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function F5(t,e){let n=e.start;for(;n>0&&ZS(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function j5(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&ZS(t[r],t[r-e.length]);)r++;return r-n}function aU(t,e){const n=e[0];let r=t.length-(n?F5(t,n):0);for(const s of e)r-=j5(t,s);return r}function lU(t,e,n){for(let r=0;t.length>r;r++){const s=t[(e+r)%t.length],i=t[(n+r)%t.length];if(s!==i)return i>s}return!1}var cU=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=ft(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return yv(t,"DOMException")}isDOMError(t){return yv(t,"DOMError")}},uU=class{match(t){return Wf(t)}coerce(t,e){var n;const r=this.getStack(t),s=r===void 0?(n=e.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(t),value:this.getMessage(t,e),stack:r??s,cause:t.cause?e.next(t.cause):void 0,synthetic:i}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if(typeof e=="string"&&e.length>0)return e;const n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},dU=class{match(t){return!!yv(t,"ErrorEvent")&&(t.error!=null||this.yr(t))}coerce(t,e){var n;if(t.error!=null)return e.apply(t.error);const r=e.apply(t.message);return j(j({},r),{},{stack:(n=this.br(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}yr(t){return ft(t.message)&&t.message.length>0}br(t){var e,n;const r=t,s=(e=r.lineno)!==null&&e!==void 0?e:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(ft(r.filename)&&r.filename.length!==0&&s!==0)return`Error
18
- at ${r.filename}:${s}:${i}`}};const fU=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var hU=class{match(t){return typeof t=="string"}coerce(t,e){var n;const[r,s]=this.getInfos(t);return{type:r??"Error",value:s??t,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const r=t.match(fU);return r&&(e=r[1],n=r[2]),[e,n]}};const pU=["fatal","error","warning","log","info","debug"];function z5(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?`${s.slice(0,e)}...`:s}return""}var mU=class{match(t){return typeof t=="object"&&t!==null}coerce(t,e){var n,r;const s=this.getErrorPropertyFromObject(t);return s?e.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(n=this.getStack(t))!==null&&n!==void 0?n:(r=e.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(US(t))return t.constructor.name;const e="name"in t?t.name:void 0;return ft(e)&&!fp(e)?e:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;const e=this.getObjectClassName(t);return`${e&&e!=="Object"?`'${e}'`:"Object"} captured as exception with keys: ${z5(t)}`}isSeverityLevel(t){return ft(t)&&!fp(t)&&pU.indexOf(t)>=0}getStack(t){try{return ft(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:ft(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(Wf(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},gU=class{match(t){return US(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${z5(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},vU=class{match(t){return n5(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},yU=class{match(t){return yv(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!US(t))return!1;try{const e=t.detail;return e!=null&&typeof e=="object"&&"reason"in e}catch{return!1}}coerce(t,e){var n;const r=this.getUnhandledRejectionReason(t);return n5(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};const bv="$message",xv="$timestamp",_U=new Set([bv,xv]),r2={enabled:!0,max_bytes:32768};function Sv(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:r2.enabled,max_bytes:bU(t.max_bytes,r2.max_bytes)}:j({},r2)}var wU=class{constructor(t){this.ns=[],this.ss=0,this.Fr=Sv(t)}setConfig(t){this.Fr=Sv(t),this.rs()}add(t){const e=(function(r){let s;try{s=e5(r)}catch{return}try{const i=JSON.parse(s);if(!ut(i))return;const o=i,l=o[bv],c=o[xv];return!ft(l)||l.trim().length===0||!ft(c)&&!Yn(c)?void 0:{step:o,json:s}}catch{return}})(t);if(!e)return;const n=(function(r){if("u">typeof TextEncoder)return new TextEncoder().encode(r).length;const s=encodeURIComponent(r);let i=0;for(let o=0;s.length>o;o++)s[o]==="%"?(i+=1,o+=2):i+=1;return i})(e.json);n>this.Fr.max_bytes||(this.ns.push({step:e.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(t=>t.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Fr.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function bU(t,e){if(!Yn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const f3=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function h3(t){return typeof t=="string"||t}function p3(t){return typeof t=="string"?t:void 0}const xU=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],V5="NativeGzipValidationError",ub=t=>t.length>=2&&t[0]===31&&t[1]===139,m3=(t,e)=>t===nb.GZipJS||e===nb.GZipJS||e==="gzip",g3=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let Nh;const W0=t=>{throw N5(V5,`Native gzip produced invalid output: ${t}`)},SU=(function(){var t=pn(function*(e,n){18>e.size&&W0("too-short");const r=new Uint8Array(yield e.slice(0,10).arrayBuffer());ub(r)&&r[2]===8||W0("invalid-header");const s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(o=>{const l=(()=>{if(Nh)return Nh;Nh=[];for(let d=0;256>d;d++){let f=d;for(let h=0;8>h;h++)f=1&f?3988292384^f>>>1:f>>>1;Nh[d]=f>>>0}return Nh})();let c=4294967295;for(let d=0;o.length>d;d++)c=l[255&(c^o[d])]^c>>>8;return(4294967295^c)>>>0})(n)&&W0("invalid-crc");const i=n.length>>>0;s.getUint32(4,!0)!==i&&W0("invalid-size")});return function(e,n){return t.apply(this,arguments)}})();function db(){return db=pn(function*(t,e=!0,n){try{const s=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),l=o.write(s).then(()=>o.close()).catch((r=pn(function*(f){try{yield o.abort(f)}catch{}throw f}),function(f){return r.apply(this,arguments)})),c=new Response(i.readable).blob(),[d]=yield Promise.all([c,l]);return yield SU(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return e&&console.error("Failed to gzip compress data",s),null}var r}),db.apply(this,arguments)}function H5(t,e){if(t==null)return{};var n,r,s=(function(o,l){if(o==null)return{};var c={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(l.includes(d))continue;c[d]=o[d]}return c})(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;i.length>r;r++)e.includes(n=i[r])||{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}const gs="[redacted]",kU=/^[A-Za-z0-9+/\n\r]+=*$/,EU=/^[A-Za-z0-9_-]+={0,2}$/,CU=/[-_]/,PU=/^data:[^,\s]*;base64,/i,TU=/^[A-Za-z0-9+/_-]+={0,2}$/,RU=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,AU=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,U5=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,IU=/[\s<>"]/,B5=new RegExp(U5.source,"i"),Z5=/[a-z][a-z0-9+.-]{0,63}:\/\//i,OU=new RegExp(`^${Z5.source}`,"i"),MU=new RegExp(Z5.source,"gi"),NU=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,LU=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,DU=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,$U=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,FU=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,jU=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,zU=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,VU=/\b\d(?:[ ./-]?\d){12,}\b/g,v3=/\d+/g,HU=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,UU=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function fb(t){return(function(e){return AU.test(e)})(t)||NU.test(t)||LU.test(t)}function s2(t){return t.split("&",129).length>128}function BU(t,e,n){return fb(t)||e.includes(";")&&(function(r){return r.split(";").some(s=>fb(s.split("=",1)[0]))})(e)?gs:B5.test(e)?n?WS(e,{allowNestedUrls:!1,stripPunctuation:!0}):gs:e}function W5(t,e){const n=new URLSearchParams;let r=!1,s=!1;for(const[i,o]of new URLSearchParams(t)){const l=kv(i),c=kv(o);r||(r=l!==i||c!==o);const d=BU(l,c,e);r||(r=d!==c),s=fb(l)||d!==c,n.append(l,d)}return{changed:r,lastFieldSensitive:s,serialized:n.toString()}}function y3(t,e){if(!t.includes("="))return{value:ZU(t,e),lastFieldSensitive:!1};const n=W5(t,e);return{value:n.changed?n.serialized:t,lastFieldSensitive:n.lastFieldSensitive}}function ZU(t,e){return e?WS(t,{allowNestedUrls:!1,stripPunctuation:!0}):B5.test(t)?gs:t}function WU(t,e,n){return t==="#"?!e.fragment&&(e.fragment=!0):t==="?"&&(e.fragment?n!=="="&&!e.fragmentQuery&&(e.fragmentQuery=!0):!e.query&&(e.query=!0))}function i2(t,e){var n;if(t.length>8192&&OU.test(t))return gs;const{address:r,suffix:s}=e.stripPunctuation?(function(b){let x=b.length;for(;x>0&&".,;:!?)]}'".includes(b[x-1]);)x--;return{address:b.slice(0,x),suffix:b.slice(x)}})(t):{address:t,suffix:""};let i;try{i=new URL(r)}catch{return gs+s}const o=i.search.slice(1),l=i.hash!=="",c=(function(b){const x=b.slice(1),k=x.indexOf("?");return 0>k?{head:x,tail:null}:{head:x.slice(0,k),tail:x.slice(k+1)}})(i.hash);if(s2(o)||s2(c.head)||s2((n=c.tail)!==null&&n!==void 0?n:""))return gs+s;let d=!1;(i.username||i.password)&&(i.username=gs,i.password="",d=!0);const f=W5(o,e.allowNestedUrls);f.changed&&(i.search=f.serialized,d=!0);const h=y3(c.head,e.allowNestedUrls),m=c.tail===null?null:(v=c.tail,h.lastFieldSensitive?{value:v===""?"":gs,lastFieldSensitive:!0}:y3(v,e.allowNestedUrls));var v;const y=m===null?h.value:`${h.value}?${m.value}`;y!==i.hash.slice(1)&&(i.hash=y,d=!0);const _=l?m??h:f;return(d?kv(i.toString()):r)+(_.lastFieldSensitive?"":s)}function WS(t,e){return t.replace(U5,n=>(function(r,s){const i=(function(c){if(!c.includes("://"))return[];const d=[...c.matchAll(MU)].map(_=>_.index),f=[],h={query:!1,fragment:!1,fragmentQuery:!1};let m=0,v=!1,y="";for(let _=0;c.length>_&&d.length>m;_++){d[m]===_&&(_>0&&y!=="="&&f.push(_),m++);const b=c[_];WU(b,h,y)?(y=b,v=!0):v&&"=&".includes(b)&&(y=b)}return f})(r);if(i.length===0)return i2(r,s);let o="",l=0;for(const c of i)o+=i2(r.slice(l,c),j(j({},s),{},{stripPunctuation:!1})),l=c;return o+i2(r.slice(l),s)})(n,j(j({},e),{},{stripPunctuation:e.stripPunctuation&&n.length!==t.length})))}function kv(t){return t.replace(RU,gs)}function K5(t,e){return(function(n){return n.length>=10240&&(kU.test(n)||(function(r){const s=PU.exec(r);if(!s)return!1;let i;try{i=decodeURIComponent(r.slice(s[0].length))}catch{return!1}return TU.test(i.replace(/[\r\n]/g,""))})(n)||CU.test(n)&&EU.test(n))})(t)?"[binary data redacted - not supported by PostHog MCP analytics]":(function(n,r,s){const i=4*s.maxStringLength;if(n.length>i){const o=r(n.slice(0,(function(l,c){let d=c;for(;d>0&&!IU.test(l[d-1]);)d--;return d})(n,i)));if(o.length>=2*s.maxStringLength)return o+s.truncationSuffix}return r(n)})(t,n=>(function(r){return WS(r,{allowNestedUrls:!0,stripPunctuation:!0})})((function(r){let s=r.replace(DU," ");return s=s.replace($U,gs),s=s.replace(FU,gs),s=s.replace(jU,`$1${gs}`),s=s.replace(VU,qU),s=s.replace(zU,gs),s=s.replace(HU,`$1${gs}`),s=s.replace(UU,`$1${gs}`),s})(kv(n))),e)}function KU(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;if(0>s||s>9)return!1;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function qU(t){const e=[];for(let i=v3.exec(t);i!==null;i=v3.exec(t))e.push({digits:i[0],start:i.index,end:i.index+i[0].length});let n="",r=0,s=0;for(;e.length>s;){let i="",o=-1;for(let l=s;e.length>l&&(i+=e[l].digits,19>=i.length);l++)i.length>=13&&KU(i)&&(o=l);0>o?s++:(n+=t.slice(r,e[s].start)+gs,r=e[o].end,s=o+1)}return n+t.slice(r)}const GU={}.propertyIsEnumerable;function Ev(t,e){try{return q5(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function KS(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:lb};if(n.remainingNodes--,Os(t))return{boolValue:t};if(typeof t=="bigint")return(function(s,i){const o=s.toString(),l=BigInt("9223372036854775808");return s>=l||-l>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const s=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e==null||e.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Kd(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:lb};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?Kd(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return KS(s.call(t),e,n,r+1)}catch{}return Ue(t)?{arrayValue:{values:YU(t,e,n,r+1)}}:{kvlistValue:{values:q5(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Kd(String(t))}}function YU(t,e,n,r){const s=[],i=Math.min(t.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const l=o in t?t[o]:void 0;if(at(l))continue;s.push(KS(l,e,n,r))}catch{s.push({stringValue:Rm})}return t.length>o&&s.push({stringValue:lb}),s}function q5(t,e,n,r){const s=[];for(const i in t)if(GU.call(t,i)){if(!i){e==null||e.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=t[i];if(Nn(o)||de(o))continue;s.push({key:Kd(i),value:KS(o,e,n,r)})}catch{s.push({key:Kd(i),value:{stringValue:Rm}})}}return s}function G5(t,e,n){return j(j(j(j({},O5({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const XU=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Y5(t,e){const n=O5({},t),r={};for(const s of XU)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...Ev(n,e),...Ev(r,e)]}const _3={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},X5={text:"INFO",number:9},QU={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:X5,warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}};function JU(t){try{return Kd(String(t))}catch{return Rm}}function eB(t,e,n,r){const s=t.level||"info",{text:i,number:o}=QU[s]||X5,l=(function(m=Date.now()){return String(m)+"000000"})(Yn(r)?r:void 0),c={};e.distinctId&&(c.posthogDistinctId=e.distinctId),e.sessionId&&(c.sessionId=e.sessionId),e.windowId&&(c["window.id"]=e.windowId),at(e.sessionStartTimestamp)||(c.sessionStartTimestamp=String(e.sessionStartTimestamp)),at(e.lastActivityTimestamp)||(c.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(c["url.full"]=e.currentUrl),e.screenName&&(c["screen.name"]=e.screenName),e.appState&&(c["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(c.feature_flags=e.activeFeatureFlags);const d=j({},c),f=t.attributes;if(f){let m=[];try{m=Object.keys(f)}catch{m=[]}for(const v of m){let y;try{y=f[v]}catch{y=Rm}Object.defineProperty(d,v,{value:y,enumerable:!0,writable:!0,configurable:!0})}}const h={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:JU(t.body)},attributes:Ev(d,n)};return t.trace_id&&(h.traceId=t.trace_id),t.span_id&&(h.spanId=t.span_id),de(t.trace_flags)||(h.flags=t.trace_flags),h}function Q5(t,e,n){return G5(t,e,n)}function J5(t,e,n,r){return{resourceLogs:[{resource:{attributes:Y5(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var eO=class{constructor(t){this.ls=t,this.us=0}get pending(){return!!this.cs}arm(t){this.clear(),this.us=Date.now()+t,this.cs=L5(()=>{this.cs=void 0,this.ls()},t)}armNoEarlierThan(t){this.cs&&Date.now()+t<=this.us||this.arm(t)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function tO(){return .75+.5*Math.random()}function nO(t,e,n,r){const s=Math.min(Math.max(0,e-1),6),i=t*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,t))*n)}var tB=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Fr=e,this.R=n,this.hs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new eO(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new M5,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=e.maxBufferSize,this.Is=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Ms=e.flushIntervalMs,this.Es=e.maxBatchRecordsPerPost,this.As=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Uo.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.$s=0,this.Cs=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Fr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.Ps()&&this.Os():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Fs(t);if(r===null)return;if(!r.body)return void this.R.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:eB(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.hs(),this.R,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Fs(t){const e=this.Fr.beforeSend;if(!e)return t;const n=Ue(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.R.info("Log was rejected in beforeSend function"),null;r=i}catch(i){return this.R.error("Error in beforeSend function for log:",i),null}return r}Ds(){if(this.Rs===void 0)return!0;const t=Date.now(),e=t-this.xs;return this.As>e&&e>=0||(this.xs=t,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.R.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.As}ms`),this.Cs=!0),!1)}flush(){var t=this;return pn(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return pn(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(Uo.LogsQueue))!==null&&e!==void 0?e:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;const l=t._s;t.bs=0;const c=Math.min(n.length,t.Es),d=n.slice(0,c),f=J5(d.map(m=>m.record),t.js(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.qs(f);if(t._s!==l)return;if(h.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.R.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${t.Es}`);else if(t.ws.record(h),t.ps.pending&&t.ps.arm(Math.max(t.Ms,t.ws.remainingMs())),h.kind==="retry-later"||(h.kind==="too-large"?t.R.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Fr.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Fr.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(Uo.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,h.kind==="fatal"))throw h.error}})()}Bs(t){var e=this;return pn(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(Uo.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Uo.LogsQueue,s.slice(r)),yield e.vs()})()}js(){return Q5(this.Fr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(Uo.LogsQueue))!==null&&e!==void 0?e:[];this.Is>n.length||(n.shift(),this.bs++,this.R.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Uo.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Os():this.gs()}Os(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(nO(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}Ps(){const t=this._instance.getPersistedProperty(Uo.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return pn(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield o3(n,t):yield n})()}flushWithTimeout(t){var e=this;return pn(function*(){const n=e.flush();yield o3(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=tO(),this.R.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Ps()&&this.ps.armNoEarlierThan(this.zs())})}};const nB=/^[0-9a-f]+$/;function w3(t,e,n){return typeof t=="string"&&t.length===e&&t!==n&&nB.test(t)}const rB=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/,sB="00",K0=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function hb(t){return String(t)+"000000"}function o2(t,e,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${t}\0${e}\0${n??""}\0${s}`}var iB=class{constructor(t,e,n){this._instance=t,this.Fr=e,this.R=n,this.Hs=new Map,this.ps=new eO(()=>this.flush().catch(r=>{this.R.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Gs=new Map,this.Qs=new Set,this.Js=!1,this.ws=new M5,this.ks=0,this.Ss=1,this.Zs=0}count(t,e=1,n){this.Ks({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Ks({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Ks({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes,bounds:Ue(n==null?void 0:n.bounds)?n.bounds.slice():n==null?void 0:n.bounds})}flush(){var t=this;const e=this.ys,n=(function(){var r=pn(function*(){e&&(yield e.catch(()=>{})),yield t.Ys()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.ys===n&&(this.ys=null)});return this.ys=n,n}drainWindow(){if(this.Hs.size===0)return null;const t=this.Hs;return this.Xs(),this._o(t)}reset(){this.Zs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.ys=null,this.Xs(),this.Gs=new Map,this.Js=!1}Xs(){this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Qs=new Set}Ks(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Fs(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.R.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.R.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type!=="count"&&e.type!=="gauge"&&e.type!=="histogram")return void this.R.warn(`Dropping metric '${e.name}': unknown type '${String(e.type)}'`);if(e.type==="count"&&0>e.value)return void this.R.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?j({},e.attributes):void 0,r=o2(e.type,e.name,e.unit,n)}catch(c){return void this.R.warn(`Dropping metric '${e.name}': attributes could not be serialized`,c)}let s,i=this.Hs.get(r);if(!i&&!this.ko()||e.type==="histogram"&&(s=this.So(e.name,e.unit,e.bounds),!s))return;i||(i={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now(),hist:s&&oB(s)},this.Hs.set(r,i));const o=this.Ws.get(e.name);o===void 0?this.Ws.set(e.name,e.type):o===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.R.warn(`Metric name '${e.name}' is already used as a ${o}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.xo(i,e.value);const l=this.$o();l&&(i.exemplar=j(j({},l),{},{value:e.value,timeMs:Date.now()})),this.Os()}$o(){try{var t,e;const n=(function(r){const s=(function(o){if(typeof o!="string")return;const l=rB.exec(o.trim());if(!l)return;const[,c,d,f,h,m]=l;return c==="ff"||c==="00"&&m||!(function(v){return w3(v,32,"00000000000000000000000000000000")})(d)||!(function(v){return w3(v,16,"0000000000000000")})(f)?void 0:{version:c,traceId:d,spanId:f,flags:h}})(r);return s&&{traceId:s.traceId,spanId:s.spanId,flags:(i=s.flags,1&parseInt(i,16)?"01":sB)};var i})((t=(e=this._instance).getActiveSpan)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.traceparent());if(n&&n.flags==="01")return{traceId:n.traceId,spanId:n.spanId}}catch{}}ko(){return this.Fr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.R.warn(`Metric series cap reached (${this.Fr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}So(t,e,n){if(n!==void 0&&!(function(o){if(!Ue(o)||o.length===0)return!1;for(let l=0;o.length>l;l++)if(!Number.isFinite(o[l])||l>0&&o[l-1]>=o[l])return!1;return!0})(n))return void this.R.warn(`Dropping histogram '${t}': bounds must be a non-empty array of finite, strictly increasing numbers`);const r=o2("histogram",t,e,void 0),s=this.Gs.get(r);if(s)return this.Co(t,r,s,n),s;if(this.Gs.size>=this.Fr.maxSeriesPerFlush)return this.Js||(this.Js=!0,this.R.warn(`Histogram bounds limit reached (${this.Fr.maxSeriesPerFlush} distinct histograms); new histograms that pass custom bounds are dropped. Reduce histogram name cardinality.`)),n&&!b3(n,K0)?void 0:K0;const i=n?n.slice():K0;return this.Gs.set(r,i),i}Co(t,e,n,r){b3(n,r??K0)||this.Qs.has(e)||(this.Qs.add(e),this.R.warn(`Histogram '${t}' already uses the bounds [${n.join(", ")}]; samples that pass different bounds are recorded in those buckets.`))}xo(t,e){switch(t.type){case"count":var n;t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":{const r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(e,r.bounds)]+=1;break}}}Fs(t){const e=this.Fr.beforeSend;if(!e)return t;const n=Ue(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.R.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.R.error("Error in beforeSend function for metric:",i),null}return r}Os(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(nO(this.Fr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Ys(){var t=this;return pn(function*(){if(t.ps.clear(),t.Hs.size===0)return;const e=t.Hs;t.Xs();const n=t.Zs,r=yield t._instance.To(t._o(e));if(n===t.Zs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=tO()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.zs()),r.kind){case"ok":return;case"retry-later":return t.Io(e),void t.ps.armNoEarlierThan(t.zs());case"too-large":return void t.R.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.R.error("Failed to send metrics batch:",r.error)}})()}_o(t){return e=this.Mo(t),n=(function(i,o,l){return G5(i,o,l)})(this.Fr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Y5(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}Mo(t){const e=hb(Date.now()),n=new Map;for(const o of t.values()){var r;const l=o2(o.type,o.name,o.unit,void 0);let c=n.get(l);c||(c=j({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?c.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?c.gauge={dataPoints:[]}:c.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,c));const d=Ev((r=o.attributes)!==null&&r!==void 0?r:{},this.R),f=hb(o.windowStartMs),h=aB(o.exemplar);if(o.type==="count"){var s;const m=j({attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0},h);c.sum.dataPoints.push(m)}else if(o.type==="gauge"){var i;const m=j({attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0},h);c.gauge.dataPoints.push(m)}else{const m=o.hist,v=j({attributes:d,startTimeUnixNano:f,timeUnixNano:e,count:m.count,sum:m.sum,min:m.min,max:m.max,bucketCounts:m.bucketCounts,explicitBounds:m.bounds},h);c.histogram.dataPoints.push(v)}}return Array.from(n.values())}Io(t){for(const[s,i]of t){var e;const o=this.Hs.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.exemplar=(e=o.exemplar)!==null&&e!==void 0?e:i.exemplar,o.type){case"count":var n,r;o.total=((n=o.total)!==null&&n!==void 0?n:0)+((r=i.total)!==null&&r!==void 0?r:0);break;case"gauge":break;case"histogram":{const l=o.hist,c=i.hist;l.count+=c.count,l.sum+=c.sum,l.min=Math.min(l.min,c.min),l.max=Math.max(l.max,c.max);for(let d=0;l.bucketCounts.length>d;d++)l.bucketCounts[d]+=c.bucketCounts[d];break}}else this.ko()&&this.Hs.set(s,i)}}};function b3(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;t.length>n;n++)if(t[n]!==e[n])return!1;return!0}function oB(t){return{bounds:t,count:0,sum:0,min:1/0,max:-1/0,bucketCounts:new Array(t.length+1).fill(0)}}function aB(t){return t?{exemplars:[{filteredAttributes:[],timeUnixNano:hb(t.timeMs),asDouble:t.value,traceId:t.traceId,spanId:t.spanId}]}:{}}const rO=(t,{debugEnabled:e}={})=>{const n={N(r,...s){let i;try{i=typeof window>"u"?void 0:window}catch{return}i&&(Za.DEBUG||i.POSTHOG_DEBUG||e)&&!de(i.console)&&i.console&&("__rrweb_original__"in i.console[r]?i.console[r].__rrweb_original__:i.console[r])(t,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>rO(`${t} ${r}`,s)};return n},ve=rO("[PostHog.js]"),An=(t,e)=>ve.createLogger(t,e),lB=An("[ExternalScriptsLoader]"),Cv=t=>{const e=Oe==null?void 0:Oe.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},gd=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return lB.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=()=>{if(Oe==null||Oe.removeEventListener("DOMContentLoaded",r),t.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");if(!Oe)return n("document not found");let i=Oe.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=c=>{i.__posthog_loading_callback_fired=!0,n(void 0,c)},i.onerror=c=>{i.__posthog_loading_error=c,n(c)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");const o=Cv(i.src);if(o){if(o.integrity!==i.integrity||o.crossOrigin!==i.crossOrigin||o.nonce!==i.nonce)return n("Existing script conflicts with prepared script policy");if(o.__posthog_loading_callback_fired)return n();const c=o.__posthog_loading_error;return c?n(c):(o.addEventListener("load",d=>{o.__posthog_loading_callback_fired=!0,n(void 0,d)}),void o.addEventListener("error",d=>{o.__posthog_loading_error=d,n(d)}))}if(!Oe.body)return s();if(t.config.external_scripts_inject_target==="head")Oe.head.appendChild(i);else{const c=Oe.querySelectorAll("body > script");var l;c.length>0?(l=c[0].parentNode)===null||l===void 0||l.insertBefore(i,c[0]):Oe.body.appendChild(i)}},s=()=>{Oe==null||Oe.addEventListener("DOMContentLoaded",r)};Oe!=null&&Oe.body||Cv(e)?r():s()},a2={},x3=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};tt.__PosthogExtensions__=tt.__PosthogExtensions__||{},tt.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void gd(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=a2[s];if(r==="fallback"&&i){if(Cv(i))return void gd(t,i,n);delete a2[s]}return void gd(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var c;const d=x3(t,e);a2[s]=d;const f=Cv(s);f==null||(c=f.parentNode)===null||c===void 0||c.removeChild(f),gd(t,d,n)}else n(void 0,l)}:n)}gd(t,x3(t,e),n)},tt.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);gd(t,r,n)},Za.DEBUG=!1,Za.LIB_VERSION="1.447.1",Za.LIB_NAME="web";var Zs=Za;const pb="$early_access_features",Ha="$active_feature_flags",_u="$feature_flag_details",jp="$feature_flag_errors",Jl="$feature_flag_evaluated_at",wu="$feature_flag_request_id",pp="$minimal_flag_called_events",yo="$enabled_feature_flags",Bl="$stored_group_properties",Zl="$stored_person_properties",Go="$flag_call_reported",Qh="$flag_call_reported_session_id",Wl="$feature_flag_payloads",Ho="$override_feature_flags",nu="$override_feature_flag_payloads",qd="visibilitychange",sO="$autocapture_disabled_server_side",Jh="$surveys",Pv="$surveys_loaded_at",mb="PostHog loadExternalDependency extension not found.",gb="$surveys_activated",Fg="$surveys_activated_session",jg="$surveys_activated_timestamps",cB="$people_distinct_id",Ui="distinct_id",qS="$device_id",l2="$device_model",Tv="__alias",uB="__cmpns",S3="$fbc",Gd="$fbc_persistence",k3="$fbp",mp="$fbp_persistence",vb="__timers",yb="$heatmaps_enabled_server_side",_b="$exception_capture_enabled_server_side",iO="$error_tracking_suppression_rules",wb="$error_tracking_capture_extension_exceptions",bb="$web_vitals_enabled_server_side",GS="$dead_clicks_enabled_server_side",YS="$product_tours_enabled_server_side",oO="$logs_capture_enabled_server_side",aO="$web_vitals_allowed_metrics",gp="$session_recording_remote_config",dB="$session_recording_enabled_server_side",fB="$replay_sample_rate",hB="$replay_override_sampling",pB="$replay_override_linked_flag",mB="$replay_override_url_trigger",gB="$replay_override_event_trigger",Dd="$sesid",lO="$session_is_sampled",vB="$session_past_minimum_duration",yB="$session_recording_url_trigger_activated_session",_B="$session_recording_event_trigger_activated_session",wB="$debug_first_full_snapshot_timestamp",bB="$sess_rec_flush_size",cO="$groups",xb="ph_product_tours",xB="$product_tours_activated",SB="$product_tours_activated_session",kB="$conversations_widget_session_id",EB="$conversations_ticket_id",CB="$conversations_widget_state",PB="$conversations_user_traits",ms="$user_state",Sb="$client_session_props",uO="$capture_rate_limit",dO="$initial_campaign_params",fO="$initial_referrer_info",$d="$initial_person_info",XS="$epp",c2="$posthog_cookieless",hO="$cookieless_mode",pO="$sdk_debug_extensions_init_method",mO="$sdk_debug_extensions_init_time_ms",QS="$sdk_debug_recording_script_not_loaded",JS="$sdk_debug_replay_stale_config",gO="$sdk_debug_replay_event_trigger_status",vO="$sdk_debug_replay_linked_flag_trigger_status",yO="$sdk_debug_replay_matched_recording_trigger_groups",_O="$sdk_debug_replay_pending_trigger_conditions",wO="$sdk_debug_replay_remote_trigger_matching_config",bO="$sdk_debug_replay_trigger_groups_count",xO="$sdk_debug_replay_url_trigger_status",TB="$session_recording_start_reason",Ua="anonymous",zg="identified",SO="identified_only",Rv="beforeunload",ek="$pageview",E3="$pageleave",kO="$identify",C3="$groupidentify";function Fd(t,e){Ue(t)&&t.forEach(e)}function Kt(t,e){if(!at(t))if(Ue(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)HS.call(t,n)&&e(t[n],n)}const _n=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function Vg(t){const e=Object.keys(t);let n=e.length;const r=new Array(n);for(;n--;)r[n]=[e[n],t[e[n]]];return r}const RB=function(t){return function(...e){try{return t.apply(this,e)}catch(n){ve.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ve.critical(n)}}},tk=function(t){const e={};return Kt(t,function(n,r){(ft(n)&&n.length>0||Yn(n))&&(e[r]=n)}),e};function EO(t){const e=j({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const AB=["herokuapp.com","vercel.app","netlify.app"];function IB(t){const e=t==null?void 0:t.hostname;if(!ft(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of AB)if(n===r)return!1;return!0}function Lt(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function u2(t){return t.name==="ph_toolbar_internal"}const vp=t=>{if(Oe){try{const e=t+"=",n=Oe.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};var OB=class kb{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new kb(i)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new kb(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},MB=class{generate(){const t=this.generateOrAbort();if(!de(t))return t;{this.Tt=0;const e=this.generateOrAbort();if(de(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return Yn(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Tt)this.Tt=t,this.It();else{if(this.Tt>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Tt++,this.It())}return OB.fromFieldsV7(this.Tt,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.At.nextUint32())}It(){this.Mt=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Tt=0,this.Mt=0,this.At=new NB}};const P3=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};let T3;var NB=class{nextUint32(){var t;return this.Rt.length>this.Et||(((t=T3)!==null&&t!==void 0?t:T3="u">typeof window&&!de(window.crypto)&&crypto.getRandomValues?e=>{try{return crypto.getRandomValues(e)}catch{return P3(e)}}:P3)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let R3;const _o=()=>LB().toString(),LB=()=>(R3||(R3=new MB)).generate();let Lh="";const DB=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let vd=null;const Sn={Ot(){if(!Nn(vd))return vd;if(vd=!1,Oe)try{const t=`__ph_cookie_support_${_o()}`;Sn.$t(t,"xyz"),vd=vp(t)==='"xyz"',Sn.Dt(t)}catch{vd=!1}return vd},Pt(t){ve.error("cookieStore error: "+t)},Lt:vp,Ft(t){let e;try{e=JSON.parse(Sn.Lt(t))||{}}catch{}return e},$t(t,e,n,r,s){if(!Oe)return!1;try{let i="",o="";const l=(function(d,f){if(f){let h=(function(m,v=Oe){if(Lh)return Lh;if(!v||["localhost","127.0.0.1"].includes(m))return"";const y=m.split(".");let _=Math.min(y.length,8);const b="dmn_chk_"+_o();for(;!Lh&&_--;){const x=y.slice(_).join("."),k=b+"=1;domain=."+x+";path=/";v.cookie=k+";max-age=3",v.cookie.includes(b)&&(v.cookie=k+";max-age=0",Lh=x)}return Lh})(d);if(!h){const m=(v=>{const y=v.match(DB);return y?y[0]:""})(d);m!==h&&ve.info("Warning: cookie subdomain discovery mismatch",m,h),h=m}return h?"; domain=."+h:""}return""})(Oe.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const c=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&ve.warn("cookieStore warning: large cookie, len="+c.length),Oe.cookie=c,!0}catch{return!1}},Dt(t,e){if(Oe!=null&&Oe.cookie&&(!e||!Nn(vp(t))))try{Sn.$t(t,"",-1,e)}catch{return}}};let d2=null;const It={Ot(){if(!Nn(d2))return d2;let t=!0;if(de(ce))t=!1;else try{const e="__mplssupport__";It.$t(e,"xyz"),It.Lt(e)!=='"xyz"'&&(t=!1),It.Dt(e)}catch{t=!1}return t||ve.error("localStorage unsupported; falling back to cookie store"),d2=t,t},Pt(t){ve.error("localStorage error: "+t)},Lt(t){try{return ce==null?void 0:ce.localStorage.getItem(t)}catch(e){It.Pt(e)}return null},Ft(t){try{return JSON.parse(It.Lt(t))||{}}catch{}return null},$t(t,e){try{return ce==null||ce.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){It.Pt(n)}return!1},Dt(t){try{ce==null||ce.localStorage.removeItem(t)}catch(e){It.Pt(e)}}},f2=[Zl,Ha,yo,_u,Wl,wu,Jl,jp,Go],ru=[qS,Ui,Dd,lO,XS,$d,Gd,ms],yp=t=>t+"_cpm",$B=["__proto__","constructor","prototype"],h2=t=>{if(!ut(t))return{};const e={};return Object.keys(t).forEach(n=>{$B.indexOf(n)===-1&&(e[n]=t[n])}),e},p2=(t,e=[])=>{const n={};return[...ru,...e].forEach(r=>{const s=t[r];de(s)||Nn(s)||s===""||(n[r]=s)}),n},CO=t=>{let e=5381,n=2166136261;for(let r=0;t.length>r;r++){const s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},A3=(t,e)=>({p:e,f:CO(JSON.stringify(t))}),I3=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=Sn.Ft(yp(t)),r=(n==null?void 0:n.f)===CO(e)&&Ue(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},m2=(t,e)=>e+"|"+(Sn.Lt(yp(t))||""),yd={},Eb={Ot:()=>!0,Pt(t){ve.error("memoryStorage error: "+t)},Lt:t=>t in yd?yd[t]:null,Ft:t=>t in yd?yd[t]:null,$t:(t,e)=>(yd[t]=e,!0),Dt(t){delete yd[t]}};let Hc=null;const hn={Ot(){if(!Nn(Hc))return Hc;if(Hc=!0,de(ce))Hc=!1;else try{const t="__support__";hn.$t(t,"xyz"),hn.Lt(t)!=='"xyz"'&&(Hc=!1),hn.Dt(t)}catch{Hc=!1}return Hc},Pt(t){ve.error("sessionStorage error: ",t)},Lt(t){try{return ce==null?void 0:ce.sessionStorage.getItem(t)}catch(e){hn.Pt(e)}return null},Ft(t){try{return JSON.parse(hn.Lt(t))||null}catch{}return null},$t(t,e){try{return ce==null||ce.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){hn.Pt(n)}return!1},Dt(t){try{ce==null||ce.sessionStorage.removeItem(t)}catch(e){hn.Pt(e)}}};var FB=class{constructor(t){this._instance=t}get Fr(){return this._instance.config}get consent(){return this.Fl()?0:this.Dl}isOptedOut(){return this.Fr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Fr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Fr.opt_out_capturing_by_default}optInOut(t){this.Ll.$t(this.Nl,t?1:0,this.Fr.cookie_expiration,this.Fr.cross_subdomain_cookie,this.Fr.secure_cookie)}reset(){this.Ll.Dt(this.Nl,this.Fr.cross_subdomain_cookie)}get Nl(){const{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:n}=this._instance.config;return n||(e?e+t:"__ph_opt_in_out_"+t)}get Dl(){const t=this.Ll.Lt(this.Nl);return X_(t)?1:Ke(LH,t)?0:-1}get Ll(){const t=this.Fr.opt_out_capturing_persistence_type,e=t==="localStorage"?It:Sn,n=e.Ot()?e:Eb;if(!this.jl||this.jl!==n){this.jl=n;const r=t==="localStorage"?Sn:It;r.Lt(this.Nl)&&(this.jl.Lt(this.Nl)||this.optInOut(X_(r.Lt(this.Nl))),r.Dt(this.Nl,this.Fr.cross_subdomain_cookie))}return this.jl}Fl(){return!!this.Fr.respect_dnt&&[Qr==null?void 0:Qr.doNotTrack,Qr==null?void 0:Qr.msDoNotTrack,tt.doNotTrack,Qr==null?void 0:Qr.globalPrivacyControl].some(t=>X_(t))}};function PO(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!Vn(r))return e;try{const s=r(e);return ft(s)&&s?s:e}catch(s){return ve.error("Error in get_current_url, falling back to window.location.href",s),e}}function O3(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function Yi(t){return!!t&&t.nodeType===1}function hr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function TO(t){return!!t&&t.nodeType===3}function Av(t){return!!t&&t.nodeType===11&&Yi(t.host)}function nk(t){return t?yf(t).split(/\s+/):[]}function M3(t,e){const n=(function(r){var s;const i=typeof window>"u"?void 0:window,o=i==null||(s=i.location)===null||s===void 0?void 0:s.href;return de(o)?void 0:PO(r,o)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function bu(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return nk(e)}function RO(t){return at(t)?null:yf(t).split(/(\s+)/).filter(e=>Yd(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function zp(t){let e="";return ec(t)&&!_f(t)&&t.childNodes&&t.childNodes.length&&Kt(t.childNodes,function(n){var r;TO(n)&&n.textContent&&(e+=(r=RO(n.textContent))!==null&&r!==void 0?r:"")}),yf(e)}function _p(t){var e;return de(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const rk=["a","button","form","input","select","textarea","label"];function ep(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function Cb(t,e){if(de(e))return!0;for(const n of t)if(e.some(r=>ep(n,r)))return!0;return!1}function AO(t){const e=t.parentNode;return!(!e||!Yi(e))&&e}const q0=[".ph-no-autocapture","[data-ph-no-autocapture]"],IO=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],sk=[...IO,"+","-","−","–"],N3=sk.length+10,jB=["button","a","input","select","textarea","label"],zB=["button","link","tab","menuitem","option"],L3=(t,e)=>/[a-z0-9]/i.test(e)?Ke(sk,e)?new RegExp(`\\b${e}\\b`).test(t):t.includes(e):t===e,VB=t=>Ke(jB,t.tagName.toLowerCase())||Ke(zB,(t.getAttribute("role")||"").toLowerCase());function g2(t){let e="",n="";const r=o=>{Yi(o)&&ec(o)&&!_f(o)&&(e+=` ${zp(o)}`,n=n||o.getAttribute("aria-label")||"",Kt(o.childNodes,r))};r(t),e=yf(e.replace(/\s+/g," "));const s=(Yd(e)?e:"").toLowerCase(),i=t.getAttribute("aria-label")||(s?"":n);return{safeText:s,ariaLabel:yf(i).toLowerCase()}}const D3=[".ph-no-rageclick",".ph-no-capture"],HB=["","text","search","email","password","url","tel","number"];function OO(t,e){if(!(!(typeof window>"u")&&window)||ik(t))return!1;let n,r,s;var i,o;if(Os(e)?(n=!!e&&D3,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:D3,r=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(c){return!(!c||!Yi(c))&&(!!hr(c,"textarea")||(hr(c,"input")?Ke(HB,(c.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const h=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return h==="true"||h===""})(c)))})(t))return!1;const{targetElementList:l}=MO(t,!1);return!(r&&(function(c,{safeText:d,ariaLabel:f}){let h;if(c===!0)h=IO;else{if(!Ue(c))return!1;if(c.length>N3)return ve.error(`[PostHog] content_ignorelist array cannot exceed ${N3} items. Use css_selector_ignorelist for more complex matching.`),!1;h=c.map(m=>m.toLowerCase())}return h.some(m=>L3(d,m)||L3(f,m))})(r,(function(c,d){for(const h of d)if(VB(h))return g2(h);for(const h of d){try{var f;if(((f=window)===null||f===void 0?void 0:f.getComputedStyle(h).getPropertyValue("cursor"))!=="pointer")break}catch{break}const m=g2(h);if(m.safeText||m.ariaLabel)return m}return g2(c)})(t,l))||Cb(l,n))}const ik=t=>!t||hr(t,"html")||!Yi(t),MO=(t,e)=>{const n=typeof window>"u"?void 0:window;if(!n||ik(t))return{parentIsUsefulElement:!1,targetElementList:[]};let r=!1;const s=[t];let i=t;for(;i.parentNode&&!hr(i,"body");){if(Av(i.parentNode)){s.push(i.parentNode.host),i=i.parentNode.host;continue}const o=AO(i);if(!o)break;if(e||rk.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{const l=n.getComputedStyle(o);l&&l.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}s.push(o),i=o}return{parentIsUsefulElement:r,targetElementList:s}};function ec(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!hr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=bu(i);if(Ke(o,"ph-sensitive")||Ke(o,"ph-no-capture"))return!1}if(Ke(bu(t),"ph-include"))return!0;const r=t.type||"";if(ft(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!ft(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function _f(t){return!!(hr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||hr(t,"select")||hr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const $3=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),F3=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,UB=[16,15,14,13],BB=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),j3=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),z3=/[0-9A-Za-z_]/;function ZB(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function Yd(t,e=!0){return!(at(t)||ft(t)&&(t=yf(t),(e?$3.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(F3.lastIndex=0;r=F3.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const l of UB){const c=o+l;if(i.length>=c){const d=i.slice(o,c);if($3.test(d)&&ZB(d))return!0}}}return!1})(t))||(e?BB.test(t):(function(n){let r;for(j3.lastIndex=0;r=j3.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&z3.test(s)&&z3.test(i)))return!0}return!1})(t))))}function V3(t){let e=zp(t);return e=`${e} ${NO(t)}`.trim(),Yd(e)?e:""}function NO(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Kt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=zp(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${NO(n)}`.trim())}catch(s){ve.error("[AutoCapture]",s)}}),e}function H3(t){return t.replace(/"|\\"/g,'\\"')}function WB(t){const e=t.attr__class;if(e)return Ue(e)?e:nk(e)}const G0=An("[Dead Clicks]"),KB=()=>!0,qB=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(GS)),r=t.instance.config.capture_dead_clicks;return Os(r)?r:!!ut(r)||n};var U3=class{get lazyLoadedDeadClicksAutocapture(){return this.ql}constructor(t,e,n){this.instance=t,this.isEnabled=e,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[GS]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bl(()=>{this.zl()}):this.stop()}Bl(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?G0.error("failed to load script",s):t()})}zl(){var t;if(Oe){if(!this.ql&&(!((t=tt.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=ut(this.instance.config.capture_dead_clicks)?j({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.ql=tt.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ql.start(Oe),G0.info("starting...")}}else G0.error("`document` not found. Cannot start.")}stop(){this.ql&&(this.ql.stop(),this.ql=void 0,G0.info("stopping..."))}};const Dh=An("[SegmentIntegration]");function B3(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>Vn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,c,d,f){const h=v=>{const y=()=>v.anonymousId()||_o();l.config.get_device_id=y,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:y()}),l.persistence.set_property(ms,zg)),d(f?void 0:v.anonymousId()||void 0)},m=c.user();"then"in m&&Vn(m.then)?m.then(h):h(m)})(t,s,l=>{s.register(((c,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||Dh.warn("This browser does not have Promise support, and can not use the segment integration");const h=(m,v)=>{if(!v)return m;const y=!!d&&m.event.anonymousId===d&&!m.event.userId;y||m.event.userId||m.event.anonymousId===c.get_distinct_id()||(Dh.info("No userId set, resetting PostHog"),c.reset()),y||(d=void 0),m.event.userId&&m.event.userId!==c.get_distinct_id()&&(Dh.info("UserId set, identifying with PostHog"),c.identify(m.event.userId));let _=c.calculateEventProperties(v,m.event.properties);if(!at(f)){const b=m.event.properties||{},x={};for(const C of Object.keys(_))HS.call(b,C)||(x[C]=_[C]);const k=((C,P)=>{const R=Ue(C)?C:[C];let O=j({},P);for(const I of R)try{if(O=I(O),at(O))return null}catch(A){return Dh.error("Error in Segment filterProperties:",A),null}return O})(f,x);if(at(k))return m;_=k}return m.event.properties=Object.assign({},_,m.event.properties),m};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(m){return h(m,m.event.event)},page(m){return h(m,ek)},identify(m){return h(m,kO)},screen(m){return h(m,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},c=>{Dh.error("Failed to register the Segment integration",c),e()})},n)}const LO="posthog-js";function DO(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,c,d,f,h;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const m=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const v=((l=o.exception)===null||l===void 0?void 0:l.values)||[],y=v.map(x=>j(j({},x),{},{stacktrace:x.stacktrace?j(j({},x.stacktrace),{},{type:"raw",frames:(x.stacktrace.frames||[]).map(k=>j(j({},k),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((c=v[0])===null||c===void 0?void 0:c.value)||o.message,$exception_type:(d=v[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:y,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=v[0])===null||f===void 0?void 0:f.value)||o.message,$sentry_exception_type:(h=v[0])===null||h===void 0?void 0:h.type,$sentry_tags:o.tags};var b;return e&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((b=t.exceptions)===null||b===void 0||b.sendExceptionEvent(_)),o}}var GB=class{constructor(t,e,n,r,s,i){this.name=LO,this.setupOnce=function(o){o(DO(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},Z3=class{constructor(t){this.Hl=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ve.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Ul=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Wl()}Wl(){var t;this.Vl=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Hl)}destroy(){var t;(t=this.Vl)===null||t===void 0||t.call(this),this.Vl=void 0}doPageView(t,e){var n;const r=this.Gl(t,e);return this.Ul={pathname:(n=ce==null?void 0:ce.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Gl(t,(e=this.Ul)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Ul)===null||t===void 0?void 0:t.pageViewId}}Gl(t,e){const n=this.Ul;if(!n)return{$pageview_id:e};let r={$pageview_id:e,$prev_pageview_id:n.pageViewId};const s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:i,lastScrollY:o,maxScrollY:l,maxContentHeight:c,lastContentY:d,maxContentY:f}=s;if(!(de(i)||de(o)||de(l)||de(c)||de(d)||de(f))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d),f=Math.ceil(f);const h=i>1?Jo(o/i,0,1,ve):1,m=i>1?Jo(l/i,0,1,ve):1,v=c>1?Jo(d/c,0,1,ve):1,y=c>1?Jo(f/c,0,1,ve):1;r=_n(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:y})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const $h=["flags","surveys"],YB={[cB]:{exposure:"hidden"},[Tv]:{exposure:"hidden"},[uB]:{exposure:"hidden"},[vb]:{exposure:"hidden"},[Gd]:{exposure:"hidden"},[mp]:{exposure:"hidden"},[sO]:{exposure:"event"},[yb]:{exposure:"hidden"},[oO]:{exposure:"hidden"},[_b]:{exposure:"event"},[iO]:{exposure:"hidden"},[wb]:{exposure:"event"},[bb]:{exposure:"event"},[GS]:{exposure:"event"},[YS]:{exposure:"hidden"},[aO]:{exposure:"event"},[gp]:{exposure:"hidden"},[dB]:{exposure:"hidden"},[Dd]:{exposure:"hidden"},[lO]:{exposure:"event"},[fB]:{exposure:"event",shouldSkipFromEventProperties:t=>Nn(t)},[vB]:{exposure:"event"},[yB]:{exposure:"event"},[_B]:{exposure:"event"},[wB]:{exposure:"event"},[bB]:{exposure:"hidden"},[yo]:{exposure:"hidden",storageGroup:"flags"},[Ha]:{exposure:"hidden",storageGroup:"flags"},[pb]:{exposure:"hidden"},[_u]:{exposure:"hidden",storageGroup:"flags"},[Wl]:{exposure:"hidden",storageGroup:"flags"},[wu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[pp]:{exposure:"hidden",storageGroup:"flags"},[Ho]:{exposure:"hidden"},[nu]:{exposure:"hidden"},[Zl]:{exposure:"hidden"},[Bl]:{exposure:"hidden"},[Jh]:{exposure:"hidden",storageGroup:"surveys"},[Pv]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[gb]:{exposure:"event"},[Fg]:{exposure:"hidden"},[jg]:{exposure:"hidden"},[xb]:{exposure:"hidden"},[xB]:{exposure:"hidden"},[SB]:{exposure:"hidden"},[kB]:{exposure:"event"},[EB]:{exposure:"event"},[CB]:{exposure:"event"},[PB]:{exposure:"event"},[Go]:{exposure:"hidden"},[Qh]:{exposure:"hidden"},[cO]:{exposure:"event"},[jp]:{exposure:"hidden"},[Jl]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ms]:{exposure:"hidden"},[Sb]:{exposure:"hidden"},[uO]:{exposure:"hidden"},[dO]:{exposure:"hidden"},[fO]:{exposure:"hidden"},[$d]:{exposure:"hidden"},[XS]:{exposure:"hidden"},[hB]:{exposure:"event"},[pB]:{exposure:"event"},[mB]:{exposure:"event"},[gB]:{exposure:"event"},[pO]:{exposure:"event"},[mO]:{exposure:"event"},[QS]:{exposure:"hidden"},[JS]:{exposure:"hidden"},[gO]:{exposure:"hidden"},[vO]:{exposure:"hidden"},[yO]:{exposure:"hidden"},[_O]:{exposure:"hidden"},[wO]:{exposure:"hidden"},[bO]:{exposure:"hidden"},[xO]:{exposure:"hidden"},[TB]:{exposure:"event"}},XB=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Vr=t=>{const e=YB[t];if(e)return e;for(const[n,r]of XB)if(t.indexOf(n)===0)return r};function ok(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const aa=t=>{const e=typeof document>"u"?void 0:document,n=e==null?void 0:e.createElement("a");return de(n)?null:(n.href=t,n)},$O=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},FO=(t,e)=>t>=e&&$O(),jO=(t,e,n,r)=>{if(t===0){if($O()){const s=e+1;return s===n&&r(),s}return e}return 0},jd=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return Wf(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,EO(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return e5(t)}},wf=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let r;for(let s=0;n.length>s;s++){const i=n[s].split(/=(.*)/);if(i[0]===e){r=i;break}}if(!Ue(r)||2>r.length)return"";{let s=r[1].replace(/\+/g," ");try{s=decodeURIComponent(s)}catch{ve.error("Skipping decoding for malformed query param: "+s)}return s}},Vp=function(t,e,n){if(!t||!e||!e.length)return t;const r=t.split(/#(.*)/),s=r[1],i=(r[0]||"").split(/\?(.*)/),o=i[1],l=i[0],c=(o||"").split("&"),d=[];for(let h=0;c.length>h;h++){const m=c[h].split("?");let v=0;for(;m.length>v&&!e.includes(m[v].split("=")[0]);)v++;d.push(m.length>v?m.slice(0,v).concat(m[v].split("=")[0]+"="+n).join("?"):c[h])}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},Iv=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},bf=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],QB=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...bf],Hp="<masked>",JB=["li_fat_id"];function zO(t,e,n){if(!Oe)return{};const r=e?[...bf,...n||[]]:[],s=VO(Vp(Oe.URL,r,Hp),t),i=(function(){const o={};return Kt(JB,function(l){const c=vp(l);o[l]=c||null}),o})();return _n(i,s)}function VO(t,e){const n=QB.concat(e||[]),r={};return Kt(n,function(s){const i=wf(t,s);r[s]=i||null}),r}function HO(t){const e=(function(s){return s?s.search("https?://(.*)google.([^/?]*)")===0?"google":s.search("https?://(.*)bing.com")===0?"bing":s.search("https?://(.*)yahoo.com")===0?"yahoo":s.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!Nn(e)){r.$search_engine=e;const s=Oe?wf(Oe.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function UO(){return navigator.language||navigator.userLanguage}function eZ(){const t=UO();return typeof t=="string"?t.split("-")[0]:void 0}const Ov="$direct";function BO(){return(Oe==null?void 0:Oe.referrer)||Ov}function ZO(t,e,n=!1){const r=t?[...bf,...e||[]]:[],s=n?Ql(fn==null?void 0:fn.href):fn==null?void 0:fn.href,i=s==null?void 0:s.substring(0,1e3);return{r:BO().substring(0,1e3),u:i?Vp(i,r,Hp):void 0}}function WO(t,e=!1){var n;const{r,u:s}=t,i=e?Ql(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Ov?Ov:(n=aa(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=aa(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const c=VO(i);_n(o,c)}if(r){const l=HO(r);_n(o,l)}return o}function tZ(){try{return new Date().getTimezoneOffset()}catch{return}}const nZ={flags:Jl,surveys:Pv},rZ=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Y0=t=>`${t}_cookie_identity_change_pending`,X0=t=>{let e="",n=0;for(const r of t){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;e+=r,n+=s}return e},gr="main",Ma=[yo,Ha,_u,Wl,wu,Jl,pp,Zl],v2=t=>Ma.indexOf(t)!==-1,KO=[Gd,mp],W3=t=>KO.indexOf(t)!==-1,El=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},_d=t=>{if(!t)return{};const e=JSON.parse(t);return ut(e)?e:{}},K3=(t,e)=>{Kt(t,(n,r)=>{const s=Vr(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var y2=class{constructor(t,e,n=!0,r=!t.cookieless_mode){if(this.Ql={},this.Jl=!1,this.Zl=!1,this.Kl=!1,this.Yl=!1,this.Xl=!1,this.tu=new Map,this.eu=!1,this.iu=!1,this.nu=!1,this.su=new Set,this.ru=new Set,this.Fr=t,this.ou=n,this.props={},this.au=void 0,this.lu=(s=>{let i="";return s.token&&(i=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+i+"_posthog"})(t),this.fi=t.disable_persistence||!!e,this.Ll=this.uu(t),this.Kl=this.cu(t),this.load(r),this.hu(),t.debug&&ve.info("Persistence loaded",t.persistence,j({},this.props)),this.update_config(t,t,e),this.save(),ce){const s=()=>this.flush();Lt(ce,"beforeunload",s,{capture:!1}),Lt(ce,"pagehide",s,{capture:!1}),this.du=i=>{if(this.Jl&&(!i.storageArea||i.storageArea===(ce==null?void 0:ce.localStorage))&&i.key)if(i.key!==this.lu){if(this.Kl){const o=$h.find(l=>i.key===this.vu(l));o&&this.fu(i.key,o)}}else this.fu(i.key,gr)},Lt(ce,"storage",this.du)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.tu.get(e);if(!v2(e)||r===!0)return;if(n===!0)return void this.pu(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.pu(e,s)})}onCrossTabFeatureFlagChange(t){return this.ru.add(t),()=>this.ru.delete(t)}destroy(){this.du&&ce&&(ce.removeEventListener("storage",this.du),this.du=void 0),this.ru.clear()}fu(t,e,n=!0){if(this.fi)return!1;let r,s;try{if(s=It.Lt(t),Nn(s)){const l=this.gu(e);return l.storageValue=null,e!==gr&&(l.persisted=!1),!1}r=_d(s)}catch{return!1}const i=e===gr?r:It.Ft(this.lu);if(i&&this.mu(i))return!1;const o=this.yu(r,e,n);return e===gr&&this.Kl&&!El(this.bu().main,r)||this._u(r,e,!0,s),o}mu(t){const e=this.props[Ui],n=t[Ui];return!de(e)&&!de(n)&&e!==n}_u(t,e,n,r){const s=this.gu(e);s.storageValue=r,e!==gr&&(s.persisted=n);try{s.fingerprint=this.wu(t,e)}catch{s.fingerprint=void 0}}yu(t,e,n){let r=!1;return Ma.forEach(s=>{var i;const o=(i=Vr(s))===null||i===void 0?void 0:i.storageGroup;if(e===gr&&this.Kl&&o||e!==gr&&o!==e)return;const l=s in t,c=this.ku(s,l?t[s]:void 0),d=this.tu.has(s)?s in this.props:l;d===s in this.props&&El(c,this.props[s])||(d?this.Su(s,c,!1):this.xu(s,!1),r=!0)}),r&&n&&this.ru.forEach(s=>s()),r}$u(){if(!this.Jl)return!1;try{this.nu=!1;const t=It.Lt(this.lu),e=this.gu(gr);let n,r=!1,s=!1;if(t!==e.storageValue)if(Nn(t))e.storageValue=null;else{if(n=_d(t),this.nu=!this.iu&&this.mu(n),this.nu)return!1;s=this.yu(n,gr,!1),!this.Kl||El(this.bu().main,n)?this._u(n,gr,!0,t):e.storageValue=t,r=!0}return this.Kl&&$h.forEach(i=>{const o=It.Lt(this.vu(i)),l=this.gu(i),c=n||{},d=r&&Ma.some(h=>{var m;return((m=Vr(h))===null||m===void 0?void 0:m.storageGroup)===i&&h in c});if(o===l.storageValue&&!d)return;if(Nn(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this.yu(c,i,!1)||s));const f=_d(o);s=this.yu(f,i,!1)||s,this._u(f,i,!0,o)}),s}catch{return!1}}pu(t,e){this.tu.set(t,e);const n=Vr(t);n!=null&&n.volatile||(this.gu((this.Kl?n==null?void 0:n.storageGroup:void 0)||gr).fingerprint=void 0,this.Cu(t))}Tu(){Ma.forEach(t=>this.tu.set(t,!0))}hu(){if(this.Jl)try{const t=It.Lt(this.lu),e=_d(t);this.gu(gr).storageValue=t,Ma.forEach(n=>{var r;const s=this.Kl?(r=Vr(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?It.Lt(this.vu(s)):null;if(s){const l=this.gu(s);l.storageValue=i,l.persisted=!Nn(i)}const o=s&&!Nn(i)?_d(i):e;n in this.props?this.Iu(n,o[n],this.props[n]):n in o&&this.pu(n,!0)})}catch{}}ku(t,e){const n=this.tu.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(Ue(e)?e:[]),o=new Set(Ue(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=ut(e)?j({},e):{},s=ut(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}Iu(t,e,n){if(!v2(t))return;const r=this.tu.get(t);if(r===!0)return;let s=e;if(this.Jl)try{var i;const l=this.Kl?(i=Vr(t))===null||i===void 0?void 0:i.storageGroup:void 0,c=l?this.vu(l):this.lu;s=_d(It.Lt(c))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!de(e)&&!Ue(e)||!de(s)&&!Ue(s)||!Ue(n))return void this.pu(t,!0);const l=new Set(e||[]),c=new Set(s||[]),d=new Set(n);new Set([...l,...d]).forEach(f=>{l.has(f)!==d.has(f)&&o.add(f)}),o.forEach(f=>{c.has(f)===d.has(f)&&o.delete(f)})}else{if(!ut(n))return void(El(s,n)?this.tu.delete(t):this.pu(t,!0));{if(!de(e)&&!ut(e)||de(e)&&Ws(n)&&de(s))return void this.pu(t,!0);const l=ut(e)?e:{},c=ut(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&El(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in c==d in n&&El(c[d],n[d])&&o.delete(d)})}}o.size?this.pu(t,o):this.tu.delete(t)}Mu(){var t;const e=(t=this.Fr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Yn(e)&&e>0?e:0}Eu(t){if(this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=p2(t,this.Fr.cookie_persisted_properties||[]),n=A3(e,this.Fr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=Sn.Lt(this.lu)||void 0;s&&m2(this.lu,s)===r&&(this.Au=r,this.Ru=s)}catch{}else try{const e=Sn.Lt(this.lu)||void 0;this.Au=e?m2(this.lu,e):void 0,this.Ru=e}catch{}}syncCookieProperties(){return this.Pu(this.Fr)}Pu(t,e=!1){if(this.fi&&!e||this.Xl||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=Sn.Lt(this.lu)||void 0}catch{}if(!n||n===this.Ru)return!1;const r=m2(this.lu,n);let s;try{s=h2(JSON.parse(n))}catch{return!1}if((Sn.Lt(this.lu)||void 0)!==n)return!1;this.Au=r,this.Ru=n;const i=I3(this.lu,n),o=[...ru,...i.properties],l={};if(Object.keys(s).forEach(_=>{const b=s[_];(de(b)||Nn(b)||b===""||_==="$user_state"&&b!=="anonymous"&&b!=="identified")&&(l[_]=!0,delete s[_])}),Ws(s))return!1;const c="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[Ui],h=d[ms],m=_n({},d);[...ru,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(c||_!=="distinct_id"&&_!=="$user_state")){const b=m[_];(i.isValid||ru.indexOf(_)===-1||b!==!1&&b!==0)&&delete m[_]}}),this.props=_n(m,s),Ma.forEach(_=>{const b=_ in this.props;_ in d===b&&El(d[_],this.props[_])||(b?this.Iu(_,d[_],this.props[_]):this.pu(_,!0))}),!c||"$user_state"in s||"$user_state"in this.props||this.Su(ms,Ua);const v=this.props[Ui],y=this.props[ms];return!c||v===f&&y===h||(this.iu=!0,this.Yl=!0,hn.$t(Y0(this.lu),!0),this.xu(Zl),this.xu(Ha),this.xu(yo),this.xu(_u),this.xu(Wl),this.xu(wu),this.xu(Jl),this.xu(jp),this.xu(Go),y!=="anonymous"||h!=="identified"&&s.$user_state!=="anonymous"&&(de(f)||v===f)||(K3(this.props,s),this.xu(Bl)),y==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.xu(Tv)),!0}consumeCookieIdentityChange(){const t=Y0(this.lu),e=this.Yl||!!hn.Lt(t);return this.Yl=!1,e&&hn.Dt(t),e}Ou(t=!1){return!(this.Xl||this.fi&&!t||!this.Fr.cookieWinsOnConflict||this.Fr.persistence.toLowerCase()!=="localstorage+cookie"||(this.Xl=!0,0))}Fu(){this.Xl&&(de(this.Du)||(clearTimeout(this.Du),this.Du=void 0),delete this.Ql[gr],this.Lu(!0))}Nu(t=!0){if(this.Xl)try{t?this.Fu():de(this.Du)||(clearTimeout(this.Du),this.Du=void 0)}finally{this.Xl=!1}}isDisabled(){return!!this.fi}uu(t){rZ.indexOf(t.persistence.toLowerCase())===-1&&(ve.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1,c=()=>!1)=>{const d=[...ru,...o];return j(j({},It),{},{ju(f){return[Sn.Lt(f),Sn.Lt(yp(f)),It.Lt(f)].join("\0")},Ft(f){try{let m,v={};try{m=Sn.Lt(f)||void 0,v=m?h2(JSON.parse(m)):{}}catch{}const y=JSON.parse(It.Lt(f)||"{}");let _;if(l){const b=I3(f,m),x=[...ru,...b.properties],k={};Object.keys(v).forEach(P=>{const R=v[P];Nn(R)||R===""||P==="$user_state"&&R!=="anonymous"&&R!=="identified"||(k[P]=R)});const C="distinct_id"in k||k.$user_state==="anonymous"||k.$user_state==="identified";if(Object.keys(k).length>0){var h;const P=y[Ui],R=(h=y.$user_state)!==null&&h!==void 0?h:Ua;d.forEach(O=>{if(x.indexOf(O)!==-1&&!(O in v)&&(C||O!=="distinct_id"&&O!=="$user_state")){const I=y[O];(b.isValid||ru.indexOf(O)===-1||I!==!1&&I!==0)&&delete y[O]}}),!C||"$user_state"in v||"$user_state"in y||(y[ms]=Ua),!C||("distinct_id"in k?k[Ui]:y[Ui])===P&&("$user_state"in k?k[ms]:y[ms])===R||(f2.forEach(O=>delete y[O]),k.$user_state==="identified"&&"distinct_id"in k?y.$user_id=k[Ui]:delete y.$user_id,k.$user_state!=="identified"&&(delete y[cO],delete y[Bl]),delete y.__alias)}_=_n(y,k)}else _=_n(v,y);return c()||It.$t(f,_),_}catch{}return null},$t(f,h,m,v,y,_){const b=It.$t(f,h,void 0,void 0,_);try{const x=p2(h,o);if(Object.keys(x).length){if(l){const k=yp(f),C=A3(x,o);if(Sn.$t(k,C,m,v,y,_),Sn.Lt(k)!==JSON.stringify(C)){Sn.Dt(k,v);const P=p2(h);return Sn.$t(f,P,m,v,y,_),b}}Sn.$t(f,x,m,v,y,_)}}catch(x){It.Pt(x)}return b},Dt(f,h){try{ce==null||ce.localStorage.removeItem(f),Sn.Dt(f,h),Sn.Dt(yp(f),h)}catch(m){It.Pt(m)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict,()=>!!this.fi);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&It.Ot()?(n=It,s=!0):i==="localstorage+cookie"&&e.Ot()?(n=e,s=!0,r=!0):i==="sessionstorage"&&hn.Ot()?n=hn:i==="memory"?n=Eb:i==="cookie"&&Sn.Ot()?(n=Sn,r=!0):e.Ot()?(n=e,s=!0,r=!0):Sn.Ot()?(n=Sn,r=!0):n=Eb,this.Jl=s,this.Zl=r,n}vu(t){return`${this.lu}__${t}`}cu(t){return this.Jl&&!!t.split_storage}properties(){const t={};return Kt(this.props,(e,n)=>{const r=Vr(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,e))return;t[n]=e}}),t}load(t=!1){if(this.fi&&!t)return;const e=this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie",n=e?It.Ft(this.lu):null;let r={};if(e)try{r=h2(Sn.Ft(this.lu)),Kt(r,(l,c)=>{(de(l)||Nn(l)||l==="")&&delete r[c]})}catch{}const s=this.Ll.Ft(this.lu);if(s&&(this.props=_n({},s)),this.Kl&&this.qu(),e&&s){var i,o;const l=n==null?void 0:n[Ui],c=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Ua,d=s[Ui],f=(o=s.$user_state)!==null&&o!==void 0?o:Ua;if(d!==l||f!==c){this.Yl=!0,this.fi||hn.$t(Y0(this.lu),!0);const h=_n({},this.props);f2.forEach(v=>delete h[v]),f!=="anonymous"||c!=="identified"&&r.$user_state!=="anonymous"&&(de(l)||d===l)||(K3(h,r),delete h[Bl]),this.props=h;const m=new Set;f2.forEach(v=>{var y;const _=(y=Vr(v))===null||y===void 0?void 0:y.storageGroup;_&&m.add(_)}),m.forEach(v=>{if(this.fi)return;const y={};Kt(this.props,(_,b)=>{var x;((x=Vr(b))===null||x===void 0?void 0:x.storageGroup)===v&&(y[b]=_)}),Ws(y)?(It.Dt(this.vu(v)),this.Ql[v]={}):It.$t(this.vu(v),y)&&(this.Ql[v]={persisted:!0,fingerprint:this.wu(y,v)})})}}hn.Lt(Y0(this.lu))&&(this.Yl=!0)}qu(){for(const t of $h){const e=It.Ft(this.vu(t));if(e&&!Ws(e)){const n=this.gu(t);n.persisted=!0,this.Bu(t)||(n.fingerprint=this.wu(e,t)),this.zu(t,e)||_n(this.props,e)}}}Bu(t){return Object.keys(this.props).some(e=>{var n;return((n=Vr(e))===null||n===void 0?void 0:n.storageGroup)===t})}zu(t,e){const n=nZ[t];if(!n)return!1;const r=e[n],s=this.props[n];return Yn(r)&&Yn(s)&&s>r}refreshKey(t){this.Hu([t])}Hu(t){if(this.fi)return;let e,n=!1;const r=()=>(n||(e=this.Ll.Ft(this.lu),n=!0),e);t.forEach(s=>{var i;if(this.su.has(s))return;const o=this.Kl?(i=Vr(s))===null||i===void 0?void 0:i.storageGroup:void 0,l=o?It.Ft(this.vu(o)):r();if(l&&s in l)this.Su(s,l[s],!1);else{if(o){const c=r();if(c&&s in c)return void this.Su(s,c[s],!1)}this.xu(s,!1)}})}refreshMetaIdentifiers(){if(this.fi)return;const t=this.Uu();(de(t)||t!==this.Wu)&&(this.Hu(KO),this.Vu(t))}Vu(t=this.Uu()){this.Wu=this.su.size===0?t:void 0}Uu(){const t=this.Ll.ju?this.Ll.ju(this.lu):this.Ll.Lt(this.lu);return ft(t)?t:void 0}save(){if(this.fi)return;const t=this.Mu();t>0?de(this.Du)&&(this.Du=setTimeout(()=>{this.Du=void 0,this.Lu()},t)):this.Lu()}flush(){de(this.Du)||(clearTimeout(this.Du),this.Du=void 0,this.Lu())}Lu(t=!1){if(this.fi||this.Xl&&!t)return;t||(this.syncCookieProperties(),this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie"||this.refreshMetaIdentifiers());const e=!t&&!this.eu;e||(this.nu=!1);const n=!!e&&this.$u();if(this.nu)return void(this.Fr.debug&&ve.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Kl)return this.Gu(),void(n&&this.ru.forEach(s=>s()));const r=this.Qu(this.Ll,this.lu,this.props,gr);r==="written"&&this.Eu(this.props),r!=="failed"&&(this.tu.clear(),this.iu=!1,this.su.clear()),r==="written"&&this.Vu(),n&&this.ru.forEach(s=>s())}Gu(){const{main:t,groups:e}=this.bu(),n=this.Qu(this.Ll,this.lu,t,gr);n==="written"&&this.Eu(t),n!=="failed"&&(this.iu=!1,this.su.clear(),Ma.forEach(s=>{var i;!((i=Vr(s))===null||i===void 0)&&i.storageGroup||this.tu.delete(s)})),n==="written"&&this.Vu();for(const s of $h){var r;const i=e[s];if(Ws(i)&&!(!((r=this.Ql[s])===null||r===void 0)&&r.persisted)){Ma.forEach(l=>{var c;((c=Vr(l))===null||c===void 0?void 0:c.storageGroup)===s&&this.tu.delete(l)});continue}const o=this.Qu(It,this.vu(s),i,s);o!=="failed"&&Ma.forEach(l=>{const c=Vr(l);(c==null?void 0:c.storageGroup)!==s||o!=="written"&&c.volatile||this.tu.delete(l)})}}bu(){const t={},e={flags:{},surveys:{}};return Kt(this.props,(n,r)=>{var s;const i=(s=Vr(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}wu(t,e){if(e===gr)return JSON.stringify(t)+"|"+this.Ju+"|"+this.Zu+"|"+this.Ku;const n={};return Kt(t,(r,s)=>{var i;n[s]=!((i=Vr(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Qu(t,e,n,r){const s=this.gu(r);if(r!==gr&&!s.dirty&&!de(s.fingerprint))return"skipped";let i;try{if(i=this.wu(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return t.$t(e,n,this.Ju,this.Zu,this.Ku,this.Fr.debug)?(s.dirty=!1,r!==gr&&(s.persisted=!0),de(i)||(s.fingerprint=i),this.Jl&&(s.storageValue=It.Lt(e)),"written"):(this.Fr.debug&&ve.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.Tu(),de(this.Du)||(clearTimeout(this.Du),this.Du=void 0),this.Ll.Dt(this.lu,!1),this.Ll.Dt(this.lu,!0),!t&&this.ou)for(const e of $h)It.Dt(this.vu(e));t?delete this.Ql[gr]:this.Ql={},this.Au=void 0,this.Ru=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(ut(t)){this.syncCookieProperties(),de(e)&&(e="None"),this.Ju=de(n)?this.Yu:n;let r=!1;if(Kt(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Su(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(ut(t)){this.syncCookieProperties(),this.Ju=de(e)?this.Yu:e;let n=!1;if(Kt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||ut(r)||Ue(r))&&(this.Su(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();const e=typeof t=="string"?[t]:t;let n=!1;for(const r of e)r in this.props&&(this.xu(r),n=!0);n&&this.save()}update_campaign_params(){const t=Oe==null?void 0:Oe.URL;if(t===this.au)return;const e=zO(this.Fr.custom_campaign_params,this.Fr.mask_personal_data_properties,this.Fr.custom_personal_data_properties),n=!Ws(tk(e));return n&&this.register(e),this.au=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=Oe==null?void 0:Oe.referrer;return t?HO(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:BO(),$referring_domain:(Oe==null?void 0:Oe.referrer)&&((t=aa(Oe.referrer))===null||t===void 0?void 0:t.host)||Ov},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=ZO(this.Fr.mask_personal_data_properties,this.Fr.custom_personal_data_properties,this.Fr.disable_capture_url_hashes);this.register_once({[$d]:this.Zl?{r:X0(t.r),u:t.u?X0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Kt([fO,dO],n=>{const r=this.props[n];r&&Kt(r,function(s,i){t["$initial_"+rb(i)]=s})});const e=this.props[$d];if(e){const n=(function(r,s=!1){const i=WO(r,s),o={};return Kt(i,function(l,c){o[`$initial_${rb(c)}`]=l}),o})(e,this.Fr.disable_capture_url_hashes);_n(t,n)}return t}safe_merge(t){return Kt(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const r=t.persistence!==e.persistence,s=!((v,y)=>{if(v.length!==y.length)return!1;const _=[...v].sort(),b=[...y].sort();return _.every((x,k)=>x===b[k])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,c=!!this.fi&&!l;l||this.Pu(e,c),this.Fr=t,!l&&(r||s||o)&&(this.Au=void 0,this.Ru=void 0,this.Pu(j(j({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),c));const d=i||o?this.uu(t):this.Ll;this.Xu();const f=this.cu(t),h=i||f!==this.Kl,m=!l&&(h||t.cross_subdomain_cookie!==this.Zu||t.secure_cookie!==this.Ku)&&this.Ou(c);this.eu=h;try{if(this.Yu=this.Ju=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),h){const v=this.props;this.clear(),this.Ll=d,this.Kl=f,this.props=v,this.save()}else o&&(this.Ll=d,l||(delete this.Ql[gr],this.Lu()))}finally{this.eu=!1,m&&this.Nu()}}Xu(){const t=this.props[$d];if(!this.Zl||!ut(t)||typeof t.r!="string")return;const e=X0(t.r),n=typeof t.u=="string"?X0(t.u):t.u;e===t.r&&n===t.u||this.Su($d,j(j({},t),{},{r:e,u:n}))}set_disabled(t){this.fi=t,this.fi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Zu&&(this.Zu=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ku&&(this.Ku=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.Su(vb,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return de(n)||(delete e[t],this.Su(vb,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.Su(t,e),this.save()}Su(t,e,n=!0){var r;const s=this.props[t];this.props[t]=e,n&&(t!=="distinct_id"&&t!=="$user_state"||s===e||(this.iu=!0),W3(t)&&!El(s,e)&&this.su.add(t),this.Iu(t,s,e),!((r=Vr(t))===null||r===void 0)&&r.volatile||this.Cu(t))}xu(t,e=!0){delete this.props[t],e&&(v2(t)&&this.pu(t,!0),W3(t)&&this.su.add(t),this.Cu(t))}Cu(t){var e;const n=(e=Vr(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.gu(n).dirty=!0)}gu(t){return this.Ql[t]||(this.Ql[t]={})}};const yi={GZipJS:"gzip-js",Base64:"base64"},Fh={Activation:"events",Cancellation:"cancelEvents"},_2={Popover:"popover",API:"api",Widget:"widget"},vi={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},w2={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Pb={Popover:"popover",Inline:"inline"};function Q0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&Vn(n.then)&&n.then(void 0,()=>{})}}}}const sZ={SHOWN:"product tour shown"},q3={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},G3=An("[RateLimiter]");var iZ=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{G3.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void G3.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}get isClientRateLimited(){return 1>this.tc().tokens}clientRateLimitContext(t=!1){var e;const n=this.tc(),r=1>n.tokens;if(r||t||(n.tokens=Math.max(0,n.tokens-1)),r&&!t){const s=(Yn(n.dropped)?n.dropped:0)+1;n.dropped=s,!this.lastEventRateLimited&&this.ec(s)&&(n.dropped=0)}return this.lastEventRateLimited=r,(e=this.instance.persistence)===null||e===void 0||e.set_property("$capture_rate_limit",n),{isRateLimited:r,remainingTokens:n.tokens}}tc(){var t;const{captureEventsBurstLimit:e,captureEventsPerSecond:n}=this,r=new Date().getTime(),s=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(uO),i=s?j({},s):{tokens:e,last:r};return i.tokens+=Math.max(0,r-i.last)/1e3*n,i.last=Math.max(i.last,r),i.tokens>e&&(i.tokens=e),i}nc(t){const e=this.instance.config.property_denylist;return!Ue(e)||!e.includes(t)}sc(){var t;if(this.nc("$current_url")&&this.nc("$pathname")&&(fn!=null&&fn.pathname))return`${(t=fn.origin)!==null&&t!==void 0?t:""}${fn.pathname}`}ec(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.sc(),o=this.nc("$session_id")?(e=(n=this.instance).get_session_id)===null||e===void 0?void 0:e.call(n):void 0,l=[`${t} event(s) dropped since the last warning`,i?`triggered on ${i}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${l}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(t){const e=this.serverLimits[t||"events"]||!1;return e!==!1&&new Date().getTime()<e}};const Cl=An("[RemoteConfig]");var qO=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=tt._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}rc(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}oc(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:t})}load(){try{if(this.remoteConfig)return Cl.info("Using preloaded remote config",this.remoteConfig),void this.ac(this.remoteConfig);if(this._instance.lc())return void Cl.warn("Remote config is disabled. Falling back to local config.");this.rc(t=>{if(!t)return Cl.info("No config found after loading remote JS config. Falling back to JSON."),void this.oc(e=>{this.ac(e.json,e)});this.ac(t)})}catch(t){Cl.error("Error loading remote config",t),this.ac()}}ac(t,e){!t&&e&&(e.statusCode===0?e.error||Cl.warn("Failed to fetch remote config from PostHog."):Cl.error("Failed to fetch remote config from PostHog."));try{this._instance.ac(t?{ok:!0,config:t}:{ok:!1})}catch(r){Cl.error("Error applying remote config",r)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(r){Cl.error("Error loading feature flags",r)}}},Xi=Uint8Array,qs=Uint16Array,xf=Uint32Array,ak=new Xi([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),lk=new Xi([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Y3=new Xi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),GO=function(t,e){for(var n=new qs(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new xf(n[30]);for(r=1;30>r;++r)for(var i=n[r];n[r+1]>i;++i)s[i]=i-n[r]<<5|r;return[n,s]},YO=GO(ak,2),Tb=YO[1];YO[0][28]=258,Tb[258]=28;for(var X3=GO(lk,0)[1],XO=new qs(32768),Ln=0;32768>Ln;++Ln){var wd=(43690&Ln)>>>1|(21845&Ln)<<1;XO[Ln]=((65280&(wd=(61680&(wd=(52428&wd)>>>2|(13107&wd)<<2))>>>4|(3855&wd)<<4))>>>8|(255&wd)<<8)>>>1}var wp=function(t,e,n){for(var r=t.length,s=0,i=new qs(e);r>s;++s)++i[t[s]-1];var o,l=new qs(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new qs(r),s=0;r>s;++s)o[s]=XO[l[t[s]-1]++]>>>15-t[s];return o},Mu=new Xi(288);for(Ln=0;144>Ln;++Ln)Mu[Ln]=8;for(Ln=144;256>Ln;++Ln)Mu[Ln]=9;for(Ln=256;280>Ln;++Ln)Mu[Ln]=7;for(Ln=280;288>Ln;++Ln)Mu[Ln]=8;var Mv=new Xi(32);for(Ln=0;32>Ln;++Ln)Mv[Ln]=5;var oZ=wp(Mu,9),aZ=wp(Mv,5),QO=function(t){return(t/8|0)+(7&t&&1)},JO=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof qs?qs:t instanceof xf?xf:Xi)(n-e);return r.set(t.subarray(e,n)),r},Ca=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},jh=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},b2=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new Xi(0),0];if(s==1){var o=new Xi(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(R,O){return R.f-O.f}),n.push({s:-1,f:25001});var l=n[0],c=n[1],d=0,f=1,h=2;for(n[0]={s:-1,f:l.f+c.f,l,r:c};f!=s-1;)l=n[n[h].f>n[d].f?d++:h++],c=n[d!=f&&n[h].f>n[d].f?d++:h++],n[f++]={s:-1,f:l.f+c.f,l,r:c};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var v=new qs(m+1),y=Rb(n[f-1],v,0);if(y>e){r=0;var _=0,b=y-e,x=1<<b;for(i.sort(function(R,O){return v[O.s]-v[R.s]||R.f-O.f});s>r;++r){var k=i[r].s;if(e>=v[k])break;_+=x-(1<<y-v[k]),v[k]=e}for(_>>>=b;_>0;){var C=i[r].s;e>v[C]?_-=1<<e-v[C]++-1:++r}for(;r>=0&&_;--r){var P=i[r].s;v[P]==e&&(--v[P],++_)}y=e}return[new Xi(v),y]},Rb=function(t,e,n){return t.s==-1?Math.max(Rb(t.l,e,n+1),Rb(t.r,e,n+1)):e[t.s]=n},Q3=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new qs(++e),r=0,s=t[0],i=1,o=function(c){n[r++]=c},l=1;e>=l;++l)if(t[l]==s&&l!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[l]}return[n.subarray(0,r),e]},zh=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},Ab=function(t,e,n){var r=n.length,s=QO(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},J3=function(t,e,n,r,s,i,o,l,c,d,f){Ca(e,f++,n),++s[256];for(var h=b2(s,15),m=h[0],v=h[1],y=b2(i,15),_=y[0],b=y[1],x=Q3(m),k=x[0],C=x[1],P=Q3(_),R=P[0],O=P[1],I=new qs(19),A=0;k.length>A;++A)I[31&k[A]]++;for(A=0;R.length>A;++A)I[31&R[A]]++;for(var M=b2(I,7),L=M[0],z=M[1],$=19;$>4&&!L[Y3[$-1]];--$);var q,X,K,H,ee=d+5<<3,V=zh(s,Mu)+zh(i,Mv)+o,Q=zh(s,m)+zh(i,_)+o+14+3*$+zh(I,L)+(2*I[16]+3*I[17]+7*I[18]);if(V>=ee&&Q>=ee)return Ab(e,f,t.subarray(c,c+d));if(Ca(e,f,1+(V>Q)),f+=2,V>Q){q=wp(m,v),X=m,K=wp(_,b),H=_;var B=wp(L,z);for(Ca(e,f,C-257),Ca(e,f+5,O-1),Ca(e,f+10,$-4),f+=14,A=0;$>A;++A)Ca(e,f+3*A,L[Y3[A]]);f+=3*$;for(var D=[k,R],G=0;2>G;++G){var fe=D[G];for(A=0;fe.length>A;++A)Ca(e,f,B[ie=31&fe[A]]),f+=L[ie],ie>15&&(Ca(e,f,fe[A]>>>5&127),f+=fe[A]>>>12)}}else q=oZ,X=Mu,K=aZ,H=Mv;for(A=0;l>A;++A)if(r[A]>255){var ie;jh(e,f,q[257+(ie=r[A]>>>18&31)]),f+=X[ie+257],ie>7&&(Ca(e,f,r[A]>>>23&31),f+=ak[ie]);var ue=31&r[A];jh(e,f,K[ue]),f+=H[ue],ue>3&&(jh(e,f,r[A]>>>5&8191),f+=lk[ue])}else jh(e,f,q[r[A]]),f+=X[r[A]];return jh(e,f,q[256]),f+X[256]},lZ=new xf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),cZ=(function(){for(var t=new xf(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),x2=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function uZ(t,e){e===void 0&&(e={});var n=(function(){var h=4294967295;return{p(m){for(var v=h,y=0;m.length>y;++y)v=cZ[255&v^m[y]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=t.length;n.p(t);var s,i,o,l,c,d=(l=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(h,m,v,y,_,b){var x=h.length,k=new Xi(y+x+5*(1+Math.floor(x/7e3))+_),C=k.subarray(y,k.length-_),P=0;if(!m||8>x)for(var R=0;x>=R;R+=65535){var O=R+65535;x>O?P=Ab(C,P,h.subarray(R,O)):(C[R]=b,P=Ab(C,P,h.subarray(R,x)))}else{for(var I=lZ[m-1],A=I>>>13,M=8191&I,L=(1<<v)-1,z=new qs(32768),$=new qs(L+1),q=Math.ceil(v/3),X=2*q,K=function(Ct){return(h[Ct]^h[Ct+1]<<q^h[Ct+2]<<X)&L},H=new xf(25e3),ee=new qs(288),V=new qs(32),Q=0,B=0,D=(R=0,0),G=0,fe=0;x>R;++R){var ie=K(R),ue=32767&R,he=$[ie];if(z[ue]=he,$[ie]=ue,R>=G){var _e=x-R;if((Q>7e3||D>24576)&&_e>423){P=J3(h,C,0,H,ee,V,B,D,fe,R-fe,P),D=Q=B=0,fe=R;for(var le=0;286>le;++le)ee[le]=0;for(le=0;30>le;++le)V[le]=0}var ne=2,be=0,Ve=M,De=ue-he&32767;if(_e>2&&ie==K(R-De))for(var $e=Math.min(A,_e)-1,Ut=Math.min(32767,R),nn=Math.min(258,_e);Ut>=De&&--Ve&&ue!=he;){if(h[R+ne]==h[R+ne-De]){for(var kt=0;nn>kt&&h[R+kt]==h[R+kt-De];++kt);if(kt>ne){if(ne=kt,be=De,kt>$e)break;var Dt=Math.min(De,kt-2),un=0;for(le=0;Dt>le;++le){var qt=R-De+le+32768&32767,Ne=qt-z[qt]+32768&32767;Ne>un&&(un=Ne,he=qt)}}}De+=(ue=he)-(he=z[ue])+32768&32767}if(be){H[D++]=268435456|Tb[ne]<<18|X3[be];var Je=31&Tb[ne],Re=31&X3[be];B+=ak[Je]+lk[Re],++ee[257+Je],++V[Re],G=R+ne,++Q}else H[D++]=h[R],++ee[h[R]]}}P=J3(h,C,b,H,ee,V,B,D,fe,R-fe,P)}return JO(k,0,y+QO(P)+_)})(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,l,c,!0)),f=d.length;return(function(h,m){var v=m.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>m.level?4:m.level==9?2:0,h[9]=3,m.mtime!=0&&x2(h,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),v){h[3]=8;for(var y=0;v.length>=y;++y)h[y+10]=v.charCodeAt(y)}})(d,e),x2(d,f-8,n.d()),x2(d,f-4,r),d}const dZ=!!VS||!!Dp,eM=new WeakMap,tM="text/plain";let S2=0,Hg=!1;const nM=(t,e)=>{const[n,r]=t.split("#"),[s,i]=n.split("?");if(!i)return t;const o=i.split("&").filter(l=>l.split("=")[0]!==e).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},M1=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=j({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var f;const[h,m]=d.split("="),v=n&&(f=o[h])!==null&&f!==void 0?f:m;return delete o[h],`${h}=${v}`}))!==null&&r!==void 0?r:[],c=(function(d,f="&"){let h,m;const v=[];return Kt(d,function(y,_){de(y)||de(_)||_==="undefined"||(h=encodeURIComponent((b=>b instanceof File)(y)?y.name:y.toString()),m=encodeURIComponent(_),v[v.length]=m+"="+h)}),v.join(f)})(o);return c&&l.push(c),l.length>0?`${s}?${l.join("&")}`:s},k2=t=>{if(t.cr)return t.cr;const{data:e,compression:n}=t;if(!e)return;if(n===yi.GZipJS){const s=uZ((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Xi(i.length+(i.length>>>1)),c=0,d=function(v){l[c++]=v},f=0;o>f;++f){if(c+5>l.length){var h=new Xi(c+8+(o-f<<1));h.set(l),l=h}var m=i.charCodeAt(f);128>m?d(m):2048>m?(d(192|m>>>6),d(128|63&m)):m>55295&&57344>m?(d(240|(m=65536+(1047552&m)|1023&i.charCodeAt(++f))>>>18),d(128|m>>>12&63),d(128|m>>>6&63),d(128|63&m)):(d(224|m>>>12),d(128|m>>>6&63),d(128|63&m))}return JO(l,0,c)})(jd(e)),{mtime:0});return{contentType:tM,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===yi.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,c)=>String.fromCharCode(parseInt(c,16))))})(jd(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:jd(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=jd(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},rM=t=>{const e=()=>t.transport==="sendBeacon"?{url:M1(t.url,{compression:yi.Base64}),encodedBody:k2(j(j({},t),{},{compression:yi.Base64,cr:void 0}))}:{url:nM(t.url,"compression"),encodedBody:k2(j(j({},t),{},{compression:void 0,cr:void 0}))};let n;try{n=k2(t)}catch(s){if(m3(t.compression,wf(t.url,"compression")))return ve.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&m3(t.compression,wf(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?ub(new Uint8Array(r)):ArrayBuffer.isView(r)&&ub(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(Hg=!0,e()):{url:t.url,encodedBody:n};var r},sM=t=>{try{return rM(t)}catch(n){var e;return ve.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},fZ=(function(){var t=pn(function*(e){const n=yield(function(s){return db.apply(this,arguments)})(jd(e.data),Zs.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return j(j({},e),{},{cr:{contentType:tM,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),iM=t=>N5("AbortError","PostHog request timed out"+(t?` after ${t}ms`:"")),hZ=/Failed to fetch|NetworkError|Load failed/i,oM=t=>(t==null?void 0:t.name)==="TypeError"&&hZ.test((t==null?void 0:t.message)||""),aM=t=>{try{const e=(function(n,r=Date.now(),s=3e5){if(typeof n!="string"||!n)return;const i=n.trim(),o=/^\d+\s*,/.test(i)?i.slice(0,i.indexOf(",")).trim():i;if(/^\d+$/.test(o)){const d=1e3*Math.min(Number(o),s/1e3);return d>0?d:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(o))return;const l=/^\w{3} \w{3} /.test(o)?o+" GMT":o,c=Date.parse(l)-r;return Number.isFinite(c)&&c>0?Math.min(c,s):void 0})(t());return de(e)?void 0:Math.min(e,3e4)}catch{return}},lM=t=>{const e=sM(t);if(!e)return;const n=new VS;eM.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Kt(t.headers,function(c,d){n.setRequestHeader(d,c)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout);let l=!1;n.ontimeout=()=>{l=!0},n.onloadend=()=>{var c;if(l){var d;const h=iM(t.timeout);return ve.warn(h),void((d=t.callback)===null||d===void 0||d.call(t,{statusCode:0,error:h}))}const f={statusCode:n.status,text:n.responseText};if(n.status===200)try{f.json=JSON.parse(n.responseText)}catch{}(c=t.callback)===null||c===void 0||c.call(t,f,aM(()=>n.getResponseHeader("Retry-After")))},n.send(o)},cM=t=>{const e=sM(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;Kt(t.headers,function(y,_){l.append(_,y)}),s&&l.append("Content-Type",s);let c=null,d=!1;if(QC){const y=new QC;c={signal:y.signal,timeout:setTimeout(()=>{d=!0;try{y.abort(iM(t.timeout))}catch(_){h(_)}},t.timeout)}}let f=!1;const h=y=>{var _;f||(f=!0,d&&(y==null?void 0:y.name)==="AbortError"||oM(y)?ve.warn(y):ve.error(y),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:y}))};let m=0;const v=()=>{S2-=m,m=0,c&&clearTimeout(c.timeout)};try{const y=j({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:c==null?void 0:c.signal},t.fetchOptions),_=o??(de(i)?0:void 0);y.keepalive=y.method==="POST"&&!t.Ol&&y.keepalive!==!1&&y.body===i&&!de(_)&&_>=0&&52428.8>S2+_,y.keepalive&&(m=_,S2+=m),Dp(n,y).then(b=>b.text().then(x=>{var k;if(f)return;const C={statusCode:b.status,text:x};if(b.status===200)try{C.json=JSON.parse(x)}catch(P){ve.error(P)}f=!0,v(),(k=t.callback)===null||k===void 0||k.call(t,C,aM(()=>b.headers.get("Retry-After")))})).catch(b=>{v(),h(b)}).finally(v)}catch(y){v(),h(y)}},Ib=t=>{try{var e;const{url:n,encodedBody:r}=rM(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(Qr.sendBeacon(n,l))return;const c=Ue(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(Ue(c)&&c.length>1&&(o??0)>16384){const d=Math.ceil(c.length/2),f=h=>Ue(t.data)?h:j(j({},t.data),{},{batch:h});return Ib(j(j({},t),{},{data:f(c.slice(0,d))})),void Ib(j(j({},t),{},{data:f(c.slice(d))}))}ve.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${Dp?"fetch":"XHR"}`),Dp?cM(j(j({},t),{},{Ol:!0})):lM(t)}catch(n){ve.warn("Beacon send failed",n)}},eP=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return M1(n===yi.GZipJS?nM(t,"compression"):t,j(j({},s?{[s]:Date.now().toString()}:{}),n===yi.GZipJS?{}:{compression:n}))},pZ=(()=>{const t=[];return Dp&&t.push({transport:"fetch",method:cM}),VS&&t.push({transport:"XHR",method:lM}),Qr!=null&&Qr.sendBeacon&&t.push({transport:"sendBeacon",method:Ib}),t})();let uM=!dZ&&(As==null?void 0:As.indexOf("MSIE"))===-1&&(As==null?void 0:As.indexOf("Mozilla"))===-1;function dM(t,e,n){var r,s,i,o;n&&(e=j(j({},e),{},{callback:l=>n(l)})),t.__loaded?uM?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=j(j({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(r=t.compression)!==null&&r!==void 0?r:e.compressionFallback:e.compression,(de(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,(s=e.onDispatch)===null||s===void 0||s.call(e),((l,c)=>{var d,f,h;const m=j(j({},l),{},{callback:c??(x=>{var k;return(k=l.callback)===null||k===void 0?void 0:k.call(l,x)})});m.timeout=m.timeout||6e4;const v=(d=m.transport)!==null&&d!==void 0?d:"fetch";v==="sendBeacon"&&de(m.compression)&&m.data&&(m.compression=yi.Base64),m.method==="POST"&&m.data&&(m.timestampMode==="capture-body"?m.data=(x=>{var k,C;const P=(Ue(x)?x:[x]).map(O=>j(j({},O),O.timestamp instanceof Date&&!isNaN(O.timestamp.getTime())?{timestamp:O.timestamp.toISOString()}:{})),R=P[0];return{api_key:(k=R==null||(C=R.properties)===null||C===void 0?void 0:C.token)!==null&&k!==void 0?k:R==null?void 0:R.token,batch:P,sent_at:new Date().toISOString()}})(m.data):m.timestampMode==="body"&&(m.data=((x,k=new Date().toISOString())=>Ue(x)?x.map(C=>j(j({},C),{},{sent_at:k})):j(j({},x),{},{sent_at:k}))(m.data))),m.url=eP(m.url,m.method,m.compression,m.timestampMode);const y=pZ.filter(x=>!m.disableTransport||!x.transport||!m.disableTransport.includes(x.transport)),_=(f=(h=(function(x,k){for(let C=0;x.length>C;C++)if(k(x[C]))return x[C]})(y,x=>x.transport===v))===null||h===void 0?void 0:h.method)!==null&&f!==void 0?f:y[0].method;if(!_)throw new Error("No available transport method");const b=x=>{try{_(x)}catch(C){var k;oM(C)?ve.warn(C):ve.error(C),(k=m.callback)===null||k===void 0||k.call(m,{statusCode:0,error:C})}};v!=="sendBeacon"&&!m.preferSyncCompression&&m.data&&m.compression===yi.GZipJS&&TH&&typeof Promise<"u"&&!Hg?fZ(m).then(x=>{b(x)}).catch(x=>{if(g3(x))return Hg=!0,void b(j(j({},m),{},{compression:void 0,url:eP(l.url,l.method,void 0,l.timestampMode)}));(k=>{if(!k||typeof k!="object")return!1;const C="name"in k?String(k.name):"";return g3(k)||C===V5})(x)&&(Hg=!0),b(m)}):b(m)})(e,(l,c)=>{var d,f,h;t.rateLimiter.checkForLimiting(l),400>l.statusCode||(d=(f=t.config).on_request_error)===null||d===void 0||d.call(f,l),n?n(l,c):(h=e.callback)===null||h===void 0||h.call(e,l)})):e.fireCallbackOnDrop&&((o=e.callback)===null||o===void 0||o.call(e,{statusCode:0}))}var mZ=class{constructor(t,e){this.uc=!0,this.cc=[],this.hc=Jo((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,ve.createLogger("flush interval"),3e3),this.dc=t}enqueue(t){this.cc.push(t),this.vc||this.fc()}unload(){this.gc();const t=this.cc.length>0?this.mc():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.yc(j(j({},n),{},{callback:void 0}),"sendBeacon")})}enable(){this.uc=!1,this.fc()}fc(){this.uc||(this.vc=setTimeout(()=>{this.gc(),this.bc()},this.hc))}bc(){if(this.cc.length>0){const t=this.mc();for(const e in t)this.yc(t[e])}}yc(t,e){try{this.dc(t,e)}catch(n){ve.error(n)}}gc(){clearTimeout(this.vc),this.vc=void 0}mc(){const t={},e={};Kt(this.cc,n=>{var r;const s=n,i=((s?s.batchKey:null)||s.url)+(s.batchGroup?`:${s.batchGroup}`:"");de(t[i])&&(t[i]=j(j({},s),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),e[i]=[]),(r=t[i].data)===null||r===void 0||r.push(s.data),s.callback&&e[i].push(s.callback)});for(const n in e){const r=e[n];r.length&&(t[n].callback=s=>{for(const i of r)i(s)})}return this.cc=[],t}};const gZ=["retriesPerformedSoFar"];var vZ=class{constructor(t){this._instance=t,this._c=!1,this.wc=3e3,this.cc=[],this.cc=[],this.kc=!0,this.resume()}resume(){if(!de(ce)&&"onLine"in ce.navigator){if(this.kc=ce.navigator.onLine,this.Sc)return;this.Sc=()=>{this.kc=!0,this.bc()},this.xc=()=>{this.kc=!1},Lt(ce,"online",this.Sc),Lt(ce,"offline",this.xc)}}get length(){return this.cc.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=H5(t,gZ);Oa(n)&&(r.url=M1(r.url,{retry_count:n})),dM(this._instance,e?j(j({},r),{},{transport:e}):r,(s,i)=>{var o;if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ls(j({retriesPerformedSoFar:n},r),i);s.statusCode===0&&ve.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${n??0} retries.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}Ls(t,e){const n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const l=3e3*Math.pow(2,o),c=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-c);return Math.ceil(d+f)})(n),e??0),s=Date.now()+r;this.cc.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),ve.warn(i),this._c||(this._c=!0,this.$c())}$c(){if(this.Cc&&clearTimeout(this.Cc),this.cc.length===0)return this._c=!1,void(this.Cc=void 0);this.Cc=setTimeout(()=>{this.kc&&this.cc.length>0&&this.bc(),this.$c()},this.wc)}bc(){const t=Date.now(),e=[],n=this.cc.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.cc=e,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.Cc&&(clearTimeout(this.Cc),this.Cc=void 0),this._c=!1,de(ce)||(this.Sc&&(ce.removeEventListener("online",this.Sc),this.Sc=void 0),this.xc&&(ce.removeEventListener("offline",this.xc),this.xc=void 0));for(const{requestOptions:t}of this.cc)try{this._instance._send_request(j(j({},t),{},{callback:Ue(t.data)?void 0:t.callback,transport:"sendBeacon"}))}catch(e){ve.error(e)}this.cc=[]}},yZ=class{constructor(t){this._instance=t,this.Tc=()=>{var e,n,r,s;this.Ic||(this.Ic={});const i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,c=o+((i==null?void 0:i.clientHeight)||0),d=(i==null?void 0:i.scrollHeight)||0;this.Ic.lastScrollY=Math.ceil(o),this.Ic.maxScrollY=Math.max(o,(e=this.Ic.maxScrollY)!==null&&e!==void 0?e:0),this.Ic.maxScrollHeight=Math.max(l,(n=this.Ic.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ic.lastContentY=c,this.Ic.maxContentY=Math.max(c,(r=this.Ic.maxContentY)!==null&&r!==void 0?r:0),this.Ic.maxContentHeight=Math.max(d,(s=this.Ic.maxContentHeight)!==null&&s!==void 0?s:0)}}get Mc(){return this._instance.config.scroll_root_selector}getContext(){return this.Ic}resetContext(){const t=this.Ic;return this.Ic=void 0,setTimeout(this.Tc,0),t}startMeasuringScrollPosition(){Lt(ce,"scroll",this.Tc,{capture:!0}),Lt(ce,"scrollend",this.Tc,{capture:!0}),Lt(ce,"resize",this.Tc)}scrollElement(){if(this.Mc){const n=Ue(this.Mc)?this.Mc:[this.Mc];for(const r of n){var t;const s=ce==null||(t=ce.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return ce==null||(e=ce.document)===null||e===void 0?void 0:e.documentElement}Ec(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.Mc){const s=this.scrollElement();return s&&s[r]||0}return ce?t==="y"?ce.scrollY||ce.pageYOffset||((e=ce.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:ce.scrollX||ce.pageXOffset||((n=ce.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.Ec("y")}scrollX(){return this.Ec("x")}};const _Z=t=>ZO(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);var tP=class{constructor(t,e,n,r){this.je=s=>{const i=this.Ac();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.Rc(this._instance)};this.Pc.register({[Sb]:o})},this._instance=t,this.Oc=e,this.Pc=n,this.Rc=r||_Z,this.Oc.onSessionId(this.je)}Ac(){return this.Pc.props[Sb]}getSetOnceProps(){var t;const e=(t=this.Ac())===null||t===void 0?void 0:t.props;return e?"r"in e?WO(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){const t={};return Kt(tk(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${rb(n)}`]=e}),t}},Nv=class{on(t,e){return this.Eo[t]||(this.Eo[t]=[]),this.Eo[t].push(e),()=>{this.Eo[t]=this.Eo[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.Eo[t]||[])n(e);for(const n of this.Eo["*"]||[])n(t,e)}constructor(){this.Eo={}}};const bd=An("[SessionId]"),nP=864e5;var rP=class{on(t,e){return this.Fc.on(t,e)}constructor(t,e,n){var r;if(this.Dc=null,this.Lc=null,this.Nc=[],this.jc=void 0,this.qc=!1,this.Fc=new Nv,this.Bc=(i,o)=>!(!Oa(i)||!Oa(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Fr=t.config,this.Pc=t.persistence,this.Be=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.zc=void 0,this._sessionActivityTimestamp=null,this.Hc=e||_o,this.Uc=n||_o;const s=this.Fr.persistence_name||this.Fr.token;if(this._sessionTimeoutMs=1e3*Jo(this.Fr.session_idle_timeout_seconds||1800,60,36e3,bd.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Wc(),this.Vc="ph_"+s+"_window_id",this.Gc="ph_"+s+"_primary_window_exists",this.Qc()){const i=hn.Ft(this.Vc),o=hn.Ft(this.Gc);i&&!o?this.Be=i:hn.Dt(this.Vc),hn.$t(this.Gc,!0)}!((r=this.Fr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Fr.bootstrap.sessionID),this.Jc()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return de(this.Nc)&&(this.Nc=[]),this.Nc.push(t),this.Xt&&t(this.Xt,this.Be),()=>{this.Nc=this.Nc.filter(e=>e!==t)}}Qc(){return this.Fr.persistence!=="memory"&&!this.Pc.fi&&hn.Ot()}Zc(t){t!==this.Be&&(this.Be=t,this.Qc()&&hn.$t(this.Vc,t))}Kc(){return this.Be?this.Be:this.Qc()?hn.Ft(this.Vc):null}Yc(t){const e=this.Dc;return!Nn(e)&&!Nn(t)&&5e3>Math.abs(t-e)}Xc(t,e,n){const r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.Yc(e)||(this.Dc=e,this.Pc.register({[Dd]:[e,t,n]}))}eh(){var t;const e=(t=this.Fr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Oa(e)&&e>0}ih(){this.eh()?this.Pc.refreshKey(Dd):(this.Pc.flush(),this.Pc.load())}nh(){var t;if(Nn(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Dc)return;this.ih();const[,e,n]=this.sh();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Dc=this._sessionActivityTimestamp,this.Pc.register({[Dd]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Pc.flush())}rh(){const[t]=this.sh(),e=Oa(t)?t:0,n=Oa(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}oh(t){return this.ih(),this.Bc(t,this.rh())}sh(){const t=this.Pc.props[Dd];return Ue(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Dc=null,this.zc=void 0,clearTimeout(this.ah),this.ah=void 0,this.Xc(null,null,null)}setBootstrapSessionId(t,e=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const l=o.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(r);return i>s+6e4?void bd.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void bd.error("Invalid sessionID in bootstrap",i)}})(t);return!de(n)&&(e?this.zc={sessionId:t,sessionStartTimestamp:n}:this.Xc(t,new Date().getTime(),n),!0)}destroy(){this.qc=!0,this.nh(),clearTimeout(this.ah),this.ah=void 0,this.jc&&ce&&(ce.removeEventListener(Rv,this.jc,{capture:!1}),this.jc=void 0),this.Nc=[]}Jc(){this.jc=()=>{this.nh(),this.Qc()&&hn.Dt(this.Gc)},Lt(ce,Rv,this.jc,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Fr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=e||new Date().getTime(),s=this.Xt;if(n)this.Lc=r;else if(Nn(this.Lc)||this.Lc>r||r-this.Lc>=1e3){var i,o;(i=(o=this.Pc).syncCookieProperties)===null||i===void 0||i.call(o),this.Lc=r}let[,l,c]=this.sh();const d=!de(s)&&l!==s,f=this.rh();let h=this.Kc();const m=this.zc,v=!!m&&(m.sessionStartTimestamp>r+6e4||r-m.sessionStartTimestamp>nP),y=m?v:Oa(c)&&Math.abs(r-c)>nP;let _=!1,b=d,x=!l||!!m;const k=l;let C=!x&&!t&&this.Bc(r,f);if(C&&(C=this.oh(r),C||bd.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,c]=this.sh(),C||(x=!l||!!m)),x||C||y){b=!1;const I=m&&!v;l=I?m.sessionId:this.Hc(),h=this.Uc(),bd.info("new session ID assigned",{sessionId:l,windowId:h,bootstrapped:!!I,changeReason:{noSessionId:x,activityTimeout:C,sessionPastMaximumLength:y}}),c=I?m.sessionStartTimestamp:r,this.zc=void 0,_=!0}else h||(h=this.Uc(),_=!0),b=b||l!==k,b&&(bd.info("adopted cross-tab session id",{sessionId:l,windowId:h}),_=!0);const P=Oa(f)&&t&&!y?f:r,R=Oa(c)?c:new Date().getTime();this.Zc(h),this.Xc(l,P,R),t||this.Wc();const O={noSessionId:x,activityTimeout:C,sessionPastMaximumLength:y,crossTabAdoption:b};return _&&this.Nc.forEach(I=>I(l,h,O)),{sessionId:l,windowId:h,sessionStartTimestamp:R,changeReason:_?O:void 0,lastActivityTimestamp:f}}Wc(){this.qc||(clearTimeout(this.ah),this.ah=setTimeout(()=>{if(!this.qc)if(this.oh(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.Fc.emit("forcedIdleReset",{idleSessionId:t})}else this.Wc()},1.1*this.sessionTimeoutMs))}};const sP=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]),fM=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&e3(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>e3(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function hM(){return(hM=pn(function*(){const t=Qr==null?void 0:Qr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return ft(n)&&n.length>0?n:void 0}catch(e){return void ve.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function wZ(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function pM(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const Lv=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},J0=t=>t.toLowerCase(),mM={exact:(t,e)=>e.some(n=>t.some(r=>n===r)),is_not:(t,e)=>e.every(n=>t.every(r=>n!==r)),regex:(t,e)=>e.some(n=>t.some(r=>Lv(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Lv(n,r))),icontains:(t,e)=>e.map(J0).some(n=>t.map(J0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(J0).every(n=>t.map(J0).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})};function gM(t,e){return!t||Object.entries(t).every(([n,r])=>{const s=e==null?void 0:e[n];if(s==null)return!1;const i=mM[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function E2(t,e,n){return jd({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const Ob="custom",iP="i.posthog.com",bZ=/^\/static\//,xZ=["/s/","/e/","/i/"];var SZ=class{constructor(t){this.uh={},this.instance=t}get apiHost(){const t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){const t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t;let e=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace(`.${iP}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}get region(){return this.uh[this.apiHost]||(this.uh[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ob),this.uh[this.apiHost]}hh(t){if(!bZ.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}dh(t){const e=aa(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}fh(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=aa(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&xZ.some(o=>e.indexOf(o)===0)){const o=this.dh(r);if(o){const l=this.apiHost;let c=this.ph;(c==null?void 0:c.apiHost)===l&&c.rewriteRequestPath===s||(c={apiHost:l,rewriteRequestPath:s,urls:new Set},this.ph=c),c.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.ph,n=this.dh(t);return(e==null?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&e.urls.has(n)}endpointFor(t,e=""){if(e&&(e=e[0]==="/"?e:`/${e}`),t==="ui")return this.fh(t,e,this.uiHost+e);if(t==="flags")return this.fh(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.hh(e);if(r)return this.fh(t,e,`${r}${e}`)}if(this.region===Ob)return this.fh(t,e,this.apiHost+e);const n=iP+e;switch(t){case"assets":return this.fh(t,e,`https://${this.region}-assets.${n}`);case"api":return this.fh(t,e,`https://${this.region}.${n}`)}}};const Wt=An("[Surveys]"),vM=t=>{try{const e=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){Wt.error("Failed to persist survey seen state",e)}},kZ=[_2.Popover,_2.Widget,_2.API],EZ={ignoreConditions:!1,ignoreDelay:!1,displayType:Pb.Popover},CZ=An("[PostHog ExternalIntegrations]"),PZ={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var TZ=class{constructor(t){this._instance=t}Bl(t,e){var n,r;(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return CZ.error("failed to load script",s);e()})}startIfEnabledOrStop(){var t;for(const[s,i]of Object.entries((t=this._instance.config.integrations)!==null&&t!==void 0?t:{})){var e,n,r;i&&!(!((e=tt.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.Bl(PZ[s],()=>{var o;(o=tt.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[s])===null||o===void 0||o.start(this._instance)}),!i&&(!((n=tt.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=tt.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},yM=class{constructor(t){this.disabled=t===!1;const e=ut(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:n}];return!1}};const Mb=()=>typeof window>"u"?void 0:window,Vh=()=>typeof document>"u"?void 0:document,C2="$copy_autocapture",RZ=["password","hidden","file","checkbox","button","submit","reset","image"],eg=An("[AutoCapture]");function P2(t,e){return e.length>t?e.slice(0,t)+"...":e}function AZ(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Yi(e));return e}function IZ(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,c;if(!Yi(t))return{props:{}};const d=[t],f=new Set([t]);let h=t;for(;h.parentNode&&!hr(h,"body")&&1e3>d.length;){if(Av(h.parentNode)){const O=h.parentNode.host;if(f.has(O))break;f.add(O),d.push(O),h=O;continue}if(!Yi(h.parentNode)||f.has(h.parentNode))break;f.add(h.parentNode),d.push(h.parentNode),h=h.parentNode}const m=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(O=>hr(O,"button")||hr(O,"a")):-1;m>0&&(r=r||d.slice(0,m+1).some(O=>!ec(O)||_f(O)));const v=[],y={};let _,b=!1,x=!1;if(Kt(d,O=>{const I=ec(O);if(hr(O,"a")&&!n&&!(s!=null&&s.includes("href"))){const A=O.getAttribute("href");b=!!(I&&A&&Yd(A))&&(o?Ql(A):A)}Ke(bu(O),"ph-no-capture")&&(x=!0),v.push((function(A,M,L,z,$=!1){const q=A.tagName.toLowerCase(),X={tag_name:q};rk.indexOf(q)>-1&&!L&&(X.$el_text=q.toLowerCase()==="a"||q.toLowerCase()==="button"?P2(1024,V3(A)):P2(1024,zp(A)));const K=bu(A);M||z!=null&&z.includes("class")||0>=K.length||(X.classes=K.filter(function(Q){return Q!==""})),Kt(A.attributes,function(Q){var B;if((!_f(A)||["name","id","class","aria-label"].indexOf(Q.name)!==-1)&&!(z!=null&&z.includes(Q.name))&&!M&&Yd(Q.value)&&(!ft(B=Q.name)||B.substring(0,10)!=="_ngcontent"&&B.substring(0,7)!=="_nghost")){let D=Q.value;Q.name==="class"&&(D=nk(D).join(" ")),X["attr__"+Q.name]=P2(1024,Q.name==="href"&&$?Ql(D):D)}});let H=1,ee=1,V=A;for(;V=AZ(V);)H++,V.tagName===A.tagName&&ee++;return X.nth_child=H,X.nth_of_type=ee,X})(O,n,r,s,o)),Kt((function(A){if(!ec(A))return{};const M={};return Kt(A.attributes,function(L){if(L.name&&L.name.indexOf("data-ph-capture-attribute")===0){const z=L.name.replace("data-ph-capture-attribute-",""),$=L.value;z&&$&&Yd($)&&(M[z]=$)}}),M})(O),(A,M)=>{({}).hasOwnProperty.call(y,M)||(y[M]=A)})}),x)return{props:{},explicitNoCapture:x};if(m>0&&(t=d[m],v.splice(0,m)),r||(v[0].$el_text=hr(t,"a")||hr(t,"button")?V3(t):zp(t)),b){var k,C;v[0].attr__href=b;const O=(k=aa(b))===null||k===void 0?void 0:k.host,I=(C=Mb())===null||C===void 0||(C=C.location)===null||C===void 0?void 0:C.host;O&&I&&O!==I&&(_=b)}return{props:_n((R=e.type,{$event_type:R,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(P=v,Ue(P)?(function(O){return O.map(I=>{var A,M;let L="";if(I.tag_name&&(L+=I.tag_name),I.attr_class){I.attr_class.sort();for(const q of I.attr_class)L+=`.${q.replace(/"/g,"")}`}const z=j(j(j(j({},I.text?{text:I.text}:{}),{},{"nth-child":(A=I.nth_child)!==null&&A!==void 0?A:0,"nth-of-type":(M=I.nth_of_type)!==null&&M!==void 0?M:0},I.href?{href:I.href}:{}),I.attr_id?{attr_id:I.attr_id}:{}),I.attributes),$={};return Vg(z).sort(([q],[X])=>(function(K,H){return H>K?-1:K>H?1:0})(q,X)).forEach(([q,X])=>$[H3(q.toString())]=H3(X.toString())),L+=":",L+=Vg($).map(([q,X])=>`${q}="${X}"`).join(""),L}).join(";")})((function(O){return O.map(I=>{var A,M;const L={text:(A=I.$el_text)===null||A===void 0?void 0:A.slice(0,400),tag_name:I.tag_name,href:(M=I.attr__href)===null||M===void 0?void 0:M.slice(0,2048),attr_class:WB(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return Vg(I).filter(([z])=>z.indexOf("attr__")===0).forEach(([z,$])=>L.attributes[z]=$),L})})(P)):"")},!((l=v[0])===null||l===void 0)&&l.$el_text?{$el_text:(c=v[0])===null||c===void 0?void 0:c.$el_text}:{},_&&e.type==="click"?{$external_click_url:_}:{},y),target:t};var P,R}const _M="autocapture";var OZ=class{vl(){this.fl=void 0,clearTimeout(this.pl),this.pl=void 0}gl(t){var e;if(!ec(t))return!0;const n=(e=this.ml().css_selector_ignorelist)!==null&&e!==void 0?e:q0,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=bu(i);if(Ke(o,"ph-no-capture")||Ke(o,"ph-sensitive")||_f(i)||n.some(c=>ep(i,c)))return!0;const l=s.parentNode;s=Av(l)?l.host:l&&Yi(l)?l:null}return!1}yl(t){if(!this.isEnabled||t.type==="pointercancel")return void this.vl();if(t.type==="pointerdown"){var e;this.vl();const r=_p(t);return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Yi(r)&&(this.fl={target:r,excluded:this.gl(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this.Fa)===null||e===void 0?void 0:e.distinctId}))}const n=this.fl;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.vl():t.type==="pointerup"&&(n.released=!0,this.pl=setTimeout(()=>this.vl(),0)))}bl(t){var e;const n=this.fl;this.vl();const r=_p(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this.Fa)===null||e===void 0?void 0:e.distinctId)&&t.pointerId===n.id&&(t.detail>0||t.pointerType==="touch"||t.pointerType==="pen")&&t.button===0&&5>=Math.abs(t.clientX-n.x)&&5>=Math.abs(t.clientY-n.y)&&r&&(hr(r,"html")||hr(r,"body"))){var s,i,o;if(n.excluded)return null;const l=(s=this.ml().css_selector_ignorelist)!==null&&s!==void 0?s:q0;return[r,(i=Vh())===null||i===void 0?void 0:i.documentElement,(o=Vh())===null||o===void 0?void 0:o.body].some(c=>{if(!c)return!1;const d=bu(c);return Ke(d,"ph-no-capture")||Ke(d,"ph-sensitive")||!ec(c)||_f(c)||l.some(f=>ep(c,f))})?null:n.target}}constructor(t){this.Na=t,this.name=_M,this._l=!1,this.wl=null,this.kl=!1,this.Sl=new Map,this.xl=!1,this.Fr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Ti=!1,this.Na.refresh(this.Fr),this.rageclicks=new yM(this.Fr.rageclick),this.$l=null}setup(t){this.Cl(),this.Fa=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Ti?e.dispose():(this.Za=e,this.startIfEnabled())}dispose(){var t;this.Ti||(this.Ti=!0,this.Fa=void 0,(t=this.Za)===null||t===void 0||t.dispose(),this.Za=void 0,this.Sl.clear(),this.$l=null,this.Tl())}ml(){return this.Na.refresh(this.Fr),this.Fr}Cl(){var t,e;return this.ml(),this.Fr.url_allowlist=(t=this.Fr.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Fr.url_ignorelist=(e=this.Fr.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Fr}Il(){const t=Mb(),e=Vh();if(!this.isBrowserSupported())return void eg.info("Disabling Automatic Event Collection because this browser is not supported");if(!t||!e)return;this.Ml=t,this.El=e;const n=this.Al=r=>{r=r||(t==null?void 0:t.event);try{if(r.type==="blur")return void this.vl();if(r.type.indexOf("pointer")===0)return void this.yl(r);const s=r.type==="click"?this.bl(r):void 0;if(Nn(s))return;this.Rl(r,"$autocapture",s)}catch(s){eg.error("Failed to capture event",s)}};if(Lt(t,"blur",n),Lt(e,"submit",n,{capture:!0}),Lt(e,"change",n,{capture:!0}),Lt(e,"click",n,{capture:!0}),Kt(["pointerdown","pointermove","pointerup","pointercancel"],r=>{Lt(e,r,n,{capture:!0})}),this.ml().capture_copied_text){const r=this.Pl=s=>{s=s||(t==null?void 0:t.event);try{this.Rl(s,C2)}catch(i){eg.error("Failed to capture clipboard event",i)}};Lt(e,"copy",r,{capture:!0}),Lt(e,"cut",r,{capture:!0}),Lt(e,"paste",r,{capture:!0})}}Tl(){const t=this.Ml,e=this.El;this.vl(),this.Al&&(t==null||t.removeEventListener("blur",this.Al),Kt(["pointerdown","pointermove","pointerup","pointercancel"],n=>{e==null||e.removeEventListener(n,this.Al,!0)}),e==null||e.removeEventListener("submit",this.Al,!0),e==null||e.removeEventListener("change",this.Al,!0),e==null||e.removeEventListener("click",this.Al,!0),this.Al=void 0),this.Pl&&(e==null||e.removeEventListener("copy",this.Pl,!0),e==null||e.removeEventListener("cut",this.Pl,!0),e==null||e.removeEventListener("paste",this.Pl,!0),this.Pl=void 0),this.Ml=void 0,this.El=void 0,this._l=!1}startIfEnabled(){this.isEnabled||this.vl(),!this.Ti&&this.Fa&&this.isEnabled&&!this._l&&(this.Il(),this._l=!0)}onRemoteConfig(t){if(this.Ti)return;if(this.kl=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.xl=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;Os(n)&&((r=this.Fa)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.wl=n),this.startIfEnabled()}setElementSelectors(t,e=this){if(this.Ti)return;t.size?this.Sl.set(e,new Set(t)):this.Sl.delete(e);const n=new Set;this.Sl.forEach(r=>{r.forEach(s=>n.add(s))}),this.$l=n}getElementSelectors(t,e){var n;const r=[];return(n=this.$l)===null||n===void 0||n.forEach(s=>{var i;const o=(i=Vh())===null||i===void 0?void 0:i.querySelectorAll(s);o==null||o.forEach(l=>{t!==l&&e!==l||Ke(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.Ti)return!1;const n=(t=this.Fa)===null||t===void 0?void 0:t.kv.get(sO),r=this.wl,s=this.ml();if(!s.remoteRequestsDisabled&&!this.kl)return!1;const i=s.remoteRequestsDisabled&&!this.kl;if(Nn(r)&&!Os(n)&&!i)return!1;const o=(e=this.wl)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}Rl(t,e="$autocapture",n){if(!this.isEnabled)return void this.vl();let r=n||_p(t);TO(r)&&(r=r.parentNode||null);const s=this.Cl();var i;e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime()))&&OO(r,s.rageclick)&&this.Rl(t,"$rageclick",n);const o=e===C2,l=o?j(j({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(m,v,y,_,b,x){var k;const C=typeof window>"u"?void 0:window;if(!C||ik(m)||y!=null&&y.url_allowlist&&!M3(y.url_allowlist,x)||y!=null&&y.url_ignorelist&&M3(y.url_ignorelist,x))return!1;if(y!=null&&y.dom_event_allowlist){const I=y.dom_event_allowlist;if(I&&!I.some(A=>v.type===A))return!1}const{parentIsUsefulElement:P,targetElementList:R}=MO(m,_);if(!(function(I,A){const M=A==null?void 0:A.element_allowlist;if(de(M))return!0;for(const L of I)if(M.some(z=>L.tagName.toLowerCase()===z))return!0;return!1})(R,y)||!Cb(R,y==null?void 0:y.css_selector_allowlist)||Cb(R,(k=y==null?void 0:y.css_selector_ignorelist)!==null&&k!==void 0?k:q0))return!1;try{const I=C.getComputedStyle(m);if(I&&I.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0}catch{}const O=m.tagName.toLowerCase();switch(O){case"html":return!1;case"form":return(b||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(b||["change","click"]).indexOf(v.type)>=0;default:return P?(b||["click"]).indexOf(v.type)>=0:(b||["click"]).indexOf(v.type)>=0&&(rk.indexOf(O)>-1||m.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var c;const{props:m,explicitNoCapture:v,target:y}=IZ(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.xl,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(v)return!1;const _=this.getElementSelectors(r,y);if(_&&_.length>0&&(m.$element_selectors=_),e===C2){const b=t.type||"clipboard";if(b!=="paste"){var d,f;const x=(d=Mb())===null||d===void 0||(d=d.getSelection())===null||d===void 0?void 0:d.toString(),k=RO(x);if(!k)return!1;m.$selected_content=k,m.$clipboard_text_length=(f=x==null?void 0:x.length)!==null&&f!==void 0?f:0}m.$copy_type=b}if(e==="$autocapture"&&t.type==="change"&&s.capture_value_css_selector_allowlist&&!s.maskAllText&&(hr(h=r,"input")?!Ke(RZ,h.type):hr(h,"textarea")||hr(h,"select")&&!h.multiple)&&(function(b,x){var k;if(!ec(b))return!1;const C=(k=x.css_selector_ignorelist)!==null&&k!==void 0?k:q0,P=new Set;let R=b;for(hr(b,"select")&&(R=b.options[b.selectedIndex]||b);R;){const O=R,I=bu(O);if(P.size>=1e3||P.has(R)||Ke(I,"ph-sensitive")||Ke(I,"ph-no-capture")||C.some(M=>ep(O,M)))return!1;P.add(R);const A=R.assignedSlot||R.parentNode;R=Av(A)?A.host:A&&Yi(A)?A:null}return!0})(r,s)&&!r.querySelector(".ph-no-capture, .ph-sensitive")){const b=s.capture_value_css_selector_allowlist;let x=!1;try{x=Vn(b)?!!b(r):Ue(b)&&b.some(k=>ep(r,k))}catch(k){eg.error("capture_value_css_selector_allowlist threw",k)}x&&(m.$input_value=r.value)}return(c=this.Fa)===null||c===void 0||c.capture(e,m),!0}var h}isBrowserSupported(){var t;return Vn((t=Vh())===null||t===void 0?void 0:t.querySelectorAll)}};const wM="featureFlags",bM="logs",Up=()=>{var t;return!(ce==null||(t=ce.performance)===null||t===void 0)&&t.now?ce.performance.now():Date.now()},MZ=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4];var NZ=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if(typeof t=="string")return e==null?void 0:e.get_property(t);const n={};for(const r of t){const s=e==null?void 0:e.get_property(r);de(s)||(n[r]=s)}return n}set(t,e){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof t=="string"?{[t]:e}:t)}remove(t){var e;(e=this._instance.persistence)===null||e===void 0||e.unregister(t)}},LZ=class{constructor(t){this.instance=t,this.R=ve,this.kv=new NZ(t),this.onSession=e=>Q0(this.instance.onSessionId(n=>{try{e(n)}catch(r){this.R.error("Browser extension session listener failed",r)}})),this.onEvent=e=>Q0(this.instance._addCaptureHook((n,r)=>{if(r)try{e({event:n,properties:r.properties})}catch(s){this.R.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=e=>{const n=s=>{try{e(s)}catch(i){this.R.error("Browser extension remote config listener failed",i)}},r=this.instance.dr.on("extensionsRemoteConfig",n);return this.instance.vr&&n(this.instance.vr),Q0(r)}}get logger(){return this.R}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property("$device_id"))!==null&&t!==void 0?t:this.distinctId}get deviceId(){const t=this.instance.get_property(qS);return typeof t=="string"?t:void 0}get library(){return{name:Zs.LIB_NAME,version:Zs.LIB_VERSION}}get initialPersonProperties(){var t,e;return(t=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,r,s;const i=(t=this.instance.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(e=i==null?void 0:i.sessionId)!==null&&e!==void 0?e:"",windowId:(n=i==null?void 0:i.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(r=i==null?void 0:i.sessionStartTimestamp)!==null&&r!==void 0?r:0,lastActivityTimestamp:(s=i==null?void 0:i.lastActivityTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return Vn(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!!(!((t=this.instance.rateLimiter)===null||t===void 0)&&t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case wM:case"featureFlagsCommon":e=this.instance.featureFlags;break;case bM:e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case _M:e=this.instance.autocapture}return e}capture(t,e,n){if(!n)return this.pr(this.instance.capture(t,e));const r=j({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},n.delivery==="unload"?{transport:"sendBeacon",send_instantly:!0}:{});return this.pr(this.instance.capture(t,e,r))}pr(t){var e;return!de(t)||!(!((e=this.instance.rateLimiter)===null||e===void 0)&&e.lastEventRateLimited)}registerDynamicEventProperties(t){return Q0(this.instance.mr(t))}sendRequest(t){var e=this;return pn(function*(n,r={}){var s;const i=(s=r.target)!==null&&s!==void 0?s:"api",o=r.query?M1(n,r.query):n,l=e.instance.requestRouter.endpointFor(i,o),c={method:r.method,url:l,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?nb.Base64:void 0,timestampMode:r.sentAt};return i==="api"&&n==="/i/v1/logs"&&(c.batchKey="logs"),r.transport==="sendBeacon"?(e.instance._send_request(c),{statusCode:202}):new Promise(d=>{var f;if(c.callback=d,i==="flags"&&((f=e.instance.config.metrics)===null||f===void 0?void 0:f.flags)){let h;c.onDispatch=()=>{h=Up()},c.callback=m=>{de(h)||e.gr(l,m,Up()-h),d(m)}}e.instance._send_request(c)})}).apply(this,arguments)}gr(t,e,n){try{var r,s,i;const o=e.statusCode||void 0,l={"server.address":((r=(s=aa(t))===null||s===void 0?void 0:s.hostname)!==null&&r!==void 0?r:t).replace(/^\[(.*)\]$/,"$1")};o&&(l["http.response.status_code"]=o);const c=((f,h)=>f?400>f?void 0:String(f):(h==null?void 0:h.name)==="AbortError"?"timeout":"_OTHER")(o,e.error);c&&(l["error.type"]=c);const d=ok();d&&(l["client.timezone"]=d),(i=this.instance.metrics)===null||i===void 0||i.histogram("posthog.flags.request.duration",n,{unit:"ms",attributes:l,bounds:MZ})}catch(o){ve.error("Failed to record the /flags request duration",o)}}};const bp={};let T2=0;const xp=()=>{},oP='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',xd="Surveys module not available",aP="sanitize_properties is deprecated. Use before_send instead",xM="Invalid value for property_denylist config: ",DZ=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],$Z=["$feature_flag_called","$$heatmap","$snapshot"],lP=t=>t.charAt(0)==="$"&&!Ke($Z,t),FZ=/^[A-Za-z0-9_-]{1,400}$/,cP=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,uP=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,jZ=["token","distinct_id",hO],tp="posthog",zZ=[...sP].sort()[sP.length-1],VZ=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},R2=t=>{var e;return j({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:IB(Oe==null?void 0:Oe.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:xp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:fn&&ft(fn==null?void 0:fn.search)&&fn.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(ce==null||(e=ce.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){ve.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:SO,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:xp},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:sk,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:VZ(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},HZ=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],dP=t=>{const e={};for(const[s,i]of HZ)de(t[s])||(e[i]=t[s]);const n=_n({},e,t),r=t.__preview_external_dependency_versioned_paths;return de(r)||(de(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),ft(r)&&de(t.asset_host)&&(n.asset_host=r)),Ue(t.property_blacklist)&&(de(t.property_denylist)?n.property_denylist=t.property_blacklist:Ue(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ve.error(xM+t.property_denylist)),n};var UZ=class{constructor(){this.__forceAllowLocalhost=!1}get gh(){return this.__forceAllowLocalhost}set gh(t){ve.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},Sp=class Rl{mh(e){if(!e)return;const n=this.yh.indexOf(e);n!==-1&&this.yh.splice(n,1)}bh(e,n){var r;return this.mh(e),this.yh.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}_h(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}wh(){if(this.kh||this.config.reuseAnonymousId||this.config.segment||this._h())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.Sh)return;let n,r,s;e?(n=`persistence is set to '${this.config.persistence}'`,r=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",s="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",r="on every page load",s="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.kh=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${r}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${s}`)}xh(){const e=this.persistence;if(!e||this.$h)return;if(this._h())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.Ch(),this.Th()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.Ih()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(_o());this.register({distinct_id:r,$device_id:r}),e.set_property(ms,Ua)}this.Ch()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.Mh=!1,this.Eh=!1,this.webPerformance=new UZ,this.Ah=!1,this.version=Zs.LIB_VERSION,this.Rh=new Set,this.Ph="",this.dr=new Nv,this.yh=[],this.Oh=[],this.Fh=!1,this.Sh=!1,this.kh=!1,this.$h=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=R2(),this.SentryIntegration=GB,this.sentryIntegration=r=>(function(s,i){const o=DO(s,i);return{name:LO,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Dh=!1,this.Lh=null,this.Nh=null,this.jh=null,this.scrollManager=new yZ(this),this.pageViewManager=new Z3(this),this.rateLimiter=new iZ(this),this.requestRouter=new SZ(this),this.consent=new FB(this),this.externalIntegrations=new TZ(this);const n=(e=Rl.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{const o=ft(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=ft(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>ve.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==tp){var s;const i=(s=bp[r])!==null&&s!==void 0?s:new Rl;return i._init(e,n,r),bp[r]=i,bp[tp][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=ft(e)?e.trim():"";if(!l)return ve.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var c;if(this.__loaded)return l!==((c=this.config)===null||c===void 0?void 0:c.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${l}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=R2(n.defaults),n.debug=this.qh(n.debug),this.Bh=n,this.zh=[],n.person_profiles?this.Nh=n.person_profiles:n.process_person&&(this.Nh=n.process_person);const d=R2(n.defaults),f=dP(n),h=_n({},d,f,{name:r,token:l});ut(d.rageclick)&&ut(f.rageclick)&&(h.rageclick=_n({},d.rageclick,f.rageclick)),ut(d.session_recording)&&ut(f.session_recording)&&(h.session_recording=_n({},d.session_recording,f.session_recording)),this.set_config(h),this.config.on_xhr_error&&ve.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:yi.GZipJS;const m=this.Ih(),v=!this._h();if(this.persistence=new y2(this.config,m,!0,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new y2(j(j({},this.config),{},{persistence:"sessionStorage"}),m,!1,v),this.Ph="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!m&&hn.Ot()){const k=hn.Ft(this.Ph);Ue(k)&&k.forEach(C=>{ft(C)&&this.Rh.add(C)})}else hn.Dt(this.Ph);const y=j({},this.persistence.props),_=j({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Hh=new mZ((k,C)=>this.Uh(k,C),this.config.request_queue_config),this.Wh=new vZ(this),this.__request_queue=[];const b=this._h();b||(this.sessionManager=new rP(this),this.sessionPropsManager=new tP(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((k,C,P)=>{(P!=null&&P.activityTimeout||P!=null&&P.sessionPastMaximumLength||P!=null&&P.crossTabAdoption)&&this.Vh()})),this.Gh(),this.config.__preview_deferred_init_extensions?(ve.info("Deferring extension initialization to improve startup performance"),this.Qh=setTimeout(()=>{this.Qh=void 0,this.Jh(b)},0)):(ve.info("Initializing extensions synchronously"),this.Jh(b)),Zs.DEBUG=Zs.DEBUG||this.config.debug,Zs.DEBUG&&ve.info("Starting in debug mode",{this:this,config:n,thisC:j({},this.config),p:y,s:_}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=j(j({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const x=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.Sh=!!x&&!fp(x),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const k=n.bootstrap.distinctID,C=this.get_distinct_id(),P=this.persistence.get_property(ms);if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&P==="anonymous")this.identify(k);else if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&P==="identified")ve.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const R=this.config.get_device_id(_o()),O=n.bootstrap.isIdentifiedID?R:k;this.persistence.set_property(ms,n.bootstrap.isIdentifiedID?zg:Ua),this.register({distinct_id:k,$device_id:O})}}if(b)this.register_once({distinct_id:c2,$device_id:null},"");else if(!this.get_distinct_id()){const k=this.config.get_device_id(_o());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(ms,Ua)}return Lt(ce,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Lt(ce,"pageshow",k=>{if(this.Mh=!1,!this.Eh){var C;if(k.persisted&&this.persistence){const P=this.persistence.get_property(Ui),R=this.persistence.get_property(ms);this.persistence.load(),this.Zh()||P===this.persistence.get_property("distinct_id")&&R===this.persistence.get_property("$user_state")||this.Kh()}(C=this.Wh)===null||C===void 0||C.resume()}}),n.segment?B3(this,()=>this.Yh()):this.Yh(),Vn(this.config._onCapture)&&this.config._onCapture!==xp&&(ve.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",k=>this.config._onCapture(k.event,k))),this.config.ip&&ve.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return hM.apply(this,arguments)})().then(k=>{k&&this.register({[l2]:k})}).catch(xp),this}Xh(e){const n=e;return ft(n.name)&&Vn(n.setup)}ed(e,n){var r=this;this.Xh(e)?n.push(pn(function*(){try{yield e.setup(r.nd())}catch(i){ve.error(`Failed to set up extension "${e.name}"`,i);try{var s;yield(s=e.dispose)===null||s===void 0?void 0:s.call(e)}catch(o){ve.error(`Failed to dispose extension "${e.name}"`,o)}}})):this.yh.push(e)}Gh(){var e,n,r,s=this;const i=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=Rl.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var o,l,c;if(i)if(this.featureFlags&&this.featureFlags instanceof i||((o=this.sd)===null||o===void 0||o.call(this),this.sd=void 0,this.featureFlags=new i(this)),Vn(this.featureFlags.onReloading)&&Vn(this.featureFlags.setup)){if(!this.sd){this.sd=this.featureFlags.onReloading(()=>{this.dr.emit("featureFlagsReloading",!0)});const d=this.featureFlags;pn(function*(){try{yield d.setup(s.nd())}catch(f){ve.error("Failed to set up feature flags",f);const h=s.sd;s.sd=void 0;try{h==null||h()}catch(m){ve.error("Failed to unsubscribe feature flag reloading",m)}try{yield d.dispose()}catch(m){ve.error("Failed to dispose feature flags",m)}}})()}}else(l=(c=this.featureFlags).initialize)===null||l===void 0||l.call(c)}Jh(e){const n=performance.now(),r=j(j({},Rl.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,c,d,f,h,m;r.exceptions&&this.yh.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.yh.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.yh.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.yh.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.yh.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.ed(this.autocapture=new r.autocapture(this),s),r.surveys&&this.ed(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.ed(this.logs=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.yh.push(this.metrics=(c=this.metrics)!==null&&c!==void 0?c:new r.metrics(this)),r.conversations&&this.yh.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.yh.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.yh.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.yh.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.yh.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.yh.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,qB)),r.toolbar&&this.yh.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.yh.push(this.experiments=(h=this.experiments)!==null&&h!==void 0?h:new r.experiments(this)),r.webMCP&&this.yh.push(this.webMCP=(m=this.webMCP)!==null&&m!==void 0?m:new r.webMCP(this)),this.yh.forEach(v=>{v.initialize&&s.push(()=>{var y;(y=v.initialize)===null||y===void 0||y.call(v)})}),s.push(()=>{if(this.rd){const v=this.rd;this.rd=void 0,this.yh.forEach(y=>{var _;return(_=y.onRemoteConfig)===null||_===void 0?void 0:_.call(y,v)})}}),this.od(s,n)}od(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void(this.Qh=setTimeout(()=>{this.Qh=void 0,this.od(e,n)},0));const s=e.shift();if(s)try{s()}catch(i){ve.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[pO]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[mO]:r}),this.config.__preview_deferred_init_extensions&&ve.info(`PostHog extensions initialized (${r}ms)`)}ac(e){if(!Oe||!Oe.body)return ve.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.ac(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.rd=e),this.vr=e,this.compression=void 0,e.ok){var n;const r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Ke(r.supportedCompression,yi.GZipJS)?yi.GZipJS:Ke(r.supportedCompression,yi.Base64)?yi.Base64:void 0),!((n=r.analytics)===null||n===void 0)&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.Nh?this.Nh:SO}),this.dr.emit("extensionsRemoteConfig",e),this.yh.forEach(r=>{var s;return(s=r.onRemoteConfig)===null||s===void 0?void 0:s.call(r,e)})}Yh(){try{this.config.loaded(this)}catch(e){ve.critical("`loaded` function failed",e)}if(this.ad(),this.config.internal_or_test_user_hostname&&(fn==null?void 0:fn.hostname)){const e=fn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this._h())&&this.ld()},1),this.ud=new qO(this),this.ud.load()}ad(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Hh)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&Fd(this.__request_queue,e=>this.Uh(e)),this.__request_queue=[],this.ad()}_handle_unload(){var e,n,r,s,i,o;this.Mh=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.hd()&&this.capture(E3),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.Hh)===null||i===void 0||i.unload(),(o=this.Wh)===null||o===void 0||o.unload()):this.hd()&&this.capture(E3,null,{transport:"sendBeacon"})}_send_request(e){dM(this,e)}Uh(e,n){this.Wh?this.Wh.retriableRequest(e,n):this._send_request(n?j(j({},e),{},{transport:n}):e)}_execute_array(e){T2++;try{let n;const r=[],s=[],i=[];Fd(e,l=>{if(l)if(n=l[0],Ue(n))i.push(l);else if(Vn(l))try{l.call(this)}catch(c){ve.error("Error executing queued PostHog call",l,c)}else Ue(l)&&n==="alias"?r.push(l):Ue(l)&&n.indexOf("capture")!==-1&&Vn(this[n])?i.push(l):s.push(l)});const o=function(l,c){Fd(l,function(d){try{if(Ue(d[0])){let f=c;Kt(d,function(h){f=f[h[0]].apply(f,h.slice(1))})}else c[d[0]].apply(c,d.slice(1))}catch(f){ve.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{T2--}}push(e){if(T2>0&&Ue(e)&&ft(e[0])){const n=Rl.prototype[e[0]];return void(Vn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get dd(){return{property:S3,persistenceKey:Gd,cookieName:"_fbc",pattern:cP,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Gd]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Gd)}}}get vd(){return{property:k3,persistenceKey:mp,cookieName:"_fbp",pattern:uP,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[mp]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(mp)}}}fd(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return ft(r)&&e.pattern.test(r)?{value:r,delivered:!1}:ut(r)&&ft(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}pd(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}gd(e){if(!this.config.save_campaign_params||this._h())return;const n=vp(e.cookieName);return ft(n)&&e.pattern.test(n)?n:void 0}md(e,n,r,s){if(!this.persistence)return;const i=this.dd;this.persistence.refreshMetaIdentifiers();const o=this.fd(i);if(s)return void i.unregister();if(r)return ft(n)&&cP.test(n)?this.pd(i,n,o):void i.unregister();const l=ft(e)&&FZ.test(e)?e:void 0,c=this.gd(i);return c&&((d,f,h)=>{const m=d.split(".");if(f)return m[3]===f;if(!h)return!0;const v=h.value.split(".");return m[3]===v[3]||Number(m[2])>Number(v[2])})(c,l,o)?this.pd(i,c,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.pd(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}yd(e,n,r){if(!this.persistence)return;const s=this.vd;this.persistence.refreshMetaIdentifiers();const i=this.fd(s);if(r)return void s.unregister();if(n)return ft(e)&&uP.test(e)?this.pd(s,e,i):void s.unregister();const o=this.gd(s);return o?this.pd(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}bd(e,n){if(!this.persistence)return;this.persistence.refreshMetaIdentifiers();const r=this.fd(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i,o;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Hh))return void ve.uninitializedWarning("posthog.capture");if(!this.is_capturing())return void ve.info(`Event "${e}" was not captured because capturing is disabled (opted out or consent pending).`);if(de(e)||!ft(e))return void ve.error("No event name provided to posthog.capture");if(this.xh(),e==="$snapshot"&&this._h())return;const l=!this.config.opt_out_useragent_filter&&this._is_bot();if(l&&!this.config.__preview_capture_bot_pageviews)return void ve.info(`Event "${e}" was not captured because the user agent looks like a bot. Set \`opt_out_useragent_filter: true\` to capture it.`);const c=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c!=null&&c.isRateLimited)return void ve.critical("This capture call is ignored due to client rate limiting.");let d;n!=null&&n.$current_url&&!ft(n==null?void 0:n.$current_url)&&(ve.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r._d||ve.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(d=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const f=new Date,h=(r==null?void 0:r.timestamp)||f,m=s3(r==null?void 0:r.uuid,_o);let v={uuid:m,event:e,properties:this.calculateEventProperties(e,n||{},h,m)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&l&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),c&&(v.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);const y=e==="$feature_flag_called"&&v.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!y&&(v.$set=r==null?void 0:r.$set);const _=ut(n==null?void 0:n.$set)?n.$set:void 0,b=Ue(n==null?void 0:n.$unset)?n.$unset:[],x=(r==null?void 0:r.$unset)||[],k=K=>{var H;const ee=!!(r!=null&&r.$set)&&K in r.$set;return{hasProvided:ee||!!_&&K in _,provided:ee?r==null||(H=r.$set)===null||H===void 0?void 0:H[K]:_==null?void 0:_[K],unset:b.indexOf(K)!==-1||x.indexOf(K)!==-1}},C=k(S3),P=k(k3),R=[{channel:this.dd,hasProvided:C.hasProvided,update:this.md(d==null?void 0:d.fbclid,C.provided,C.hasProvided,C.unset)},{channel:this.vd,hasProvided:P.hasProvided,update:this.yd(P.provided,P.hasProvided,P.unset)}];for(const{channel:K,hasProvided:H,update:ee}of R)ee&&v.properties.$process_person_profile===!0&&ee.pending&&!H&&!y&&(v.$set=j({[K.property]:ee.value},v.$set));const O=r==null?void 0:r.$unset;O&&(v.$unset=O);const I=y?void 0:this.wd(r==null?void 0:r.$set_once,e!==C3,e===kO);if(I&&(v.$set_once=I),r!=null&&r._noTruncate||(A=this.config.properties_string_max_length,v=(function(K,H){const ee=new Set;return(function V(Q,B){if(Q!==Object(Q))return H?H(Q):Q;if(ee.has(Q))return;let D;if(ee.add(Q),Ue(Q))D=[],Fd(Q,G=>{D.push(V(G))});else{const G={};Kt(Wf(Q)?EO(Q):Q,(fe,ie)=>{ee.has(fe)||(G[ie]=V(fe))}),D=G}return D})(K)})(v,K=>ft(K)?K.slice(0,A):K)),v.timestamp=h,de(r==null?void 0:r.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=f),y&&(v.properties=((K,H=[])=>{const ee={},V=Q=>{K[Q]!==void 0&&(ee[Q]=K[Q])};return xU.forEach(V),H.forEach(V),ee})(v.properties,jZ)),e===vi.DISMISSED||e===vi.SENT){const K=n==null?void 0:n[w2.SURVEY_ID],H=n==null?void 0:n[w2.SURVEY_ITERATION];vM({id:K,current_iteration:H}),v.$set=j(j({},v.$set),{},{[wZ({id:K,current_iteration:H},e===vi.SENT?"responded":"dismissed")]:!0})}else e===vi.SHOWN&&(v.$set=j(j({},v.$set),{},{[w2.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var A;if(e===sZ.SHOWN){const K=n==null?void 0:n[q3.TOUR_TYPE];K&&(v.$set=j(j({},v.$set),{},{[`${q3.TOUR_LAST_SEEN_DATE}/${K}`]:new Date().toISOString()}))}const M=j(j({},v.properties.$set),v.$set);if(Ws(M)||this.setPersonPropertiesForFlags(M),!at(this.config.before_send)){const K=this.Fs(v);if(!K)return;v=K,v.uuid=s3(v.uuid,_o)}this.sessionRecording&&!this.Fh&&lP(e)&&(this.Fh=!0,setTimeout(()=>this.Fh=!1,3e4));const L=R.filter(({channel:K,update:H})=>{var ee,V,Q;const B=(ee=(V=v.$set)===null||V===void 0?void 0:V[K.property])!==null&&ee!==void 0?ee:ut((Q=v.properties)===null||Q===void 0?void 0:Q.$set)?v.properties.$set[K.property]:void 0;return(H==null?void 0:H.pending)&&B===H.value});this.dr.emit("eventCaptured",v);const z=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),$=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(z),q=j(j(j({method:"POST",url:z,data:v,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:$?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},$&&(!((i=v.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:v.properties.$session_id+(v.properties.$window_id?`-${v.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),L.length?{fireCallbackOnDrop:!0,callback:K=>{if(K.statusCode>=200&&300>K.statusCode)for(const{channel:H,update:ee}of L)this.bd(H,ee.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly){var X;let K;!q.transport&&!q.callback&&Ws((X=this.config.request_headers)!==null&&X!==void 0?X:{})&&this.Mh&&(K="sendBeacon"),this.Uh(q,K)}else this.Hh.enqueue(q);return(o=this.featureFlags)===null||o===void 0||o.sendFlagCallsPendingCapture(),v}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.kd)===null||n===void 0?void 0:n.getExtension(e)}nd(){var e;return(e=this.kd)!==null&&e!==void 0?e:this.kd=new LZ(this)}mr(e){this.Oh.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Oh.indexOf(e);r!==-1&&this.Oh.splice(r,1)}}Zh(e=!0){var n;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Kh(e),!0)}Kh(e=!0){var n,r,s;this.jh=null,((n=this.persistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="anonymous"&&((s=this.sessionPersistence)===null||s===void 0||s.clear(),this.Rh.clear(),this.Sd()),(r=this.featureFlags)===null||r===void 0||r.reset(),e&&this.reloadFeatureFlags()}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.xh(),this.persistence.syncCookieProperties(),this.Zh();const o=i?void 0:this.persistence.remove_event_timer(e);let l=j({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults==="latest"?zZ:this.config.defaults,this._h()&&(l[hO]=!0),e==="$snapshot"){const k=j(j({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=k.distinct_id,(!ft(l.distinct_id)&&!Yn(l.distinct_id)||fp(l.distinct_id))&&ve.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const c=(function(k,C,P,R=!1){var O,I,A,M;if(!As)return{};const L=k?[...bf,...C||[]]:[],[z,$]=A5(As),[q,X]=(function(ie){for(let ue=0;r3.length>ue;ue++){const[he,_e,le]=r3[ue],ne=ie.match(he);if(ne){const be=le&&ie.match(le)||ne;return[_e,(be==null?void 0:be[1])||""]}}return["",""]})(As),K=(function(){const ie="u">typeof navigator?navigator:void 0;return ie!=null&&ie.brave?{brave:!0}:{}})(),H={};de(P)||(H.detectGoogleSearchApp=P);const ee={},V=(O=navigator)===null||O===void 0||(O=O.userAgentData)===null||O===void 0?void 0:O.platform,Q=(I=navigator)===null||I===void 0?void 0:I.maxTouchPoints,B=ce==null||(A=ce.screen)===null||A===void 0?void 0:A.width,D=ce==null||(M=ce.screen)===null||M===void 0?void 0:M.height,G=ce==null?void 0:ce.devicePixelRatio;de(V)||(ee.userAgentDataPlatform=V),de(Q)||(ee.maxTouchPoints=Q),de(B)||(ee.screenWidth=B),de(D)||(ee.screenHeight=D),de(G)||(ee.devicePixelRatio=G);const fe=_n(tk({$os:z,$os_version:$,$browser:R5(As,navigator.vendor,K,H),$webview_app:q,$webview_app_version:X,$device:I5(As),$device_type:BH(As,ee),$timezone:ok(),$timezone_offset:tZ()}),{$current_url:Vp(R?Ql(fn==null?void 0:fn.href):fn==null?void 0:fn.href,L,Hp),$host:fn==null?void 0:fn.host,$pathname:fn==null?void 0:fn.pathname,$raw_user_agent:As.length>1e3?As.substring(0,997)+"...":As,$browser_version:UH(As,navigator.vendor,K,H),$browser_language:UO(),$browser_language_prefix:eZ(),$screen_height:ce==null?void 0:ce.screen.height,$screen_width:ce==null?void 0:ce.screen.width,$viewport_height:ce==null?void 0:ce.innerHeight,$viewport_width:ce==null?void 0:ce.innerWidth,$lib:Za.LIB_NAME,$lib_version:Za.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Za.SDK_DIST_CHANNEL&&(fe.$sdk_dist_channel=Za.SDK_DIST_CHANNEL),fe})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){const{sessionId:k,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=k,l.$window_id=C}this.sessionPropsManager&&_n(l,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const k=this.sessionRecording.sdkDebugProperties,C=!this.Fh&&lP(e);for(const P in k)(C||Ke(DZ,P))&&(l[P]=k[P])}l.$sdk_debug_retry_queue_size=(d=this.Wh)===null||d===void 0?void 0:d.length}catch(k){l.$sdk_debug_error_capturing_properties=String(k)}let f;if(this.requestRouter.region===Ob&&(l.$lib_custom_api_host=this.config.api_host),f=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),l=_n(l,f),e==="$pageview"&&Oe&&(l.title=Oe.title),!de(o)){const k=r.getTime()-o;l.$duration=parseFloat((k/1e3).toFixed(3))}As&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const h=this.persistence.properties(),m=this.sessionPersistence.properties(),v=l.$groups,y=h.$groups;ut(v)&&!Ws(v)&&(l.$groups=j(j({},ut(y)?y:{}),v)),Kt(["$referrer","$referring_domain"],k=>{k in h&&delete m[k]});const _={};if(this.Oh.length>0)for(const k of this.Oh.slice())try{_n(_,k())}catch(C){ve.error("Failed to produce browser extension event properties",C)}l=_n({},c,h,m,j(j({},_),l)),l.$is_identified=this._isIdentified(),Ue(this.config.property_denylist)?Kt(this.config.property_denylist,function(k){delete l[k]}):ve.error(xM+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const b=this.config.sanitize_properties;b&&(ve.error(aP),l=b(l,e));const x=this.xd();return l.$process_person_profile=x,x&&!i&&this.$d("_calculate_event_properties"),l}wd(e,n=!0,r=!1){var s;if(!this.persistence||!this.xd()||this.Ah&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=_n({},i,o||{},e||{});const c=this.config.sanitize_properties;return c&&(ve.error(aP),l=c(l,"$set_once")),n&&(this.Ah=!0),Ws(l)?void 0:l}register(e,n){var r;(r=this.persistence)===null||r===void 0||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.Zh(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.Rh.add(s)),this.Sd()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.Rh.delete(e),this.Sd()}Cd(e,n){this.register({[e]:n})}Vh(){this.Rh.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Rh.clear(),this.Sd()}Sd(){var e;if(!this.Ph)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.fi||!hn.Ot())return void hn.Dt(this.Ph);const n=[];this.Rh.forEach(r=>n.push(r)),n.length>0?hn.$t(this.Ph,n):hn.Dt(this.Ph)}getFeatureFlag(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.dr.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:xd}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:xd})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:xd})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:xd}),()=>{})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=EZ){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:xd}}canRenderSurveyAsync(e,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:xd})}Td(e){return!e||fp(e)?(ve.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(ve.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ve.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return ve.uninitializedWarning("posthog.identify");if(Yn(e)&&(e=e.toString(),ve.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.Td(e)||!this.$d("posthog.identify"))return;this.xh();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.Zh(!1),l=this.persistence.Ou();let c=!1;try{const f=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:f},""),e!==f&&e!==this.get_property("__alias")&&(this.unregister(Tv),this.register({distinct_id:e}));const h=(this.persistence.get_property("$user_state")||"anonymous")===Ua,m=e!==f,v=!m&&h;if(m&&h){var d;const y=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(ms,zg),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Fu(),this.capture("$identify",y,{$set:n||{},$set_once:r||{}})&&(this.jh=E2(e,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(v){this.persistence.set_property(ms,zg);const y=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:y,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.Fu(),this.capture("$set",{$set:y,$set_once:_})&&(this.jh=E2(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);m||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Go)):v&&(n||r)&&this.reloadFeatureFlags(),c=!0}finally{l&&this.persistence.Nu(c)}}setPersonProperties(e,n){if(!e&&!n||!this.$d("posthog.setPersonProperties"))return;const r=E2(this.get_distinct_id(),e,n);this.jh!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.jh=r)):ve.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(Ue(e)?e:[e]).filter(s=>ft(s)&&s.length>0);r.length!==0&&this.$d("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.jh=null)}group(e,n,r){var s;if(!e||!n)return void ve.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.Zh();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:j(j({},i),{},{[e]:n})}),(o||r)&&this.xd()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(C3,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var r;this.$d("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=Os(e)?e:e==null?void 0:e.resetDeviceID,r=Os(e)||e==null?void 0:e.bootstrap;this.Id(n,!1,r)}Id(e,n=!1,r){var s,i,o,l,c,d;if(ve.info("reset"),!this.__loaded)return ve.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Bh)===null||s===void 0?void 0:s.bootstrap)||{},(i=this.featureFlags)===null||i===void 0||(o=i.updateConfig)===null||o===void 0||o.call(i,this.config,this.lc());const h=this.get_property(qS),m=this.get_property(l2),v=this.get_property(gp);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const y=this.is_capturing();n||this.consent.reset(),n||!y||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const _=(c=this.persistence)===null||c===void 0||(d=c.Ou)===null||d===void 0?void 0:d.call(c),b=this.$h;this.$h=b||n;let x=!1;try{var k,C,P,R,O,I,A,M,L,z,$,q,X;if((k=this.persistence)===null||k===void 0||k.clear(),(C=this.sessionPersistence)===null||C===void 0||C.clear(),this.Rh.clear(),this.Sd(),de(v)||(z=this.persistence)===null||z===void 0||z.register({$session_recording_remote_config:v}),(P=this.surveys)===null||P===void 0||P.reset(),(R=this.featureFlags)===null||R===void 0||R.reset(),(O=this.conversations)===null||O===void 0||O.reset(),(I=this.logs)===null||I===void 0||I.reset(),(A=this.metrics)===null||A===void 0||A.reset(),(M=this.persistence)===null||M===void 0||M.set_property("$user_state","anonymous"),(L=this.sessionManager)===null||L===void 0||L.resetSessionId(),this.jh=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:c2,$device_id:null},"");else{const V=this.config.get_device_id(_o());this.register_once({distinct_id:V,$device_id:e?V:h},""),e||de(m)||this.register({[l2]:m})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this._h()&&((X=this.persistence)===null||X===void 0||X.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),($=this.featureFlags)===null||$===void 0||$.initialize(),!at(f)&&!(!((q=this.sessionManager)===null||q===void 0)&&q.setBootstrapSessionId(f,!0)))){const V=j({},r);delete V.sessionID,this.config.bootstrap=V}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,x=!0}finally{var K,H;this.$h=b,_&&((K=this.persistence)===null||K===void 0||(H=K.Nu)===null||H===void 0||H.call(K,x))}var ee;this.vr&&((ee=this.conversations)===null||ee===void 0||ee.onRemoteConfig(this.vr)),this.reloadFeatureFlags()}shutdown(e){var n=this;return pn(function*(){if(!n.__loaded)return void ve.uninitializedWarning("posthog.shutdown");n.Eh=!0,clearTimeout(n.Qh),n.Qh=void 0;const r=n.sd;n.sd=void 0;for(const s of[()=>{var i;return(i=n.sessionRecording)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.logs)===null||i===void 0?void 0:i.flushLogs("sendBeacon")},()=>{var i;return(i=n.metrics)===null||i===void 0?void 0:i.flush("sendBeacon")},()=>{var i;return(i=n.metrics)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.logs)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.surveys)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.autocapture)===null||i===void 0?void 0:i.dispose()},()=>r==null?void 0:r(),()=>{var i;return(i=n.Hh)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.Wh)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.featureFlags)===null||i===void 0?void 0:i.destroy()},()=>{var i;return(i=n.persistence)===null||i===void 0?void 0:i.destroy()},()=>{var i;return(i=n.sessionPersistence)===null||i===void 0?void 0:i.destroy()}])try{const i=s();i&&Vn(i.then)&&i.then(void 0,o=>{ve.error("Error during shutdown",o)})}catch(i){ve.error("Error during shutdown",i)}})()}setIdentity(e,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)===null||r===void 0||r.Md()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.Ed()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e!=null&&e.withTimestamp&&r){var i;const o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+=`?t=${Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}`}return s}alias(e,n){return e===this.get_property("$people_distinct_id")?(ve.critical("Attempting to create alias for existing People user - aborting."),-2):this.$d("posthog.alias")?(de(n)&&(n=this.get_distinct_id()),e!==n?(this.Cd(Tv,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ve.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=j({},this.config);if(ut(e)){var r,s,i,o,l,c,d,f,h,m,v,y,_,b;_n(this.config,dP(e));const R=this.Ih();if(this.persistence){const I=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var x,k;if(I&&this.sessionPersistence!==this.persistence&&((x=this.sessionPersistence)===null||x===void 0||x.remove(),(k=this.sessionPersistence)===null||k===void 0||k.destroy()),this.persistence.update_config(this.config,n,R),I)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new y2(j(j({},this.config),{},{persistence:"sessionStorage"}),R,!1);else{var C;(C=this.sessionPersistence)===null||C===void 0||C.update_config(j(j({},this.config),{},{persistence:"sessionStorage"}),j(j({},n),{},{persistence:"sessionStorage"}),R)}}const O=this.qh(this.config.debug);var P;Os(O)&&(this.config.debug=O),Os(this.config.debug)&&(this.config.debug?(Zs.DEBUG=!0,It.Ot()&&It.$t("ph_debug",!0),ve.info("set_config",{config:e,oldConfig:n,newConfig:j({},this.config)})):(Zs.DEBUG=!1,It.Ot()&&It.Dt("ph_debug"))),(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.lc()),(i=this.exceptionObserver)===null||i===void 0||i.onConfigChange(),(o=this.exceptions)===null||o===void 0||o.onConfigChange(),(l=this.metrics)===null||l===void 0||l.onConfigChange(),(c=this.webMCP)===null||c===void 0||c.startIfEnabled(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.tracingHeaders)===null||f===void 0||f.startIfEnabledOrStop(),(h=this.autocapture)===null||h===void 0||h.startIfEnabled(),(m=this.heatmaps)===null||m===void 0||m.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((P=this.historyAutocapture)===null||P===void 0||P.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(y=this.deadClicksAutocapture)===null||y===void 0||y.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.Ch(),(b=this.externalIntegrations)===null||b===void 0||b.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&B3(this,xp,!1)}}_overrideSDKInfo(e,n){Zs.LIB_NAME=e,Zs.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,r={sampling:n||!!(e!=null&&e.sampling),linked_flag:n||!!(e!=null&&e.linked_flag),url_trigger:n||!!(e!=null&&e.url_trigger),event_trigger:n||!!(e!=null&&e.event_trigger)};var s,i,o,l,c;Object.values(r).some(Boolean)&&((s=this.sessionManager)===null||s===void 0||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((c=this.sessionRecording)===null||c===void 0||c.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(!((e=this.sessionRecording)===null||e===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(j(j({},r),n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:Rl.Ad}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)===null||r===void 0?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:tp;return n!==tp&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}xd(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ws(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}hd(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.xd()||this.$d("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.$d("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}$d(e){return this.config.person_profiles==="never"?(ve.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.wh(),this.Cd(XS,!0),!0)}Ih(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}Ch(){var e,n;const r=this.Ih();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.Rd(),((e=this.persistence)===null||e===void 0?void 0:e.fi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.fi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),this.Sd(),r}opt_in_capturing(e){var n,r,s;if(this.config.cookieless_mode==="always")return void ve.warn(oP);if(this._h()){var i,o,l,c,d,f;(i=this.sessionRecording)===null||i===void 0||i.dispose({discardBufferedEvents:!0}),this.Id(!0,!0),(o=this.sessionManager)===null||o===void 0||o.destroy(),(l=this.pageViewManager)===null||l===void 0||l.destroy(),this.sessionManager=new rP(this),this.pageViewManager=new Z3(this),this.persistence&&(this.sessionPropsManager=new tP(this,this.sessionManager,this.persistence));const x=(c=(d=this.config.__extensionClasses)===null||d===void 0?void 0:d.sessionRecording)!==null&&c!==void 0?c:(f=Rl.__defaultExtensionClasses)===null||f===void 0?void 0:f.sessionRecording;var h,m;x&&(this.sessionRecording=this.bh(this.sessionRecording,new x(this)),this.vr&&((h=this.sessionRecording)===null||h===void 0||(m=h.onRemoteConfig)===null||m===void 0||m.call(h,this.vr)))}const v=this.consent.consent===1;var y,_,b;v&&this.xh(),this.consent.optInOut(!0),this.Ch(),this.ad(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((y=this.surveys)===null||y===void 0||y.loadIfEnabled(),(_=this.conversations)===null||_===void 0||_.loadIfEnabled()),v||!de(e==null?void 0:e.captureEventName)&&!(e!=null&&e.captureEventName)||this.capture((b=e==null?void 0:e.captureEventName)!==null&&b!==void 0?b:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),(r=this.persistence)===null||r===void 0||r.syncCookieProperties(),this.Zh(),(s=this.featureFlags)===null||s===void 0||s.sendFlagCallsPendingCapture(),this.config.capture_pageview&&this.ld()}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.Ch(),this.config.cookieless_mode==="on_reject"&&this.Th()):ve.warn(oP)}Th(){var e,n;const r=this.sessionRecording;r==null||r.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.Id(!0,!0),this.register({distinct_id:c2,$device_id:null}),this.mh(r),this.sessionRecording=void 0,(e=this.sessionManager)===null||e===void 0||e.destroy(),(n=this.pageViewManager)===null||n===void 0||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.ld(),this.ad()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return!this.$h&&(this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.Ch()}_is_bot(){return Qr?fM(Qr,this.config.custom_blocked_useragents):void 0}ld(){Oe&&(Oe.visibilityState==="visible"?this.Dh||(this.Dh=!0,this.capture(ek,{title:Oe.title},{send_instantly:!0}),this.Lh&&(Oe.removeEventListener(qd,this.Lh),this.Lh=null)):this.Lh||(this.Lh=this.ld.bind(this),Lt(Oe,qd,this.Lh)))}debug(e){e===!1?(ce==null||ce.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ce==null||ce.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}lc(){const e=this.Bh||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ve.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,i,o){const l=r in n&&!at(n[r]),c=s in n&&!at(n[s]);return l?n[r]:!!c&&(o&&o.warn(`Config field '${s}' is deprecated. Please use '${r}' instead. The old field will be removed in a future major version.`),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,ve)}Fs(e){var n;if(at(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(MH),s=Ue(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=e;for(const o of s)try{if(i=o(i),at(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return OH(e.event)?ve.warn(`${l}. This can cause unexpected behavior.`):ve.info(l),null}i.properties&&!Ws(i.properties)||ve.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return ve.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&at(i.properties[o]))return ve.warn(`Event '${e.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.Ul)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}qh(e){const n=Os(e)&&!e,r=It.Ot()&&It.Lt("ph_debug")==="true";return!n&&(!!r||e)}};Sp.__defaultExtensionClasses={},Sp.Ad=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=RB(t.prototype[e[n]])})(Sp,["identify"]);const BZ=["[data-ph-capture-value]"];var ZZ=class{constructor(t){this._instance=t}refresh(t){var e;const n=this._instance.config,r=ut(n.autocapture)?n.autocapture:void 0;t.enabled=!!n.autocapture,t.rageclick=n.rageclick,t.maskAllElementAttributes=n.mask_all_element_attributes,t.maskAllText=n.mask_all_text,t.disableCaptureUrlHashes=n.disable_capture_url_hashes,t.getCurrentUrl=n.get_current_url,t.remoteRequestsDisabled=this._instance.lc(),t.url_allowlist=r==null?void 0:r.url_allowlist,t.url_ignorelist=r==null?void 0:r.url_ignorelist,t.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,t.element_allowlist=r==null?void 0:r.element_allowlist,t.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,t.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,t.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,t.capture_copied_text=r==null?void 0:r.capture_copied_text,t.capture_value_css_selector_allowlist=(e=r==null?void 0:r.capture_value_css_selector_allowlist)!==null&&e!==void 0?e:BZ}};const Hh=An("[ExceptionAutocapture]"),fP=()=>{},hP=t=>{var e;if(Vn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function Sf(t,e,n){try{if(!(e in t))return fP;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return Vn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);let i=t[e],o=hP(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=hP(i)}}}catch{return fP}}const WZ=An("[TracingHeaders]"),Uc=An("[Web Vitals]"),pP=9e5,mP=["CLS","FCP","INP","LCP"],KZ=["INP","LCP"],qZ=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],A2="disabled",gP="lazy_loading",Pa=An("[SessionRecording]"),GZ=[QS,JS,gO,vO,yO,_O,wO,bO,xO],YZ=An("[Heatmaps]");function I2(t){return ut(t)&&"clientX"in t&&"clientY"in t&&Yn(t.clientX)&&Yn(t.clientY)}const tg=An("[Product Tours]"),O2=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(YS))},XZ=["$set_once","$set"],Fo=An("[SiteApps]"),vP="Error while initializing PostHog app with config id ";function Sd(t,e,n){if(at(t))return!1;switch(n){case"exact":return t===e;case"contains":{const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var QZ=class{constructor(t){this.$i=t,this.Ao=new Set,this.Ro=new Set,this.Po=new Nv,this.Oo=(e,n)=>this.Fo(e,n)&&this.Do(e,n)&&this.Lo(e,n)&&this.No(e,n),this.Fo=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;de((t=this.$i)===null||t===void 0?void 0:t.subscribeCapture)||(this.jo=(e=this.$i)===null||e===void 0?void 0:e.subscribeCapture((n,r)=>{this.on(n,r)}))}dispose(){var t,e,n;(t=this.jo)===null||t===void 0||t.call(this),this.jo=void 0,(e=this.$i)===null||e===void 0||(n=e.setElementSelectors)===null||n===void 0||n.call(e,new Set,this),this.Po=new Nv}register(t){var e,n;if(!de((e=this.$i)===null||e===void 0?void 0:e.subscribeCapture)&&(t.forEach(r=>{var s;this.Ao.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.Ro.add((i==null?void 0:i.event)||"")})}),(n=this.$i)===null||n===void 0?void 0:n.setElementSelectors)){const r=new Set;this.Ao.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this.$i.setElementSelectors(r,this)}}replace(t){this.Ao.clear(),this.Ro.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.Ro.has(t)||this.Ro.has(e.event))&&this.Ao.forEach(n=>{this.qo(e,n)&&this.Po.emit("actionCaptured",n.name)})}Bo(t){this.onAction("actionCaptured",e=>t(e))}qo(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.Oo(t,n))return!0;return!1}onAction(t,e){return this.Po.on(t,e)}Do(t,e){if(e!=null&&e.url){var n;let i=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!(t!=null&&t.properties)||!("$current_url"in t.properties))try{var r,s;i=(r=this.$i)===null||r===void 0||(s=r.getActionUrl)===null||s===void 0?void 0:s.call(r)}catch{return!1}if(!i||typeof i!="string"||!Sd(i,e.url,e.url_matching||"contains"))return!1}return!0}Lo(t,e){return!!this.zo(t,e)&&!!this.Ho(t,e)&&!!this.Uo(t,e)}zo(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.Wo(t);if(r.length>0)return r.some(i=>Sd(i.href,e.href,e.href_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&Sd((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}Ho(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.Wo(t);if(r.length>0)return r.some(c=>Sd(c.text,e.text,e.text_matching||"exact")||Sd(c.$el_text,e.text,e.text_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(c){const d=[],f=/(?::|")text="(.*?)"/g;let h;for(;!at(h=f.exec(c));)d.includes(h[1])||d.push(h[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(c=>Sd(c,o,l)));var i,o,l}Uo(t,e){var n,r;if(!(e!=null&&e.selector))return!0;const s=t==null||(n=t.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(e.selector))return!0;const i=(t==null||(r=t.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch{}return!1}Wo(t){var e;return(t==null||(e=t.properties)===null||e===void 0?void 0:e.$elements)==null?[]:t==null?void 0:t.properties.$elements}No(t,e){return!(e!=null&&e.properties)||e.properties.length===0||gM(e.properties.reduce((n,r)=>{const s=Ue(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),t==null?void 0:t.properties)}},JZ=class{constructor(t,e){this.Vo=e,this.Go=[],this.$i=t,this.Qo=new Map,this.Jo=new Map,this.Zo=new Map}Ko(){var t,e;this.Yo=(t=(e=this.$i).subscribeSession)===null||t===void 0?void 0:t.call(e,n=>this.Xo(n))}ta(t){return!1}ea(){return null}ia(t){}na(){}sa(t,e){return!!t&&gM(t.propertyFilters,e==null?void 0:e.properties)}ra(t,e){const n=new Map;return t.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[e])===null||s===void 0||(s=s.values)===null||s===void 0||s.forEach(i=>{if(i!=null&&i.name){const o=n.get(i.name)||[];o.push(r.id),n.set(i.name,o)}})}),n}oa(t,e,n){const r=(n===Fh.Activation?this.Qo:this.Jo).get(t);let s=[];return this.aa(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const l=(o=i.conditions)===null||o===void 0||(o=o[n])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(c=>c.name===t);return this.sa(l,e)})}register(t){this.la(t,!1)}replace(t){this.la(t,!0)}la(t,e){de(this.$i.subscribeCapture)||(this.ua(t,e),this.ca(t,e))}ca(t,e){const n=t.filter(i=>{var o;return(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var r;if(e&&this.Zo.clear(),n.length===0)return void(e&&((r=this.ha)===null||r===void 0||r.replace([])));this.ha||(this.ha=new QZ(this.$i),this.ha.init(),this.ha.Bo(i=>this.onAction(i)));const s=[];n.forEach(i=>{var o;(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(l=>{if(s.push(l),l.name){var c;const d=(c=this.Zo.get(l.name))!==null&&c!==void 0?c:[];d.includes(i.id)||d.push(i.id),this.Zo.set(l.name,d)}})}),e?this.ha.replace(s):this.ha.register(s)}da(t,e){e.forEach((n,r)=>{var s;const i=(s=t.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),t.set(r,i)})}ua(t,e){var n,r,s;const i=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.events)&&((h=d.conditions)===null||h===void 0||(h=h.events)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),o=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.cancelEvents)&&((h=d.conditions)===null||h===void 0||(h=h.cancelEvents)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),l=this.ra(t,Fh.Activation),c=this.ra(t,Fh.Cancellation);e?(this.Qo=l,this.Jo=c):(this.da(this.Qo,l),this.da(this.Jo,c)),(i.length!==0||o.length!==0||t.some(d=>{var f;return(f=d.conditions)===null||f===void 0||(f=f.actions)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length}))&&((n=this.jo)!==null&&n!==void 0||(this.jo=(r=(s=this.$i).subscribeCapture)===null||r===void 0?void 0:r.call(s,(d,f)=>{this.onEvent(d,f)})))}onEvent(t,e){var n,r;const s=this.va(),i=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$survey_id)||(e==null||(r=e.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const l=this.fa(t,i,e);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.pa([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.ga(i),void this.ma([i])}if(this.Jo.has(t)){const l=this.oa(t,e,Fh.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(c=>c.id)}),this.pa(l.map(c=>c.id)),l.forEach(c=>this.ya(c.id)))}if(!this.Qo.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this.Qo.get(t)});const o=this.oa(t,e,Fh.Activation);this.ba(o.map(l=>l.id))}onAction(t){this.Zo.has(t)&&this.ba(this.Zo.get(t)||[])}ba(t){if(t.length===0)return;const e=!!this.$i.getSessionId(),n=[];for(const r of t)e&&this.ta(r)?this.ga(r)&&this._a(r):n.push(r);n.length>0&&(this.Go=[...new Set([...this.Go,...n])]),this.va().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.wa()}ga(t){this.Go=this.Go.filter(n=>n!==t);const e=this.ka();return!e.includes(t)&&(this.Sa([...e,t]),this.xa(),!0)}pa(t){const e=new Set(t);this.Go=this.Go.filter(s=>!e.has(s));const n=this.$a(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.Sa(r),r.length===0&&this.Ca()),this.ma(t),this.wa()}wa(){try{var t;(t=this.Vo)===null||t===void 0||t.call(this)}catch(e){this.va().error("Error while handling activated items change",e)}}Ta(){const t=this.ea();if(!t)return{};const e=this.$i.getProperty(t);return e&&typeof e=="object"?e:{}}_a(t){if(!this.ea())return;const e=this.Ta();this.ia(j(j({},e),{},{[t]:Date.now()}))}ma(t){if(!this.ea())return;const e=this.Ta(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(Ws(n)?this.na():this.ia(n))}Ia(){this.ea()&&this.na()}getActivationTimestamp(t){if(!this.ka().includes(t))return;const e=this.Ta()[t];return Yn(e)?e:void 0}$a(){const t=this.Ma();return this.$i.getProperty(t)||[]}ka(){const t=this.$a();if(t.length===0)return[];const e=this.$i.getProperty(this.Ea()),n=this.$i.getSessionId();return n&&e===n?t:[]}xa(){const t=this.$i.getSessionId();t&&this.Aa(t)}Ca(){this.Ra()}Xo(t){const e=this.$i.getProperty(this.Ea());if(e&&e!==t){const n=this.$a(),r=this.Ta();n.length>0&&(this.Sa([]),n.filter(s=>Yn(r[s])).forEach(s=>this.ya(s))),this.Ca(),this.Ia(),n.length>0&&this.wa()}}getActivatedIds(){return[...new Set([...this.ka(),...this.Go])].filter(t=>!this.Pa(t))}dispose(){var t,e,n;(t=this.Yo)===null||t===void 0||t.call(this),this.Yo=void 0,(e=this.jo)===null||e===void 0||e.call(this),this.jo=void 0,(n=this.ha)===null||n===void 0||n.dispose(),this.ha=void 0}reset(){this.Go=[],this.$a().length>0&&this.Sa([]),this.Ca(),this.Ia(),this.wa()}getEventToItemsMap(){return this.Qo}Oa(){return this.ha}},eW=class extends JZ{constructor(t,e,n,r){var s;super({subscribeCapture(i){const o=t.onEvent(l=>i(l.event,l));return()=>o.dispose()},subscribeSession(i){const o=t.onSession(i);return()=>o.dispose()},getSessionId(){var i;return(i=t.session)===null||i===void 0?void 0:i.sessionId},getProperty:i=>t.kv.get(i),getActionUrl:n==null?void 0:n.getActionUrl,setElementSelectors:(s=n==null?void 0:n.setElementSelectors)!==null&&s!==void 0?s:(i,o)=>{var l;return(l=t.getExtension("autocapture"))===null||l===void 0?void 0:l.setElementSelectors(i,o)}},r),this.Fa=t,this.Da=e,this.Ko()}Ma(){return gb}Ea(){return Fg}ea(){return jg}ia(t){this.Fa.kv.set({[jg]:t})}na(){this.Fa.kv.remove(jg)}ta(t){var e;let n;this.aa(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return Yn(r)&&r>0}La(){return vi.SHOWN}aa(t){this.Da.getSurveys(t)}ya(t){this.Da.cancelPendingSurvey(t)}va(){return Wt}Sa(t){this.Fa.kv.set({[gb]:t})}Aa(t){this.Fa.kv.set({[Fg]:t})}Ra(){this.Fa.kv.remove(Fg)}Pa(){return!1}fa(t,e,n){var r;if(t===vi.SENT&&(n==null||(r=n.properties)===null||r===void 0?void 0:r.$survey_completed)===!1)return"ignore";let s;return this.aa(i=>{s=i.find(o=>o.id===e)}),!s||(function(i){var o;return pM(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?t===vi.SHOWN?"consume":"ignore":t===vi.SHOWN?"persist":t===vi.DISMISSED||t===vi.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};const ck=(t,e)=>t!=null&&t.then?t.then(e):e(t),kd="SDK is not enabled or survey functionality is not yet loaded",yP="Disabled. Not loading surveys.";var tW=class{constructor(t){this.Na=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ja=!1,this.qa=!1,this.Ba=[],this.za=[],this.Ha=null,this.Ua=null,this.Ti=!1,this.Wa=new Set,this.onRemoteConfig=e=>{if(this.Ti||this.Fr.disableSurveys)return;if(!e.ok)return this.qa=!0,this.Va({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Wt.warn("Remote config unavailable. Not loading surveys.");const n=e.config.surveys;if(at(n))return Wt.warn("Flags not loaded yet. Not loading surveys.");this.Ga=Os(n)?n:n.length>0,Wt.info(`flags response received, isSurveysEnabled: ${this.Ga}`),this.loadIfEnabled()},this.Va=e=>{this.za.slice().forEach(n=>this.Qa(n,e))}}setup(t){if(!this.Ti)return this.Ja=t,ck(t.kv.initialize(),()=>{if(this.Ja!==t||this.Ti)return;this.Ja=void 0,this.Fa=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.Ti?e.dispose():(this.Za=e,this.loadIfEnabled())})}dispose(){var t,e,n,r,s;this.Ti||(this.Ti=!0,this.Ja=void 0,this.Fa=void 0,(t=this.Za)===null||t===void 0||t.dispose(),this.Za=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(r=n.dispose)===null||r===void 0||r.call(n),this._surveyManager=null,this.Ba=[],this.za.forEach(i=>{i.active=!1}),this.za=[],(s=this.Ka)===null||s===void 0||s.call(this),this.Ka=void 0,this.Ha=null,this.Wa.forEach(i=>clearTimeout(i)),this.Wa.clear())}get Fr(){return this.Na.get()}getRenderContext(){if(!this.Fa)return;const t=this;return{client:this.Fa,get config(){return t.Fr},surveys:t}}initialize(){this.loadIfEnabled()}reset(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.clearInMemoryInProgressSurveyState)===null||e===void 0||e.call(t);try{var n;(n=this._surveyEventReceiver)===null||n===void 0||n.reset(),localStorage.removeItem("lastSeenSurveyDate");const r=[];for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);(i!=null&&i.startsWith("seenSurvey_")||i!=null&&i.startsWith("inProgressSurvey_"))&&r.push(i)}r.forEach(s=>localStorage.removeItem(s))}catch{}this.Va()}loadIfEnabled(){if(this.Ti||!this.Fa)return;const t=this.Fr;if(this._surveyManager)return;if(this.ja)return void Wt.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Wt.info(yP);if(t.cookielessMode&&this.Fa.isOptedOut)return void Wt.info("Not loading surveys in cookieless mode without consent.");const e=this.Na.getExtensions();if(!e)return void this.Ya("PostHog Extensions not found.");if(de(this.Ga)&&!t.advancedEnableSurveys)return;const n=this.Ga||t.advancedEnableSurveys;this.ja=!0,this.qa=!1;try{const r=e.generateSurveys;if(r)return this.Xa(r,n),void(this.ja=!1);const s=e.loadExternalDependency;if(!s)return this.Ya(mb),void(this.ja=!1);s(i=>{try{if(this.Ti)return;const o=this.Na.getExtensions();i||!(o!=null&&o.generateSurveys)?this.Ya("Could not load surveys script",i):this.Xa(o.generateSurveys,n)}finally{this.ja=!1}})}catch(r){throw this.ja=!1,this.Ya("Error initializing surveys",r),r}}Xa(t,e){var n;if(this.Ti)return;this._surveyManager=t(e),this._surveyEventReceiver=this.tl(this.Fa,this.Va);const r=(n=this.Fa)===null||n===void 0?void 0:n.kv.get(Jh);r&&this.el(r),Wt.info("Surveys loaded successfully"),this.il(),this.Va(),this.nl({isLoaded:!0})}tl(t,e){return new eW(t,this,void 0,e)}Ya(t,e){this.qa=!0,Wt.error(t,e),this.Va({isLoaded:!1,error:t}),this.nl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ba.push(t),this._surveyManager&&this.nl({isLoaded:!0}),()=>{this.Ba=this.Ba.filter(e=>e!==t)}}getSurveys(t,e=!1){if(this.Ti)return;const n=this.Fa;if(!n)return t([],{isLoaded:!1,error:kd});if(this.Fr.disableSurveys)return Wt.info(yP),t([]);const r=n.kv.get(Jh);if(r&&!e)return t(r,{isLoaded:!0}),void(this.sl()&&this.getSurveys(()=>{},!0));if(this.Ha)return void this.Ha.then(({surveys:o,context:l})=>{this.Ti||t(o,l)}).catch(o=>Wt.error("Error in survey callback",o));const s=n.sendRequest("/api/surveys/",{method:"GET",query:{token:n.projectToken},sentAt:"query",timeoutMs:this.Fr.requestTimeoutMs}).then(o=>{try{return this.rl(n,o)}catch(l){return Wt.error("Error processing surveys response",l),this.rl(n,{statusCode:0,error:l})}},o=>this.rl(n,{statusCode:0,error:o}));this.Ha=s;const i=()=>{this.Ha===s&&(this.Ha=null)};s.then(o=>{i(),this.Ti||(this.Va(o.context),t(o.surveys,o.context))},i).catch(o=>Wt.error("Error in survey callback",o))}rl(t,e){if(this.Ti)return{surveys:[],context:{isLoaded:!1,error:kd}};const n=e.statusCode;if(n!==200||!e.json){const s=`Surveys API could not be loaded, status: ${n}`;return n!==0?Wt.error(s):e.error||Wt.warn(s),this.Ua=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Ua=null;const r=e.json.surveys||[];return t.kv.set({[Jh]:r,[Pv]:Date.now()}),this.el(r),{surveys:r,context:{isLoaded:!0}}}el(t){const e=t.filter(n=>(function(r){return!(!r.start_date||r.end_date)})(n)&&(pM(n)||(function(r){var s;return!!(!((s=r.conditions)===null||s===void 0||(s=s.actions)===null||s===void 0||(s=s.values)===null||s===void 0)&&s.length)})(n)));this.al(e)}al(t){var e;(e=this._surveyEventReceiver)===null||e===void 0||e.replace(t)}sl(){return this.ll()&&!this.Ha&&!this.ul()}ll(){var t;const e=(t=this.Fa)===null||t===void 0?void 0:t.kv.get(Pv);return Yn(e)&&Date.now()-e>3e5}ul(){return Yn(this.Ua)&&3e5>Date.now()-this.Ua}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};vM(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Va()}nl(t){for(const e of this.Ba){if(this.Ti)return;try{t.isLoaded?this.getSurveys(e):e([],t)}catch(n){Wt.error("Error in survey callback",n)}}}getActiveMatchingSurveys(t,e=!1){if(!at(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Wt.warn("init was not called")}onActiveMatchingSurveysChanged(t){var e;if(this.Ti)return()=>{};const n={callback:t,active:!0,revision:0};this.za.push(n),this.il();const r=(e=this.Fa)===null||e===void 0?void 0:e.kv.get(Jh);return this.Fr.disableSurveys||!this._surveyManager&&this.qa&&!this.ja||!r&&!at(this.Ua)&&!this.Ha?this.Qa(n,{isLoaded:!1}):this._surveyManager&&this.Qa(n),()=>{var s;n.active=!1,this.za=this.za.filter(i=>i!==n),this.za.length===0&&((s=this.Ka)===null||s===void 0||s.call(this),this.Ka=void 0)}}il(){var t,e,n;this._surveyManager&&this.za.length>0&&((t=this.Ka)!==null&&t!==void 0||(this.Ka=(e=(n=this.Na).onMatchingConditionsChanged)===null||e===void 0?void 0:e.call(n,this.Va)))}Qa(t,e){if(this.Ti||!t.active)return;const n=++t.revision,r=s=>{if(!this.Ti&&t.active&&n===t.revision)try{const i=e??{isLoaded:!0},o=JSON.stringify([s,i]);if(o===t.lastResult)return;t.lastResult=o,t.callback(s,i)}catch(i){Wt.error("Error in active matching surveys callback",i)}};try{e&&!e.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(s){Wt.error("Error in active matching surveys callback",s)}}cl(t){let e=null;return this.getSurveys(n=>{var r;e=(r=n.find(s=>s.id===t))!==null&&r!==void 0?r:null}),e}hl(t){if(at(this._surveyManager))return{eligible:!1,reason:kd};const e=typeof t=="string"?this.cl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}dl(t){var e;if(!(!((e=this.Fa)===null||e===void 0)&&e.canCapture))return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(at(this._surveyManager))return{eligible:!1,reason:kd};const n=typeof t=="string"?this.cl(t):t;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(at(this._surveyManager))return Wt.warn("init was not called"),{visible:!1,disabledReason:kd};const e=this.dl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return at(this._surveyManager)?(Wt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:kd})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null;if(i){const o=this.dl(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r,s,i;if(!(!((r=this.Fa)===null||r===void 0)&&r.canCapture))return;if(at(this._surveyManager))return void Wt.warn("init was not called");const o=typeof t=="string"?this.cl(t):t;if(!(o!=null&&o.id))return void Wt.warn("Survey not found");if(!kZ.includes(o.type))return void Wt.warn(`Surveys of type ${o.type} cannot be rendered in the app`);const l=(s=typeof document>"u"?void 0:document)===null||s===void 0?void 0:s.querySelector(e);if(l){if(!((i=o.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){Wt.info(`Rendering survey ${o.id} with delay of ${o.appearance.surveyPopupDelaySeconds} seconds`);const c=setTimeout(()=>{var d,f,h;this.Wa.delete(c),!this.Ti&&(!((d=this.Fa)===null||d===void 0)&&d.canCapture)&&(Wt.info(`Rendering survey ${o.id} with delay of ${(f=o.appearance)===null||f===void 0?void 0:f.surveyPopupDelaySeconds} seconds`),(h=this._surveyManager)===null||h===void 0||h.renderSurvey(o,l,n),Wt.info(`Survey ${o.id} rendered`))},1e3*o.appearance.surveyPopupDelaySeconds);return void this.Wa.add(c)}this._surveyManager.renderSurvey(o,l,n)}else Wt.warn("Survey element not found")}displaySurvey(t,e){var n,r;if(!(!((n=this.Fa)===null||n===void 0)&&n.canCapture))return;if(at(this._surveyManager))return void Wt.warn("init was not called");const s=this.cl(t);if(!s)return void Wt.warn("Survey not found");let i=s;if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(i=j(j({},s),{},{appearance:j(j({},s.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==Pb.Popover&&e.initialResponses&&Wt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const o=this.hl(s);if(!o.eligible)return void Wt.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==Pb.Inline?this._surveyManager.handlePopoverSurvey(i,e):this.renderSurvey(i,e.selector,e.properties)}cancelPendingSurvey(t){at(this._surveyManager)?Wt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}},nW=class{constructor(t){this._instance=t}get(){var t,e,n,r;const s=(t=this._instance)===null||t===void 0?void 0:t.config;return{disableSurveys:!!(s!=null&&s.disable_surveys),cookielessMode:!!(s!=null&&s.cookieless_mode),advancedEnableSurveys:!!(s!=null&&s.advanced_enable_surveys),requestTimeoutMs:(e=s==null?void 0:s.surveys_request_timeout_ms)!==null&&e!==void 0?e:1e4,prefillFromUrl:!!(!(s==null||(n=s.surveys)===null||n===void 0)&&n.prefillFromUrl),automaticDisplay:!(s!=null&&s.disable_surveys_automatic_display),featureFlagEvaluation:!(s!=null&&s.advanced_disable_feature_flags),overrideLanguage:s==null?void 0:s.override_display_language,prepareStylesheet:s==null?void 0:s.prepare_external_dependency_stylesheet,get_current_url:s==null?void 0:s.get_current_url,uiHost:(r=this._instance)===null||r===void 0||(r=r.requestRouter)===null||r===void 0?void 0:r.endpointFor("ui","")}}getExtensions(){const t=tt==null?void 0:tt.__PosthogExtensions__;if(!t||!this._instance)return;const e=this._instance,{generateSurveys:n,loadExternalDependency:r}=t;return{generateSurveys:n?s=>n(e,s):void 0,loadExternalDependency:r?s=>r(e,"surveys",s):void 0}}onMatchingConditionsChanged(t){var e,n;const r=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook(l=>{l!=="$pageview"&&l!==vi.SHOWN&&l!==vi.DISMISSED&&l!==vi.SENT||t()}),s=()=>t();Lt(ce,"PHSurveyShown",s);let i=!1;const o=(n=this._instance)===null||n===void 0?void 0:n.onFeatureFlags(()=>{i&&t()});return i=!0,()=>{i=!1,r==null||r(),o==null||o(),ce==null||ce.removeEventListener("PHSurveyShown",s)}}};const rW=ce!=null&&ce.location?Iv(ce.location.hash,"__posthog")||Iv(location.hash,"state"):null,_P="_postHogToolbarParams",wP=An("[Toolbar]"),bP=An("[FeatureFlags]"),Bc=An("[FeatureFlags]",{debugEnabled:!0}),M2=`" failed. Feature flags didn't load in time.`,sW=[502,504],xP=["click","keydown","wheel","touchstart","pointerdown"],SP="connection_error",kP=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},EP=t=>{const e={};for(const[n,r]of Vg(t||{}))r&&(e[n]=r);return e},iW=(t,e)=>t.distinctId===e.distinctId&&t.sessionId===e.sessionId&&((n,r)=>{const s=Object.keys(n);return s.length===Object.keys(r).length&&s.every(i=>n[i]===r[i])})(t.groups,e.groups);var oW=class{constructor(t){this.name="featureFlags",this.Pd=!1,this.featureFlagEventHandlers=[],this.R=bP,this.Od={},this.Fd={},this.Dd=[],this.Ld=new Set,this.Nd=new Set,this.jd=!1,this.qd=!1,this.Bd=0,this.zd=!1,this.Hd=!1,this.Ud=!1,this.Wd=new Map,this.Vd=!1,this.Gd=!1,this.Qd=!1,this.Jd=0,this.Zd=!1,this.sn=()=>{const e=this.Kd();this.Jd=0,e&&this.reloadFeatureFlags()},this.Yd=()=>{var e,n;const r=this.Xd,s=(e=this.tv)!==null&&e!==void 0?e:r;de(r)||de(s)||this.Fr.remoteRequestsDisabled||!this.ev||this.ev.visibilityState==="hidden"||Date.now()-((n=this.iv)!==null&&n!==void 0?n:0)<s||(this.tv=this.Zd||!this.Fr.idleRefreshBackoff?r:Math.min(2*s,36e5),this.Zd=!1,this.reloadFeatureFlags(),this.nv())},this.sv=()=>{this.Zd&&this.tv===this.Xd||this.rv()},this.an=()=>{var e;((e=this.ev)===null||e===void 0?void 0:e.visibilityState)==="visible"&&this.rv()},this.Na=t}get ov(){}av(){this.Fa&&this.lv()}setup(t){try{this.uv=typeof window>"u"?void 0:window,this.ev=typeof document>"u"?void 0:document}catch{this.uv=void 0,this.ev=void 0}return this.Ja=t,this.R=t.logger.createLogger("[FeatureFlags]"),ck(t.kv.initialize(),()=>{this.Ja===t&&(this.Ja=void 0,this.Fa=t,this.hv(t))})}hv(t){var e;if(this.Fa===t)return this.uv&&Lt(this.uv,"online",this.sn),this.lv(),this.dv=t.registerDynamicEventProperties(()=>this.vv()?this.Od:this.Fd),this.fv=(e=this.ov)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.pv(),this.gv(),this.mv()}),this.gv(),this.initialize()}rv(){this.Zd=!0,this.tv=this.Xd,this.Yd()}lv(){var t;const e=this.Fr.refreshIntervalMs,n=!this.Fr.remoteRequestsDisabled&&this.ev&&!de(e)&&e>0?e:void 0;this.Fr.idleRefreshBackoff||(this.tv=n),n!==this.Xd&&(this.yv(),de(n)||(this.Xd=n,this.tv=n,this.nv(),!((t=this.ev)===null||t===void 0)&&t.addEventListener&&(Lt(this.ev,qd,this.an),Fd(xP,r=>{Lt(this.ev,r,this.sv,{capture:!0})}))))}nv(){de(this.Xd)||(de(this.bv)||clearInterval(this.bv),this.iv=Date.now(),this.bv=setInterval(this.Yd,this.Xd))}yv(){var t,e;de(this.bv)||(clearInterval(this.bv),this.bv=void 0,(t=this.ev)===null||t===void 0||(e=t.removeEventListener)===null||e===void 0||e.call(t,"visibilitychange",this.an),Fd(xP,n=>{var r,s;(r=this.ev)===null||r===void 0||(s=r.removeEventListener)===null||s===void 0||s.call(r,n,this.sv,{capture:!0})})),this.Xd=void 0,this.tv=void 0,this.Zd=!1,this.iv=void 0}destroy(){this._v()}dispose(){this._v()}_v(){var t,e,n;this.yv(),this.Bd++,this.Hd=!1,this.Ja=void 0,this.wv(this.Ld,"cancelled"),this.wv(this.Nd,"cancelled"),this.Fa&&(this.Sv(),(t=this.dv)===null||t===void 0||t.dispose(),this.dv=void 0,(e=this.fv)===null||e===void 0||e.call(this),this.fv=void 0,this.Dd=[],(n=this.uv)===null||n===void 0||n.removeEventListener("online",this.sn),this.Fa=void 0)}get Fr(){return this.Na.get()}xv(t){var e;return this.$v&&t in this.$v?this.$v[t]:(e=this.Fa)===null||e===void 0?void 0:e.kv.get(t)}pv(){return!!this.$v&&(this.$v=void 0,!0)}Cv(){var t;return!de((t=this.Fa)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.pv()}$t(t){this.Tv(()=>{var e;return(e=this.Fa)===null||e===void 0?void 0:e.kv.set(t)})}Iv(t,e,n){if(!this.ov||!t.$enabled_feature_flags)return;const r=this.xv("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},i=e.flags||e.featureFlags,o=e.flags?Object.entries(e.flags).filter(([,b])=>!(b!=null&&b.failed)).map(([b])=>b):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,c=l?o:n&&!Ue(i)?Object.keys(i||{}):Array.from(new Set([...Object.keys(r),...Object.keys(s)])),d=this.xv("$feature_flag_payloads")||{},f=t.$feature_flag_payloads||{},h=l||n?c:Array.from(new Set([...Object.keys(d),...Object.keys(f)])),m=!l&&!n,v=!!m||c,y=!!m||h,_={[Ha]:v,[yo]:v,[Wl]:y};t.$feature_flag_details&&(_[_u]=v);for(const b of[wu,Jl,pp])de(t[b])||(_[b]=!0);this.ov.markCrossTabFeatureFlagChanges(_)}Dt(t){this.Tv(()=>{var e;return(e=this.Fa)===null||e===void 0?void 0:e.kv.remove(t)})}Tv(t){try{t()}catch(e){this.R.error("Failed to update feature flag persistence",e)}}gv(){const t={};for(const r of[Ha,Wl,wu,Ho]){const s=this.xv(r);de(s)||(t[r]=s)}this.Od=t;const e=j({},t),n=this.xv(yo);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.Fd=e}vv(){const t=this.Fr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.xv(Jl);return typeof e!="number"||Date.now()-e>t}Mv(){return!!this.vv()&&(this.Qd||this.qd||(this.Qd=!0,this.R.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ev(){const t=this.Fr.evaluationContexts;return t!=null&&t.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.R.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Av(){const t=this.Fr.flagKeys;if(!de(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.R.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Fr,r=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i;const o=(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},l=Object.keys(r).filter(d=>!de(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),c=Object.keys(o).filter(d=>l[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.Rv({featureFlags:l,featureFlagPayloads:c},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.xv("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.xv("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=j(j({},i),t),c=j(j({},o),e),d={};for(const[f,h]of Object.entries(l))d[f]={key:f,enabled:h3(h),variant:p3(h),reason:void 0,metadata:de(c==null?void 0:c[f])?void 0:{id:0,version:void 0,description:void 0,payload:c[f]}};this.Rv({flags:d})}get hasLoadedFlags(){return this.jd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.xv(_u),e=this.xv(Ho),n=this.xv(nu);if(!n&&!e)return t||{};const r=_n({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i,o;const c=r[l],d=e==null?void 0:e[l],f=de(d)?(i=c==null?void 0:c.enabled)!==null&&i!==void 0&&i:!!d,h=de(d)?c==null?void 0:c.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[l],v=j(j({},c),{},{enabled:f,variant:f?h??(c==null?void 0:c.variant):void 0});f!==(c==null?void 0:c.enabled)&&(v.original_enabled=c==null?void 0:c.enabled),h!==(c==null?void 0:c.variant)&&(v.original_variant=c==null?void 0:c.variant),m&&(v.metadata=j(j({},c==null?void 0:c.metadata),{},{payload:m,original_payload:c==null||(o=c.metadata)===null||o===void 0?void 0:o.payload})),r[l]=v}return this.Pd||(this.R.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Pd=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:h3(r),variant:p3(r),payload:f3(e[n])}})}getFlagVariants(){const t=this.xv(yo),e=this.xv(Ho);if(!e)return t||{};const n=_n({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Pd||(this.R.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Pd=!0),n}getFlagPayloads(){const t=this.xv(Wl),e=this.xv(nu);if(!e)return t||{};const n=_n({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Pd||(this.R.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Pd=!0),n}reloadFeatureFlags(){this.zd||this.Fr.featureFlagsDisabled||this.Kd()||(this.Ud&&this.R.warn("reloadFeatureFlags() was called inside an onFeatureFlags callback. This callback also runs when flags change in other tabs, so this can cause a request loop."),this.qd&&(this.Hd=!0),this.Pv||(this.Dd.slice().forEach(t=>{try{t()}catch(e){this.R.error("Error while running feature flags reloading callback",e)}}),this.Pv=setTimeout(()=>{this.Ov()},5)))}reloadFeatureFlagsAsync(){return!this.Fa||this.zd||this.Fr.featureFlagsDisabled||this.Fr.remoteRequestsDisabled||this.Kd()?Promise.resolve({status:"skipped"}):new Promise(t=>{this.Ld.add(t),this.reloadFeatureFlags()})}wv(t,e){t.forEach(n=>n({status:e})),t.clear()}Sv(){clearTimeout(this.Pv),this.Pv=void 0}onReloading(t){return this.Dd.push(t),()=>{this.Dd=this.Dd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.jd||this.qd||this.Pv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.zd=t}resetFlagCallReported(){this.Dt(Go),this.Wd=new Map}sendFlagCallsPendingCapture(){var t;if(this.Wd.size!==0&&!this.Vd&&(!((t=this.Fa)===null||t===void 0)&&t.canCapture)&&!this.Fa.isRateLimited){this.Vd=!0;try{const e=this.getFlagVariants();for(const n of Array.from(this.Wd.keys())){const r=this.Wd.get(n);if(r){if(r.value!==String(e[n])||!iW(r.context,this.Fv())){this.Wd.delete(n);continue}if(this.getFeatureFlagResult(n),this.Wd.has(n))break}}}finally{this.Vd=!1}}}Ov(t){var e;this.Sv();const n=this.Fa;if(!n||this.Fr.remoteRequestsDisabled||this.Kd())return void this.wv(this.Ld,"skipped");if(this.qd)return void(this.Hd=!0);const r={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:j(j(j({},n.initialPersonProperties),this.xv("$stored_person_properties")||{}),{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this.xv(Bl),timezone:ok()};de(n.deviceId)||(r.$device_id=n.deviceId),(t!=null&&t.disableFlags||this.Fr.featureFlagsDisabled)&&(r.disable_flags=!0);const s=this.Ev();s.length&&(r.evaluation_contexts=s);const i=this.Av();de(i)||(r.flag_keys=i);const o=this.Fr.onlyEvaluateSurveyFeatureFlags,l="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),c=this.Bd,d=this.Ld;this.Ld=new Set,this.Nd=d,this.qd=!0;const f=()=>{this.Hd&&(this.Hd=!1,this.Ov())},h=b=>{var x,k;const C=(x=b.json)!==null&&x!==void 0?x:{},P=b.statusCode!==200;if(this.qd=!1,c!==this.Bd)return void f();if(this.Dv(b.statusCode),P||this.Hd||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.Hd)return void this.wv(d,"skipped");this.Gd=!P;const R=[];b.error?R.push(b.error instanceof Error&&b.error.name==="AbortError"?"timeout":b.error instanceof Error?SP:"unknown_error"):b.statusCode!==200&&R.push(`api_error_${b.statusCode}`),C.errorsWhileComputingFlags&&R.push("errors_while_computing_flags");const O=!!(!((k=C.quotaLimited)===null||k===void 0)&&k.includes("feature_flags"));O&&R.push("quota_limited"),this.$t({[jp]:R}),O?this.R.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):r.disable_flags||this.Rv(C,P,{partialResponse:o}),this.wv(d,r.disable_flags?"skipped":R.length||!C.flags&&!C.featureFlags?"error":"loaded"),f()},m=b=>{this.qd=!1,c===this.Bd&&(this.$t({[jp]:[SP]}),this.R.error("Feature flag request failed",b),this.Cv()&&this.mv(!0),this.wv(d,"error")),f()};let v=(e=this.Fr.requestMaxRetries)!==null&&e!==void 0?e:1;const y=()=>v>0&&c===this.Bd,_=()=>{if(c!==this.Bd||!this.Fa||this.Fr.remoteRequestsDisabled)return this.qd=!1,this.wv(d,"skipped"),void f();try{n.sendRequest(l,{target:"flags",method:"POST",body:r,compression:this.Fr.compression,sentAt:"body",timeoutMs:this.Fr.requestTimeoutMs}).then(b=>{if((x=>sW.includes(x.statusCode)||(k=>k.statusCode===0&&k.error instanceof Error&&k.error.name==="AbortError")(x))(b)&&y())return v--,void setTimeout(_,500);h(b)}).catch(m)}catch(b){m(b)}};_()}Kd(){return FO(this.Jd,3)}Dv(t){this.Jd=jO(t,this.Jd,3,()=>this.R.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e={}){var n;if(e.fresh&&!this.Gd)return;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return void this.R.warn('getFeatureFlag for key "'+t+M2);if(this.Mv())return;const r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.Gd)return;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return void this.R.warn('getFeatureFlagResult for key "'+t+M2);if(this.Mv())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.xv("$feature_flag_request_id")||void 0,c=this.xv("$feature_flag_evaluated_at")||void 0;let d,f=this.xv("$flag_call_reported")||{};if(this.Fr.deduplicateCallsPerSession){var h;const q=(h=this.Fa)===null||h===void 0||(h=h.session)===null||h===void 0?void 0:h.sessionId,X=this.xv(Qh);q&&q!==X&&(f={},d=q)}if(!e.send_event&&"send_event"in e)d&&this.$t({[Go]:f,[Qh]:d});else{var m,v,y;const q=!(!((m=this.Fa)===null||m===void 0)&&m.canCapture),X=!q&&!(!((v=this.Fa)===null||v===void 0)&&v.isRateLimited);var _;if(X?this.Wd.delete(t):(q&&Object.keys(f).length>0&&(f={},this.$t({[Go]:f})),!((_=f[t])===null||_===void 0)&&_.includes(o)||this.Lv(t,o)),X&&!(!((y=f[t])===null||y===void 0)&&y.includes(o))){var b,x,k,C,P,R,O,I,A,M,L,z,$;Ue(f[t])?f[t].push(o):f[t]=[o],this.$t(j({[Go]:f},d?{[Qh]:d}:{}));const K=this.getFeatureFlagDetails(t),H=[...(b=this.xv("$feature_flag_errors"))!==null&&b!==void 0?b:[]];de(s)&&H.push("flag_missing");const ee={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:(x=(k=this.Fr.bootstrap)===null||k===void 0||(k=k.featureFlags)===null||k===void 0?void 0:k[t])!==null&&x!==void 0?x:null,$feature_flag_bootstrapped_payload:(C=(P=this.Fr.bootstrap)===null||P===void 0||(P=P.featureFlagPayloads)===null||P===void 0?void 0:P[t])!==null&&C!==void 0?C:null,$used_bootstrap_value:!this.Gd};de(K==null||(R=K.metadata)===null||R===void 0?void 0:R.has_experiment)||(ee.$feature_flag_has_experiment=K.metadata.has_experiment),de(K==null||(O=K.metadata)===null||O===void 0?void 0:O.version)||(ee.$feature_flag_version=K.metadata.version);const V=(I=K==null||(A=K.reason)===null||A===void 0?void 0:A.description)!==null&&I!==void 0?I:K==null||(M=K.reason)===null||M===void 0?void 0:M.code;V&&(ee.$feature_flag_reason=V),!(K==null||(L=K.metadata)===null||L===void 0)&&L.id&&(ee.$feature_flag_id=K.metadata.id),de(K==null?void 0:K.original_variant)&&de(K==null?void 0:K.original_enabled)||(ee.$feature_flag_original_response=de(K.original_variant)?K.original_enabled:K.original_variant),!(K==null||(z=K.metadata)===null||z===void 0)&&z.original_payload&&(ee.$feature_flag_original_payload=K==null||($=K.metadata)===null||$===void 0?void 0:$.original_payload),H.length&&(ee.$feature_flag_error=H.join(",")),this.Nv(ee)||(this.jv(t,o),this.Lv(t,o))}else d&&this.$t({[Go]:f,[Qh]:d})}return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:f3(i)}:void 0}Nv(t){try{var e;return((e=this.Fa)===null||e===void 0?void 0:e.capture("$feature_flag_called",t))!==!1}catch(n){return this.R.error("Failed to capture feature flag call",n),!0}}Lv(t,e){this.Wd.set(t,{value:e,context:this.Fv()})}Fv(){var t,e,n;return{distinctId:(t=this.Fa)===null||t===void 0?void 0:t.distinctId,groups:j({},(e=this.Fa)===null||e===void 0?void 0:e.groups),sessionId:this.Fr.deduplicateCallsPerSession?(n=this.Fa)===null||n===void 0||(n=n.session)===null||n===void 0?void 0:n.sessionId:void 0}}jv(t,e){const n=this.xv("$flag_call_reported")||{},r=n[t];Ue(r)&&r.includes(e)&&(n[t]=r.filter(s=>s!==e),this.$t({[Go]:n}))}getRemoteConfigPayload(t,e){this.qv(t,e)}qv(t,e){var n=this;return pn(function*(){const r=n.Fa;if(!r)return;const s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.Ev();i.length&&(s.evaluation_contexts=i);const o=n.Av();let l;de(o)||(s.flag_keys=o);try{var c;const d=(c=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Fr.compression,sentAt:"body",timeoutMs:n.Fr.requestTimeoutMs})).json)===null||c===void 0?void 0:c.featureFlagPayloads;l=(d==null?void 0:d[t])||void 0}catch(d){return void n.R.error("Remote config feature flag request failed",d)}try{e(l)}catch(d){n.R.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.Gd)return e.defaultValue;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return this.R.warn('isFeatureEnabled for key "'+t+M2),e.defaultValue;const n=this.getFeatureFlag(t,e);return de(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Rv(t,e,n)}Rv(t,e,n){if(!this.Fa)return;this.jd=!0;const r=((s,i={},o={},l={},c,d=bP)=>{const f=((C,P)=>{const R=C.flags;if(R){const O=Object.fromEntries(Object.keys(R).map(A=>{var M;return[A,(M=R[A].variant)!==null&&M!==void 0?M:R[A].enabled]})),I=Object.fromEntries(Object.keys(R).filter(A=>R[A].enabled).filter(A=>{var M;return!de((M=R[A].metadata)===null||M===void 0?void 0:M.payload)}).map(A=>{var M;return[A,(M=R[A].metadata)===null||M===void 0?void 0:M.payload]}));return j(j({},C),{},{featureFlags:O,featureFlagPayloads:I})}return C.featureFlags&&P.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),h=f.flags,m=f.featureFlags,v=f.featureFlagPayloads;if(!m)return;const y=s.requestId,_=s.evaluatedAt;if(Ue(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(m)for(let P=0;m.length>P;P++)C[m[P]]=!0;return{[Ha]:m,[yo]:C,[pp]:!1}}let b=m,x=v,k=h;if(c!=null&&c.partialResponse){const C=Object.keys(b),P=x||{};b=j(j({},i),b),x=j(j({},o),P),C.forEach(R=>{R in P||x==null||delete x[R]}),k=j(j({},l),k)}else if(s.errorsWhileComputingFlags)if(h){const C=new Set(Object.keys(h).filter(R=>{var O;return!(!((O=h[R])===null||O===void 0)&&O.failed)}));b=j(j({},i),Object.fromEntries(Object.entries(b).filter(([R])=>C.has(R))));const P=Object.fromEntries(Object.entries(x||{}).filter(([R])=>C.has(R)));x=j(j({},o),P),C.forEach(R=>{R in P||x==null||delete x[R]}),k=j(j({},l),Object.fromEntries(Object.entries(k||{}).filter(([R])=>C.has(R))))}else b=j(j({},i),b),x=j(j({},o),x),k=j(j({},l),k);return j(j({[Ha]:Object.keys(EP(b)),[yo]:b||{},[Wl]:x||{},[_u]:k||{},[pp]:s.minimalFlagCalledEvents===!0},y?{[wu]:y}:{}),_?{[Jl]:_}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.R);if(r)if((n==null?void 0:n.persist)===!1){const s=!de(this.Fa.kv.get(yo));this.$v=r,s||this.$t(r)}else this.pv(),this.Iv(r,t,!!(n!=null&&n.partialResponse)),this.$t(r);else e&&this.Cv();e||(this.Qd=!1),this.mv(e)}override(t,e=!1){this.R.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Bv(t)}Bv(t){if(this.Fa){if(t===!1)return this.Dt([Ho,nu]),this.mv(),void Bc.info("All overrides cleared");if(Ue(t))return this.$t({[Ho]:kP(t)}),this.mv(),void Bc.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.Pd=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[Ho]=Ue(s)?kP(s):s),i&&(r[nu]=i),Object.keys(r).length&&this.$t(r),s===!1&&i===!1?this.Dt([Ho,nu]):s===!1?this.Dt(Ho):i===!1&&this.Dt(nu),this.mv(),s===!1?Bc.info("Flag overrides cleared"):s&&Bc.info("Flag overrides set",{flags:s}),void(i===!1?Bc.info("Payload overrides cleared"):i&&Bc.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.$t({[Ho]:t}),this.mv(),void Bc.info("Flag overrides set",{flags:t});this.R.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.R.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.jd){const{flags:e,flagVariants:n}=this.zv();try{t(e,n)}catch(r){this.R.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r;const s=(this.xv("$early_access_features")||[]).find(d=>d.flagKey===t),i={[`$feature_enrollment/${t}`]:e},o={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const l=j(j({},this.getFlagVariants()),{},{[t]:e});(r=this.ov)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.$t({[Ha]:Object.keys(EP(l)),[yo]:l,[Zl]:j(j({},this.xv("$stored_person_properties")||{}),i)}),this.mv();try{var c;(c=this.Fa)===null||c===void 0||c.capture("$feature_enrollment_update",o)}catch(d){this.R.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e=!1,n){const r=this.xv(pb);!r||e?this.Hv(t,n):t(r)}Hv(t,e){var n=this;return pn(function*(){const r=n.Fa;if(!r)return;const s=e?`&${e.map(o=>`stage=${o}`).join("&")}`:"";let i;try{const o=yield r.sendRequest(`/api/early_access_features/?token=${r.projectToken}${s}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i=o.json.earlyAccessFeatures,n.$t({[pb]:i})}catch(o){return void n.R.error("Early access feature request failed",o)}try{t(i)}catch(o){n.R.error("Early access feature callback failed",o)}})()}zv(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,r)=>(n[r]=e[r],n),{})}}mv(t){this.gv();const{flags:e,flagVariants:n}=this.zv(),r=this.Ud;this.Ud=!0,this.featureFlagEventHandlers.forEach(s=>{try{s(e,n,{errorsLoading:t})}catch(i){this.R.error("Error while running feature flags callback",i)}}),this.Ud=r}setPersonPropertiesForFlags(t,e=!0){this.Uv(t,e)}Uv(t,e=!0){const n=this.xv("$stored_person_properties")||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.$t({[Zl]:j(j(j({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=j({},this.xv("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.$t({[Zl]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Dt(Zl),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.xv("$stored_group_properties")||{},r=j({},n);for(const s of Object.keys(t))r[s]=j(j({},n[s]),t[s]);this.$t({[Bl]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.xv("$stored_group_properties")||{};this.$t({[Bl]:j(j({},e),{},{[t]:{}})})}else this.Dt(Bl)}reset(){this.Bd++,this.wv(this.Ld,"cancelled"),this.wv(this.Nd,"cancelled"),this.Hd=!1,this.Od={},this.Fd={},this.$v=void 0,this.jd=!1,this.zd=!1,this.Gd=!1,this.$anon_distinct_id=void 0,this.Sv(),this.Pd=!1,this.Jd=0,this.Wd=new Map}};const CP=An("[FeatureFlags]");var aW=class{constructor(t,e=!1){this.Wv=!1,this.update(t,e)}update(t,e){this.Vv=((n,r)=>{var s,i,o,l,c,d,f,h;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(c=n.remote_config_refresh_interval_ms)!==null&&c!==void 0?c:3e5,idleRefreshBackoff:de(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(d=n.feature_flag_request_max_retries)!==null&&d!==void 0?d:1),compression:n.disable_compression?void 0:"best-available",evaluationContexts:(f=(h=n.evaluation_contexts)!==null&&h!==void 0?h:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:Ue(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Wv||(CP.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Wv=!0),de(t.flag_keys)||Ue(t.flag_keys)||CP.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Vv}},ng=class extends oW{constructor(t){const e=new aW(t.config,t.lc());super(e),this.name=wM,this._instance=t,this.Gv=e}get ov(){return this._instance.persistence}updateConfig(t,e){this.Gv.update(t,e),this.av()}};const PP=t=>Wf(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),co=An("[Error tracking]"),Nb="webkit-masked-url:",lW=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],cW=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Nb],uW=["__firefox__","__gCrWeb"];function TP(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function dW(t,e){return(function(n){if(Array.isArray(n))return n})(t)||(function(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var i,o,l,c,d=[],f=!0,h=!1;try{if(l=(s=s.call(n)).next,r!==0)for(;!(f=(i=l.call(s)).done)&&(d.push(i.value),d.length!==r);f=!0);}catch(m){h=!0,o=m}finally{try{if(!f&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(h)throw o}}return d}})(t,e)||(function(n,r){if(n){if(typeof n=="string")return TP(n,r);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?TP(n,r):void 0}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}const SM=Object.entries,RP=Object.setPrototypeOf,fW=Object.isFrozen,hW=Object.getPrototypeOf,pW=Object.getOwnPropertyDescriptor;let Jr=Object.freeze,ns=Object.seal,Od=Object.create,kM=typeof Reflect<"u"&&Reflect,Lb=kM.apply,Db=kM.construct;Jr||(Jr=function(t){return t}),ns||(ns=function(t){return t}),Lb||(Lb=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;n>s;s++)r[s-2]=arguments[s];return t.apply(e,r)}),Db||(Db=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return new t(...n)});const Ed=Sr([].forEach),mW=Sr([].lastIndexOf),AP=Sr([].pop),Cd=Sr([].push),gW=Sr([].splice),Nl=Array.isArray,np=Sr("".toLowerCase),N2=Sr("".toString),IP=Sr("".match),Uh=Sr("".replace),OP=Sr("".indexOf),vW=Sr("".trim),yW=Sr(0 .toString),_W=Sr(Boolean.prototype.toString),MP=typeof BigInt>"u"?null:Sr(BigInt.prototype.toString),NP=typeof Symbol>"u"?null:Sr(Symbol.prototype.toString),Hr=Sr({}.hasOwnProperty),rg=Sr({}.toString),zr=Sr(/t/.test),Zc=(LP=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return Db(LP,e)});var LP;function Sr(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];return Lb(t,e,r)}}function Zt(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:np;if(RP&&RP(t,null),!Nl(e))return t;let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const i=n(s);i!==s&&(fW(e)||(e[r]=i),s=i)}t[s]=!0}return t}function wW(t){for(let e=0;t.length>e;e++)Hr(t,e)||(t[e]=null);return t}function fs(t){const e=Od(null);for(const r of SM(t)){var n=dW(r,2);const s=n[0],i=n[1];Hr(t,s)&&(e[s]=Nl(i)?wW(i):i&&typeof i=="object"&&i.constructor===Object?fs(i):i)}return e}function uo(t,e){for(;t!==null;){const n=pW(t,e);if(n){if(n.get)return Sr(n.get);if(typeof n.value=="function")return Sr(n.value)}t=hW(t)}return function(){return null}}const DP=Jr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),L2=Jr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),D2=Jr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),bW=Jr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),$2=Jr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),xW=Jr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$P=Jr(["#text"]),FP=Jr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),F2=Jr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),jP=Jr(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),sg=Jr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),SW=ns(/{{[\w\W]*|^[\w\W]*}}/g),kW=ns(/<%[\w\W]*|^[\w\W]*%>/g),EW=ns(/\${[\w\W]*/g),CW=ns(/^data-[\-\w.\u00B7-\uFFFF]+$/),PW=ns(/^aria-[\-\w]+$/),zP=ns(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),TW=ns(/^(?:\w+script|data):/i),RW=ns(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),AW=ns(/^html$/i),IW=ns(/^[a-z][.\w]*(-[.\w]+)+$/i),VP=ns(/<[/\w!]/g),HP=ns(/<[/\w]/g),OW=ns(/<\/no(script|embed|frames)/i),MW=ns(/\/>/i),NW=function(){return typeof window>"u"?null:window},Pl=function(t,e,n,r){return Hr(t,e)&&Nl(t[e])?Zt(r.base?fs(r.base):{},t[e],r.transform):n};var LW=(function t(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:NW();const n=F=>t(F);if(n.version="3.4.13",n.removed=[],!e||!e.document||e.document.nodeType!==9||!e.Element)return n.isSupported=!1,n;let r=e.document;const s=r,i=s.currentScript,o=e.HTMLTemplateElement,l=e.Node,c=e.NodeFilter,d=e.DOMParser,f=e.trustedTypes,h=e.Element.prototype,m=uo(h,"cloneNode"),v=uo(h,"remove"),y=uo(h,"nextSibling"),_=uo(h,"childNodes"),b=uo(h,"parentNode"),x=uo(h,"shadowRoot"),k=uo(h,"attributes"),C=l&&l.prototype?uo(l.prototype,"nodeType"):null,P=l&&l.prototype?uo(l.prototype,"nodeName"):null,R=l&&l.prototype?uo(l.prototype,"ownerDocument"):null;if(typeof o=="function"){const F=r.createElement("template");F.content&&F.content.ownerDocument&&(r=F.content.ownerDocument)}let O,I,A="",M=!1,L=0;const z=function(){if(L>0)throw Zc('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},$=function(F){z(),L++;try{return O.createHTML(F)}finally{L--}},q=r.implementation,X=r.createNodeIterator,K=r.createDocumentFragment,H=r.getElementsByTagName,ee=s.importNode;let V={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported=typeof SM=="function"&&typeof b=="function"&&q&&q.createHTMLDocument!==void 0;const Q=SW,B=kW,D=EW,G=CW,fe=PW,ie=TW,ue=RW,he=IW;let _e=zP,le=null;const ne=Zt({},[...DP,...L2,...D2,...$2,...$P]);let be=null;const Ve=Zt({},[...FP,...F2,...jP,...sg]);let De=Object.seal(Od(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$e=null,Ut=null;const nn=Object.seal(Od(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let kt=!0,Dt=!0,un=!1,qt=!0,Ne=!1,Je=!0,Re=!1,Ct=!1,Se=null,$t=null,ht=!1,mt=!1,tr=!1,Oi=!1,Pn=!0,lr=!1;const to="user-content-";let bs=!0,rs=!1,nr={},vn=null;const ss=Zt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let pr=null;const Co=Zt({},["audio","video","img","source","image","track"]);let Wr=null;const rr=Zt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Nr="http://www.w3.org/1998/Math/MathML",ai="http://www.w3.org/2000/svg",cr="http://www.w3.org/1999/xhtml";let xs=cr,it=!1,cn=null;const rn=Zt({},[Nr,ai,cr],N2),yn=Jr(["mi","mo","mn","ms","mtext"]);let Tn=Zt({},yn);const Gt=Jr(["annotation-xml"]);let $n=Zt({},Gt);const is=Zt({},["title","style","font","a","script"]);let sr=null;const kr=["application/xhtml+xml","text/html"];let Bt=null,Mi=null;const rh=r.createElement("form"),ol=function(F){return F instanceof RegExp||F instanceof Function},Po=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Mi&&Mi===F)return;F&&typeof F=="object"||(F={}),F=fs(F),sr=kr.indexOf(F.PARSER_MEDIA_TYPE)===-1?"text/html":F.PARSER_MEDIA_TYPE,Bt=sr==="application/xhtml+xml"?N2:np,le=Pl(F,"ALLOWED_TAGS",ne,{transform:Bt}),be=Pl(F,"ALLOWED_ATTR",Ve,{transform:Bt}),cn=Pl(F,"ALLOWED_NAMESPACES",rn,{transform:N2}),Wr=Pl(F,"ADD_URI_SAFE_ATTR",rr,{transform:Bt,base:rr}),pr=Pl(F,"ADD_DATA_URI_TAGS",Co,{transform:Bt,base:Co}),vn=Pl(F,"FORBID_CONTENTS",ss,{transform:Bt}),$e=Pl(F,"FORBID_TAGS",fs({}),{transform:Bt}),Ut=Pl(F,"FORBID_ATTR",fs({}),{transform:Bt}),nr=!!Hr(F,"USE_PROFILES")&&(F.USE_PROFILES&&typeof F.USE_PROFILES=="object"?fs(F.USE_PROFILES):F.USE_PROFILES),kt=F.ALLOW_ARIA_ATTR!==!1,Dt=F.ALLOW_DATA_ATTR!==!1,un=F.ALLOW_UNKNOWN_PROTOCOLS||!1,qt=F.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=F.SAFE_FOR_TEMPLATES||!1,Je=F.SAFE_FOR_XML!==!1,Re=F.WHOLE_DOCUMENT||!1,mt=F.RETURN_DOM||!1,tr=F.RETURN_DOM_FRAGMENT||!1,Oi=F.RETURN_TRUSTED_TYPE||!1,ht=F.FORCE_BODY||!1,Pn=F.SANITIZE_DOM!==!1,lr=F.SANITIZE_NAMED_PROPS||!1,bs=F.KEEP_CONTENT!==!1,rs=F.IN_PLACE||!1,_e=(function(ge){try{return zr(ge,""),!0}catch{return!1}})(F.ALLOWED_URI_REGEXP)?F.ALLOWED_URI_REGEXP:zP,xs=typeof F.NAMESPACE=="string"?F.NAMESPACE:cr,Tn=Hr(F,"MATHML_TEXT_INTEGRATION_POINTS")&&F.MATHML_TEXT_INTEGRATION_POINTS&&typeof F.MATHML_TEXT_INTEGRATION_POINTS=="object"?fs(F.MATHML_TEXT_INTEGRATION_POINTS):Zt({},yn),$n=Hr(F,"HTML_INTEGRATION_POINTS")&&F.HTML_INTEGRATION_POINTS&&typeof F.HTML_INTEGRATION_POINTS=="object"?fs(F.HTML_INTEGRATION_POINTS):Zt({},Gt);const pe=Hr(F,"CUSTOM_ELEMENT_HANDLING")&&F.CUSTOM_ELEMENT_HANDLING&&typeof F.CUSTOM_ELEMENT_HANDLING=="object"?fs(F.CUSTOM_ELEMENT_HANDLING):Od(null);if(De=Od(null),Hr(pe,"tagNameCheck")&&ol(pe.tagNameCheck)&&(De.tagNameCheck=pe.tagNameCheck),Hr(pe,"attributeNameCheck")&&ol(pe.attributeNameCheck)&&(De.attributeNameCheck=pe.attributeNameCheck),Hr(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(De.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),ns(De),Ne&&(Dt=!1),tr&&(mt=!0),nr&&(le=Zt({},$P),be=Od(null),nr.html===!0&&(Zt(le,DP),Zt(be,FP)),nr.svg===!0&&(Zt(le,L2),Zt(be,F2),Zt(be,sg)),nr.svgFilters===!0&&(Zt(le,D2),Zt(be,F2),Zt(be,sg)),nr.mathMl===!0&&(Zt(le,$2),Zt(be,jP),Zt(be,sg))),nn.tagCheck=null,nn.attributeCheck=null,Hr(F,"ADD_TAGS")&&(typeof F.ADD_TAGS=="function"?nn.tagCheck=F.ADD_TAGS:Nl(F.ADD_TAGS)&&(le===ne&&(le=fs(le)),Zt(le,F.ADD_TAGS,Bt))),Hr(F,"ADD_ATTR")&&(typeof F.ADD_ATTR=="function"?nn.attributeCheck=F.ADD_ATTR:Nl(F.ADD_ATTR)&&(be===Ve&&(be=fs(be)),Zt(be,F.ADD_ATTR,Bt))),Hr(F,"ADD_URI_SAFE_ATTR")&&Nl(F.ADD_URI_SAFE_ATTR)&&Zt(Wr,F.ADD_URI_SAFE_ATTR,Bt),Hr(F,"FORBID_CONTENTS")&&Nl(F.FORBID_CONTENTS)&&(vn===ss&&(vn=fs(vn)),Zt(vn,F.FORBID_CONTENTS,Bt)),Hr(F,"ADD_FORBID_CONTENTS")&&Nl(F.ADD_FORBID_CONTENTS)&&(vn===ss&&(vn=fs(vn)),Zt(vn,F.ADD_FORBID_CONTENTS,Bt)),bs&&(le["#text"]=!0),Re&&Zt(le,["html","head","body"]),le.table&&(Zt(le,["tbody"]),delete $e.tbody),F.TRUSTED_TYPES_POLICY){if(typeof F.TRUSTED_TYPES_POLICY.createHTML!="function")throw Zc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof F.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Zc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ge=O;O=F.TRUSTED_TYPES_POLICY;try{A=$("")}catch(ke){throw O=ge,ke}}else F.TRUSTED_TYPES_POLICY===null?(O=void 0,A=""):(O===void 0&&(M||(I=(function(ge,ke){if(typeof ge!="object"||typeof ge.createPolicy!="function")return null;let We=null;const _t="data-tt-policy-suffix";ke&&ke.hasAttribute(_t)&&(We=ke.getAttribute(_t));const gt="dompurify"+(We?"#"+We:"");try{return ge.createPolicy(gt,{createHTML:jt=>jt,createScriptURL:jt=>jt})}catch{return console.warn("TrustedTypes policy "+gt+" could not be created."),null}})(f,i),M=!0),O=I),O&&typeof A=="string"&&(A=$("")));Jr&&Jr(F),Mi=F},Lr=Zt({},[...L2,...D2,...bW]),Ni=Zt({},[...$2,...xW]),Ls=function(F){Cd(n.removed,{element:F});try{b(F).removeChild(F)}catch{if(v(F),!b(F))throw Zc("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},no=function(F){li(F);const pe=_(F);if(pe){const ke=[];Ed(pe,We=>{Cd(ke,We)}),Ed(ke,We=>{try{v(We)}catch{}})}const ge=k(F);if(ge)for(let ke=ge.length-1;ke>=0;--ke){const We=ge[ke],_t=We&&We.name;if(typeof _t=="string")try{F.removeAttribute(_t)}catch{}}},Ds=function(F,pe){try{Cd(n.removed,{attribute:pe.getAttributeNode(F),from:pe})}catch{Cd(n.removed,{attribute:null,from:pe})}if(pe.removeAttribute(F),F==="is")if(mt||tr)try{Ls(pe)}catch{}else try{pe.setAttribute(F,"")}catch{}},al=function(F){const pe=k(F);if(pe)for(let ge=pe.length-1;ge>=0;--ge){const ke=pe[ge],We=ke&&ke.name;if(typeof We=="string"&&!be[Bt(We)])try{F.removeAttribute(We)}catch{}}},li=function(F){const pe=[F];for(;pe.length>0;){const ge=pe.pop();(C?C(ge):ge.nodeType)===1&&al(ge);const ke=_(ge);if(ke)for(let We=ke.length-1;We>=0;--We)pe.push(ke[We])}},Cc=function(F){let pe=null,ge=null;if(ht)F="<remove></remove>"+F;else{const _t=IP(F,/^[\r\n\t ]+/);ge=_t&&_t[0]}sr==="application/xhtml+xml"&&xs===cr&&(F='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+F+"</body></html>");const ke=O?$(F):F;if(xs===cr)try{pe=new d().parseFromString(ke,sr)}catch{}if(!pe||!pe.documentElement){pe=q.createDocument(xs,"template",null);try{pe.documentElement.innerHTML=it?A:ke}catch{}}const We=pe.body||pe.documentElement;return F&&ge&&We.insertBefore(r.createTextNode(ge),We.childNodes[0]||null),xs===cr?H.call(pe,Re?"html":"body")[0]:Re?pe.documentElement:We},Uu=function(F){const pe=R?R(F):F.ownerDocument;return X.call(pe||F,F,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ll=function(F){return F=Uh(F,Q," "),F=Uh(F,B," "),Uh(F,D," ")},dn=function(F){var pe;F.normalize();const ge=R?R(F):F.ownerDocument,ke=X.call(ge||F,F,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let We=ke.nextNode();for(;We;)We.data=ll(We.data),We=ke.nextNode();const _t=(pe=F.querySelectorAll)===null||pe===void 0?void 0:pe.call(F,"template");_t&&Ed(_t,gt=>{ci(gt.content)&&dn(gt.content)})},To=function(F){const pe=P?P(F):null;return typeof pe=="string"&&Bt(pe)==="form"&&(typeof F.nodeName!="string"||typeof F.textContent!="string"||typeof F.removeChild!="function"||F.attributes!==k(F)||typeof F.removeAttribute!="function"||typeof F.setAttribute!="function"||typeof F.namespaceURI!="string"||typeof F.insertBefore!="function"||typeof F.hasChildNodes!="function"||F.nodeType!==C(F)||F.childNodes!==_(F))},ci=function(F){if(!C||typeof F!="object"||F===null)return!1;try{return C(F)===11}catch{return!1}},Ro=function(F){if(!C||typeof F!="object"||F===null)return!1;try{return typeof C(F)=="number"}catch{return!1}};function Kr(F,pe,ge){F.length!==0&&Ed(F,ke=>{ke.call(n,pe,ge,Mi)})}const Pc=function(F,pe,ge,ke){return F.length===0?pe:pe===ge||pe===ke?fs(pe):pe},Tc=function(F,pe){if(Kr(V.beforeSanitizeElements,F,null),F!==pe&&b(F)===null)return rs&&li(F),!0;if(To(F))return Ls(F),!0;const ge=Bt(P?P(F):F.nodeName);if(le=Pc(V.uponSanitizeElement,le,ne,Se),Kr(V.uponSanitizeElement,F,{tagName:ge,allowedTags:le}),F!==pe&&b(F)===null)return rs&&li(F),!0;if((function(ke,We){return!!(Je&&ke.hasChildNodes()&&!Ro(ke.firstElementChild)&&zr(VP,ke.textContent)&&zr(VP,ke.innerHTML))||!(!Je||ke.namespaceURI!==cr||We!=="style"||!Ro(ke.firstElementChild))||ke.nodeType===7||!(!Je||ke.nodeType!==8||!zr(HP,ke.data))})(F,ge))return Ls(F),!0;if($e[ge]||!(nn.tagCheck instanceof Function&&nn.tagCheck(ge))&&!le[ge]){const ke=(function(We,_t,gt){if(!$e[_t]&&Bu(_t)&&(De.tagNameCheck instanceof RegExp&&zr(De.tagNameCheck,_t)||De.tagNameCheck instanceof Function&&De.tagNameCheck(_t)))return!1;if(bs&&!vn[_t]){const jt=b(We),Jt=_(We);if(Jt&&jt)for(let wt=Jt.length-1;wt>=0;--wt){const Fn=We===gt?m(Jt[wt],!0):Jt[wt];jt.insertBefore(Fn,y(We))}}return Ls(We),!0})(F,ge,pe);return ke===!1&&Kr(V.afterSanitizeElements,F,null),ke}if((C?C(F):F.nodeType)===1&&!(function(ke){let We=b(ke);We&&We.tagName||(We={namespaceURI:xs,tagName:"template"});const _t=np(ke.tagName),gt=np(We.tagName);return!!cn[ke.namespaceURI]&&(ke.namespaceURI===ai?(function(jt,Jt,wt){return Jt.namespaceURI===cr?jt==="svg":Jt.namespaceURI===Nr?jt==="svg"&&(wt==="annotation-xml"||Tn[wt]):!!Lr[jt]})(_t,We,gt):ke.namespaceURI===Nr?(function(jt,Jt,wt){return Jt.namespaceURI===cr?jt==="math":Jt.namespaceURI===ai?jt==="math"&&$n[wt]:!!Ni[jt]})(_t,We,gt):ke.namespaceURI===cr?(function(jt,Jt,wt){return!(Jt.namespaceURI===ai&&!$n[wt])&&!(Jt.namespaceURI===Nr&&!Tn[wt])&&!Ni[jt]&&(is[jt]||!Lr[jt])})(_t,We,gt):!(sr!=="application/xhtml+xml"||!cn[ke.namespaceURI]))})(F)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&zr(OW,F.innerHTML))return Ls(F),!0;if(Ne&&F.nodeType===3){const ke=ll(F.textContent);F.textContent!==ke&&(Cd(n.removed,{element:F.cloneNode()}),F.textContent=ke)}return Kr(V.afterSanitizeElements,F,null),!1},ga=function(F,pe,ge){if(Ut[pe]||Je&&pe==="patchsrc"||Je&&pe==="for"&&F!=="label"&&F!=="output"||Pn&&(pe==="id"||pe==="name")&&(ge in r||ge in rh))return!1;const ke=be[pe]||nn.attributeCheck instanceof Function&&nn.attributeCheck(pe,F);if(!(Dt&&zr(G,pe))){if(!(kt&&zr(fe,pe))){if(ke){if(!Wr[pe]){if(!zr(_e,Uh(ge,ue,""))){if((pe!=="src"&&pe!=="xlink:href"&&pe!=="href"||F==="script"||OP(ge,"data:")!==0||!pr[F])&&!(un&&!zr(ie,Uh(ge,ue,"")))){if(ge)return!1}}}}else if(!(Bu(F)&&(De.tagNameCheck instanceof RegExp&&zr(De.tagNameCheck,F)||De.tagNameCheck instanceof Function&&De.tagNameCheck(F))&&(De.attributeNameCheck instanceof RegExp&&zr(De.attributeNameCheck,pe)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(pe,F))||pe==="is"&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&zr(De.tagNameCheck,ge)||De.tagNameCheck instanceof Function&&De.tagNameCheck(ge))))return!1}}return!0},os=Zt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Bu=function(F){return!os[np(F)]&&zr(he,F)},Ss=function(F,pe,ge,ke){if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ge)switch(f.getAttributeType(F,pe)){case"TrustedHTML":return $(ke);case"TrustedScriptURL":return(function(We){z(),L++;try{return O.createScriptURL(We)}finally{L--}})(ke)}return ke},sh=function(F,pe,ge,ke){try{ge?F.setAttributeNS(ge,pe,ke):F.setAttribute(pe,ke),To(F)?Ls(F):AP(n.removed)}catch{Ds(pe,F)}},Zu=function(F){Kr(V.beforeSanitizeAttributes,F,null);const pe=F.attributes;if(!pe||To(F))return;be=Pc(V.uponSanitizeAttribute,be,Ve,$t);const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:be,forceKeepAttr:void 0};let ke=pe.length;const We=Bt(F.nodeName);for(;ke--;){const _t=pe[ke],gt=_t.name,jt=_t.namespaceURI,Jt=_t.value,wt=Bt(gt),Fn=Jt;let ot=gt==="value"?Fn:vW(Fn);ge.attrName=wt,ge.attrValue=ot,ge.keepAttr=!0,ge.forceKeepAttr=void 0,Kr(V.uponSanitizeAttribute,F,ge),ot=ge.attrValue,!lr||wt!=="id"&&wt!=="name"||OP(ot,to)===0||(Ds(gt,F),ot=to+ot),Je&&zr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ot)||wt==="attributename"&&IP(ot,"href")?Ds(gt,F):ge.forceKeepAttr||(!ge.keepAttr||!qt&&zr(MW,ot)?Ds(gt,F):(Ne&&(ot=ll(ot)),ga(We,wt,ot)?(ot=Ss(We,wt,jt,ot),ot!==Fn&&sh(F,gt,jt,ot)):Ds(gt,F)))}Kr(V.afterSanitizeAttributes,F,null)},Ao=function(F){let pe=null;const ge=Uu(F);for(Kr(V.beforeSanitizeShadowDOM,F,null);pe=ge.nextNode();)if(Kr(V.uponSanitizeShadowNode,pe,null),Tc(pe,F),Zu(pe),ci(pe.content)&&Ao(pe.content),(C?C(pe):pe.nodeType)===1){const ke=x(pe);ci(ke)&&(Io(ke),Ao(ke))}Kr(V.afterSanitizeShadowDOM,F,null)},Io=function(F){const pe=[{node:F,shadow:null}];for(;pe.length>0;){const ge=pe.pop();if(ge.shadow){Ao(ge.shadow);continue}const ke=ge.node,We=(C?C(ke):ke.nodeType)===1,_t=_(ke);if(_t)for(let gt=_t.length-1;gt>=0;--gt)pe.push({node:_t[gt],shadow:null});if(We){const gt=P?P(ke):null;if(typeof gt=="string"&&Bt(gt)==="template"){const jt=ke.content;ci(jt)&&pe.push({node:jt,shadow:null})}}if(We){const gt=x(ke);ci(gt)&&pe.push({node:null,shadow:gt},{node:gt,shadow:null})}}};return n.sanitize=function(F){let pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,ke=null,We=null,_t=null;if(it=!F,it&&(F="<!-->"),typeof F!="string"&&!Ro(F)&&typeof(F=(function(wt){switch(typeof wt){case"string":return wt;case"number":return yW(wt);case"boolean":return _W(wt);case"bigint":return MP?MP(wt):"0";case"symbol":return NP?NP(wt):"Symbol()";case"undefined":default:return rg(wt);case"function":case"object":{if(wt===null)return rg(wt);const Fn=wt,ot=uo(Fn,"toString");if(typeof ot=="function"){const Dr=ot(Fn);return typeof Dr=="string"?Dr:rg(Dr)}return rg(wt)}}})(F))!="string")throw Zc("dirty is not a string, aborting");if(!n.isSupported)return F;Ct?(le=Se,be=$t):Po(pe),(V.uponSanitizeElement.length>0||V.uponSanitizeAttribute.length>0)&&(le=fs(le)),V.uponSanitizeAttribute.length>0&&(be=fs(be)),n.removed=[];const gt=rs&&typeof F!="string"&&Ro(F);if(gt){(function(Fn){if(!Je)return;const ot=[Fn];for(;ot.length>0;){const Dr=ot.pop(),cl=C?C(Dr):Dr.nodeType;if(cl===7||cl===8&&zr(HP,Dr.data)){try{v(Dr)}catch{}continue}if(cl===1){const Er=Dr,va=Bt(P?P(Dr):Dr.nodeName);try{Er.hasAttribute&&Er.hasAttribute("patchsrc")&&Er.removeAttribute("patchsrc"),Er.hasAttribute&&Er.hasAttribute("for")&&va!=="label"&&va!=="output"&&Er.removeAttribute("for")}catch{}}const Oo=_(Dr);if(Oo)for(let Er=Oo.length-1;Er>=0;--Er)ot.push(Oo[Er])}})(F);const wt=P?P(F):F.nodeName;if(typeof wt=="string"){const Fn=Bt(wt);if(!le[Fn]||$e[Fn])throw no(F),Zc("root node is forbidden and cannot be sanitized in-place")}if(To(F))throw no(F),Zc("root node is clobbered and cannot be sanitized in-place");try{Io(F)}catch(Fn){throw no(F),Fn}}else if(Ro(F))ge=Cc("<!---->"),ke=ge.ownerDocument.importNode(F,!0),ke.nodeType===1&&ke.nodeName==="BODY"||ke.nodeName==="HTML"?ge=ke:ge.appendChild(ke),Io(ke);else{if(!mt&&!Ne&&!Re&&F.indexOf("<")===-1)return O&&Oi?$(F):F;if(ge=Cc(F),!ge)return mt?null:Oi?A:""}ge&&ht&&Ls(ge.firstChild);const jt=gt?F:ge;try{const wt=Uu(jt);for(;We=wt.nextNode();)Tc(We,jt),Zu(We),ci(We.content)&&Ao(We.content)}catch(wt){throw gt&&(no(F),Ed(n.removed,Fn=>{Fn.element&&li(Fn.element)})),wt}if(gt)return Ed(n.removed,wt=>{wt.element&&li(wt.element)}),Ne&&dn(F),F;if(mt){if(Ne&&dn(ge),tr)for(_t=K.call(ge.ownerDocument);ge.firstChild;)_t.appendChild(ge.firstChild);else _t=ge;return(be.shadowroot||be.shadowrootmode)&&(_t=ee.call(s,_t,!0)),_t}let Jt=Re?ge.outerHTML:ge.innerHTML;return Re&&le["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&zr(AW,ge.ownerDocument.doctype.name)&&(Jt="<!DOCTYPE "+ge.ownerDocument.doctype.name+`>
20
- `+Jt),Ne&&(Jt=ll(Jt)),O&&Oi?$(Jt):Jt},n.setConfig=function(){Po(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Ct=!0,Se=le,$t=be},n.clearConfig=function(){Mi=null,Ct=!1,Se=null,$t=null,O=I,A=""},n.isValidAttribute=function(F,pe,ge){Mi||Po({});const ke=Bt(F),We=Bt(pe);return ga(ke,We,ge)},n.addHook=function(F,pe){typeof pe=="function"&&Hr(V,F)&&Cd(V[F],pe)},n.removeHook=function(F,pe){if(Hr(V,F)){if(pe!==void 0){const ge=mW(V[F],pe);return ge===-1?void 0:gW(V[F],ge,1)[0]}return AP(V[F])}},n.removeHooks=function(F){Hr(V,F)&&(V[F]=[])},n.removeAllHooks=function(){V={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n})();const UP="Refusing to render web experiment since the viewer is a likely bot",BP={ADD_ATTR:(t,e)=>t==="target"&&e==="a"||t==="form"&&/^(button|fieldset|input|output|select|textarea)$/.test(e),ADD_URI_SAFE_ATTR:["form"]};let ZP;const DW={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Lv(e,t),not_regex:(t,e)=>!Lv(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Hi=An("[Conversations]"),Wc="Conversations not available yet.";function WP(t,e){var n,r,s,i,o,l,c;const d=(n=t==null?void 0:t.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=t==null?void 0:t.maxBufferSize)!==null&&r!==void 0?r:100,h=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,m=de(h)?Math.max(f,2048):Math.max(f,h),v=j(j({},(function(){let y="",_="";try{var b;const x="u">typeof globalThis?globalThis:"u">typeof window?window:void 0,k=x==null||(b=x.navigator)===null||b===void 0?void 0:b.userAgent;k&&([y,_]=A5(k))}catch{}return(function(x,k){const C=(function(P){if(P)return{}.hasOwnProperty.call(_3,P)?_3[P]:P})(x);return j(j({},C?{"os.name":C}:{}),k?{"os.version":k}:{})})(y,_)})()),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:t==null?void 0:t.serviceName)!==null&&i!==void 0?i:e==null?void 0:e.serviceNameDefault,serviceVersion:(l=v==null?void 0:v["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(c=v==null?void 0:v["deployment.environment"])!==null&&c!==void 0?c:t==null?void 0:t.environment,resourceAttributes:v,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:m,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const $W=["debug","log","warn","error","info"],FW=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},KP="console",EM="__posthogHandledLogsRequestError",j2=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[EM]=!0,n},qP=t=>!!t&&typeof t=="object"&&t[EM]===!0;var jW=class{get Qv(){return j(j({},this.R),{},{error:(...t)=>{t.some(qP)||this.R.error(...t)}})}constructor(t,e){var n;this.Na=t,this.Jv=e,this.name="logs",this.Zv=!1,this.Kv=!1,this.Yv=!1,this.R=An("[logs]"),this.cc=[],this.Xv=[],this.Jd=0,this.tf=!1,this.Ti=!1,this.ef=[],this.if=[],this.nf=!1,this.sf=!1,this.rf=!1,this.af=()=>{var r,s;this.Ti||(this.Jd=0,(r=this.lf)===null||r===void 0||r.onReconnect(),(s=this.uf)===null||s===void 0||s.onReconnect())},this.Zv=!!(!((n=t.get())===null||n===void 0)&&n.captureConsoleLogs)}get cf(){return!0}hf(){}df(){if(!this.rf){try{this.uv=typeof window>"u"?void 0:window}catch{this.uv=void 0}this.uv&&(Lt(this.uv,"online",this.af),this.rf=!0)}}vf(t,e,n,r){this.df();const s=WP(this.Na.get(),n);return[new tB(this.ff(t,e),s,this.Qv,()=>this.Jv(),i=>i(),void 0,r),s]}pf(){const t=this.Na.get();var e;return this.lf&&this.gf===t||((e=this.lf)===null||e===void 0||e.reset(),this.gf=t,[this.lf,this.mf]=this.vf(()=>this.cc,n=>{this.cc=n})),this.lf}yf(){const t=this.Na.get();var e;return this.uf&&this.bf===t||((e=this.uf)===null||e===void 0||e.reset(),this.bf=t,[this.uf,this._f]=this.vf(()=>this.Xv,n=>{this.Xv=n},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},KP)),this.uf}setup(t){if(!this.Ti&&!this.tf)return this.tf=!0,this.Fa=t,this.R=t.logger.createLogger("[logs]"),ck(t.kv.initialize(),()=>{this.Ti||this.hv(t)})}hv(t){var e;this.df(),!((e=this.Na.get())===null||e===void 0)&&e.captureConsoleLogs&&(this.Zv=!0),(this.Zv||this.Na.remoteConfigWillArrive&&t.kv.get(this.Na.captureHintKey))&&this.wf();let n=!1;const r=t.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.Ti?r.dispose():(this.Za=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r,s,i,o;this.Ti||(this.Ti=!0,this.kf(),(t=this.Za)===null||t===void 0||t.dispose(),this.Za=void 0,this.Fa=void 0,this.Yv=!1,(e=this.uv)===null||e===void 0||e.removeEventListener("online",this.af),(n=this.Sf)===null||n===void 0||n.call(this),this.Sf=void 0,(r=this.lf)===null||r===void 0||r.clearQueue(),(s=this.uf)===null||s===void 0||s.clearQueue(),(i=this.lf)===null||i===void 0||i.reset(),(o=this.uf)===null||o===void 0||o.reset())}onRemoteConfig(t){var e,n;if(this.Ti)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;at(r)?this.xf():((n=this.Fa)===null||n===void 0||n.kv.set(this.Na.captureHintKey,!!r),r?(this.Zv=!0,this.Kv||this.wf(),this.loadIfEnabled()):this.xf())}reset(){var t,e,n,r;this.kf(),(t=this.lf)===null||t===void 0||t.clearQueue(),this.cc=[],(e=this.lf)===null||e===void 0||e.reset(),(n=this.uf)===null||n===void 0||n.clearQueue(),this.Xv=[],(r=this.uf)===null||r===void 0||r.reset(),this.Jd=0}captureLog(t){!this.Ti&&this.Fa&&this.pf().captureLog(t)}captureConsoleLog(t){!this.Ti&&this.Fa&&this.yf().captureLog(t)}captureBufferedConsoleLog(t,e,n){!this.Ti&&this.Fa&&this.yf().captureLog(t,{context:e,occurredAtMs:n})}Rd(){var t;this.kf(),(t=this.uf)===null||t===void 0||t.clearQueue(),this.Xv=[]}xf(){this.Zv||this.kf()}wf(){var t;if(this.nf||!(!((t=this.uv)===null||t===void 0)&&t.console))return;const e=WP(this.Na.get()).maxBufferSize;let n=!0;this.if.push(()=>{n=!1});for(const r of $W){let s;try{s=FW(this.uv.console[r])}catch{continue}s&&this.if.push(Sf(this.uv.console,r,i=>{const o=(...l)=>{try{n&&this.$f(r,l,e)}catch{}return i.apply(this.uv.console,l)};return o.__rrweb_original__=s,o}))}this.nf=!0,this.Cf=setTimeout(()=>{this.kf()},3e4)}$f(t,e,n){var r;if(this.nf&&!this.sf&&e.length!==0)if(!((r=this.Fa)===null||r===void 0)&&r.canCapture){if(n>this.ef.length){this.sf=!0;try{this.ef.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Jv()})}finally{this.sf=!1}}}else this.kf()}kf(){if(this.ef=[],this.nf){this.nf=!1,this.Cf&&(clearTimeout(this.Cf),this.Cf=void 0);for(const t of this.if)t();this.if=[]}}Tf(){const t=this.ef;return this.kf(),t}get logger(){return this.If||(this.If={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.If}flushLogs(t){this.Fa&&(t?this.Mf(t):(this.lf&&this.lf.flush().catch(e=>this.Ef(e)),this.uf&&this.uf.flush().catch(e=>this.Ef(e))))}flush(){var t=this;return pn(function*(){var e,n;const r=(e=t.lf)===null||e===void 0?void 0:e.flush().catch(i=>t.Ef(i)),s=(n=t.uf)===null||n===void 0?void 0:n.flush().catch(i=>t.Ef(i));yield r,yield s})()}Ef(t){qP(t)||this.R.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Ti||!this.Zv||this.Kv||this.Yv)return;const t=this.hf();if(t){this.Yv=!0;try{t((e,n)=>{if(this.Yv=!1,!this.Ti&&this.Zv)if(e||!n)this.R.error("Could not load logs script",e),this.kf();else{const r=this.Tf();this.Sf=n.initialize(this.Fa),this.Kv=!0,r.length>0&&n.replay(this.Fa,r)}})}catch(e){throw this.Yv=!1,e}}else this.kf()}ff(t,e){const n=this.Fa;return{get isDisabled(){return!1},get optedOut(){return!n.canCapture},getPersistedProperty:r=>r===Uo.LogsQueue?t():void 0,setPersistedProperty(r,s){r===Uo.LogsQueue&&e(s??[])},qs:r=>this.qs(r),getLibraryId:()=>n.library.name,getLibraryVersion:()=>n.library.version}}qs(t){return new Promise(e=>{if(FO(this.Jd,3))return void e({kind:"fatal",error:j2(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=o=>{n||(n=!0,clearTimeout(s),e(o))},s=setTimeout(()=>{this.R.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:j2(void 0,"logs request timed out")})},9e4),i=this.cf;this.Fa.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.Fa.projectToken},body:t,compression:"best-available",timeoutMs:6e4}).then(o=>{var l;const c=o.statusCode;this.Af(c,i),c>=200&&300>c?r({kind:"ok"}):c===413?r({kind:"too-large"}):c!==0&&c!==408&&c!==429&&500>c?r({kind:"fatal",error:new Error(`logs request failed with status ${c}`)}):c===0?(o.error||this.R.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:j2(o.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error(`logs request failed with status ${c}`)})},o=>{r({kind:"retry-later",error:o})})})}Af(t,e){(t!==0||e)&&(this.Jd=jO(t,this.Jd,3,()=>this.R.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Mf(t){this.cc.length>0&&this.Rf(t,this.cc,this.mf,this.Fa.library.name,e=>{this.cc=e}),this.Xv.length>0&&this.Rf(t,this.Xv,this._f,KP,e=>{this.Xv=e})}Rf(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=J5(i,Q5(n,this.Fa.library.name,this.Fa.library.version),r,this.Fa.library.version);this.Fa.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.Fa.projectToken},body:o,compression:"best-available",transport:t,timeoutMs:6e4}).catch(l=>this.Ef(l))}};const Dv=An("[NetworkMetrics]"),zW={"http:":80,"https:":443},VW=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),CM=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=aa(r))===null||n===void 0?void 0:n.href)||r}},$b=(t,e,n,r,s,i,o=!1)=>{try{var l,c;const d=s();if(!d)return;const f=n||void 0,h=Up()-r,m=aa(e.url);if(m&&m.protocol!=="http:"&&m.protocol!=="https:")return;const v={url:(m==null?void 0:m.href)||e.url,method:e.method},y=Vn(d.name)?d.name(v):ft(d.name)?d.name:"http.client.request.duration";if(!y)return;const _=o&&!f?void 0:((x,k)=>x?400>x?void 0:String(x):(k==null?void 0:k.name)||"_OTHER")(f,i),b=j(j(j(j(j({},(x=>{const k=VW.has(x)?x:"_OTHER";return j({"http.request.method":k},k==="_OTHER"&&x!==k?{"http.request.method_original":x}:{})})(v.method)),m?(x=>{return{"server.address":x.hostname.startsWith("[")&&x.hostname.endsWith("]")?x.hostname.slice(1,-1):x.hostname,"server.port":Number(x.port)||zW[x.protocol],"url.scheme":x.protocol.slice(0,-1),"url.template":(k=x.pathname,k.split("/").map(C=>(P=>/^\d+$/.test(P)||P.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(P))(C)?":id":C).join("/"))};var k})(m):{}),f?{"http.response.status_code":f}:{}),_?{"error.type":_}:{}),(l=d.attributes)===null||l===void 0?void 0:l.call(d,v,{status:f,durationMs:h}));(c=t.metrics)===null||c===void 0||c.histogram(y,h,{unit:"ms",attributes:b})}catch(d){Dv.error("Failed to record network metric",d)}},PM=()=>{},HW=(t,e)=>Vn(ce==null?void 0:ce.fetch)?Sf(ce,"fetch",n=>function(...r){const s=Up(),i=n.apply(this,r);if(!e())return i;try{var o,l,c;const[d,f]=r,h=CM((o=(l=f==null?void 0:f.method)!==null&&l!==void 0?l:d==null?void 0:d.method)!==null&&o!==void 0?o:"GET",(c=d==null?void 0:d.url)!==null&&c!==void 0?c:d);return i.then(m=>($b(t,h,m==null?void 0:m.status,s,e,void 0,!0),m),m=>{throw $b(t,h,void 0,s,e,m),m})}catch(d){return Dv.error("Failed to observe fetch",d),i}}):PM,UW=(t,e)=>{var n;const r=ce==null||(n=ce.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return PM;const s=new WeakMap,i=Sf(r,"open",l=>function(...c){try{eM.has(this)||s.set(this,CM(c[0],c[1]))}catch(d){Dv.error("Failed to observe XHR open",d)}return l.apply(this,c)}),o=Sf(r,"send",l=>function(...c){let d;try{const f=s.get(this);if(f&&e()){const h=Up();d=()=>{this.removeEventListener("loadend",d),$b(t,f,this.status,h,e)},Lt(this,"loadend",d)}}catch(f){Dv.error("Failed to observe XHR send",f)}try{return l.apply(this,c)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},GP=new WeakMap,BW=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),ZW={maxStringLength:2048,truncationSuffix:"..."},WW={maxStringLength:2048,truncationSuffix:"..."};function YP(t){if(t)return t===!0?{intent:!0,model:!0}:{intent:t.intent!==!1,model:t.model!==!1}}function z2(t,e){return{}.hasOwnProperty.call(t,e)}function V2(t,e){const n=Object.create(t);return e&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:e}),n}function XP(t,e,n=!1){if(!ft(t))return;const r=t.trim();return r?(n?K5(r,ZW):r).slice(0,e):void 0}function QP(t){try{return ut(t)&&t.isError===!0}catch{return!1}}function TM(t){return K5(t||"Unknown error",WW).slice(0,2048)}function KW(t,e){try{return TM(e?(function(n){try{return!ut(n)||!Ue(n.content)?void 0:n.content.filter(r=>ut(r)&&r.type==="text"&&ft(r.text)).map(r=>r.text).join(" ").trim()||void 0}catch{return}})(t):ut(t)&&ft(t.message)?t.message:ft(t)?t:String(t))}catch{return"Unknown error"}}function qW(t,e,n){return e.errorResult?[{type:"Error",value:n,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:t.buildProperties(e.error,{handled:!0}).$exception_list.map(r=>j(j({},r),{},{value:TM(r.value)}))}function GW(t,e){if(e)return"Error";try{if(!ut(t))return"Error";let n=ft(t.name)?t.name.trim():"";const r=t.constructor;return n&&n!=="Error"||!Vn(r)||r.name==="Error"||(n=r.name),(n||"Error").slice(0,256)}catch{return"Error"}}function YW(t,e){return{message:KW(t,e),type:GW(t,e)}}Sp.__defaultExtensionClasses=j({},((...t)=>_n({},...t))({featureFlags:ng},{sessionRecording:class{get Fr(){return this._instance.config}get Pc(){return this._instance.persistence}get started(){var t;return!!(!((t=this.Pf)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.Of==="awaiting_config"||this.Of==="missing_config"?this.Of:(t=(e=this.Pf)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.Of}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Of=A2,this.Ff=void 0,this.Df=!1,this.Ye=(()=>{var e,n;if(!(Oe!=null&&Oe.visibilityState)||Oe.visibilityState==="visible")return!0;const r=ce==null||(e=ce.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.an=()=>{var e,n;(Oe==null?void 0:Oe.visibilityState)==="visible"&&(this.Ye=!0,(e=this.Pf)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw Pa.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Fr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');Oe!=null&&Oe.addEventListener&&Lt(Oe,"visibilitychange",this.an)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.Df=!0,Oe==null||(e=Oe.removeEventListener)===null||e===void 0||e.call(Oe,"visibilitychange",this.an),t?this.Lf(!0):this.stopRecording()}get Nf(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Fr.disable_session_recording,r=this.Fr.disable_session_recording||this._instance.consent.isOptedOut();return ce&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.Df||this.Nf&&(!((e=this.Pf)===null||e===void 0)&&e.isStarted))return;const n=!de(Object.assign)&&!de(Array.from);this.Nf&&n?(this.jf(t),Pa.info("starting")):(this.Of=A2,this.stopRecording())}jf(t){var e,n;if(this.Nf)if(this.Of!=="awaiting_config"&&this.Of!=="missing_config"&&(this.Of=gP),(tt==null||(e=tt.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=tt.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.qf(t);else{var r,s;const i=this._instance.sessionManager;(r=tt.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.Bf,o=>{if(!this.Df&&this.Nf&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),Pa.error("could not load recorder",o)):void this.qf(t);this.Of="disabled"})}}stopRecording(){var t,e;(t=this.Ff)===null||t===void 0||t.call(this),this.Ff=void 0,(e=this.Pf)===null||e===void 0||e.stop()}Lf(t=!1){var e,n;(e=this.Ff)===null||e===void 0||e.call(this),this.Ff=void 0,(n=this.Pf)===null||n===void 0||n.discard({discardProducerEvents:t})}zf(){var t,e;(t=this.Pc)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Pc)===null||e===void 0||e.unregister("$replay_sample_rate")}Hf(t,e){if(at(t))return null;const n=Yn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(Pa.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}Uf(t){if(this.Pc){var e,n;const r=this.Pc,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.Hf((i=this.Fr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.Hf(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??c;at(d)&&this.zf();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[gp]:j(j({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:j({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:d,minimumDurationMilliseconds:de(f)?null:f,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.Ff)===null||e===void 0||e.call(this),this.Ff=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.Uf(e),void this.Lf()):(this.Uf(e),void this.startIfEnabledOrStop()):(this.Of==="awaiting_config"&&(this.Of="missing_config",this._instance.register_for_session({[JS]:!0}),Pa.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.Pf)===null||n===void 0)&&n.log?this.Pf.log(t,e):Pa.warn("log called before recorder was ready")}get Bf(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(gp);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}Wf(){const t=this._instance.get_property(gp);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return Pa.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!at(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}qf(t){var e,n,r;if(!this.Df&&this.Nf&&this._instance.sessionManager){if(!(!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return Pa.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[QS]:!0});var s;if(this.Pf||(this.Pf=(s=tt.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Ye),this.Pf._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Wf())return this.Of==="missing_config"||this.Of==="awaiting_config"?void 0:(this.Of="awaiting_config",Pa.info("persisted remote config is stale, requesting fresh config before starting"),void new qO(this._instance).load());this.Of=gP,(n=(r=this.Pf).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Ye),this.Pf.start(t)}else this.Of=A2}onRRwebEmit(t){var e,n;(e=this.Pf)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.Pf||(e=this.Pc)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.Pf)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Pf||(e=this.Pc)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.Pf)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.Pf||(n=this.Pc)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.Pf)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const r of GZ){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);de(s)||(e[r]=s)}return j(j({},e),((t=this.Pf)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.Pf)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.Pf)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},{autocapture:class extends OZ{constructor(t){super(new ZZ(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.Vf=!1,this._instance=t,this.Gf=this.Qf()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.Jf();return!!(t.path||t.search||this.Zf(t))}startIfEnabled(){this.isEnabled&&(ve.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Gf=this.Qf(),this.startIfEnabled()}stop(){this.Kf&&this.Kf(),this.Kf=void 0,this.Yf&&this.Yf(),this.Yf=void 0,ve.info("History API monitoring stopped")}monitorHistoryChanges(){ce&&ce.history&&(this.Xf("pushState"),this.Xf("replaceState"),this.tp(),this.Zf()&&this.ep())}Xf(t){var e;if(!ce||!((e=ce.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;Sf(ce.history,t,r=>function(s,i,o){var l;n.np(o)&&n.sp(),r.call(this,s,i,o),n.rp(t,!n.Vf&&(ce==null||(l=ce.event)===null||l===void 0?void 0:l.type)!=="popstate")})}Qf(){const t=ce==null?void 0:ce.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Jf(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:ut(t)?t:{}}Zf(t=this.Jf()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}op(t){const e=this.Jf(),n=this.Gf;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.Zf(e)&&t.hash!==n.hash))}rp(t,e=!1){try{e||this.sp();const n=this.Qf();if(!n)return;if(this.op(n)){const r=()=>this._instance.capture(ek,{navigation_type:t});e?(this.ap=r,Promise.resolve().then(()=>this.sp())):r()}this.Gf=n}catch(n){ve.error(`Error capturing ${t} pageview`,n)}}np(t){var e,n;return!(at(t)||!ce)&&((e=aa(String(t)))===null||e===void 0?void 0:e.href)!==((n=ce.location)===null||n===void 0?void 0:n.href)}sp(){const t=this.ap;if(t){this.ap=void 0,this.Vf=!0;try{t()}catch(e){ve.error("Error capturing deferred pageview",e)}finally{this.Vf=!1}this.Gf=this.Qf()}}tp(){if(this.Kf)return;const t=()=>{this.rp("popstate")};Lt(ce,"popstate",t),this.Kf=()=>{ce&&ce.removeEventListener("popstate",t)}}ep(){if(this.Yf)return;const t=()=>{this.rp("hashchange")};Lt(ce,"hashchange",t),this.Yf=()=>{ce&&ce.removeEventListener("hashchange",t)}}},heatmaps:class{get Fr(){return this.instance.config}constructor(t){var e;this.lp=!1,this._l=!1,this.up=null,this.instance=t,this.lp=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[yb]),this.rageclicks=new yM(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return ut(this.Fr.capture_heatmaps)&&this.Fr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Fr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return at(this.Fr.capture_heatmaps)?at(this.Fr.enable_heatmaps)?this.lp:this.Fr.enable_heatmaps:this.Fr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._l)return;YZ.info("starting..."),this.cp(),this.an()}else{var t;clearInterval((t=this.up)!==null&&t!==void 0?t:void 0),this.hp(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[yb]:n}),this.lp=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}dp(t){I2(t.originalEvent)&&this.Pr(t.originalEvent,"deadclick")}an(){this.up&&clearInterval(this.up),this.up=(Oe==null?void 0:Oe.visibilityState)==="visible"?setInterval(this.bc.bind(this),this.flushIntervalMilliseconds):null}cp(){ce&&Oe&&(this.vp=this.bc.bind(this),Lt(ce,Rv,this.vp),this.fp=t=>this.Pr(t||(ce==null?void 0:ce.event)),Lt(Oe,"click",this.fp,{capture:!0}),this.pp=t=>this.gp(t||(ce==null?void 0:ce.event)),Lt(Oe,"mousemove",this.pp,{capture:!0}),this.mp=new U3(this.instance,KB,this.dp.bind(this)),this.mp.startIfEnabledOrStop(),this.yp=this.an.bind(this),Lt(Oe,qd,this.yp),this._l=!0)}hp(){var t;ce&&Oe&&(this.vp&&ce.removeEventListener(Rv,this.vp),this.fp&&Oe.removeEventListener("click",this.fp,{capture:!0}),this.pp&&Oe.removeEventListener("mousemove",this.pp,{capture:!0}),this.yp&&Oe.removeEventListener(qd,this.yp),clearTimeout(this.bp),(t=this.mp)===null||t===void 0||t.stop(),this._l=!1)}_p(t,e){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,c){let d=o;for(;d&&Yi(d)&&!hr(d,"body");){if(d===c)return!1;let v;try{var f,h,m;v=(f=(h=(m=d.ownerDocument)===null||m===void 0?void 0:m.defaultView)!==null&&h!==void 0?h:ce)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(Ke(l,v))return!0;d=AO(d)}return!1})(_p(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Pr(t,e="click"){var n;if(O3(t.target)||!I2(t))return;const r=this._p(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&OO(_p(t),this.instance.config.rageclick)&&this.Ks(j(j({},r),{},{type:"rageclick"})),this.Ks(r)}gp(t){!O3(t.target)&&I2(t)&&(clearTimeout(this.bp),this.bp=setTimeout(()=>{this.Ks(this._p(t,"mousemove"))},500))}Ks(t){if(!ce)return;const e=this.Fr.disable_capture_url_hashes?Ql(ce.location.href):ce.location.href,n=this.Fr.custom_personal_data_properties,r=this.Fr.mask_personal_data_properties?[...bf,...n||[]]:[],s=Vp(e,r,Hp);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}bc(){this.Rt&&!Ws(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:U3,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.lp=!1,this._l=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.wp=(n=!1)=>{clearTimeout(this.kp),this.kp=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",j({$current_url:this.Rt.url},this.Rt.metrics.reduce((r,s)=>j(j({},r),{},{[`$web_vitals_${s.name}_event`]:j({},s),[`$web_vitals_${s.name}_value`]:s.value}),{})),n?{transport:"sendBeacon",send_instantly:!0}:void 0),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Sp=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},at(n==null?void 0:n.name)||at(n==null?void 0:n.value))return void Uc.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.xp(s);if(de(i))return;const o=Yn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.$p&&n.value>=this.$p)return void Uc.error("Ignoring metric with value >= "+this.$p,n);this.Rt.navigationKey!==o&&(this.wp(),this.kp=setTimeout(this.wp,this.flushToCaptureTimeoutMs)),de(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=i),this.Rt.firstMetricTimestamp=de(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),c=j(j(j({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete c.entries,ut(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of qZ){const h=f==="url"&&typeof n.attribution[f]=="string"?this.xp(n.attribution[f]):n.attribution[f];de(h)||(d[f]=h)}c.attribution=d}else delete c.attribution;de(l)||(c.$session_id=l.sessionId,c.$window_id=l.windowId),this.Rt.metrics.push(c),this.Rt.metrics.length===this.allowedMetrics.length&&this.wp()},this.Cp=()=>{if(this._l)return;let n,r,s,i,o=!1;const l=tt.__PosthogExtensions__,c=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(c==null?void 0:c[this.Tp])||(this.Tp==="web-vitals"&&de(c)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!de(d)){const v=d.withoutAttribution,y=this.attributionMetrics;o=!de(v),n=y.indexOf("LCP")>-1?d.onLCP:(v==null?void 0:v.onLCP)||d.onLCP,r=y.indexOf("CLS")>-1?d.onCLS:(v==null?void 0:v.onCLS)||d.onCLS,s=y.indexOf("FCP")>-1?d.onFCP:(v==null?void 0:v.onFCP)||d.onFCP,i=y.indexOf("INP")>-1?d.onINP:(v==null?void 0:v.onINP)||d.onINP}if(!(n&&r&&s&&i))return void Uc.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},h=o&&this.attributionMetrics.indexOf("INP")>-1?j(j({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.Sp.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Sp.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Sp.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.Sp.bind(this),h);const m=ce==null?void 0:ce.document;Lt(m,qd,()=>{(m==null?void 0:m.visibilityState)==="hidden"&&this.wp(!0)}),Lt(ce,"pagehide",()=>this.wp(!0)),this._l=!0},this.lp=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[bb]),this.startIfEnabled()}get Ip(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=ut(this.Ip)?(t=this.Ip)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return at(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||mP:n}get flushToCaptureTimeoutMs(){return(ut(this.Ip)?this.Ip.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=ut(this.Ip)?this.Ip.web_vitals_attribution:void 0;return Os(t)?t?mP:[]:Ue(t)?t:KZ}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=ut(this.Ip)?this.Ip.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get $p(){const t=ut(this.Ip)&&Yn(this.Ip.__web_vitals_max_value)?this.Ip.__web_vitals_max_value:pP;return t>0&&6e4>=t?pP:t}get isEnabled(){const t=fn==null?void 0:fn.protocol;if(t!=="http:"&&t!=="https:")return Uc.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=ut(this.Ip)?this.Ip.web_vitals:Os(this.Ip)?this.Ip:void 0;return Os(e)?e:this.lp}startIfEnabled(){this.isEnabled&&!this._l&&(Uc.info("enabled, starting..."),this.Bl(this.Cp))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=ut(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ut(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[bb]:n}),this._instance.persistence.register({[aO]:r})),this.lp=n,this.startIfEnabled()}get Tp(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Bl(t){var e;const n=tt.__PosthogExtensions__,r=this.Tp,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&de(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?Uc.error("failed to load script",i):t()})}xp(t){const e=t||(ce==null?void 0:ce.location.href);if(!e)return void Uc.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?Ql(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...bf,...r||[]]:[];return Vp(n,s,Hp)}}},{exceptionObserver:class{constructor(t){var e;this.Cp=()=>{var n;if(!ce||!this.isEnabled||!(!((n=tt.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=tt.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=tt.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=tt.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Mp&&this.Fr.capture_unhandled_errors&&(this.Mp=r(this.captureException.bind(this))),!this.Ep&&this.Fr.capture_unhandled_rejections&&(this.Ep=s(this.captureException.bind(this))),!this.Ap&&this.Fr.capture_console_errors&&(this.Ap=i(this.captureException.bind(this)))}catch(o){Hh.error("failed to start",o),this.Rp()}},this._instance=t,this.Pp=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[_b]),this.kt=new $H(j(j({},(function(n={}){var r,s,i,o;return{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,R:Hh})),this.Fr=this.Op(),this.startIfEnabledOrStop()}Op(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ut(t)?e=j(j({},e),t):(de(t)?this.Pp:t)&&(e=j(j({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Fr.capture_console_errors||this.Fr.capture_unhandled_errors||this.Fr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Hh.info("enabled"),this.Rp(),this.Bl(this.Cp)):this.Rp()}Bl(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return Hh.error("failed to load script",s);t()})}Rp(){var t,e,n;(t=this.Mp)===null||t===void 0||t.call(this),this.Mp=void 0,(e=this.Ep)===null||e===void 0||e.call(this),this.Ep=void 0,(n=this.Ap)===null||n===void 0||n.call(this),this.Ap=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.Pp=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[_b]:this.Pp}),this.Fr=this.Op(),this.startIfEnabledOrStop())}onConfigChange(){this.Fr=this.Op()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.kt.consumeRateLimit(s))return void Hh.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.Fp=[],this.Dp=new qH([new cU,new yU,new dU,new uU,new gU,new mU,new hU,new vU],(function(r,...s){return(i,o=0)=>{const l=[],c=i.split(`
21
- `),d=Math.min(c.length,o+1e3),f=[];for(let v=o;d>v;v++){const y=c[v];if(y.length>1024)continue;const _=d3.test(y)?y.replace(d3,"$1"):y;if(!_.match(/\S*Error: /)){for(const b of s){const x=b(_,r);if(x){l.push(x);const k=iU(l);if(k){for(let C=f.length-1;C>=0;C--){const P=f[C];if(k.start>=P.start+P.length)break;f.pop()}f.push(k)}break}}if(aU(l,f)>=50)break}}const h=[...f].sort((v,y)=>y.start-v.start),m=h[h.length-1];if(m){const v=F5(l,m);l.splice(m.start-v,v);for(const y of h)y.start-=v}for(const v of h)oU(l,v);return f.some(v=>v.start===0&&l.length===v.length)&&(function(v){const y=v.map(b=>`${b.function}|${b.filename}|${b.lineno}|${b.colno}|${b.module}`);let _=0;for(let b=1;y.length>b;b++)lU(y,b,_)&&(_=b);v.push(...v.splice(0,_))})(l),(function(v){if(!v.length)return[];const y=Array.from(v);return y.reverse(),y.slice(0,50).map(_=>{return j(j({},_),{},{filename:_.filename||(b=y,b[b.length-1]||{}).filename,function:_.function||"?"});var b})})(l)}})("web:javascript",tU,sU)),this._instance=t,this.Fp=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.Lp=Sv(this.Np()),this.jp=new wU(this.Lp)}onConfigChange(){this.Lp=Sv(this.Np()),this.jp.setConfig(this.Lp)}onRemoteConfig(t){var e,n,r;if(!t.ok)return;const s=t.config;if(!("errorTracking"in s))return;const i=(e=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.Fp=i,this._instance.persistence&&this._instance.persistence.register({[iO]:this.Fp,[wb]:o})}get qp(){var t;const e=!!this._instance.get_property(wb),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Dp.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Lp.enabled)try{if(!ft(t)||t.trim().length===0)return void co.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:r}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};const i=[];return{sanitizedProperties:Object.keys(s).reduce((o,l)=>_U.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.Bp(e));r.length>0&&co.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.jp.add(j({[bv]:t,[xv]:new Date().toISOString()},n))}catch(n){co.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.zp(e)){if(this.Hp(e))return this.Up("Exception dropped: matched a suppression rule"),void co.info("Skipping exception capture because a suppression rule matched");if(!this.qp&&this.Wp(e))return this.Up("Exception dropped: thrown by a browser extension"),void co.info("Skipping exception capture because it was thrown by an extension");if(!this.qp&&this.Vp(e))return this.Up("Exception dropped: thrown by an injected browser script"),void co.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Gp(e))return this.Up("Exception dropped: thrown by the PostHog SDK"),void co.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.Lp.enabled&&at(t.$exception_steps)?this.Qp(t):t,r=(function(){if("u">typeof process){var s;const o=(s=PH.POSTHOG_RELEASE_ID)===null||s===void 0?void 0:s.trim();if(o)return o}const i=globalThis._posthogReleaseId;return typeof i=="string"&&i.length>0?i:void 0})();r&&(n.$release_id=r);try{const s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",_d:!0});return s&&this.jp.clear(),s}catch(s){return PP(s)||co.error("Failed to capture exception event. Dropping this exception.",s),void this.jp.clear()}}catch(e){return void(PP(e)||co.error("Failed to process exception event. Ignoring this exception.",e))}}Qp(t){try{const e=this.jp.getAttachable();return e.length===0?t:j(j({},t),{},{$exception_steps:e})}catch(e){return co.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Up(t){this.Lp.enabled&&this.jp.add({[bv]:t,[xv]:new Date().toISOString()})}Bp(t){return ut(t)?j({},t):{}}Np(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}Hp(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(ft(r)&&r.length>0&&n.$exception_types.push(r),ft(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.Fp.some(n=>{const r=n.values.map(s=>{const i=mM[s.operator],o=e[s.key];if(!i||!o)return!1;const l=Ue(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return co.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Wp(t){const e=t.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=e.filter(({filename:r})=>!!r&&cW.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(Nb))||t.some(({type:r,value:s})=>r==="NoResponse"||ft(s)&&lW.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(Nb))))}Vp(t){return t.some(({value:e})=>ft(e)&&uW.some(n=>e.includes(n)))}Gp(t){if(t.length>0){var e,n,r,s;const i=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)===null||s===void 0?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}zp(t){return!at(t)&&Ue(t)}}},{productTours:class{get Pc(){return this._instance.persistence}constructor(t){this.Jp=null,this.Zp=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,r;if(this.Pc&&this.Pc.register({[YS]:!!e.productTours}),!O2(this._instance))return!this.Jp&&at((n=this.Pc)===null||n===void 0?void 0:n.props.ph_product_tours)||tg.info("product tours disabled; stopping and clearing cached tours"),(r=this.Jp)===null||r===void 0||r.stop(),this.Jp=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Jp&&O2(this._instance)&&this.Bl(()=>this.Kp())}Bl(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?tg.error("Could not load product tours script",s):t()})}Kp(){var t;!this.Jp&&(!((t=tt.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.Jp=tt.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(Ue(this.Zp)&&!e)return void t(this.Zp,{isLoaded:!0});const n=this.Pc;if(n){const r=n.props[xb];if(Ue(r)&&!e)return this.Zp=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:r=>{if(!O2(this._instance))return void t([],{isLoaded:!0});const s=r.statusCode;if(s!==200||!r.json){const o=`Product Tours API could not be loaded, status: ${s}`;return s===0?r.error||tg.warn(o):tg.error(o),void t([],{isLoaded:!1,error:o})}const i=Ue(r.json.product_tours)?r.json.product_tours:[];this.Zp=i,n&&n.register({[xb]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){at(this.Jp)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Jp.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Jp)===null||e===void 0||e.showTourById(t)}previewTour(t){this.Jp?this.Jp.previewTour(t):this.Bl(()=>{var e;this.Kp(),(e=this.Jp)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Jp)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Jp)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.Jp)===null||t===void 0||t.previousStep()}clearCache(){var t;this.Zp=null,(t=this.Pc)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.Jp)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.Jp)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Jp)===null||e===void 0||e.cancelPendingTour(t)}},featureFlags:ng},{siteApps:class{constructor(t){this._instance=t,this.Yp=0,this.Xp=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}tg(t,e){if(!e)return;const n=this.globalsForEvent(e);this.Xp.push(n),this.Xp.length>1e3&&(this.Xp=this.Xp.slice(10))}get siteAppLoaders(){var t;return(t=tt._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.tg.bind(this));this.eg=()=>{t(),this.Xp=[],this.eg=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");const c={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(const[v,y]of Object.entries(f))c[v]={id:d[v],type:v,properties:y};const{$set_once:h,$set:m}=t;return{event:j(j({},H5(t,XZ)),{},{properties:j(j(j({},t.properties),m?{$set:j(j({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),m)}:{}),h?{$set_once:j(j({},(r=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),h)}:{}),elements_chain:(i=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}ig(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Fo.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Fo.error("prepare_external_dependency_script returned null"),null):t}ng(){var t,e,n,r,s,i,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const c=Oe==null?void 0:Oe.defaultView,d=c==null||(t=c.Node)===null||t===void 0?void 0:t.prototype;if(!c||!d)return()=>{};if(this.Yp++,this.sg)return this.rg();const f=[],h=this,m=new WeakSet,v=(b,x,k)=>{if(!(b!=null&&b[x]))return;const C=b[x];b[x]=k(C),f.push(()=>{b[x]=C})},y=b=>{if(m.has(b))return b;const x=h.ig(b);return x&&m.add(x),x},_=b=>b.map(x=>typeof x=="string"?x:y(x)).filter(x=>!Nn(x));return v(d,"appendChild",b=>function(x){const k=y(x);return k?b.call(this,k):x}),v(d,"insertBefore",b=>function(x,k){const C=y(x);return C?b.call(this,C,k):x}),v(d,"replaceChild",b=>function(x,k){const C=y(x);return C?b.call(this,C,k):k}),[(e=c.Element)===null||e===void 0?void 0:e.prototype,(n=c.Document)===null||n===void 0?void 0:n.prototype,(r=c.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(b=>{v(b,"append",x=>function(...k){return x.apply(this,_(k))}),v(b,"prepend",x=>function(...k){return x.apply(this,_(k))})}),[(s=c.Element)===null||s===void 0?void 0:s.prototype,(i=c.CharacterData)===null||i===void 0?void 0:i.prototype,(o=c.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(b=>{v(b,"before",x=>function(...k){return x.apply(this,_(k))}),v(b,"after",x=>function(...k){return x.apply(this,_(k))}),v(b,"replaceWith",x=>function(...k){const C=_(k);return k.length&&!C.length?void 0:x.apply(this,C)})}),v((l=c.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",b=>function(x,k){const C=y(k);return C?b.call(this,x,C):null}),this.sg=()=>{f.forEach(b=>b()),this.sg=void 0},this.rg()}rg(){let t=!1;return()=>{var e;t||(t=!0,this.Yp--,this.Yp===0&&((e=this.sg)===null||e===void 0||e.call(this)))}}og(t,e=!0){const n=this.ng();try{const r=t(n);return e&&n(),r}catch(r){throw n(),r}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var i;!e.errored&&this.Xp.length&&(Fo.info(`Processing ${this.Xp.length} events for site app with id ${t.id}`),this.Xp.forEach(o=>this.og(()=>{var l;return(l=e.processEvent)===null||l===void 0?void 0:l.call(e,o)})),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.eg)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,Fo.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.og(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){Fo.error(vP+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){Fo.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}ag(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}lg(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.og(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){Fo.error(`Error while processing event ${t.event} for site app ${n.id}`,r)}}onRemoteConfig(t){var e,n,r;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.ag(),void this._instance.on("eventCaptured",l=>this.lg(l))):void Fo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.eg)===null||n===void 0||n.call(this),!t.ok)return;const s=t.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:l,url:c}of s.siteApps){var i,o;tt[`__$$ph_site_app_${l}`]=this._instance,(i=tt.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,c,d=>{if(d)return Fo.error(vP+l,d)})}else Fo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},{surveys:class extends tW{constructor(t){super(new nW(t))}},featureFlags:ng},{tracingHeaders:class{constructor(t){this._instance=t,this.ug=void 0,this.cg=void 0,this.hg=void 0,this.Cp=()=>{const e=this.dg();var n,r;e?(de(this.ug)&&(this.ug=(n=tt.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),de(this.cg)&&(this.cg=(r=tt.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Rp()}}initialize(){this.startIfEnabledOrStop()}Bl(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return WZ.error("failed to load script",s);t()})}vg(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}dg(){const t=this.vg();return Ue(t)?(Ue(this.hg)?this.hg.splice(0,this.hg.length,...t):this.hg=[...t],t.length>0?this.hg:void 0):(Ue(this.hg)&&this.hg.splice(0),this.hg=t||void 0,this.hg)}Rp(){var t,e;(t=this.ug)===null||t===void 0||t.call(this),(e=this.cg)===null||e===void 0||e.call(this),this.ug=void 0,this.cg=void 0}startIfEnabledOrStop(){this.dg()?this.Bl(this.Cp):this.Rp()}}},{toolbar:class{constructor(t){this.instance=t}fg(t){tt.ph_toolbar_state=t}pg(){var t;return(t=tt.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var r,s;if(u2(this.instance.config)||!ce||!Oe)return!1;t=(r=t)!==null&&r!==void 0?r:ce.location,n=(s=n)!==null&&s!==void 0?s:ce.history;try{if(!e){try{ce.localStorage.setItem("test","test"),ce.localStorage.removeItem("test")}catch{return!1}e=ce==null?void 0:ce.localStorage}const i=rW||Iv(t.hash,"__posthog")||Iv(t.hash,"state");let o;const l=i?i3(()=>JSON.parse(atob(decodeURIComponent(i))))||i3(()=>JSON.parse(decodeURIComponent(i))):null;return l&&l.action==="ph_authorize"?(o=l,o.source="url",o&&Object.keys(o).length>0&&(l.desiredHash?t.hash=l.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(o=JSON.parse(e.getItem(_P)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}gg(t){const e=tt.ph_load_toolbar||tt.ph_load_editor;!at(e)&&Vn(e)?e(t,this.instance):wP.warn("No toolbar load function found")}loadToolbar(t){const e=!!(Oe!=null&&Oe.getElementById("__POSTHOG_TOOLBAR__"));if(!ce||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=j(j({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ce.localStorage.setItem(_P,JSON.stringify(j(j({},r),{},{source:void 0}))),this.pg()===2)this.gg(r);else if(this.pg()===0){var s,i;this.fg(1),(s=tt.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return wP.error("[Toolbar] Failed to load",o),void this.fg(0);this.fg(2),this.gg(r)}),Lt(ce,"turbolinks:load",()=>{this.fg(0),this.loadToolbar(r)})}return!0}mg(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},{experiments:class vr{get Fr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{vr.yg("retrieved web experiments from the server"),this.bg=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.bg&&(vr.yg("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.bg)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);ft(o)&&s.variants[o]&&this._g(s,o)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];vr.wg(l,this._instance)&&this.kg(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())vr.yg(UP);else if(!this.Fr.disable_web_experiments){if(at(this.bg))return this.bg=new Map,this.loadIfEnabled(),void this.previewWebExperiment();vr.yg("applying feature flags",e),e.forEach(n=>{var r;if(this.bg&&(!((r=this.bg)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.bg)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this._g(o,i)}})}}previewWebExperiment(){const e=vr.getWindowLocation();if(e!=null&&e.search){const n=wf(e==null?void 0:e.search,"__experiment_id"),r=wf(e==null?void 0:e.search,"__experiment_variant");n&&r&&(vr.yg(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.Sg(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Fr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Fr.disable_web_experiments&&!r)return e([]);const s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Fr.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Sg(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(vr.yg(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.kg(s[0].name,n,s[0].variants[n].transforms))}_g(e,n){const r=e.variants[n];vr.xg(r,this._instance)?this.kg(e.name,n,r.transforms):vr.yg(`skipping variant ${n} of experiment ${e.name} because this page does not match its url conditions`)}static wg(e,n){return!at(e.conditions)&&vr.xg(e,n)&&vr.$g(e)}static xg(e,n){var r;if(at(e.conditions)||at((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=vr.getWindowLocation();if(s){var i,o,l;const c=PO(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||DW[(o=(l=e.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return ce==null?void 0:ce.location}static $g(e){var n;if(at(e.conditions)||at((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=zO();if(r.utm_source){var s,i,o,l,c,d,f,h;const m=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_source)==r.utm_source,y=!(!((c=e.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0)&&c.utm_medium)||((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,_=!(!((f=e.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((h=e.conditions)===null||h===void 0||(h=h.utm)===null||h===void 0?void 0:h.utm_term)==r.utm_term;return m&&y&&_&&v}return!1}static yg(e,...n){ve.info(`[WebExperiments] ${e}`,n)}static Cg(e,...n){ve.warn(`[WebExperiments] ${e}`,n)}static Tg(e){(e.namespaceURI==="http://www.w3.org/1999/xhtml"&&e.localName==="template"?e.content:e).querySelectorAll("a[target], template").forEach(n=>{var r;if(n.localName==="template")return void(n.namespaceURI==="http://www.w3.org/1999/xhtml"&&vr.Tg(n));if(n.namespaceURI!=="http://www.w3.org/1999/xhtml"||((r=n.getAttribute("target"))===null||r===void 0?void 0:r.toLowerCase())!=="_blank")return void n.removeAttribute("target");const s=(n.getAttribute("rel")||"").split(/\s+/).filter(i=>i&&!/^(opener|noopener)$/i.test(i));s.push("noopener"),n.setAttribute("rel",s.join(" "))})}kg(e,n,r){this._is_bot()?vr.yg(UP):n!=="control"?r.forEach(s=>{if(s.selector){var i;vr.yg(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);if(!(o!=null&&o.length))return void vr.Cg(`no element on this page matches selector ${s.selector} of variant ${n} for experiment ${e}`);const l=new Map;o==null||o.forEach(c=>{if(c.localName.toLowerCase()==="script")return;const d=c;if(s.html){var f;const m=c.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&c.localName==="annotation-xml"&&((f=c.getAttribute("encoding"))===null||f===void 0?void 0:f.toLowerCase())||"",v=JSON.stringify([c.namespaceURI,c.localName,m]);let y=l.get(v);if(at(y)){var h;const _=(h=ZP)!==null&&h!==void 0?h:ZP=LW(),b=c.ownerDocument.implementation.createHTMLDocument(""),x=b.createElementNS(c.namespaceURI,c.localName);m&&x.setAttribute("encoding",m);const k=b.createRange();k.selectNodeContents(x);const C=c.namespaceURI==="http://www.w3.org/2000/svg"&&/^(foreignObject|desc|title)$/.test(c.localName)||/^(text\/html|application\/xhtml\+xml)$/.test(m)?"http://www.w3.org/1999/xhtml":c.namespaceURI,P=k.createContextualFragment(s.html);c.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&/^(mi|mo|mn|ms|mtext)$/.test(c.localName)?(x.appendChild(P),_.sanitize(x,j(j({},BP),{},{NAMESPACE:C||void 0,IN_PLACE:!0}))):(x.namespaceURI==="http://www.w3.org/1999/xhtml"&&x.localName==="template"?x.content:x).appendChild(_.sanitize(P,j(j({},BP),{},{NAMESPACE:C||void 0,RETURN_DOM_FRAGMENT:!0}))),vr.Tg(x),y=x.innerHTML,l.set(v,y)}d.innerHTML=y}s.css&&d.setAttribute("style",s.css)})}}):vr.yg("Control variants leave the page unmodified.")}_is_bot(){return Qr&&this._instance?fM(Qr,this.Fr.custom_blocked_useragents):void 0}},featureFlags:ng},{conversations:class{constructor(t){this._instance=t,this.Ig=void 0,this._conversationsManager=null,this.Mg=!1,this.ie=null,this.Eg=!1,this.Ag=0,this.Rg=null,this.Pg=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations)return void(this.Rg=null);if(this.Og=t.ok,!t.ok)return;const e=t.config.conversations;at(e)?this.Rg=null:(Os(e)?this.Ig=e:(this.Ig=e.enabled,this.ie=e),this.Ig||(this.Rg=null),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.Ag++,this.Ig=void 0,this.ie=null,this.Og=void 0,this.Eg=!1,this.Rg=null}loadIfEnabled(){if(this._conversationsManager||this.Mg||this._instance.config.disable_conversations||u2(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=tt==null?void 0:tt.__PosthogExtensions__;if(t&&!de(this.Ig)&&this.Ig)if(this.ie&&this.ie.token){this.Mg=!0;try{const e=t.initConversations;if(e)return this.Fg(e),void(this.Mg=!1);const n=t.loadExternalDependency;if(!n)return void this.Dg(mb);const r=this.Ag;n(this._instance,"conversations",s=>{if(r!==this.Ag)return this.Mg=!1,void this.loadIfEnabled();s||!t.initConversations?this.Dg("Could not load conversations script",s):this.Fg(t.initConversations),this.Mg=!1})}catch(e){this.Dg("Error initializing conversations",e),this.Mg=!1}}else Hi.error("Conversations enabled but missing token in remote config.")}Fg(t){if(this.ie){try{this._conversationsManager=t(this.ie,this._instance),this.Eg=!1,Hi.info("Conversations loaded successfully")}catch(e){return void this.Dg("Error completing conversations initialization",e)}this.Pg&&this._conversationsManager.setTheme(this.Pg),this.Lg()}else Hi.error("Cannot complete initialization: remote config is null")}Lg(){const t=this.Rg;this.Rg=null,this._conversationsManager&&t&&(t==="open"?this._conversationsManager.open():this._conversationsManager.close())}Dg(t,e){Hi.error(t,e),this._conversationsManager=null,this.Mg=!1,this.Eg=!0}show(){this._conversationsManager?this._conversationsManager.show():Hi.warn("Conversations not loaded yet.")}hide(){this.Rg==="open"&&(this.Rg=null),this._conversationsManager&&this._conversationsManager.hide()}open(){this._conversationsManager?(this.Rg=null,this._conversationsManager.open()):this.Rg="open"}close(){this._conversationsManager?(this.Rg=null,this._conversationsManager.close()):this.Rg="close"}setTheme(t){var e,n;this.Pg=j(j(j({},this.Pg),t),{},{dark:j(j({},(e=this.Pg)===null||e===void 0?void 0:e.dark),t==null?void 0:t.dark)}),(n=this._conversationsManager)===null||n===void 0||n.setTheme(t)}isAvailable(){return this.Ig===!0&&!Nn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":u2(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Og===!1?"remote_config_failed":de(this.Ig)?this.Og?"disabled_in_project":"remote_config_pending":this.Ig?at(this.ie)||!this.ie.token?"missing_token":tt!=null&&tt.__PosthogExtensions__?this.Mg?"initializing":this.Eg?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return pn(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Hi.warn(Wc),null)})()}getMessages(t,e){var n=this;return pn(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Hi.warn(Wc),null)})()}markAsRead(t){var e=this;return pn(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Hi.warn(Wc),null)})()}getTickets(t){var e=this;return pn(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Hi.warn(Wc),null)})()}requestRestoreLink(t){var e=this;return pn(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Hi.warn(Wc),null)})()}restoreFromToken(t){var e=this;return pn(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Hi.warn(Wc),null)})()}restoreFromUrlToken(){var t=this;return pn(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Hi.warn(Wc),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Md(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}Ed(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},{logs:class extends jW{constructor(t){super({get(){var e;return t==null||(e=t.config)===null||e===void 0?void 0:e.logs},captureHintKey:oO,get remoteConfigWillArrive(){var e,n;return!(!((e=t.lc)===null||e===void 0)&&e.call(t))||!!(!((n=tt._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[t.config.token])===null||n===void 0)&&n.config)}},()=>(function(e){var n;const r={};if(r.distinctId=e.get_distinct_id(),e.sessionManager){const{sessionId:s,windowId:i,sessionStartTimestamp:o,lastActivityTimestamp:l}=e.sessionManager.checkAndGetSessionAndWindowId(!0);r.sessionId=s,r.windowId=i,at(o)||(r.sessionStartTimestamp=o),at(l)||(r.lastActivityTimestamp=l)}if(!(tt==null||(n=tt.location)===null||n===void 0)&&n.href&&(r.currentUrl=e.config.disable_capture_url_hashes?Ql(tt.location.href):tt.location.href),e.featureFlags){const s=e.featureFlags.getFlags();s&&s.length>0&&(r.activeFeatureFlags=s)}return r})(t)),this._instance=t,this.name=bM,this.df()}get cf(){return this._instance.__loaded}hf(){const t=An("[logs]"),e=tt==null?void 0:tt.__PosthogExtensions__;if(!e)return void t.error("PostHog Extensions not found.");const n=e.loadExternalDependency;if(n)return r=>{n(this._instance,"logs",s=>{const i=e.logs;r(s,i!=null&&i.initializeLogs?{initialize:o=>i.initializeLogs(o),replay(o,l){var c;return(c=i.replayConsoleBuffer)===null||c===void 0?void 0:c.call(i,o,l)}}:void 0)})};t.error(mb)}}},{metrics:class{constructor(t){this._instance=t,this.R=An("[metrics]"),this.Ti=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.Ti)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Ng?this.Ng=(n=>{let r=!0;const s=()=>r?(l=>{var c;const d=(c=l.config.metrics)===null||c===void 0?void 0:c.network;return d===!0?{}:d||void 0})(n):void 0,i=HW(n,s),o=UW(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.Ng&&(this.Ng(),this.Ng=void 0)}pf(){var t;if(this.Ti)return;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.lf&&this.gf===e||((n=this.lf)===null||n===void 0||n.reset(),this.gf=e,this.lf=new iB(this.ff(),(function(r){var s,i,o,l,c;const d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=d==null?void 0:d["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(l=r==null?void 0:r.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(c=r==null?void 0:r.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(e),this.R)),this.lf}count(t,e=1,n){var r;(r=this.pf())===null||r===void 0||r.count(t,e,n)}gauge(t,e,n){var r;(r=this.pf())===null||r===void 0||r.gauge(t,e,n)}histogram(t,e,n){var r;(r=this.pf())===null||r===void 0||r.histogram(t,e,n)}flush(t){if(!this.lf)return Promise.resolve();if(t){const e=this.lf.drainWindow();return e&&this.To(e,t),Promise.resolve()}return this.lf.flush().catch(e=>this.R.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.lf)===null||t===void 0||t.reset()}dispose(){var t,e;this.Ti=!0,(t=this.Ng)===null||t===void 0||t.call(this),this.Ng=void 0,(e=this.lf)===null||e===void 0||e.reset()}ff(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},To:n=>e.To(n),getLibraryId:()=>Zs.LIB_NAME,getLibraryVersion:()=>Zs.LIB_VERSION}}To(t,e){return new Promise(n=>{let r=!1;const s=o=>{r||(r=!0,clearTimeout(i),n(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(j(j({method:"POST",url:this.jg(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(o){const l=o.statusCode;if(l>=200&&300>l)s({kind:"ok"});else if(l===413)s({kind:"too-large"});else if(l!==0&&l!==408&&l!==429&&500>l)s({kind:"fatal",error:new Error(`metrics request failed with status ${l}`)});else{var c;s({kind:"retry-later",error:(c=o.error)!==null&&c!==void 0?c:new Error(`metrics request failed with status ${l}`)})}}}))})}jg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},{webMCP:class{constructor(t){this._instance=t,this.qg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.qg)return;const t=Oe==null?void 0:Oe.modelContext;if(!t||!Vn(t.registerTool))return;const e=GP.get(t);if(e)return e.instances.add(this._instance),void(this.qg=!0);const n={instances:new Set([this._instance])},r=t.registerTool,s=this;Sf(t,"registerTool",i=>{const o=i;return function(l,...c){let d=l;try{d=s.Bg(l,n)}catch{return o.call(this,l,...c)}return o.call(this,d,...c)}}),t.registerTool!==r&&(GP.set(t,n),this.qg=!0)}Bg(t,e){if(!t||!Vn(t.execute))return t;const n=t.execute,r=this,{tool:s,injected:i}=(function(o,l){const c={intent:!1,model:!1},d=o.inputSchema;if(!(function(y){return!!de(y)||ut(y)&&Object.keys(y).every(_=>BW.has(_)||_.startsWith("x-"))&&y.additionalProperties!==!0&&!ut(y.additionalProperties)&&(!y.type||y.type==="object")&&(!y.properties||ut(y.properties))&&(!y.required||Ue(y.required))})(d))return{tool:V2(o),injected:c};const f=(d==null?void 0:d.properties)||{},h=y=>z2(f,y)||Ue(d==null?void 0:d.required)&&d.required.includes(y);if(c.intent=l.intent&&!h("context"),c.model=l.model&&!h("llm_model"),!c.intent&&!c.model)return{tool:V2(o),injected:c};const m=j({},f),v=Ue(d==null?void 0:d.required)?[...d.required]:[];return c.intent&&(m.context={type:"string",description:`Explain why this tool is called and how it supports the user's goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".`},v.includes("context")||v.push("context")),c.model&&(m.llm_model={type:"string",description:`The model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the site developer's analytics.`},v.includes("llm_model")||v.push("llm_model")),{tool:V2(o,j(j({},d),{},{type:(d==null?void 0:d.type)||"object",properties:m,required:v})),injected:c}})(t,(function(o){const l={intent:!1,model:!1};for(const c of o.instances){const d=YP(c.config.capture_webmcp);l.intent||(l.intent=(d==null?void 0:d.intent)===!0),l.model||(l.model=(d==null?void 0:d.model)===!0)}return l})(e));return Object.defineProperty(s,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){const l=new Date,c=(function(v,y){if(!ut(v))return{};try{const _=y.intent?XP(v.context,2048,!0):void 0,b=y.model?XP(v.llm_model,256):void 0;return j(j({},_&&_!=="{}"?{intent:_}:{}),b&&b.toLowerCase()!=="unknown"?{model:b}:{})}catch{return{}}})(o[0],i),d=(function(v,y){const _=v[0];if(!ut(_))return v;try{const b=y.intent&&z2(_,"context"),x=y.model&&z2(_,"llm_model");if(!b&&!x)return v;const k=j({},_);return b&&delete k.context,x&&delete k.llm_model,[k,...v.slice(1)]}catch{return v}})(o,i);let f;try{f=n.apply(this===s?t:this,d)}catch(v){throw r.zg(e,s,l,{error:v,errorResult:!1},c),v}if((h=f)&&typeof h.then=="function")return Promise.resolve(f).then(v=>{const y=QP(v)?{error:v,errorResult:!0}:void 0;return r.zg(e,s,l,y,c),v},v=>{throw r.zg(e,s,l,{error:v,errorResult:!1},c),v});var h;const m=QP(f)?{error:f,errorResult:!0}:void 0;return r.zg(e,s,l,m,c),f}}),s}zg(t,e,n,r,s){const i=Date.now()-n.getTime();let o;for(const c of t.instances){var l;const d=YP(c.config.capture_webmcp);if(d){r&&!o&&(o=YW(r.error,r.errorResult));try{c.capture("$mcp_tool_call",j(j(j({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:fn==null?void 0:fn.hostname,$mcp_duration_ms:i,$mcp_is_error:!!r},o?{$mcp_error_type:o.type,$mcp_error_message:o.message}:{}),d.intent&&s.intent?{$mcp_intent:s.intent,$mcp_intent_source:"context_parameter"}:{}),d.model&&s.model?{$mcp_llm_model:s.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:n})}catch{continue}if(r&&o&&c.exceptions&&(!((l=c.exceptionObserver)===null||l===void 0)&&l.isEnabled))try{const f={$exception_list:qW(c.exceptions,r,o.message),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:fn==null?void 0:fn.hostname};c.exceptionObserver.captureException(f)}catch{}}}}}}));const XW=(function(){Zs.SDK_DIST_CHANNEL="npm";const t=bp[tp]=new Sp;return(function(){function e(){e.done||(e.done=!0,uM=!1,Kt(bp,function(n){n._dom_loaded()}))}Oe!=null&&Oe.addEventListener?Oe.readyState==="complete"?e():Lt(Oe,"DOMContentLoaded",e,{capture:!1}):ce&&ve.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Qe=XW;function Fb(t){const e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,s])=>e.indexOf(+r)===-1).map(([r,s])=>s)}function JP(t,e="|"){return t.map(n=>MM(n)).join(e)}function jb(t,e){return typeof e=="bigint"?e.toString():e}class QW{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}}function N1(t){return new QW(t)}function JW(t){return t==null}function uk(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function eK(t,e){const n=t/e,r=Math.round(n),s=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}function rl(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function dk(t){const e=Object.getOwnPropertyDescriptor(t,"shape");return e!=null&&e.get?e.get.raw:e==null?void 0:e.value}function Ya(t){return dk(t._zod.def)??t._zod.def.shape}function RM(t,e,n){Object.defineProperty(t,e,{get(){const r=n();return rl(this,e,r),r},enumerable:!0,configurable:!0})}function AM(t,e,n){e in t?rl(t,e,n):t[e]=n}function Nu(t,e,n,r){const s=Ya(e);for(const i of n){const o=Object.getOwnPropertyDescriptor(s,i);o.enumerable&&(o.get?RM(t,i,()=>{const l=e._zod.def.shape[i];return r?r(l,i):l}):AM(t,i,r?r(o.value,i):o.value))}}function tK(t,e){for(const n of Reflect.ownKeys(e)){const r=Object.getOwnPropertyDescriptor(e,n);r.enumerable&&(r.get?RM(t,n,()=>e[n]):AM(t,n,r.value))}}function _i(...t){const e={};for(const n of t){const r=Object.getOwnPropertyDescriptors(n);Object.assign(e,r)}return Object.defineProperties({},e)}function nK(t){return JSON.stringify(t)}function rK(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const IM="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Bp(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const sK=N1(()=>{var t;if(ko.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function kf(t){if(Bp(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(Bp(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function OM(t){return kf(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const iK=new Set(["string","number","symbol"]);function Ef(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _c(t,e,n){const r=new t._zod.constr(e??t._zod.def);return(!e||n!=null&&n.parent)&&(r._zod.parent=t),r}function st(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function MM(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function oK(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}const NM={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},aK={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function lK(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i={};return Nu(i,t,L1(t,e)),_c(t,_i(n,{shape:i,checks:[]}))}function L1(t,e){var s;const n=Ya(t),r=[];for(const i of Reflect.ownKeys(e)){if(!((s=Object.getOwnPropertyDescriptor(n,i))!=null&&s.enumerable))throw new Error(`Unrecognized key: "${String(i)}"`);e[i]&&r.push(i)}return r}function cK(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=new Set(L1(t,e)),o={};return Nu(o,t,Reflect.ownKeys(Ya(t)).filter(l=>!i.has(l))),_c(t,_i(n,{shape:o,checks:[]}))}function uK(t,e){if(!kf(e))throw new Error("Invalid input to extend: expected a plain object");const n=t._zod.def.checks;if(n&&n.length>0){const s=Ya(t);for(const i of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _c(t,_i(t._zod.def,{shape:LM(t,e)}))}function LM(t,e){const n={};return Nu(n,t,Reflect.ownKeys(Ya(t))),tK(n,e),n}function dK(t,e){if(!kf(e))throw new Error("Invalid input to safeExtend: expected a plain object");return _c(t,_i(t._zod.def,{shape:LM(t,e)}))}function fK(t,e){var s,i;if(!((s=e==null?void 0:e._zod)!=null&&s.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((i=t._zod.def.checks)!=null&&i.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Nu(n,t,Reflect.ownKeys(Ya(t))),Nu(n,e,Reflect.ownKeys(Ya(e)));const r=_i(t._zod.def,{shape:n,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return _c(t,r)}function eT(t,e,n,r="partial"){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const l=n?new Set(L1(e,n)):void 0,c={};return Nu(c,e,Reflect.ownKeys(Ya(e)),t&&((d,f)=>l&&!l.has(f)?d:new t({type:"optional",innerType:d}))),_c(e,_i(e._zod.def,{shape:c,checks:[]}))}function hK(t,e,n){const r=n?new Set(L1(e,n)):void 0,s={};return Nu(s,e,Reflect.ownKeys(Ya(e)),(i,o)=>r&&!r.has(o)?i:new t({type:"nonoptional",innerType:i})),_c(e,_i(e._zod.def,{shape:s}))}function Wa(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function pK(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function zd(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function Bh(t){return typeof t=="string"?t:t==null?void 0:t.message}function tT(t){const e=[];for(const n of t??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const s=r.maximum??r.length??r.size;s>=0&&e.push([s,n])}return e}function zb(t,e,n){var r;for(let s=e;s<t.length;s++)(r=t[s]).schema??(r.schema=n)}function ic(t,e,n){var c,d,f,h,m,v,y,_,b,x;var r;const s=(d=(c=t.inst)==null?void 0:c._zod)==null?void 0:d.traits;s!=null&&s.has("$ZodType")&&(s.has("$ZodCheck")?(r=t).schema??(r.schema=t.inst):t.schema=t.inst);const i=t.schema!==t.inst?(h=(f=t.schema)==null?void 0:f._zod.def)==null?void 0:h.error:void 0,o=t.message?t.message:Bh((y=(v=(m=t.inst)==null?void 0:m._zod.def)==null?void 0:v.error)==null?void 0:y.call(v,t))??Bh(i==null?void 0:i(t))??Bh((_=e==null?void 0:e.error)==null?void 0:_.call(e,t))??Bh((b=n.customError)==null?void 0:b.call(n,t))??Bh((x=n.localeError)==null?void 0:x.call(n,t))??"Invalid input",l={};for(const k of Object.keys(t))k==="inst"||k==="schema"||k==="continue"||k==="input"||k==="__proto__"||(l[k]=t[k]);return l.path??(l.path=[]),l.message=o,e!=null&&e.reportInput&&(l.input=t.input),l}const mK=/[\uD800-\uDBFF]/;function fk(t){const e=t.length;if(!mK.test(t))return e;let n=e;for(let r=0;r<e-1;r++)(t.charCodeAt(r)&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function hk(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function gK(t){const e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";const n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Zp(...t){const[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}function vK(t,e){for(const n in e){const r=Object.getOwnPropertyDescriptor(e,n);r.get?Object.defineProperty(t,n,{...r,enumerable:!1}):yK(t,n,r.value)}}function oc(t,e,n,r=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function DM(t,e,n){return oc(t,e,n,!1)}function $M(t,e){for(const n in t){const r=t[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get(){return oc(this,n,r(this))},set(s){oc(this,n,s)}})}return e}function yK(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?n:oc(this,e,n.bind(this))},set(r){oc(this,e,r)}})}function _K(t,e){const n=Object.getPrototypeOf(t);return e in n?void 0:n}let H2,Al=!1;const wK={configurable:!0,get(){Al=!0}};function an(t,e,n){const r=Object.getPrototypeOf(t._zod);if(e in r&&H2!==t._zod){H2=void 0;return}H2=t._zod,Object.defineProperty(r,e,{configurable:!0,get(){Object.defineProperty(this,e,wK);const s=Al;Al=!1;try{const i=n(this);return Al?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:i}),Al=Al||s,i}catch(i){throw delete this[e],Al=Al||s,i}},set(s){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:s})}})}function bK(t,e,n,r){const s=_K(t,e);s&&Object.defineProperty(s,e,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,e,i),i.value=n(this),Object.defineProperty(this,e,i),i.value},set(i){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:r,value:i})}})}const xK="~constantCatch";function SK(t){const e=()=>t;return e[xK]=!0,e}var nT;const FM=Object.freeze({status:"aborted"}),U2={value:void 0,enumerable:!1};let rT="captureStackTrace"in Error?Error:null;function kK(t){const e=rT;if(e){const n=e.stackTraceLimit;if(typeof n=="number"){try{e.stackTraceLimit=0}catch{return rT=null,new t}try{return new t}finally{e.stackTraceLimit=n}}}return new t}function me(t,e,n,r){const s={};function i(m){this.def=m,this.constr=h,this.traits=new Set}i.prototype=s;const o=n,l=o&&new WeakSet;function c(m,v){if(m._zod){if(m._zod.traits.has(t))return}else{U2.value=new i(v);try{Object.defineProperty(m,"_zod",U2)}finally{U2.value=void 0}}if(m._zod.traits.add(t),e(m,v),l){const _=Object.getPrototypeOf(m),b=m._zod.constr.prototype;let x=_;for(;x&&x!==b;)x=Object.getPrototypeOf(x);const k=x??_;l.has(k)||(l.add(k),vK(k,o))}const y=h.prototype;for(const _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(_ in m||(m[_]=y[_].bind(m)))}const d=(r==null?void 0:r.Parent)??Object;class f extends d{}Object.defineProperty(f,"name",{value:t});function h(m){var b;const v=r!=null&&r.Parent?kK(f):this;c(v,m);const y=v._zod.deferred;if(y){for(const x of y)x();v._zod.deferred=void 0}const _=(b=globalThis.__zod_globalConfig)==null?void 0:b.postProcessor;return _&&_(v),v}return Object.defineProperty(h,"init",{value:c}),Object.defineProperty(h,Symbol.hasInstance,{value:m=>{var v,y;return r!=null&&r.Parent&&m instanceof r.Parent?!0:(y=(v=m==null?void 0:m._zod)==null?void 0:v.traits)==null?void 0:y.has(t)}}),Object.defineProperty(h,"name",{value:t}),h}class xu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jM extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(nT=globalThis).__zod_globalConfig??(nT.__zod_globalConfig={});const ko=globalThis.__zod_globalConfig;function la(t){return t&&Object.assign(ko,t),ko}function EK(){const t=this._zod;return t.message??(t.message=JSON.stringify(t.def,jb,2)),t.message}function CK(t){this._zod.message=t}const PK={get:EK,set:CK,enumerable:!0,configurable:!0},B2={value:void 0,enumerable:!1},sT=new WeakSet([Object.prototype,Error.prototype]),TK=(t,e)=>{t.name="$ZodError",B2.value=e,Object.defineProperty(t,"issues",B2),B2.value=void 0,Object.defineProperty(t,"message",PK);const n=Object.getPrototypeOf(t);sT.has(n)||(sT.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},RK=me("$ZodError",TK);function AK(t,e,n){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:n(),writable:!0,enumerable:!0,configurable:!0}):t[e]=n()),t[e]}function IK(t,e=n=>n.message){const n={},r=[];for(const s of t.issues)s.path.length>0?AK(n,s.path[0],()=>[]).push(e(s)):r.push(e(s));return{formErrors:r,fieldErrors:n}}function OK(t,e=n=>n.message){const n={_errors:[]},r=(s,i=[])=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(l=>r({issues:l},[...i,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...i,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...i,...o.path]);else{const l=[...i,...o.path];if(l.length===0)n._errors.push(e(o));else{let c=n,d=0;for(;d<l.length;){const f=l[d],h=d===l.length-1;if(f==="_errors"){h&&c._errors.push(e(o)),d++;continue}Object.prototype.hasOwnProperty.call(c,f)||Object.defineProperty(c,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const m=c[f];h&&m._errors.push(e(o)),c=m,d++}}}};return r(t),n}function D1(t,e){return{callee:(e==null?void 0:e.callee)??t,Err:e==null?void 0:e.Err}}const pk=t=>{const e=(n,r,s,i)=>{const o=s?{...s,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new xu;if(l.issues.length){const c=new((i==null?void 0:i.Err)??t)(l.issues.map(d=>ic(d,o,la())));throw IM(c,(i==null?void 0:i.callee)??e),c}return l.value};return e},mk=t=>{const e=async(n,r,s,i)=>{const o=s?{...s,async:!0}:{async:!0};let l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){const c=new((i==null?void 0:i.Err)??t)(l.issues.map(d=>ic(d,o,la())));throw IM(c,(i==null?void 0:i.callee)??e),c}return l.value};return e},gk=t=>(e,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new xu;return i.issues.length?zM(t,i.issues,s):{success:!0,data:i.value}};function zM(t,e,n){let r;return{success:!1,get error(){return r||(r=new t(e.map(s=>ic(s,n,la()))),e=void 0,n=void 0),r},set error(s){r=s,e=void 0,n=void 0}}}const vk=t=>async(e,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=e._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?zM(t,i.issues,s):{success:!0,data:i.value}},MK=Symbol.for("zod.compile.invalid"),NK=Symbol.for("zod.compile.fallback"),LK=((t,e,n)=>{const r=t._zod.bag.validator;if(r!==void 0){if(r(e)!==MK)return!0;if(r.definite===!0&&n===void 0)return!1}return DK(t,e,n)});function DK(t,e,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=t._zod.bag.fallbackRun;let i;if(s?(r[NK]=!0,i=s({value:e,issues:[]},r)):i=t._zod.run({value:e,issues:[]},r),i instanceof Promise)throw new xu;return i.issues.length===0}const $K=async(t,e,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let s=t._zod.run({value:e,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length===0},FK=t=>{const e=pk(t),n=(r,s,i,o)=>{const l=i?{...i,direction:"backward"}:{direction:"backward"};return e(r,s,l,D1(n,o))};return n},jK=t=>{const e=pk(t),n=(r,s,i,o)=>e(r,s,i,D1(n,o));return n},zK=t=>{const e=mk(t),n=async(r,s,i,o)=>{const l=i?{...i,direction:"backward"}:{direction:"backward"};return await e(r,s,l,D1(n,o))};return n},VK=t=>{const e=mk(t),n=async(r,s,i,o)=>await e(r,s,i,D1(n,o));return n},HK=t=>(e,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return gk(t)(e,n,s)},UK=t=>(e,n,r)=>gk(t)(e,n,r),BK=t=>async(e,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return vk(t)(e,n,s)},ZK=t=>async(e,n,r)=>vk(t)(e,n,r),WK=/^[cC][0-9a-z]{6,}$/,KK=/^[0-9a-z]+$/,qK=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,GK=/^[0-9a-vA-V]{20}$/,YK=/^[A-Za-z0-9]{27}$/,XK=/^[a-zA-Z0-9_-]{21}$/;function QK(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}const JK=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eq=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,iT=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tq=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nq="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function rq(){return new RegExp(nq,"u")}const sq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,iq=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,oq=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,aq=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lq=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cq=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,uq=/^https?$/,dq=/^\+[1-9]\d{6,14}$/,VM="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function fq(t){return new RegExp(`^${t}$`)}const hq=fq(VM);function Vb(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pq(t){return new RegExp(`^${Vb(t)}$`)}function mq(t){const e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${Vb({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,r=t.local?`${n}|${Vb({precision:t.precision})}`:n;return new RegExp(`^${VM}T(?:${r})$`)}const gq=/^[\s\S]{0,}$/,vq=/^-?\d+$/,yk=/^-?\d+(?:\.\d+)?$/,yq=/^(?:true|false)$/i,_q=/^[^A-Z]*$/,wq=/^[^a-z]*$/,si=me("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),_k=t=>{const e=t.value;return!JW(e)&&e.length!==void 0},$v={number:"number",bigint:"bigint",object:"date"},HM=me("$ZodCheckLessThan",(t,e)=>{si.init(t,e);const n=$v[typeof e.value];t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:$v[typeof r.value]??n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),UM=me("$ZodCheckGreaterThan",(t,e)=>{si.init(t,e);const n=$v[typeof e.value];t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:$v[typeof r.value]??n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),bq=me("$ZodCheckMultipleOf",(t,e)=>{si.init(t,e),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?e.value!==BigInt(0)&&n.value%e.value===BigInt(0):eK(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),xq=me("$ZodCheckNumberFormat",(t,e)=>{var o;si.init(t,e),e.format=e.format||"float64";const n=(o=e.format)==null?void 0:o.includes("int"),r=n?"int":"number",[s,i]=NM[e.format];t._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort});return}}c<s&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:s,inclusive:!0,inst:t,continue:!e.abort}),c>i&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),Sq=me("$ZodCheckMaxLength",(t,e)=>{var n;si.init(t,e),(n=t._zod.def).when??(n.when=_k),t._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>e.maximum?fk(s):i)<=e.maximum)return;const l=hk(s);r.issues.push({origin:l,code:"too_big",maximum:e.maximum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),kq=me("$ZodCheckMinLength",(t,e)=>{var n;si.init(t,e),(n=t._zod.def).when??(n.when=_k),t._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>=e.minimum&&i<e.minimum*2?fk(s):i)>=e.minimum)return;const l=hk(s);r.issues.push({origin:l,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),Eq=me("$ZodCheckLengthEquals",(t,e)=>{var n;si.init(t,e),(n=t._zod.def).when??(n.when=_k),t._zod.check=r=>{const s=r.value,i=s.length,o=typeof s=="string"&&i>=e.length&&i<=e.length*2?fk(s):i;if(o===e.length)return;const l=hk(s),c=o>e.length;r.issues.push({origin:l,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),$1=me("$ZodCheckStringFormat",(t,e)=>{var n,r;si.init(t,e),e.pattern?(n=t._zod).check??(n.check=s=>{e.pattern.lastIndex=0,!e.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:e.format,input:s.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),Cq=me("$ZodCheckRegex",(t,e)=>{$1.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Pq=me("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=_q),$1.init(t,e)}),Tq=me("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=wq),$1.init(t,e)}),Rq=me("$ZodCheckIncludes",(t,e)=>{si.init(t,e);const n=Ef(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position},}${n}`:n);e.pattern=r,t._zod.check=s=>{s.value.includes(e.includes,e.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:s.value,inst:t,continue:!e.abort})}}),Aq=me("$ZodCheckStartsWith",(t,e)=>{si.init(t,e);const n=new RegExp(`^${Ef(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Iq=me("$ZodCheckEndsWith",(t,e)=>{si.init(t,e);const n=new RegExp(`.*${Ef(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),Oq=me("$ZodCheckOverwrite",(t,e)=>{si.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class Mq{constructor(e=[],n={}){this.content=[],this.indent=0,this.args=e,this.closed=n}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
22
- `).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const e=Function,n=(this==null?void 0:this.content)??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
23
- ${n.join(`
24
- `)}
25
- };`)(...Object.values(this.closed))}}const Nq={major:4,minor:6,patch:7},Xn=me("$ZodType",(t,e)=>{var i;var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Nq;const r=t._zod.def.checks,s=t._zod.traits.has("$ZodCheck")?[t,...r??[]]:r!=null&&r.length?[...r]:[];for(const o of s)for(const l of o._zod.onattach)l(t);if(s.length===0)(n=t._zod).deferred??(n.deferred=[]),(i=t._zod.deferred)==null||i.push(()=>{t._zod.run=t._zod.parse});else{const o=(c,d,f)=>{if(c.memo)return c;let h=Wa(c),m;for(const v of d){if(v._zod.def.when){if(pK(c)||!v._zod.def.when(c))continue}else if(h)continue;const y=c.issues.length,_=v._zod.check(c);if(_ instanceof Promise&&(f==null?void 0:f.async)===!1)throw new xu;if(m||_ instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await _,c.issues.length!==y&&(zb(c.issues,y,t),h||(h=Wa(c,y)))});else{if(c.issues.length===y)continue;zb(c.issues,y,t),h||(h=Wa(c,y))}}return m?m.then(()=>c):c},l=(c,d,f)=>{if(Wa(c))return c.aborted=!0,c;const h=o(d,s,f);if(h instanceof Promise){if(f.async===!1)throw new xu;return h.then(m=>t._zod.parse(m,f))}return t._zod.parse(h,f)};t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){const h=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(m=>l(m,c,d)):l(h,c,d)}const f=t._zod.parse(c,d);if(f instanceof Promise){if(d.async===!1)throw new xu;return f.then(h=>o(h,s,d))}return o(f,s,d)}}},{get"~standard"(){return DM(this,"~standard",ZM(this))},set"~standard"(t){oc(this,"~standard",t)}}),BM=(t,e)=>t.issues.length?{issues:t.issues.map(n=>ic(n,e,la()))}:{value:t.value};async function Lq(t,e){const n={async:!0};return BM(await t._zod.run({value:e,issues:[]},n),n)}function ZM(t){return{validate:e=>{const n={async:!1};try{const r=t._zod.run({value:e,issues:[]},n);if(!(r instanceof Promise))return BM(r,n)}catch{}return Lq(t,e)},vendor:"zod",version:1}}const wk=me("$ZodString",(t,e)=>{Xn.init(t,e),t._zod.pattern=e.pattern??gq,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Un=me("$ZodStringFormat",(t,e)=>{$1.init(t,e),wk.init(t,e)}),Dq=me("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=eq),Un.init(t,e)}),$q=me("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=iT(r))}else e.pattern??(e.pattern=iT());Un.init(t,e)}),Fq=me("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=tq),Un.init(t,e)}),WM=1,Fv=2;function KM(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function jq(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?KM(t)||Fv:zq(t,e)}function zq(t,e){var n;if(!e.normalize&&((n=e.protocol)==null?void 0:n.source)===uq.source&&!/^https?:\/\//i.test(t))return WM;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(t)??Fv}return new URL(t)}catch{return Fv}}const Vq=/[\t\n\r]/g;function oT(t){return t.replace(Vq,"")}function Hq(t,e){return e.lastIndex=0,e.test(t.hostname)}function Uq(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}const Bq=me("$ZodURL",(t,e)=>{Un.init(t,e),t._zod.check=n=>{try{const r=n.value.trim(),s=jq(r,e);if(s===WM){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}if(s===Fv){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort});return}if(s===!0){n.value=oT(r);return}e.hostname&&!Hq(s,e.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort}),e.protocol&&!Uq(s,e.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort}),n.value=e.normalize?s.href:oT(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Zq=me("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=rq()),Un.init(t,e)}),Wq=me("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?XK:QK(e.length)),Un.init(t,e)}),Kq=me("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=WK),Un.init(t,e)}),qq=me("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=KK),Un.init(t,e)}),Gq=me("$ZodULID",(t,e)=>{e.pattern??(e.pattern=qK),Un.init(t,e)}),Yq=me("$ZodXID",(t,e)=>{e.pattern??(e.pattern=GK),Un.init(t,e)}),Xq=me("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=YK),Un.init(t,e)}),Qq=me("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=mq(e)),Un.init(t,e)}),Jq=me("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=hq),Un.init(t,e)}),eG=me("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=pq(e)),Un.init(t,e)}),tG=me("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=JK),Un.init(t,e)}),nG=me("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=sq),Un.init(t,e)}),rG=/^[0-9a-fA-F:.]+$/;function qM(t){return rG.test(t)?KM(`http://[${t}]`):!1}const sG=me("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=iq),Un.init(t,e),t._zod.check=n=>{qM(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}),iG=me("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=oq),Un.init(t,e)});function oG(t){const e=t.split("/");if(e.length!==2)return!1;const[n,r]=e;if(!r)return!1;const s=Number(r);return`${s}`!==r||s<0||s>128?!1:qM(n)}const aG=me("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=aq),Un.init(t,e),t._zod.check=n=>{oG(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}});function GM(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const YM=/^[0-9a-zA-Z+/]*={0,2}$/,lG=me("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=YM),Un.init(t,e),t._zod.check=n=>{GM(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}}),bk=/^[A-Za-z0-9_-]*$/;function cG(t){if(!bk.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return GM(n)}const uG=me("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=bk),Un.init(t,e),t._zod.check=n=>{cG(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),dG=me("$ZodE164",(t,e)=>{e.pattern??(e.pattern=dq),Un.init(t,e)});function fG(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&(!("alg"in s)||s.alg!==e))}catch{return!1}}const hG=me("$ZodJWT",(t,e)=>{Un.init(t,e),t._zod.check=n=>{fG(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),XM=me("$ZodNumber",(t,e)=>{Xn.init(t,e),t._zod.pattern=yk,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:String(s):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:t,...i?{received:i}:{}}),n}}),pG=me("$ZodNumberFormat",(t,e)=>{xq.init(t,e),XM.init(t,e)}),mG=me("$ZodBoolean",(t,e)=>{Xn.init(t,e),t._zod.pattern=yq,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:t}),n}}),gG=me("$ZodUnknown",(t,e)=>{Xn.init(t,e),t._zod.parse=n=>n}),vG=me("$ZodNever",(t,e)=>{Xn.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function yG(t,e){const n=tT(t._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(i=>i[0])),s=t._zod.parse;t._zod.parse=(i,o)=>{const l=e(i.value);if(l>r&&!(o!=null&&o.skipChecks)&&(o==null?void 0:o.direction)!=="backward"){for(const[c,d]of tT(t._zod.def.checks))if(l>c&&d._zod.def.when(i)){const f=i.issues.length;return d._zod.check(i),i.issues[f].continue=!1,zb(i.issues,f,t),i}}return s(i,o)}}const _G=t=>Array.isArray(t)?t.length:-1;function aT(t,e,n){t.issues.length&&e.issues.push(...zd(n,t.issues)),e.value[n]=t.value}const wG=me("$ZodArray",(t,e)=>{Xn.init(t,e);const n=ko.memoizer;n==null||n.attach(t),t._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=n?n.alloc(t,r,Array(i.length),s):Array(i.length);const o=[],l=s==null?void 0:s.abortEarly;for(let c=0;c<i.length;c++){const d=i[c],f=e.element._zod.run({value:d,issues:[]},s);if(f instanceof Promise)o.push(f.then(h=>aT(h,r,c)));else if(aT(f,r,c),l&&f.issues.length!==0&&Wa(f))break}return o.length?Promise.all(o).then(()=>r):r},yG(t,_G)});function jv(t,e,n,r,s,i){const o=n in r,l=i==="optional";if(!(!o&&l&&s==="optional")){if(t.issues.length){if(s!==void 0&&l&&!o)return;e.issues.push(...zd(n,t.issues))}if(!o&&s===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?(o||s==="defaulted"&&!l)&&(e.value[n]=void 0):e.value[n]=t.value}}const bG=[];function QM(t){var o,l,c,d;const e=Object.keys(t.shape),n=Object.getOwnPropertySymbols(t.shape),r=n.length?n:bG,s=r.length?[...e,...r]:e;for(const f of s)if(!((d=(c=(l=(o=t.shape)==null?void 0:o[f])==null?void 0:l._zod)==null?void 0:c.traits)!=null&&d.has("$ZodType")))throw new Error(`Invalid element at key "${String(f)}": expected a Zod schema`);const i=oK(t.shape);return{...t,allKeys:s,symbolKeys:r,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(i)}}function JM(t,e,n,r,s,i,o){const l=[],c=s.keySet,d=s.catchall._zod,f=d.def.type,h=d.optin,m=d.optout;let v=0;for(const y in e){if(o&&n.issues.length!==v){if(Wa(n,v))break;v=n.issues.length}if(c.has(y))continue;if(y==="__proto__"){f==="never"&&l.push(y);continue}if(f==="never"){l.push(y);continue}const _=d.run({value:e[y],issues:[]},r);_ instanceof Promise?t.push(_.then(b=>jv(b,n,y,e,h,m))):jv(_,n,y,e,h,m)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:e,inst:i,continue:!0}),t.length?Promise.all(t).then(()=>n):n}const xG=me("$ZodObject",(t,e)=>{Xn.init(t,e);const n=Object.getOwnPropertyDescriptor(e,"shape"),r=n!=null&&n.get?n.get.raw:e.shape??{};if(r){const d=()=>{const f={...r};return Object.defineProperty(e,"shape",{value:f}),d.raw=f,f};d.raw=r,Object.defineProperty(e,"shape",{get:d})}const s=N1(()=>QM(e));an(t,"propValues",d=>{const f=d.def.shape,h={};for(const m in f){const v=f[m]._zod;if(v.values){Object.prototype.hasOwnProperty.call(h,m)||rl(h,m,new Set);for(const y of v.values)h[m].add(y);v.optin!==void 0&&h[m].add(void 0)}}return h});const i=Bp,o=e.catchall;let l;const c=ko.memoizer;c==null||c.attach(t),t._zod.parse=(d,f)=>{l??(l=s.value);const h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),d;d.value=c?c.alloc(t,d,{},f):{};const m=[],v=l.shape,y=f==null?void 0:f.abortEarly;let _=d.issues.length;for(const b of l.allKeys){if(y&&d.issues.length!==_){if(Wa(d,_))break;_=d.issues.length}if(b==="__proto__")continue;const x=v[b],k=x._zod.optin,C=x._zod.optout,P=x._zod.run({value:h[b],issues:[]},f);P instanceof Promise?m.push(P.then(R=>jv(R,d,b,h,k,C))):jv(P,d,b,h,k,C)}return o?JM(m,h,d,f,s.value,t,y===!0):m.length?Promise.all(m).then(()=>d):d}}),SG=me("$ZodObjectJIT",(t,e)=>{xG.init(t,e);const n=t._zod.parse,r=N1(()=>QM(e)),s=ko.memoizer,i=v=>{var R,O;const y=r.value,_=y.symbolKeys,b=new Mq(["payload","ctx"],{shape:v,inst:t,memo:s,syms:_}),x=I=>`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`,k=(I,A)=>`
26
- let ${I}_ab = false;
27
- for (let i = 0; i < ${I}.issues.length; i++) {
28
- const iss = ${I}.issues[i];
29
- iss.path = iss.path ? [${A}, ...iss.path] : [${A}];
30
- payload.issues.push(iss);
31
- if (iss.continue !== true) ${I}_ab = true;
32
- }
33
- if (${I}_ab && ctx && ctx.abortEarly) {
34
- payload.value = newResult;
35
- return payload;
36
- }`;b.write("const input = payload.value;");const C=Object.create(null);let P=0;for(const I of y.allKeys)C[I]=`key_${P++}`;b.write(s?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const I of y.allKeys){if(I==="__proto__")continue;const A=C[I],M=typeof I=="symbol"?`syms[${_.indexOf(I)}]`:nK(I),L=`${M} in input`,z=v[I],$=(R=z==null?void 0:z._zod)==null?void 0:R.optin,q=$!==void 0,X=((O=z==null?void 0:z._zod)==null?void 0:O.optout)==="optional";if(b.write(`const ${A} = ${x(M)};`),q&&X){const K=$==="optional"?`${A}_present`:`${A}.value !== undefined || ${A}_present`;b.write(`
37
- const ${A}_present = ${L};
38
- if (!${A}.issues.length || ${A}_present) {
39
- if (${A}.issues.length) {${k(A,M)}
40
- }
41
-
42
- if (${K}) {
43
- newResult[${M}] = ${A}.value;
44
- }
45
- }
46
-
47
- `)}else q?(b.write(`
48
- if (${A}.issues.length) {${k(A,M)}
49
- }
50
- `),$==="defaulted"?b.write(`newResult[${M}] = ${A}.value;`):b.write(`
51
- if (${A}.value !== undefined || ${L}) {
52
- newResult[${M}] = ${A}.value;
53
- }
54
- `)):b.write(`
55
- const ${A}_present = ${L};
56
- if (${A}.issues.length) {${k(A,M)}
57
- }
58
- if (!${A}_present && !${A}.issues.length) {
59
- payload.issues.push({
60
- code: "invalid_type",
61
- expected: "nonoptional",
62
- input: undefined,
63
- path: [${M}]
64
- });
65
- if (ctx && ctx.abortEarly) {
66
- payload.value = newResult;
67
- return payload;
68
- }
69
- }
70
-
71
- if (${A}_present) {
72
- newResult[${M}] = ${A}.value;
73
- }
74
-
75
- `)}return b.write("payload.value = newResult;"),b.write("return payload;"),b.compile()};let o;const l=Bp,c=!ko.jitless,f=c&&sK.value,h=e.catchall;let m;t._zod.parse=(v,y)=>{m??(m=r.value);const _=v.value;return l(_)?c&&f&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(o||(o=i(e.shape)),v=o(v,y),h?JM([],_,v,y,m,t,(y==null?void 0:y.abortEarly)===!0):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:_,inst:t}),v)}});function lT(t,e,n,r){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;const s=t.filter(i=>!Wa(i));return s.length===1?(e.value=s[0].value,s[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(o=>ic(o,r,la())))}),e)}const eN=me("$ZodUnion",(t,e)=>{Xn.init(t,e),an(t,"optin",r=>r.def.options.some(s=>s._zod.optin==="defaulted")?"defaulted":r.def.options.some(s=>s._zod.optin!==void 0)?"optional":void 0),an(t,"optout",r=>r.def.options.some(s=>s._zod.optout==="optional")?"optional":void 0),an(t,"values",r=>{if(r.def.options.every(s=>s._zod.values))return new Set(r.def.options.flatMap(s=>Array.from(s._zod.values)))}),an(t,"pattern",r=>{if(r.def.options.every(s=>s._zod.pattern)){const s=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>uk(i.source)).join("|")})$`)}});const n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const o=[];for(const l of e.options){const c=l._zod.run({value:r.value,issues:[]},s);if(c instanceof Promise)o.push(c),i=!0;else{if(c.issues.length===0)return c;o.push(c)}}return i?Promise.all(o).then(l=>lT(l,r,t,s)):lT(o,r,t,s)}});function kG(t){var n;const e=new Map;for(const r of t.options){const s=(n=r._zod.propValues)==null?void 0:n[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const i of s)if(e.has(i)){if(i!==void 0)throw new Error(`Duplicate discriminator value "${String(i)}"`);e.set(i,null)}else e.set(i,r)}return e}const EG=me("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,eN.init(t,e);const n=t._zod.parse;an(t,"propValues",s=>{var l,c;const i={};let o=0;for(const d of s.def.options){const f=d._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${s.def.options.indexOf(d)}"`);(l=f[s.def.discriminator])!=null&&l.has(void 0)&&o++;for(const[h,m]of Object.entries(f)){Object.prototype.hasOwnProperty.call(i,h)||rl(i,h,new Set);for(const v of m)i[h].add(v)}}return!s.def.unionFallback&&o>1&&((c=i[s.def.discriminator])==null||c.delete(void 0)),i}),e.options.forEach((s,i)=>{const o=dk(s._zod.def);if(o&&!Object.prototype.hasOwnProperty.call(o,e.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const r=N1(()=>kG(e));t._zod.parse=(s,i)=>{const o=s.value;if(!Bp(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),s;const l=o==null?void 0:o[e.discriminator],c=r.value.get(l);return c&&(l!==void 0||i.direction!=="backward")?c._zod.run(s,i):e.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(r.value.keys()).filter(d=>r.value.get(d)!==null),input:o,path:[e.discriminator],inst:t}),s)}}),CG=me("$ZodIntersection",(t,e)=>{Xn.init(t,e),t._zod.parse=(n,r)=>{const s=n.value,i=e.left._zod.run({value:s,issues:[]},r),o=e.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([c,d])=>cT(n,c,d)):cT(n,i,o)}});function Hb(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(kf(t)&&kf(e)){const n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),s={...t,...e};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(const i of r){if(i==="__proto__")continue;const o=Hb(t[i],e[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=e[r],o=Hb(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function cT(t,e,n){const r=new Map;let s;const i=new Map,o=(d,f)=>{var m,v;let h;if(d.code==="unrecognized_keys"&&!((m=d.path)!=null&&m.length))s??(s=d),h=d.keys;else if(d.code==="invalid_key"&&d.origin==="record"&&((v=d.path)==null?void 0:v.length)===1){const y=String(d.path[0]);i.has(y)||i.set(y,d),h=[y]}else return!1;for(const y of h)r.has(y)||r.set(y,{}),r.get(y)[f]=!0;return!0};for(const d of e.issues)o(d,"l")||t.issues.push(d);for(const d of n.issues)o(d,"r")||t.issues.push(d);const l=[...r].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(l.length){const d=s?l.filter(f=>s.keys.includes(f)):[];d.length&&t.issues.push({...s,keys:d});for(const f of l)!d.includes(f)&&i.has(f)&&t.issues.push(i.get(f))}const c=Hb(e.value,n.value);if(!c.valid){if(Wa(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return t.value=c.data,t}const PG=me("$ZodRecord",(t,e)=>{Xn.init(t,e);const n=ko.memoizer;n==null||n.attach(t),t._zod.parse=(r,s)=>{const i=r.value;if(!kf(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;const o=[],l=e.keyType._zod.values;if(l&&!e.partial){r.value=n?n.alloc(t,r,{},s):{};const c=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){if(c.add(typeof f=="number"?f.toString():f),f==="__proto__")continue;const h=e.keyType._zod.run({value:f,issues:[]},s);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(y=>ic(y,s,la())),input:f,path:[f],inst:t});continue}const m=h.value;if(m==="__proto__")continue;const v=e.valueType._zod.run({value:i[f],issues:[]},s);v instanceof Promise?o.push(v.then(y=>{y.issues.length&&r.issues.push(...zd(f,y.issues)),r.value[m]=y.value})):(v.issues.length&&r.issues.push(...zd(f,v.issues)),r.value[m]=v.value)}let d;for(const f in i)if(!c.has(f))if(e.mode==="loose"){if(f==="__proto__")continue;r.value[f]=i[f]}else d=d??[],d.push(f);d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:d,continue:!0})}else{r.value=n?n.alloc(t,r,{},s):{};let c;for(const d of Reflect.ownKeys(i)){if(d==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,d))continue;let f=e.keyType._zod.run({value:d,issues:[]},s);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&yk.test(d)&&f.issues.length){const y=e.keyType._zod.run({value:Number(d),issues:[]},s);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(f=y)}if(f.issues.length){e.mode==="loose"?r.value[d]=i[d]:l?(c=c??[],c.push(d)):r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(y=>ic(y,s,la())),input:d,path:[d],inst:t});continue}const m=f.value;if(m==="__proto__")continue;const v=e.valueType._zod.run({value:i[d],issues:[]},s);v instanceof Promise?o.push(v.then(y=>{y.issues.length&&r.issues.push(...zd(d,y.issues)),r.value[m]=y.value})):(v.issues.length&&r.issues.push(...zd(d,v.issues)),r.value[m]=v.value)}c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),TG=me("$ZodEnum",(t,e)=>{Xn.init(t,e);const n=Fb(e.entries),r=new Set(n);t._zod.values=r,an(t,"pattern",s=>{const i=Fb(s.def.entries).filter(o=>iK.has(typeof o));return new RegExp(i.length?`^(${i.map(o=>Ef(o.toString())).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:t}),s}}),RG=me("$ZodLiteral",(t,e)=>{Xn.init(t,e);const n=new Set(e.values);t._zod.values=n,an(t,"pattern",r=>{const s=r.def.values;return new RegExp(s.length?`^(${s.map(i=>typeof i=="string"?Ef(i):i?Ef(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),r}}),AG=me("$ZodTransform",(t,e)=>{var n;Xn.init(t,e),t._zod.optin="optional",(n=ko.memoizer)==null||n.guard(t),t._zod.parse=(r,s)=>{if(s.direction==="backward")throw new jM(t.constructor.name);const i=e.transform(r.value,r);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(r.value=l,r));if(i instanceof Promise)throw new xu;return r.value=i,r}});function uT(t,e){return t.value=e.issues.length?void 0:e.value,t}const tN=me("$ZodOptional",(t,e)=>{Xn.init(t,e),an(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",an(t,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),an(t,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${uk(r.source)})?$`):void 0}),t._zod.parse=(n,r)=>{if(n.value===void 0){if(e.innerType._zod.optin!=="defaulted")return n;const s=e.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>uT(n,i)):uT(n,s)}return e.innerType._zod.run(n,r)}}),IG=me("$ZodExactOptional",(t,e)=>{tN.init(t,e),an(t,"values",n=>n.def.innerType._zod.values),an(t,"pattern",n=>n.def.innerType._zod.pattern),t._zod.parse=(n,r)=>e.innerType._zod.run(n,r)}),OG=me("$ZodNullable",(t,e)=>{Xn.init(t,e),an(t,"optin",n=>n.def.innerType._zod.optin),an(t,"optout",n=>n.def.innerType._zod.optout),an(t,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${uk(r.source)}|null)$`):void 0}),an(t,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),MG=me("$ZodDefault",(t,e)=>{Xn.init(t,e),t._zod.optin="defaulted",an(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);if(n.value===void 0)return n.value=e.defaultValue,n;const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>dT(i,e)):dT(s,e)}});function dT(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const NG=me("$ZodPrefault",(t,e)=>{Xn.init(t,e),t._zod.optin="defaulted",an(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),LG=me("$ZodNonOptional",(t,e)=>{Xn.init(t,e),an(t,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),t._zod.parse=(n,r)=>{const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>fT(i,t)):fT(s,t)}});function fT(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function hT(t,e,n,r){return e.issues.length?(t.value=n.catchValue({...e,value:t.value,error:{issues:e.issues.map(s=>ic(s,r,la()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}const DG=me("$ZodCatch",(t,e)=>{Xn.init(t,e),an(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),an(t,"optout",n=>n.def.innerType._zod.optout),an(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>hT(n,i,e,r)):hT(n,s,e,r)}}),$G=me("$ZodPipe",(t,e)=>{Xn.init(t,e),an(t,"values",n=>n.def.in._zod.values),an(t,"optin",n=>n.def.in._zod.optin),an(t,"optout",n=>n.def.out._zod.optout),an(t,"propValues",n=>n.def.in._zod.propValues),t._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=e.out._zod.run(n,r);return i instanceof Promise?i.then(o=>ig(o,e.in,r)):ig(i,e.in,r)}const s=e.in._zod.run(n,r);return s instanceof Promise?s.then(i=>ig(i,e.out,r)):ig(s,e.out,r)}});function ig(t,e,n){return t.issues.some(r=>r.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}const FG=me("$ZodReadonly",(t,e)=>{Xn.init(t,e),an(t,"propValues",n=>n.def.innerType._zod.propValues),an(t,"values",n=>n.def.innerType._zod.values),an(t,"optin",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optin}),an(t,"optout",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optout}),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(pT):pT(s)}});function pT(t){return t.memo||(t.value=Object.freeze(t.value)),t}const jG=me("$ZodCustom",(t,e)=>{si.init(t,e),Xn.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,s=e.fn(r);if(s instanceof Promise)return s.then(i=>mT(i,n,r,t));mT(s,n,r,t)}});function mT(t,e,n,r){if(!t){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),e.issues.push(Zp(s))}}class zG extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Ub="~memo",gT=[];function nN(t){return t!==null&&typeof t=="object"}function Z2(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const rN=new WeakMap,rp=0,Ug=1,kp=2;function Bg(t,e,n){const r=rN.get(t);if(r!==void 0)return r?kp:rp;if(e.has(t))return kp;e.add(t);let s=rp;const i=f=>{if(s!==kp&&(f!=null&&f._zod)){const h=Bg(f,e);h>s&&(s=h)}},o=(f,h)=>{var v;let m=rp;for(const y of Reflect.ownKeys(f)){const _=Object.getOwnPropertyDescriptor(f,y);if(!_.enumerable)continue;const b=_.get?Ug:(v=_.value)!=null&&v._zod?Bg(_.value,e):rp;b>m&&(m=b)}return m},l=f=>{f>s&&(s=f)},c=t._zod.def;switch(c.type){case"object":{const f=dk(c);l(f?o(f):Ug),i(c.catchall);break}case"array":i(c.element);break;case"tuple":for(const f of c.items)i(f);i(c.rest);break;case"record":case"map":i(c.keyType),i(c.valueType);break;case"set":i(c.valueType);break;case"union":for(const f of c.options)i(f);break;case"intersection":i(c.left),i(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(c.innerType);break;case"pipe":i(c.in),i(c.out);break;case"function":i(c.input),i(c.output);break;case"lazy":{const f=c._cachedInner??void 0;l(f?Bg(f,e):Ug);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const f in c){const h=Object.getOwnPropertyDescriptor(c,f);if(!h||h.get)continue;const m=h.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(const v of m)i(v)}}}return e.delete(t),VG(t,s)}function VG(t,e){return e!==Ug&&rN.set(t,e===kp),e}function HG(t,e){let n=t.buckets.get(e);return n||(n=new WeakMap,t.buckets.set(e,n)),n}let og;const ag=[],UG={alloc(t,e,n){const r=og;if(!r)return n;og=void 0;const s={value:n,issues:null};return r.set(e.value,s),ag.push(s),n},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const n=t._zod.parse,r=(s,i)=>{if(i.direction!=="backward"&&ZG(i,s.value))throw new zG;return n(s,i)};t._zod.parse=r,t._zod.run===n&&(t._zod.run=r)})},attach(t){var e;let n,r=!1,s,i;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const o=t._zod.parse,l=(c,d)=>{if(n===void 0){const x=Bg(t,new Set);if(x===rp)return t._zod.parse=o,t._zod.run===l&&(t._zod.run=o),o(c,d);x===kp||r?n=!0:r=!0}const f=c.value;if(!nN(f))return o(c,d);let h=d[Ub];h||(h={buckets:new WeakMap,backEdges:void 0},d[Ub]=h);let m;s===d?m=i:(m=HG(h,t),s=d,i=m);const v=m.get(f);if(v)return c.value=v.value,v.issues?v.issues.length&&c.issues.push(...Z2(v.issues)):(c.memo=!0,h.backEdges??(h.backEdges=new WeakSet),h.backEdges.add(v.value)),c;og=m;const y=ag.length,_=o(c,d);og=void 0;const b=ag.length>y?ag.pop():void 0;return _ instanceof Promise?_.then(x=>(b&&(b.issues=x.issues.length?Z2(x.issues):gT),x)):(b&&(b.issues=_.issues.length?Z2(_.issues):gT),_)};t._zod.parse=l,t._zod.run===o&&(t._zod.run=l)})}};function BG(){return UG}function ZG(t,e){var r;const n=(r=t[Ub])==null?void 0:r.backEdges;return n!==void 0&&nN(e)&&n.has(e)}const WG=()=>{const t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(i){return t[i]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function s(i,o){return i==="number"&&typeof o=="number"&&!Number.isFinite(o)?String(o):r[i]??i}return i=>{switch(i.code){case"invalid_type":{const o=s(i.expected),l=gK(i.input),c=s(l,i.input);return`Invalid input: expected ${o}, received ${c}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${MM(i.values[0])}`:`Invalid option: expected one of ${JP(i.values,"|")}`;case"too_big":{const o=i.exact?"exactly ":i.inclusive?"<=":"<",l=e(i.origin);return l?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${l.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{const o=i.exact?"exactly ":i.inclusive?">=":">",l=e(i.origin);return l?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${l.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${JP(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(l=>`'${l}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function KG(){return{localeError:WG()}}var vT;class qG{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const r=n[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(e)};return Object.keys(s).length?s:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function GG(){return new qG}(vT=globalThis).__zod_globalRegistry??(vT.__zod_globalRegistry=GG());const sp=globalThis.__zod_globalRegistry;function sN(t){return t.checks&&(t.checks=[...t.checks]),t}function YG(t,e){return new t(sN({type:"string",...st(e)}))}function XG(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...st(e)})}function QG(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...st(e)})}function JG(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...st(e)})}function eY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...st(e)})}function tY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...st(e)})}function nY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...st(e)})}function rY(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...st(e)})}function sY(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...st(e)})}function iY(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...st(e)})}function oY(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...st(e)})}function aY(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...st(e)})}function lY(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...st(e)})}function cY(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...st(e)})}function uY(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...st(e)})}function dY(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...st(e)})}function fY(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...st(e)})}function hY(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...st(e)})}function pY(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...st(e)})}function mY(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...st(e)})}function gY(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...st(e)})}function vY(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...st(e)})}function yY(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...st(e)})}function _Y(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...st(e)})}function wY(t,e){return new t({type:"string",format:"date",check:"string_format",...st(e)})}function bY(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...st(e)})}function xY(t,e){return new t({type:"string",format:"duration",check:"string_format",...st(e)})}function SY(t,e){return new t(sN({type:"number",checks:[],...st(e)}))}function kY(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...st(e)})}function EY(t,e){return new t({type:"boolean",...st(e)})}function CY(t){return new t({type:"unknown"})}function PY(t,e){return new t({type:"never",...st(e)})}function yT(t,e){return new HM({check:"less_than",...st(e),value:t,inclusive:!1})}function W2(t,e){return new HM({check:"less_than",...st(e),value:t,inclusive:!0})}function _T(t,e){return new UM({check:"greater_than",...st(e),value:t,inclusive:!1})}function K2(t,e){return new UM({check:"greater_than",...st(e),value:t,inclusive:!0})}function wT(t,e){return new bq({check:"multiple_of",...st(e),value:t})}function iN(t,e){return new Sq({check:"max_length",...st(e),maximum:t})}function zv(t,e){return new kq({check:"min_length",...st(e),minimum:t})}function oN(t,e){return new Eq({check:"length_equals",...st(e),length:t})}function TY(t,e){return new Cq({check:"string_format",format:"regex",...st(e),pattern:t})}function RY(t){return new Pq({check:"string_format",format:"lowercase",...st(t)})}function AY(t){return new Tq({check:"string_format",format:"uppercase",...st(t)})}function IY(t,e){return new Rq({check:"string_format",format:"includes",...st(e),includes:t})}function OY(t,e){return new Aq({check:"string_format",format:"starts_with",...st(e),prefix:t})}function MY(t,e){return new Iq({check:"string_format",format:"ends_with",...st(e),suffix:t})}function Kf(t){return new Oq({check:"overwrite",tx:t})}function NY(t){return Kf(e=>e.normalize(t))}function LY(){return Kf(t=>t.trim())}function DY(){return Kf(t=>t.toLowerCase())}function $Y(){return Kf(t=>t.toUpperCase())}function FY(){return Kf(t=>rK(t))}function jY(t,e,n){return new t({type:"array",element:e,...st(n)})}function zY(t,e,n){return new t({type:"custom",check:"custom",fn:e,...st(n)})}function VY(t,e){const n=HY(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Zp(s,r.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(Zp(i))}},t(r.value,r)),e);return n}function HY(t,e){const n=new si({check:"custom",...st(e)});return n._zod.check=t,n}function Ep(t,...e){for(const n of e)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&rl(t,r,n[r]);return t}function aN(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??sp,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",intersections:[],deferred:[],external:(t==null?void 0:t.external)??void 0}}function ac(t,e,n,r,s){const i=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:r.path,message:s}):e.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(s);return Object.assign(n,i),!0}function xr(t,e,n={path:[],schemaPath:[]}){var f,h;var r;const s=t._zod.def,i=e.seen.get(t);if(i)return i.count++,n.schemaPath.includes(t)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,o),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;const l=(h=(f=t._zod).toJSONSchema)==null?void 0:h.call(f);if(l)o.schema=l;else{const m={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,m);else{const y=o.schema,_=e.processors[s.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);_(t,e,y,m)}const v=t._zod.parent;v&&(o.ref||(o.ref=v),xr(v,e,m),e.seen.get(v).isParent=!0)}const c=e.metadataRegistry.get(t);return c&&Ep(o.schema,c),e.io==="input"&&Ps(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function bT(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function lN(t,e){var o,l,c,d;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;const r=new Map;for(const f of t.seen.entries()){const h=(o=t.metadataRegistry.get(f[0]))==null?void 0:o.id;if(h){const m=r.get(h);if(m&&m!==f[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,f[0])}}const s=f=>{var _;const h=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const b=(_=t.external.registry.get(f[0]))==null?void 0:_.id,x=t.external.uri??(C=>C);if(b)return{ref:x(b)};const k=f[1].defId??f[1].schema.id??`schema${t.counter++}`;return f[1].defId=k,{defId:k,ref:`${x("__shared")}#/${h}/${bT(k)}`}}const m="#",v=`${m}/${h}/`;if(f[1]===n&&!f[1].schema.id)return{ref:m};const y=f[1].schema.id??`__schema${t.counter++}`;return{defId:y,ref:v+bT(y)}},i=f=>{if(f[1].schema.$ref)return;const h=f[1],{ref:m,defId:v}=s(f);h.def={...h.schema},v&&(h.defId=v);const y=h.schema;for(const _ in y)delete y[_];y.$ref=m};if(t.cycles==="throw")for(const f of t.seen.entries()){const h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${(l=h.cycle)==null?void 0:l.join("/")}/<root>
76
-
77
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of t.seen.entries()){const h=f[1];if(e===f[0]){i(f);continue}if(t.external){const v=(c=t.external.registry.get(f[0]))==null?void 0:c.id;if(e!==f[0]&&v){i(f);continue}}if((d=t.metadataRegistry.get(f[0]))==null?void 0:d.id){i(f);continue}if(h.cycle){i(f);continue}h.count>1&&t.reused==="ref"&&i(f)}t.external&&(t.sharedDefsExtractedFor=t.external)}function cN(t){const e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;const n=[];for(const r of e){if(!r||typeof r!="object")return;cN(r);const s=Object.keys(r);if(s.length!==1||s[0]!=="type")return;const i=r.type;for(const o of Array.isArray(i)?i:[i]){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete t.anyOf,t.type=n.length===1?n[0]:n}const uN=new Set(["type","properties","required","additionalProperties"]),xT=["oneOf","anyOf"];function ST(t){const e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function Bb(t){var i;const e=[];for(const o of t){if(typeof o!="object"||o.type!=="object")return null;for(const l in o)if(!uN.has(l))return null;e.push(o)}const n={},r=new Set;for(const o of e){for(const l in o.properties){if(Object.prototype.hasOwnProperty.call(n,l))continue;const c=[];for(const f of e){const h=((i=f.properties)==null?void 0:i[l])??ST(f);h!=null&&(c.some(m=>JSON.stringify(m)===JSON.stringify(h))||c.push(h))}const d=c.length===1?c[0]:Bb(c)??{allOf:c};rl(n,l,d)}for(const l of o.required??[])r.add(l)}const s={type:"object",properties:n};if(r.size&&(s.required=[...r]),e.every(o=>o.additionalProperties===!1))s.additionalProperties=!1;else{const o=[];for(const l of e){const c=ST(l);c&&!o.some(d=>JSON.stringify(d)===JSON.stringify(c))&&o.push(c)}o.length===1?s.additionalProperties=o[0]:o.length>1&&(s.additionalProperties={allOf:o})}return s}function UY(t){const e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(const s of uN)if(s in t)return;const n=e.filter(s=>xT.some(i=>Array.isArray(s[i])));let r=null;if(!n.length)r=Bb(e);else{const s=n[0],i=xT.find(c=>Array.isArray(s[c]));if(Object.keys(s).length!==1)return;const o=e.filter(c=>c!==s),l=s[i].map(c=>Bb([...o,c]));if(l.some(c=>!c))return;r={[i]:l}}r&&(delete t.allOf,Ep(t,r))}function dN(t,e){var l,c,d,f;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=h=>{const m=t.seen.get(h);if(m.ref===null)return;const v=m.def??m.schema,y={...v},_=m.ref;if(m.ref=null,_){r(_);const x=t.seen.get(_),k=x.schema;if(k.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(k)):Ep(v,k),Ep(v,y),h._zod.parent===_)for(const P in v)P==="$ref"||P==="allOf"||P in y||delete v[P];if(k.$ref&&x.def)for(const P in v)P==="$ref"||P==="allOf"||P in x.def&&JSON.stringify(v[P])===JSON.stringify(x.def[P])&&delete v[P]}const b=h._zod.parent;if(b&&b!==_){r(b);const x=t.seen.get(b);if(x!=null&&x.schema.$ref&&(v.$ref=x.schema.$ref,x.def))for(const k in v)k==="$ref"||k==="allOf"||k in x.def&&JSON.stringify(v[k])===JSON.stringify(x.def[k])&&delete v[k]}t.override({zodSchema:h,jsonSchema:v,path:m.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(const h of[...t.seen.entries()].reverse())r(h[0]);if(t.target!=="openapi-3.0")for(const h of t.seen.entries())cN(h[1].def??h[1].schema);for(const h of t.deferred)h();if(t.intersections.length){const h=new Map;for(const m of t.seen.values())for(const v of[m.schema,m.def]){const y=v==null?void 0:v.allOf;if(!Array.isArray(y))continue;const _=h.get(y);_?_.push(v):h.set(y,[v])}for(const m of t.intersections)for(const v of h.get(m)??[])UY(v)}}const s={};if(t.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":t.target,(l=t.external)!=null&&l.uri){const h=(c=t.external.registry.get(e))==null?void 0:c.id;if(!h)throw new Error("Schema is missing an `id` property");s.$id=t.external.uri(h)}Ep(s,n.defId?n.schema:n.def??n.schema);const i=(d=t.metadataRegistry.get(e))==null?void 0:d.id;i!==void 0&&s.id===i&&delete s.id;const o=((f=t.external)==null?void 0:f.defs)??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(const h of t.seen.entries()){const m=h[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,rl(o,m.defId,m.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const h=JSON.parse(JSON.stringify(s));return Object.defineProperty(h,"~standard",{value:{...e["~standard"],jsonSchema:{input:Vv(e,"input",t.processors),output:Vv(e,"output",t.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Ps(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ps(r.element,n);if(r.type==="set")return Ps(r.valueType,n);if(r.type==="lazy")return Ps(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return Ps(r.innerType,n);if(r.type==="intersection")return Ps(r.left,n)||Ps(r.right,n);if(r.type==="record"||r.type==="map")return Ps(r.keyType,n)||Ps(r.valueType,n);if(r.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ps(r.in,n)||Ps(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Ps(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Ps(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Ps(s,n))return!0;return!!(r.rest&&Ps(r.rest,n))}return!1}const BY=(t,e={})=>n=>{const r=aN({...n,processors:e});return xr(t,r),lN(r,t),dN(r,t)},Vv=(t,e,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=aN({...s??{},target:i,io:e,processors:n});return xr(t,o),lN(o,t),dN(o,t)},Cf=(t,e,n)=>{(t[e]===void 0||n>t[e])&&(t[e]=n)},Pf=(t,e,n)=>{(t[e]===void 0||n<t[e])&&(t[e]=n)},kT=(t,e)=>{Cf(t,"minimum",e),Pf(t,"maximum",e)},fN=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},hN=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},pN=(t,e)=>{t.mime=t.mime?t.mime.filter(n=>e.includes(n)):[...e]},mN=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},ET=(t,e)=>Cf(t,"minimum",e.minimum),CT=(t,e)=>Pf(t,"maximum",e.maximum),PT=t=>(e,n)=>{mN(e,n.format);const[r,s]=t[n.format];Cf(e,"minimum",r),Pf(e,"maximum",s)},q2={greater_than:(t,e)=>Cf(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>Pf(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>fN(t,e.value),number_format:PT(NM),bigint_format:PT(aK),min_length:ET,max_length:CT,length_equals:(t,e)=>kT(t,e.length),min_size:ET,max_size:CT,size_equals:(t,e)=>kT(t,e.size),string_format:(t,e)=>{mN(t,e.format),e.pattern&&hN(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>pN(t,e.mime)};function wo(t){var i;const e={},n=t._zod.def,r=t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[];for(const o of r)(i=q2[o._zod.def.check])==null||i.call(q2,e,o._zod.def);const s=t._zod.bag;s.minimum!==void 0&&Cf(e,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&Cf(e,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&Pf(e,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&Pf(e,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&fN(e,s.multipleOf),s.format!==void 0&&(e.format??(e.format=s.format),s.format.includes("int")&&(e.isInt=!0)),s.mime&&pN(e,s.mime);for(const o of s.patterns??[])hN(e,o);return e}const ZY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},WY=new Map([[YM,lq],[bk,cq]]),gN=t=>WY.get(t)??t,KY=(t,e,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:l,patterns:c,contentEncoding:d,laxFormat:f}=wo(t);if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),l&&(s.format=ZY[l]??l,s.format===""&&delete s.format,(l==="time"||f)&&delete s.format),d&&(s.contentEncoding=d),c&&c.size>0){const h=[...c].map(gN);h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(m=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},qY=(t,e,n,r)=>{const s=n,{minimum:i,maximum:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d,isInt:f}=wo(t);s.type=f?"integer":"number";const h=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),v=e.target==="draft-04"||e.target==="openapi-3.0";if(h?v?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof i=="number"&&(s.minimum=i),m?v?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),l){const y=new Set;for(const x of l)Number.isFinite(x)&&x!==0?y.add(Math.abs(x)):ac(t,e,s,r,`A multipleOf divisor of ${x} cannot be represented in JSON Schema`);const[_,...b]=y;_!==void 0&&(s.multipleOf=_),b.length&&(s.allOf=[...s.allOf??[],...b.map(x=>({multipleOf:x}))])}},GY=(t,e,n,r)=>{n.type="boolean"},YY=(t,e,n,r)=>{n.not={}},XY=(t,e,n,r)=>{},QY=(t,e,n,r)=>{const s=t._zod.def,i=Fb(s.entries);if(i.length===0){n.not={};return}i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},JY=(t,e,n,r)=>{const s=t._zod.def;if(s.values.length===0){n.not={};return}const i=[];for(const o of s.values)if(o===void 0){if(ac(t,e,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o=="bigint"){if(ac(t,e,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},eX=(t,e,n,r)=>{ac(t,e,n,r,"Custom types cannot be represented in JSON Schema")},tX=(t,e,n,r)=>{ac(t,e,n,r,"Transforms cannot be represented in JSON Schema")},nX=(t,e,n,r)=>{const s=n,i=t._zod.def,{minimum:o,maximum:l}=wo(t);typeof o=="number"&&(s.minItems=o),typeof l=="number"&&(s.maxItems=l),s.type="array",s.items=xr(i.element,e,{...r,path:[...r.path,"items"]})};function Hv(t){const e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?Hv(e.out):e.type==="catch"?Hv(e.innerType):t._zod.optin}const rX=(t,e,n,r)=>{var d;const s=n,i=t._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&ac(t,e,s,r,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(const f in o)rl(s.properties,f,xr(o[f],e,{...r,path:[...r.path,"properties",f]}));const c=[];for(const f of Object.keys(o)){const h=i.shape[f];(e.io==="input"?Hv(h)===void 0:h._zod.optout===void 0)&&c.push(f)}c.length>0&&(s.required=c),((d=i.catchall)==null?void 0:d._zod.def.type)==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=xr(i.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(s.additionalProperties=!1)},sX=(t,e,n,r)=>{const s=t._zod.def,i=s.inclusive===!1,o=s.options.map((l,c)=>xr(l,e,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=o:n.anyOf=o},iX=(t,e,n,r)=>{const s=t._zod.def,i=xr(s.left,e,{...r,path:[...r.path,"allOf",0]}),o=xr(s.right,e,{...r,path:[...r.path,"allOf",1]}),l=d=>"allOf"in d&&Object.keys(d).length===1,c=[...l(i)?i.allOf:[i],...l(o)?o.allOf:[o]];n.allOf=c,e.intersections.push(c)};function Zb(t,e,n){var y;if(e.$ref){if(n.has(e))return e;n.add(e);const _=(y=t.get(e))==null?void 0:y.def;if(!_)return e;const b=Zb(t,_,n);return b===_?e:b}for(const _ of["anyOf","oneOf"]){const b=e[_];if(!Array.isArray(b))continue;const x=b.map(k=>Zb(t,k,n));x.some((k,C)=>k!==b[C])&&(e={...e,[_]:x})}const r=Array.isArray(e.type)?e.type:[e.type],s=!r.includes("string")&&r.some(_=>_==="number"||_==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!s&&!(i!=null&&i.some(_=>typeof _=="number")))return e;const{minimum:o,maximum:l,exclusiveMinimum:c,exclusiveMaximum:d,multipleOf:f,format:h,id:m,...v}=e;return v.enum?v.enum=v.enum.map(_=>typeof _=="number"?String(_):_):typeof v.const=="number"&&(v.const=String(v.const)),s&&(v.type="string",i||(v.pattern=(r.includes("number")?yk:vq).source)),v}const Wb=new WeakMap;function oX(t){var r;const e=new Map;for(const s of t.seen.values())s.def&&!e.has(s.schema)&&e.set(s.schema,s);const n=new Map;for(const s of Wb.get(t)??[]){const i=t.seen.get(s),o=(r=(i==null?void 0:i.def)??(i==null?void 0:i.schema))==null?void 0:r.propertyNames;if(!o||o===!0||n.has(o))continue;const l=Zb(e,o,new Set);l!==o&&n.set(o,l)}if(n.size)for(const s of t.seen.values())for(const i of[s.schema,s.def]){const o=i&&n.get(i.propertyNames);o&&(i.propertyNames=o)}}const aX=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="object";const o=i.keyType,l=wo(o).patterns;if(i.mode==="loose"&&l&&l.size>0){const f=xr(i.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const h of l)rl(s.patternProperties,gN(h).source,f)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){s.propertyNames=xr(i.keyType,e,{...r,path:[...r.path,"propertyNames"]});let f=Wb.get(e);f||(f=[],Wb.set(e,f),e.deferred.push(()=>oX(e))),f.push(t)}s.additionalProperties=xr(i.valueType,e,{...r,path:[...r.path,"additionalProperties"]})}const c=o._zod.values,d=e.io==="input"&&Hv(i.valueType)!==void 0;if(c&&!i.partial&&!d){const f=[...c].filter(h=>typeof h=="string"||typeof h=="number");f.length>0&&(s.required=f.map(String))}},lX=(t,e,n,r)=>{const s=t._zod.def,i=xr(s.innerType,e,r),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},cX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},xk=Symbol();function vN(t,e,n,r,s){let i=!1;const o=JSON.stringify(t,(l,c)=>typeof c!="bigint"?c:(i=!0,null));return i?(ac(e,n,r,s,"BigInt defaults cannot be represented in JSON Schema"),xk):JSON.parse(o)}const uX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;const o=vN(s.defaultValue,t,e,n,r);o!==xk&&(n.default=o)},dX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);if(i.ref=s.innerType,e.io!=="input")return;const o=vN(s.defaultValue,t,e,n,r);o!==xk&&(n._prefault=o)},fX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{ac(t,e,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},hX=(t,e,n,r)=>{const s=t._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?i?s.out:s.in:s.out;xr(o,e,r);const l=e.seen.get(t);l.ref=o},pX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.readOnly=!0},yN=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},TT=new WeakSet([Object.prototype,Error.prototype]);function lg(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,e,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,e,{value:r,configurable:!0,writable:!0})}})}const mX=(t,e)=>{RK.init(t,e),t.name="ZodError";const n=Object.getPrototypeOf(t);TT.has(n)||(TT.add(n),lg(n,"format",r=>s=>OK(r,s)),lg(n,"flatten",r=>s=>IK(r,s)),lg(n,"addIssue",r=>s=>{r.issues.push(s),r.message=JSON.stringify(r.issues,jb,2)}),lg(n,"addIssues",r=>s=>{r.issues.push(...s),r.message=JSON.stringify(r.issues,jb,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Ji=me("ZodError",mX,void 0,{Parent:Error}),gX=pk(Ji),vX=mk(Ji),yX=gk(Ji),_X=vk(Ji),wX=FK(Ji),bX=jK(Ji),xX=zK(Ji),SX=VK(Ji),kX=HK(Ji),EX=UK(Ji),CX=BK(Ji),PX=ZK(Ji);function TX(){ko.localeError||la(KG())}function F1(){ko.memoizer||la({memoizer:BG()})}const Qn=me("ZodType",(t,e)=>(TX(),Xn.init(t,e),t.def=e,t.type=e.type,t),{check(...t){const e=this.def;return this.clone(_i(e,{checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return _c(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(EQ(t,e))},superRefine(t,e){return this.check(CQ(t,e))},overwrite(t){return this.check(Kf(t))},optional(){return IT(this)},exactOptional(){return fQ(this)},nullable(){return OT(this)},nullish(){return IT(OT(this))},nonoptional(t){return yQ(this,t)},array(){return Rt(this)},or(t){return Am([this,t])},and(t){return lQ(this,t)},transform(t){return MT(this,dQ(t))},default(t){return mQ(this,t)},prefault(t){return vQ(this,t)},catch(t){return wQ(this,t)},pipe(t){return MT(this,t)},readonly(){return SQ(this)},describe(t){const e=this.clone();return sp.add(e,{description:t}),e},meta(...t){if(t.length===0)return sp.get(this);const e=this.clone();return sp.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return DM(this,"~standard",{...ZM(this),jsonSchema:{input:Vv(this,"input"),output:Vv(this,"output")}})},set"~standard"(t){oc(this,"~standard",t)},parse:function t(e,n){return gX(this,e,n,{callee:t})},parseAsync:async function t(e,n){return await vX(this,e,n,{callee:t})},safeParse(t,e){return yX(this,t,e)},async safeParseAsync(t,e){return _X(this,t,e)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(t){oc(this,"spa",t)},validate(t,e){return LK(this,t,e)},validateAsync(t,e){return $K(this,t,e)},encode:function t(e,n){return wX(this,e,n,{callee:t})},decode:function t(e,n){return bX(this,e,n,{callee:t})},encodeAsync:async function t(e,n){return await xX(this,e,n,{callee:t})},decodeAsync:async function t(e,n){return await SX(this,e,n,{callee:t})},safeEncode(t,e){return kX(this,t,e)},safeDecode(t,e){return EX(this,t,e)},async safeEncodeAsync(t,e){return CX(this,t,e)},async safeDecodeAsync(t,e){return PX(this,t,e)},toJSONSchema(t){return BY(this,{})(t)},get description(){var t;return(t=sp.get(this))==null?void 0:t.description},get _def(){return this._zod.def}}),_N=me("_ZodString",(t,e)=>{wk.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>KY(t,n,r)},$M({format:t=>wo(t).format??null,minLength:t=>wo(t).minimum??null,maxLength:t=>wo(t).maximum??null},{regex(...t){return this.check(TY(...t))},includes(...t){return this.check(IY(...t))},startsWith(...t){return this.check(OY(...t))},endsWith(...t){return this.check(MY(...t))},min(...t){return this.check(zv(...t))},max(...t){return this.check(iN(...t))},length(...t){return this.check(oN(...t))},nonempty(...t){return this.check(zv(1,...t))},lowercase(t){return this.check(RY(t))},uppercase(t){return this.check(AY(t))},trim(){return this.check(LY())},normalize(...t){return this.check(NY(...t))},toLowerCase(){return this.check(DY())},toUpperCase(){return this.check($Y())},slugify(){return this.check(FY())}})),RX=me("ZodString",(t,e)=>{wk.init(t,e),_N.init(t,e)},{email(t){return this.check(XG(NX,t))},url(t){return this.check(rY(DX,t))},jwt(t){return this.check(yY(XX,t))},emoji(t){return this.check(sY($X,t))},guid(t){return this.check(QG(LX,t))},uuid(t){return this.check(JG(cg,t))},uuidv4(t){return this.check(eY(cg,t))},uuidv6(t){return this.check(tY(cg,t))},uuidv7(t){return this.check(nY(cg,t))},nanoid(t){return this.check(iY(FX,t))},cuid(t){return this.check(oY(jX,t))},cuid2(t){return this.check(aY(zX,t))},ulid(t){return this.check(lY(VX,t))},base64(t){return this.check(mY(qX,t))},base64url(t){return this.check(gY(GX,t))},xid(t){return this.check(cY(HX,t))},ksuid(t){return this.check(uY(UX,t))},ipv4(t){return this.check(dY(BX,t))},ipv6(t){return this.check(fY(ZX,t))},cidrv4(t){return this.check(hY(WX,t))},cidrv6(t){return this.check(pY(KX,t))},e164(t){return this.check(vY(YX,t))},datetime(t){return this.check(_Y(AX,t))},date(t){return this.check(wY(IX,t))},time(t){return this.check(bY(OX,t))},duration(t){return this.check(xY(MX,t))}});function se(t){return YG(RX,t)}const Jn=me("ZodStringFormat",(t,e)=>{Un.init(t,e),_N.init(t,e)}),AX=me("ZodISODateTime",(t,e)=>{Qq.init(t,e),Jn.init(t,e)}),IX=me("ZodISODate",(t,e)=>{Jq.init(t,e),Jn.init(t,e)}),OX=me("ZodISOTime",(t,e)=>{eG.init(t,e),Jn.init(t,e)}),MX=me("ZodISODuration",(t,e)=>{tG.init(t,e),Jn.init(t,e)}),NX=me("ZodEmail",(t,e)=>{Fq.init(t,e),Jn.init(t,e)}),LX=me("ZodGUID",(t,e)=>{Dq.init(t,e),Jn.init(t,e)}),cg=me("ZodUUID",(t,e)=>{$q.init(t,e),Jn.init(t,e)}),DX=me("ZodURL",(t,e)=>{Bq.init(t,e),Jn.init(t,e)}),$X=me("ZodEmoji",(t,e)=>{Zq.init(t,e),Jn.init(t,e)}),FX=me("ZodNanoID",(t,e)=>{Wq.init(t,e),Jn.init(t,e)}),jX=me("ZodCUID",(t,e)=>{Kq.init(t,e),Jn.init(t,e)}),zX=me("ZodCUID2",(t,e)=>{qq.init(t,e),Jn.init(t,e)}),VX=me("ZodULID",(t,e)=>{Gq.init(t,e),Jn.init(t,e)}),HX=me("ZodXID",(t,e)=>{Yq.init(t,e),Jn.init(t,e)}),UX=me("ZodKSUID",(t,e)=>{Xq.init(t,e),Jn.init(t,e)}),BX=me("ZodIPv4",(t,e)=>{nG.init(t,e),Jn.init(t,e)}),ZX=me("ZodIPv6",(t,e)=>{sG.init(t,e),Jn.init(t,e)}),WX=me("ZodCIDRv4",(t,e)=>{iG.init(t,e),Jn.init(t,e)}),KX=me("ZodCIDRv6",(t,e)=>{aG.init(t,e),Jn.init(t,e)}),qX=me("ZodBase64",(t,e)=>{lG.init(t,e),Jn.init(t,e)}),GX=me("ZodBase64URL",(t,e)=>{uG.init(t,e),Jn.init(t,e)}),YX=me("ZodE164",(t,e)=>{dG.init(t,e),Jn.init(t,e)}),XX=me("ZodJWT",(t,e)=>{hG.init(t,e),Jn.init(t,e)}),wN=me("ZodNumber",(t,e)=>{XM.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>qY(t,n,r,s),t.isFinite=!0},$M({minValue:t=>{const{minimum:e,exclusiveMinimum:n}=wo(t);return Math.max(e??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:t=>{const{maximum:e,exclusiveMaximum:n}=wo(t);return Math.min(e??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:t=>{const{isInt:e,multipleOf:n}=wo(t);return!!e||!!(n!=null&&n.some(Number.isSafeInteger))},format:t=>wo(t).format??null},{gt(t,e){return this.check(_T(t,e))},gte(t,e){return this.check(K2(t,e))},min(t,e){return this.check(K2(t,e))},lt(t,e){return this.check(yT(t,e))},lte(t,e){return this.check(W2(t,e))},max(t,e){return this.check(W2(t,e))},int(t){return this.check(RT(t))},safe(t){return this.check(RT(t))},positive(t){return this.check(_T(0,t))},nonnegative(t){return this.check(K2(0,t))},negative(t){return this.check(yT(0,t))},nonpositive(t){return this.check(W2(0,t))},multipleOf(t,e){return this.check(wT(t,e))},step(t,e){return this.check(wT(t,e))},finite(){return this}}));function Dn(t){return SY(wN,t)}const QX=me("ZodNumberFormat",(t,e)=>{pG.init(t,e),wN.init(t,e)});function RT(t){return kY(QX,t)}const JX=me("ZodBoolean",(t,e)=>{mG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>GY(t,n,r)});function Ys(t){return EY(JX,t)}const eQ=me("ZodUnknown",(t,e)=>{gG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>XY()});function Kb(){return CY(eQ)}const tQ=me("ZodNever",(t,e)=>{vG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>YY(t,n,r)});function nQ(t){return PY(tQ,t)}const rQ=me("ZodArray",(t,e)=>{F1(),wG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>nX(t,n,r,s),t.element=e.element},{min(t,e){return this.check(zv(t,e))},nonempty(t){return this.check(zv(1,t))},max(t,e){return this.check(iN(t,e))},length(t,e){return this.check(oN(t,e))},unwrap(){return this.element}});function Rt(t,e){return jY(rQ,t,e)}const sQ=me("ZodObject",(t,e)=>{F1(),SG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>rX(t,n,r,s),bK(t,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Vt(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(_i(this._zod.def,{catchall:t}))},passthrough(){return this.clone(_i(this._zod.def,{catchall:Kb()}))},loose(){return this.clone(_i(this._zod.def,{catchall:Kb()}))},strict(){return this.clone(_i(this._zod.def,{catchall:nQ()}))},strip(){return this.clone(_i(this._zod.def,{catchall:void 0}))},extend(t){return uK(this,t)},safeExtend(t){return dK(this,t)},merge(t){return fK(this,t)},pick(t){return lK(this,t)},omit(t){return cK(this,t)},partial(...t){return eT(xN,this,t[0])},exactPartial(...t){return eT(SN,this,t[0],"exactPartial")},required(...t){return hK(kN,this,t[0])}});function ze(t,e){const n={type:"object",shape:t??{},...st(e)};return new sQ(n)}const bN=me("ZodUnion",(t,e)=>{eN.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>sX(t,n,r,s),t.options=e.options});function Am(t,e){return new bN({type:"union",options:t,...st(e)})}const iQ=me("ZodDiscriminatedUnion",(t,e)=>{bN.init(t,e),EG.init(t,e)});function oQ(t,e,n){return new iQ({type:"union",options:e,discriminator:t,...st(n)})}const aQ=me("ZodIntersection",(t,e)=>{CG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>iX(t,n,r,s)});function lQ(t,e){return new aQ({type:"intersection",left:t,right:e})}const AT=me("ZodRecord",(t,e)=>{F1(),PG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>aX(t,n,r,s),t.keyType=e.keyType,t.valueType=e.valueType});function Sk(t,e,n){return!e||!e._zod?new AT({type:"record",keyType:se(),valueType:t,...st(e)}):new AT({type:"record",keyType:t,valueType:e,...st(n)})}const qb=me("ZodEnum",(t,e)=>{TG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(r,s,i)=>QY(t,r,s),t.enum=e.entries,t.options=[...t._zod.values];const n=new Set(Object.keys(e.entries));t.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new qb({...e,checks:[],...st(s),entries:i})},t.exclude=(r,s)=>{const i={...e.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new qb({...e,checks:[],...st(s),entries:i})}});function Vt(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new qb({type:"enum",entries:n,...st(e)})}const cQ=me("ZodLiteral",(t,e)=>{RG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>JY(t,n,r,s),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Tf(t,e){return new cQ({type:"literal",values:Array.isArray(t)?t:[t],...st(e)})}const uQ=me("ZodTransform",(t,e)=>{F1(),AG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>tX(t,n,r,s),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new jM(t.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Zp(i,n.value,e));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=n.value),o.inst??(o.inst=t),n.issues.push(Zp(o))}};const s=e.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function dQ(t){return new uQ({type:"transform",transform:t})}const xN=me("ZodOptional",(t,e)=>{tN.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>yN(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function IT(t){return new xN({type:"optional",innerType:t})}const SN=me("ZodExactOptional",(t,e)=>{IG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>yN(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function fQ(t){return new SN({type:"optional",innerType:t})}const hQ=me("ZodNullable",(t,e)=>{OG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>lX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function OT(t){return new hQ({type:"nullable",innerType:t})}const pQ=me("ZodDefault",(t,e)=>{MG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>uX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function mQ(t,e){return new pQ({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():OM(e)}})}const gQ=me("ZodPrefault",(t,e)=>{NG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>dX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function vQ(t,e){return new gQ({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():OM(e)}})}const kN=me("ZodNonOptional",(t,e)=>{LG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>cX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function yQ(t,e){return new kN({type:"nonoptional",innerType:t,...st(e)})}const _Q=me("ZodCatch",(t,e)=>{DG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>fX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function wQ(t,e){return new _Q({type:"catch",innerType:t,catchValue:typeof e=="function"?e:SK(e)})}const bQ=me("ZodPipe",(t,e)=>{$G.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>hX(t,n,r,s),t.in=e.in,t.out=e.out});function MT(t,e){return new bQ({type:"pipe",in:t,out:e})}const xQ=me("ZodReadonly",(t,e)=>{FG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>pX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function SQ(t){return new xQ({type:"readonly",innerType:t})}const kQ=me("ZodCustom",(t,e)=>{jG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>eX(t,n,r,s)});function EQ(t,e={}){return zY(kQ,t,e)}function CQ(t,e){return VY(t,e)}const EN={custom:"custom"},Gs=(t,e=String(t))=>t instanceof Error?t.message:e,PQ=["multiple_lockfiles","unsupported_package_manager","invalid_package_manager_field","invalid_manifest","invalid_workspace","path_outside_workspace","dangling_symlink","version_unreadable","version_mismatch","no_install_command","install_failed","installer_unstoppable","inputs_changed"],CN=["ENOENT","EACCES","EPERM","EEXIST","ENOTDIR","EISDIR","ELOOP","ENOSPC","EMFILE","EADDRINUSE","ECONNREFUSED","ECONNRESET","ETIMEDOUT","EBUSY","ENOTSUP","EINVAL","ENOTEMPTY","EROFS","EAI_AGAIN"],TQ=["timeout","aborted","unknown"],PN=[...PQ,...CN,...TQ];new Set(PN);new Set(CN);const pi=Dn().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),RQ=ze({command:Vt(["open","status","stop","wait","auth.status","variants.start","variants.status","variants.get","variants.list","variants.complete","variants.cancel","reference.fetch","evidence.capture","context.add","context.update","context.list","context.show","context.enable","context.disable","context.remove","context.resolve","context.inspect","context.verifier","context.verify"]).optional(),tool_name:Vt(["rivet_login","rivet_explore_designs","rivet_get_exploration","rivet_cancel_exploration","rivet_complete_variant_work","rivet_get_design_context","rivet_find_references","rivet_save_reference","rivet_remove_reference","rivet_preview_reference_import","rivet_import_references","rivet_connect_reference_account","rivet_discover_reference_collections","rivet_save_design_preference","rivet_remove_design_preference","rivet_save_design_check","rivet_remove_design_check","rivet_run_design_check"]).optional(),caller_agent:Vt(["claude","codex","cursor","unknown","other"]).optional(),mcp_editor:Vt(["claude","claude-desktop","codex","cursor","unknown","other"]).optional(),source:Vt(["cli","mcp","core","ui","visual_editor"]).optional(),surface:Vt(["cli","mcp","visual_editor"]).optional(),mode:Vt(["initial_generation","zero_to_one","source_grounded","comment_refine","vary","history_adoption","commit","unknown"]).optional(),entry_point:Vt(["mcp_tool","visual_editor_comment","variants_panel","history","watch_loop","route","unknown","login_command","signin_command","install_flow","tool_call","account_menu","library","menu","onboarding","editor_gate","cli","mcp"]).optional(),project_context_kind:Vt(["existing","fresh"]).optional(),preview_kind:Vt(["dev_server","static_artifact"]).optional(),provider:Vt(["pinterest","arena","cosmos","x"]).optional(),request_status:Vt(["accepted","rejected","completed","failed","cancelled","degraded","superseded"]).optional(),error_code:Vt(["OPERATION_FAILED","USAGE_ERROR","AUTH_REQUIRED","SERVER_UNAVAILABLE","WAIT_TIMEOUT","SESSION_NOT_FOUND","WORK_ITEM_NOT_FOUND","DIRECTION_AMBIGUOUS","MCP_REMOVED","STATIC_PREVIEW_FAILED","DEV_SERVER_FAILED","PREVIEW_UNAVAILABLE","DEPENDENCY_INSTALL_FAILED","DEV_SERVER_START_FAILED","DEV_SCRIPT_MISSING"]).optional(),reason_code:Vt(PN).optional(),failure_reason:Vt(["ack_failed","active_session","destination_not_empty","feature_disabled","invalid_stage_action","lease_expired","missing_artifact","missing_required_input","pending_change_conflict","queue_full","runtime_validation_failed","schema_validation_failed","source_context_invalid","start_in_flight","target_not_editable","timeout","unknown","work_item_not_found","local_server_failed","oauth_failed","popup_blocked","credential_store_failed","popup_closed","provider_failed","request_failed","auth_required","invalid_arguments","operation_failed","server_unavailable","usage_error","wait_timeout","session_not_found","direction_ambiguous","mcp_removed","server_start_timeout","handshake_missing","handshake_invalid","process_not_running","health_check_failed","plugin_context_mismatch","telemetry_policy_mismatch","server_starting","transport_failed","server_shutdown_pending","server_process_exited","server_upgrade_required","replacement_version_mismatch","replacement_health_failed","app_health_failed","dev_server_resolution_failed","rivet_port_unavailable","editor_server_start_failed"]).optional(),verification_outcome:Vt(["pass","fail","blocked","package_required","verifier_missing","verifier_stale","cancelled","timeout","output_limit","process_failed","invalid_result","invalid_evidence","cleanup_failed","setup_failed"]).optional(),verification_check_count:pi.int().optional(),verification_duration_ms:pi.optional(),ok:Ys().optional(),is_recoverable:Ys().optional(),is_fresh:Ys().optional(),duration_ms:pi.optional(),dwell_ms_from_terminal:pi.optional(),exit_code:pi.optional(),requested_count:pi.optional(),accepted_count:pi.optional(),work_item_count:pi.optional(),completed_count:pi.optional(),failed_count:pi.optional(),cancelled_count:pi.optional(),reference_count:pi.optional(),changed_files_count:pi.optional()}),AQ=new Set(["cli_command_completed","cli_auth_started","cli_auth_completed","cli_auth_failed","mcp_auth_started","mcp_auth_completed","mcp_auth_failed","mcp_tool_executed","mcp_tool_failed","mcp_login_failed","mcp_login_started","mcp_login_completed","visual_editor_auth_started","visual_editor_auth_completed","visual_editor_auth_failed","visual_editor_reference_connection_started","visual_editor_reference_connection_completed","visual_editor_reference_connection_failed","agent_variants.request_started","agent_variants.request_accepted","agent_variants.refinement_requested","agent_variants.refinement_completed","agent_variants.refinement_failed","agent_variants.round_started","agent_variants.round_completed","agent_variants.preview_started","agent_variants.preview_ready","agent_variants.preview_failed"]),IQ=(t,e)=>{if(!AQ.has(t))return null;const n={};for(const[r,s]of Object.entries(RQ.shape)){const i=s.safeParse(e[r]);i.success&&i.data!==void 0&&(n[r]=i.data)}return n};var tn;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(tn||(tn={}));var NT;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(NT||(NT={}));const Xe=tn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ml=t=>{switch(typeof t){case"undefined":return Xe.undefined;case"string":return Xe.string;case"number":return Number.isNaN(t)?Xe.nan:Xe.number;case"boolean":return Xe.boolean;case"function":return Xe.function;case"bigint":return Xe.bigint;case"symbol":return Xe.symbol;case"object":return Array.isArray(t)?Xe.array:t===null?Xe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Xe.promise:typeof Map<"u"&&t instanceof Map?Xe.map:typeof Set<"u"&&t instanceof Set?Xe.set:typeof Date<"u"&&t instanceof Date?Xe.date:Xe.object;default:return Xe.unknown}},Te=tn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Xa extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const d=o.path[c],f=c===o.path.length-1;if(d==="_errors"){f&&l._errors.push(n(o)),c++;continue}Object.prototype.hasOwnProperty.call(l,d)||(d==="__proto__"?Object.defineProperty(l,d,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):l[d]={_errors:[]}),l=l[d],f&&l._errors.push(n(o)),c++}}};return s(this),r}static assert(e){if(!(e instanceof Xa))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,tn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Xa.create=t=>new Xa(t);const Gb=(t,e)=>{let n;switch(t.code){case Te.invalid_type:t.received===Xe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,tn.jsonStringifyReplacer)}`;break;case Te.unrecognized_keys:n=`Unrecognized key(s) in object: ${tn.joinValues(t.keys,", ")}`;break;case Te.invalid_union:n="Invalid input";break;case Te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${tn.joinValues(t.options)}`;break;case Te.invalid_enum_value:n=`Invalid enum value. Expected ${tn.joinValues(t.options)}, received '${t.received}'`;break;case Te.invalid_arguments:n="Invalid function arguments";break;case Te.invalid_return_type:n="Invalid function return type";break;case Te.invalid_date:n="Invalid date";break;case Te.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:tn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Te.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Te.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Te.custom:n="Invalid input";break;case Te.invalid_intersection_types:n="Intersection results could not be merged";break;case Te.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Te.not_finite:n="Number must be finite";break;default:n=e.defaultError,tn.assertNever(t)}return{message:n}};let OQ=Gb;function MQ(){return OQ}const NQ=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const c=r.filter(d=>!!d).slice().reverse();for(const d of c)l=d(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function je(t,e){const n=MQ(),r=NQ({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Gb?void 0:Gb].filter(s=>!!s)});t.common.issues.push(r)}class Pi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return xt;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Pi.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return xt;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const xt=Object.freeze({status:"aborted"}),ip=t=>({status:"dirty",value:t}),eo=t=>({status:"valid",value:t}),LT=t=>t.status==="aborted",DT=t=>t.status==="dirty",Rf=t=>t.status==="valid",Uv=t=>typeof Promise<"u"&&t instanceof Promise;var nt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(nt||(nt={}));class lc{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $T=(t,e)=>{if(Rf(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Xa(t.common.issues);return this._error=n,this._error}}};function Mt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,l)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class Qt{get description(){return this._def.description}_getType(e){return Ml(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ml(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Pi,ctx:{common:e.parent.common,data:e.data,parsedType:Ml(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Uv(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ml(e)},s=this._parseSync({data:e,path:r.path,parent:r});return $T(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ml(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return Rf(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Rf(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ml(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Uv(s)?s:Promise.resolve(s));return $T(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),l=()=>i.addIssue({code:Te.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new If({schema:this,typeName:St.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return tc.create(this,this._def)}nullable(){return Of.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ra.create(this)}promise(){return Kv.create(this,this._def)}or(e){return Zv.create([this,e],this._def)}and(e){return Wv.create(this,e,this._def)}transform(e){return new If({...Mt(this._def),schema:this,typeName:St.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Xb({...Mt(this._def),innerType:this,defaultValue:n,typeName:St.ZodDefault})}brand(){return new rJ({typeName:St.ZodBranded,type:this,...Mt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Qb({...Mt(this._def),innerType:this,catchValue:n,typeName:St.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return kk.create(this,e)}readonly(){return Jb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const LQ=/^c[^\s-]{8,}$/i,DQ=/^[0-9a-z]+$/,$Q=/^[0-9A-HJKMNP-TV-Z]{26}$/i,FQ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jQ=/^[a-z0-9_-]{21}$/i,zQ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,VQ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HQ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,UQ="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";let G2;const BQ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ZQ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,WQ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,KQ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qQ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,GQ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,TN="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",YQ=new RegExp(`^${TN}$`);function RN(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function XQ(t){return new RegExp(`^${RN(t)}$`)}function QQ(t){let e=`${TN}T${RN(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function JQ(t,e){return!!((e==="v4"||!e)&&BQ.test(t)||(e==="v6"||!e)&&WQ.test(t))}function eJ(t,e){if(!zQ.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function tJ(t,e){return!!((e==="v4"||!e)&&ZQ.test(t)||(e==="v6"||!e)&&KQ.test(t))}class Kl extends Qt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Xe.string){const i=this._getOrReturnCtx(e);return je(i,{code:Te.invalid_type,expected:Xe.string,received:i.parsedType}),xt}const r=new Pi;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),je(s,{code:Te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),je(s,{code:Te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(e,s),o?je(s,{code:Te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&je(s,{code:Te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")HQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"email",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")G2||(G2=new RegExp(UQ,"u")),G2.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"emoji",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")FQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"uuid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")jQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"nanoid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")LQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"cuid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")DQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"cuid2",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")$Q.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"ulid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),je(s,{validation:"url",code:Te.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"regex",code:Te.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),je(s,{code:Te.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),je(s,{code:Te.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),je(s,{code:Te.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?QQ(i).test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{code:Te.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?YQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{code:Te.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?XQ(i).test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{code:Te.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?VQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"duration",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?JQ(e.data,i.version)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"ip",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?eJ(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"jwt",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?tJ(e.data,i.version)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"cidr",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?qQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"base64",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?GQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"base64url",code:Te.invalid_string,message:i.message}),r.dirty()):tn.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:Te.invalid_string,...nt.errToObj(r)})}_addCheck(e){return new Kl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...nt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...nt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...nt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...nt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...nt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...nt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...nt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...nt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...nt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...nt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...nt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...nt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...nt.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...nt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...nt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...nt.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...nt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...nt.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...nt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...nt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...nt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...nt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...nt.errToObj(n)})}nonempty(e){return this.min(1,nt.errToObj(e))}trim(){return new Kl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Kl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Kl({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Kl.create=t=>new Kl({checks:[],typeName:St.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Mt(t)});function nJ(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class Wp extends Qt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Xe.number){const i=this._getOrReturnCtx(e);return je(i,{code:Te.invalid_type,expected:Xe.number,received:i.parsedType}),xt}let r;const s=new Pi;for(const i of this._def.checks)i.kind==="int"?tn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),je(r,{code:Te.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),je(r,{code:Te.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),je(r,{code:Te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?nJ(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),je(r,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),je(r,{code:Te.not_finite,message:i.message}),s.dirty()):tn.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,nt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,nt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,nt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,nt.toString(n))}setLimit(e,n,r,s){return new Wp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:nt.toString(s)}]})}_addCheck(e){return new Wp({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:nt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:nt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:nt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:nt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:nt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:nt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:nt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:nt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:nt.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&tn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Wp.create=t=>new Wp({checks:[],typeName:St.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Mt(t)});class Kp extends Qt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Xe.bigint)return this._getInvalidInput(e);let r;const s=new Pi;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),je(r,{code:Te.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),je(r,{code:Te.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),je(r,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):tn.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return je(n,{code:Te.invalid_type,expected:Xe.bigint,received:n.parsedType}),xt}gte(e,n){return this.setLimit("min",e,!0,nt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,nt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,nt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,nt.toString(n))}setLimit(e,n,r,s){return new Kp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:nt.toString(s)}]})}_addCheck(e){return new Kp({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:nt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:nt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:nt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:nt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:nt.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Kp.create=t=>new Kp({checks:[],typeName:St.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Mt(t)});class FT extends Qt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Xe.boolean){const r=this._getOrReturnCtx(e);return je(r,{code:Te.invalid_type,expected:Xe.boolean,received:r.parsedType}),xt}return eo(e.data)}}FT.create=t=>new FT({typeName:St.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Mt(t)});class Bv extends Qt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Xe.date){const i=this._getOrReturnCtx(e);return je(i,{code:Te.invalid_type,expected:Xe.date,received:i.parsedType}),xt}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return je(i,{code:Te.invalid_date}),xt}const r=new Pi;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),je(s,{code:Te.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),je(s,{code:Te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):tn.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Bv({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:nt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:nt.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Bv.create=t=>new Bv({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:St.ZodDate,...Mt(t)});class jT extends Qt{_parse(e){if(this._getType(e)!==Xe.symbol){const r=this._getOrReturnCtx(e);return je(r,{code:Te.invalid_type,expected:Xe.symbol,received:r.parsedType}),xt}return eo(e.data)}}jT.create=t=>new jT({typeName:St.ZodSymbol,...Mt(t)});class zT extends Qt{_parse(e){if(this._getType(e)!==Xe.undefined){const r=this._getOrReturnCtx(e);return je(r,{code:Te.invalid_type,expected:Xe.undefined,received:r.parsedType}),xt}return eo(e.data)}}zT.create=t=>new zT({typeName:St.ZodUndefined,...Mt(t)});class VT extends Qt{_parse(e){if(this._getType(e)!==Xe.null){const r=this._getOrReturnCtx(e);return je(r,{code:Te.invalid_type,expected:Xe.null,received:r.parsedType}),xt}return eo(e.data)}}VT.create=t=>new VT({typeName:St.ZodNull,...Mt(t)});class HT extends Qt{constructor(){super(...arguments),this._any=!0}_parse(e){return eo(e.data)}}HT.create=t=>new HT({typeName:St.ZodAny,...Mt(t)});class UT extends Qt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return eo(e.data)}}UT.create=t=>new UT({typeName:St.ZodUnknown,...Mt(t)});class cc extends Qt{_parse(e){const n=this._getOrReturnCtx(e);return je(n,{code:Te.invalid_type,expected:Xe.never,received:n.parsedType}),xt}}cc.create=t=>new cc({typeName:St.ZodNever,...Mt(t)});class BT extends Qt{_parse(e){if(this._getType(e)!==Xe.undefined){const r=this._getOrReturnCtx(e);return je(r,{code:Te.invalid_type,expected:Xe.void,received:r.parsedType}),xt}return eo(e.data)}}BT.create=t=>new BT({typeName:St.ZodVoid,...Mt(t)});class ra extends Qt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Xe.array)return je(n,{code:Te.invalid_type,expected:Xe.array,received:n.parsedType}),xt;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(je(n,{code:o?Te.too_big:Te.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(je(n,{code:Te.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(je(n,{code:Te.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new lc(n,o,n.path,l)))).then(o=>Pi.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new lc(n,o,n.path,l)));return Pi.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new ra({...this._def,minLength:{value:e,message:nt.toString(n)}})}max(e,n){return new ra({...this._def,maxLength:{value:e,message:nt.toString(n)}})}length(e,n){return new ra({...this._def,exactLength:{value:e,message:nt.toString(n)}})}nonempty(e){return this.min(1,e)}}ra.create=(t,e)=>new ra({type:t,minLength:null,maxLength:null,exactLength:null,typeName:St.ZodArray,...Mt(e)});function Md(t){if(t instanceof yr){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=tc.create(Md(r))}return new yr({...t._def,shape:()=>e})}else return t instanceof ra?new ra({...t._def,type:Md(t.element)}):t instanceof tc?tc.create(Md(t.unwrap())):t instanceof Of?Of.create(Md(t.unwrap())):t instanceof Lu?Lu.create(t.items.map(e=>Md(e))):t}class yr extends Qt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=tn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Xe.object){const d=this._getOrReturnCtx(e);return je(d,{code:Te.invalid_type,expected:Xe.object,received:d.parsedType}),xt}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof cc&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const c=[];for(const d of o){const f=i[d],h=s.data[d];c.push({key:{status:"valid",value:d},value:f._parse(new lc(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof cc){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")l.length>0&&(je(s,{code:Te.unrecognized_keys,keys:l}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l){const h=s.data[f];c.push({key:{status:"valid",value:f},value:d._parse(new lc(s,h,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of c){const h=await f.key,m=await f.value;d.push({key:h,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>Pi.mergeObjectSync(r,d)):Pi.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return nt.errToObj,new yr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:nt.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new yr({...this._def,unknownKeys:"strip"})}passthrough(){return new yr({...this._def,unknownKeys:"passthrough"})}extend(e){return new yr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new yr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:St.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new yr({...this._def,catchall:e})}pick(e){const n={};for(const r of tn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new yr({...this._def,shape:()=>n})}omit(e){const n={};for(const r of tn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new yr({...this._def,shape:()=>n})}deepPartial(){return Md(this)}partial(e){const n={};for(const r of tn.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new yr({...this._def,shape:()=>n})}required(e){const n={};for(const r of tn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof tc;)i=i._def.innerType;n[r]=i}return new yr({...this._def,shape:()=>n})}keyof(){return AN(tn.objectKeys(this.shape))}}yr.create=(t,e)=>new yr({shape:()=>t,unknownKeys:"strip",catchall:cc.create(),typeName:St.ZodObject,...Mt(e)});yr.strictCreate=(t,e)=>new yr({shape:()=>t,unknownKeys:"strict",catchall:cc.create(),typeName:St.ZodObject,...Mt(e)});yr.lazycreate=(t,e)=>new yr({shape:t,unknownKeys:"strip",catchall:cc.create(),typeName:St.ZodObject,...Mt(e)});class Zv extends Qt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Xa(l.ctx.common.issues));return je(n,{code:Te.invalid_union,unionErrors:o}),xt}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const c of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=c._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new Xa(c));return je(n,{code:Te.invalid_union,unionErrors:l}),xt}}get options(){return this._def.options}}Zv.create=(t,e)=>new Zv({options:t,typeName:St.ZodUnion,...Mt(e)});function Yb(t,e){const n=Ml(t),r=Ml(e);if(t===e)return{valid:!0,data:t};if(n===Xe.object&&r===Xe.object){const s=tn.objectKeys(e),i=tn.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const l of i){if(l==="__proto__")continue;const c=Yb(t[l],e[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Xe.array&&r===Xe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],l=e[i],c=Yb(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Xe.date&&r===Xe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Wv extends Qt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(LT(i)||LT(o))return xt;const l=Yb(i.value,o.value);return l.valid?((DT(i)||DT(o))&&n.dirty(),{status:n.value,value:l.data}):(je(r,{code:Te.invalid_intersection_types}),xt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Wv.create=(t,e,n)=>new Wv({left:t,right:e,typeName:St.ZodIntersection,...Mt(n)});class Lu extends Qt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Xe.array)return je(r,{code:Te.invalid_type,expected:Xe.array,received:r.parsedType}),xt;if(r.data.length<this._def.items.length)return je(r,{code:Te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xt;!this._def.rest&&r.data.length>this._def.items.length&&(je(r,{code:Te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new lc(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Pi.mergeArray(n,o)):Pi.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Lu({...this._def,rest:e})}}Lu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lu({items:t,typeName:St.ZodTuple,rest:null,...Mt(e)})};class ZT extends Qt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Xe.map)return je(r,{code:Te.invalid_type,expected:Xe.map,received:r.parsedType}),xt;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,c],d)=>({key:s._parse(new lc(r,l,r.path,[d,"key"])),value:i._parse(new lc(r,c,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const d=await c.key,f=await c.value;if(d.status==="aborted"||f.status==="aborted")return xt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const d=c.key,f=c.value;if(d.status==="aborted"||f.status==="aborted")return xt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}ZT.create=(t,e,n)=>new ZT({valueType:e,keyType:t,typeName:St.ZodMap,...Mt(n)});class qp extends Qt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Xe.set)return je(r,{code:Te.invalid_type,expected:Xe.set,received:r.parsedType}),xt;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(je(r,{code:Te.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(je(r,{code:Te.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const d=new Set;for(const f of c){if(f.status==="aborted")return xt;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((c,d)=>i._parse(new lc(r,c,r.path,d)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(e,n){return new qp({...this._def,minSize:{value:e,message:nt.toString(n)}})}max(e,n){return new qp({...this._def,maxSize:{value:e,message:nt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}qp.create=(t,e)=>new qp({valueType:t,minSize:null,maxSize:null,typeName:St.ZodSet,...Mt(e)});class WT extends Qt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}WT.create=(t,e)=>new WT({getter:t,typeName:St.ZodLazy,...Mt(e)});class KT extends Qt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return je(n,{received:n.data,code:Te.invalid_literal,expected:this._def.value}),xt}return{status:"valid",value:e.data}}get value(){return this._def.value}}KT.create=(t,e)=>new KT({value:t,typeName:St.ZodLiteral,...Mt(e)});function AN(t,e){return new Af({values:t,typeName:St.ZodEnum,...Mt(e)})}class Af extends Qt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return je(n,{expected:tn.joinValues(r),received:n.parsedType,code:Te.invalid_type}),xt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return je(n,{received:n.data,code:Te.invalid_enum_value,options:r}),xt}return eo(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Af.create(e,{...this._def,...n})}exclude(e,n=this._def){return Af.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Af.create=AN;class qT extends Qt{_parse(e){const n=tn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Xe.string&&r.parsedType!==Xe.number){const s=tn.objectValues(n);return je(r,{expected:tn.joinValues(s),received:r.parsedType,code:Te.invalid_type}),xt}if(this._cache||(this._cache=new Set(tn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=tn.objectValues(n);return je(r,{received:r.data,code:Te.invalid_enum_value,options:s}),xt}return eo(e.data)}get enum(){return this._def.values}}qT.create=(t,e)=>new qT({values:t,typeName:St.ZodNativeEnum,...Mt(e)});class Kv extends Qt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Xe.promise&&n.common.async===!1)return je(n,{code:Te.invalid_type,expected:Xe.promise,received:n.parsedType}),xt;const r=n.parsedType===Xe.promise?n.data:Promise.resolve(n.data);return eo(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Kv.create=(t,e)=>new Kv({type:t,typeName:St.ZodPromise,...Mt(e)});class If extends Qt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===St.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{je(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return xt;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?xt:c.status==="dirty"||n.value==="dirty"?ip(c.value):c});{if(n.value==="aborted")return xt;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?xt:l.status==="dirty"||n.value==="dirty"?ip(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?xt:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?xt:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Rf(o))return xt;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Rf(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):xt);tn.assertNever(s)}}If.create=(t,e,n)=>new If({schema:t,typeName:St.ZodEffects,effect:e,...Mt(n)});If.createWithPreprocess=(t,e,n)=>new If({schema:e,effect:{type:"preprocess",transform:t},typeName:St.ZodEffects,...Mt(n)});class tc extends Qt{_parse(e){return this._getType(e)===Xe.undefined?eo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tc.create=(t,e)=>new tc({innerType:t,typeName:St.ZodOptional,...Mt(e)});class Of extends Qt{_parse(e){return this._getType(e)===Xe.null?eo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Of.create=(t,e)=>new Of({innerType:t,typeName:St.ZodNullable,...Mt(e)});class Xb extends Qt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Xe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Xb.create=(t,e)=>new Xb({innerType:t,typeName:St.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Mt(e)});class Qb extends Qt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Uv(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Xa(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Xa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Qb.create=(t,e)=>new Qb({innerType:t,typeName:St.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Mt(e)});class GT extends Qt{_parse(e){if(this._getType(e)!==Xe.nan){const r=this._getOrReturnCtx(e);return je(r,{code:Te.invalid_type,expected:Xe.nan,received:r.parsedType}),xt}return{status:"valid",value:e.data}}}GT.create=t=>new GT({typeName:St.ZodNaN,...Mt(t)});class rJ extends Qt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class kk extends Qt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?xt:i.status==="dirty"?(n.dirty(),ip(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?xt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new kk({in:e,out:n,typeName:St.ZodPipeline})}}class Jb extends Qt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Rf(s)&&(s.value=Object.freeze(s.value)),s);return Uv(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Jb.create=(t,e)=>new Jb({innerType:t,typeName:St.ZodReadonly,...Mt(e)});var St;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(St||(St={}));const Vd=Kl.create;cc.create;const sJ=ra.create,IN=yr.create;Zv.create;Wv.create;Lu.create;const iJ=Af.create;Kv.create;tc.create;Of.create;const oJ=IN({hash:Vd().regex(/^[a-f0-9]{64}$/),mimeType:iJ(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),ON=IN({id:Vd().min(1),title:Vd().trim().min(1),url:Vd().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:Vd().optional(),image:oJ.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),aJ=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=ON.safeParse(s);if(!i.success)continue;const o=i.data,l=o.url?new URL(o.url).href:void 0;if(n.has(o.id)||l&&r.has(l)){const c=e.find(d=>d.url===l&&(l!==void 0||d.id===o.id));c&&!c.image&&o.image&&(c.id===o.id||!n.has(o.id))&&(c.id=o.id,c.image=o.image,n.add(o.id));continue}e.push({...o,...l?{url:l}:{}}),n.add(o.id),l&&r.add(l)}return e.length?e:void 0},lJ=6,Gp=100,YT=100,cJ=35*1024*1024,XT=Math.ceil(cJ/3)*4,uJ=Vt(["pinterest","arena","x","cosmos"]),Ek=Vt(["image",...uJ.options,"text","pdf","variant"]),Im=Vt(["codex","claude","cursor"]),MN=ze({projectId:se().min(1).max(200),sessionId:se().min(1).max(200),variantId:se().min(1).max(200)}).strict();MN.extend({runtime:Im,note:se().trim().max(500).optional(),imageFile:se().min(1).max(2048).optional()});const NN=MN.extend({treeSha:se().max(100).optional()}),dJ=ze({hash:se().regex(/^[a-f0-9]{64}$/),mimeType:Vt(["image/png","image/jpeg","image/webp","image/gif"]),bytes:Dn().int().positive(),representation:Vt(["image","video-cover","page","variant"]).default("image"),page:Dn().int().positive().optional()});ze({provider:Ek,remoteId:se().trim().min(1).max(2048),title:se().trim().min(1).max(500),url:se().url().optional()});const LN=ze({provider:Ek,remoteId:se().trim().min(1).max(2048),title:se().max(1e3),text:se().max(1e5),url:se().url().optional(),media:Rt(dJ).max(100),remoteImages:Rt(se().url()).max(100).optional(),remoteImageRepresentations:Rt(Vt(["image","video-cover"])).max(100).optional(),unsupportedReason:se().max(1e3).optional(),variant:NN.optional(),note:se().max(500).optional()}),DN=ze({inputTokens:Dn().nonnegative().optional(),outputTokens:Dn().nonnegative().optional(),cachedInputTokens:Dn().nonnegative().optional(),allocation:Tf("equal-share").optional()}),F1e=ze({referenceId:se().min(1),revision:Dn().int().positive(),description:se().trim().min(1).max(8e3),runtime:Am([Im,Tf("user")]),evidence:Vt(["observation","preference"]),usage:DN.optional()}),j1e=LN.extend({id:se(),revision:Dn()}),fJ=ze({requestId:se().min(1).max(200),instruction:se().min(1).max(3e4),runtime:Im,mode:Vt(["auto","off","uploads"]).default("off"),excludedSourceIds:Rt(se()).max(100).default([]),excludedReferenceIds:Rt(se()).max(100).default([]),excludedMediaHashes:Rt(se()).max(100).default([]),suppliedInputHashes:Rt(se().regex(/^[a-f0-9]{64}$/)).max(Gp).optional()});fJ.extend({mode:Vt(["auto","off","uploads"]).default("uploads"),uploads:Rt(se().max(XT+YT)).max(Gp).optional()}).refine(t=>(t.uploads??[]).reduce((e,n)=>e+n.length,0)<=XT+Gp*YT,"Supplied images exceed the profile upload budget");const hJ=Kb().transform((t,e)=>{const n=ON.safeParse(t);return n.success?n.data:(e.addIssue({code:EN.custom,message:"Invalid supplied image reference"}),FM)}),QT=ze({suppliedReferences:Rt(hJ).max(Gp).optional(),failedUploadCount:Dn().int().min(0).max(Gp).optional(),usage:DN.optional(),requestId:se(),status:Vt(["selected","empty","off","unavailable","timeout"]),queries:Rt(se()),candidateIds:Rt(se()),selected:Rt(ze({id:se(),revision:Dn(),title:se().optional(),url:se().url().optional(),mediaHashes:Rt(se().regex(/^[a-f0-9]{64}$/)).optional(),reason:se(),sourceTitles:Rt(se()),variant:NN.optional()})),contextText:se().max(6e3),images:Rt(ze({path:se(),hash:se().regex(/^[a-f0-9]{64}$/),mimeType:Vt(["image/png","image/jpeg","image/webp","image/gif"])})).max(lJ),durationMs:Dn()});QT.pick({requestId:!0,suppliedReferences:!0,failedUploadCount:!0,status:!0,selected:!0,images:!0,durationMs:!0}).extend({requestId:se().min(1).max(200),selected:QT.shape.selected.max(3)});const z1e=200,Ck=ze({id:se(),name:se(),pinnedAt:se().nullable().optional(),lastOpenedAt:se(),projectPath:se(),isAvailable:Ys(),storageKind:Vt(["project","bundle"]),issue:se().optional(),historyIssue:se().optional()}),pJ=ze({dataUrl:se(),label:se(),capturedAt:se()}),mJ=ze({projectId:se(),sessionId:se(),variantId:se(),label:se(),brief:se(),createdAt:se(),hasStaticPreview:Ys(),hasInteractivePreview:Ys()}),V1e=ze({projects:Rt(Ck),variants:Rt(mJ)}),$N=ze({error:se()}),gJ=ze({errorCode:se(),message:se()}),vJ=ze({error:se().optional(),details:Am([se(),ze({formErrors:Rt(se()).optional(),fieldErrors:Sk(se(),Rt(se()).optional()).optional()})]).optional()}),yJ=ze({token:se().min(1)}),_J=ze({url:se().url()}),H1e=ze({projects:Rt(Ck)}),U1e=ze({project:Ck}),B1e=ze({projectId:se()}),Z1e=ze({preview:pJ.nullable()}),W1e=ze({projectPath:se().nullable()}),K1e=ze({editorUrl:se()}),q1e=ze({url:se()}),G1e=ze({saved:Tf(!0)}),wJ=ze({requestId:se(),sequence:Dn(),projectId:se().optional(),sessionId:se().optional(),variantId:se().optional()}),Y1e=ze({navigations:Rt(wJ)}),X1e=ze({acknowledged:Ys()}),FN=ze({profile:ze({isEnabled:Ys()}),sources:Rt(ze({provider:Ek,title:se(),url:se().nullable()}))}),jN=ze({id:se(),revision:se(),collectionCount:Dn(),referenceCount:Dn(),imageCount:Dn(),reusableCount:Dn(),unsupportedCount:Dn(),scopeDisclosure:se(),usageDisclosure:se()}),bJ=ze({isAuthenticated:Ys(),email:se().optional(),name:se().optional(),userId:se().optional()}),Y2=se().min(1).max(500),zN=ze({pinned:Rt(Y2).max(1e3),order:ze({groups:Rt(Y2).max(1e3),rows:Sk(se(),Rt(Y2).max(1e3))})}),xJ=ze({projectPath:se(),uiState:zN});ze({uiState:zN,projectPath:se().optional()});const SJ=t=>yJ.parse(t).token,JT="The library returned an invalid response.",j1="rivet_library_token";let Qa="",Mf=0,bo=null,eR=!1;const ex=new Set,Yp=()=>ex.forEach(t=>t()),Q1e=()=>bo,J1e=()=>Mf,Xp=()=>{try{const t=window.localStorage.getItem(j1)??"";Qa!==t&&(Mf+=1),Qa=t,bo=null}catch{bo="Rivet cannot access browser storage. Allow site storage and try again."}},VN=()=>{eR||(window.addEventListener("storage",t=>{t.key!==j1&&t.key!==null||(Xp(),Yp())}),eR=!0)},eye=()=>!!Qa,tye=t=>(VN(),ex.add(t),()=>ex.delete(t)),kJ=(t,e)=>{if(e!==void 0&&Xp(),e!==void 0&&e!==Mf)throw new Error("Sign-in was cancelled because the browser login changed.");try{window.localStorage.setItem(j1,t)}catch{throw bo="Rivet cannot save browser access. Allow site storage and try again.",Yp(),new Error(bo)}Qa=t,Mf+=1,bo=null,Yp()},HN=()=>{Qa="",Mf+=1,bo=null;try{window.localStorage.removeItem(j1)}catch{bo="Rivet cannot clear browser storage. Allow site storage and try again."}Yp()},EJ=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;VN(),Xp();const t=Mf,e=new URLSearchParams(window.location.hash.slice(1)).get("code");if(e){window.history.replaceState(null,"",window.location.pathname+window.location.search);try{const n=await fetch("/api/library/browser-sessions/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e})});if(n.ok){kJ(SJ(await n.json()),t);return}n.status>=500&&!Qa&&(bo="Rivet is temporarily unavailable. Please retry this link.")}catch{!Qa&&!bo&&(bo="Rivet could not open this link. Please retry when the server is available.")}}Yp()},UN=async(t,e={})=>{Xp();const n=Qa,r=new Headers(e.headers);r.set("Authorization",`Bearer ${n}`);const s=await fetch(t,{...e,headers:r});return s.status===401&&(Xp(),Qa===n&&HN()),s},CJ=async(t,{schema:e,...n})=>{const r=await UN(`/api/library${t}`,{method:n.method??"GET",signal:n.signal,headers:{"Content-Type":"application/json"},...n.body!==void 0?{body:JSON.stringify(n.body)}:{}});return PJ(r,e)},PJ=async(t,e)=>{const n=await t.text();let r;try{r=JSON.parse(n)}catch{if(t.ok)throw new Error(JT)}if(!t.ok){if(t.status===401)throw new Error("Sign in to access this library.");const i=$N.safeParse(r),o=i.success&&i.data.error.trim()?i.data.error:`Library request failed (${t.status}).`;throw new Error(o)}const s=e.safeParse(r);if(!s.success)throw new Error(JT);return s.data},Ft=(t,e={})=>{if(!window.location.pathname.startsWith("/rivet/library")){const n=new Headers(e.headers),r=CH();return r&&kH(t,e.method)&&n.set(bH,r),fetch(t,{...e,headers:n,redirect:"error"})}return UN(t,e)};let BN="off";const tR=t=>{BN=t},TJ=()=>BN==="full",ZN=({userId:t,email:e})=>{TJ()&&(t?(Qe.identify(t,e?{email:e}:{}),e&&Qe.alias(e,t)):e&&Qe.identify(e,{email:e}))},RJ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",AJ=3e3,IJ=/^plugin-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,OJ=t=>({person_profiles:"never",autocapture:!1,opt_out_useragent_filter:!0,capture_pageview:!1,capture_pageleave:!1,capture_exceptions:!1,capture_performance:!1,disable_session_recording:!0,enable_recording_console_log:!1,disable_external_dependency_loading:!0,disable_surveys:!0,advanced_disable_flags:!0,advanced_disable_feature_flags:!0,mask_all_text:!0,mask_all_element_attributes:!0,persistence:"memory",bootstrap:{distinctID:t,isIdentifiedID:!1},before_send:e=>{const n=IQ(e.event,e.properties);return n&&Ft("/api/telemetry/events",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e.event,properties:n}),keepalive:!0}).catch(()=>{}),null}}),MJ=async()=>{try{const t=await Ft("/api/telemetry",{signal:AbortSignal.timeout(AJ),cache:"no-store"});if(!t.ok)return;const e=await t.json();if(e.mode!=="full"&&e.mode!=="metrics"||e.mode==="metrics"&&(typeof e.distinctId!="string"||!IJ.test(e.distinctId)))return;const n=e.mode,s={api_host:"https://rivet-proxy.onrender.com/ingest",ui_host:"https://us.posthog.com",person_profiles:"always",capture_exceptions:!0,autocapture:!0,capture_pageview:!0,capture_performance:!0,persistence:"localStorage",...{session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]",blockSelector:"iframe[data-rivet-private]"}},mask_all_text:!1,mask_all_element_attributes:!1,loaded:i=>i.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.27.1",env:"production"})};n==="metrics"&&Object.assign(s,OJ(e.distinctId),{api_host:window.location.origin}),Qe.init(RJ,s),tR(n)}catch{tR("off")}},WN=g.createContext(void 0),Om=t=>{const e=g.useContext(WN);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},NJ=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(WN.Provider,{value:t,children:e})),LJ={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var Ll,jS,H4,DJ=(H4=class{constructor(){rt(this,Ll,LJ);rt(this,jS,!1)}setTimeoutProvider(t){Me(this,Ll,t)}setTimeout(t,e){return W(this,Ll).setTimeout(t,e)}clearTimeout(t){W(this,Ll).clearTimeout(t)}setInterval(t,e){return W(this,Ll).setInterval(t,e)}clearInterval(t){W(this,Ll).clearInterval(t)}},Ll=new WeakMap,jS=new WeakMap,H4);const ou=new DJ;function $J(t){setTimeout(t,0)}const FJ=typeof window>"u"||"Deno"in globalThis;function Is(){}function jJ(t,e){return typeof t=="function"?t(e):t}function KN(t){return typeof t=="number"&&t>=0&&t!==1/0}function qN(t,e){return Math.max(t+(e||0)-Date.now(),0)}function zn(t,e){return typeof t=="function"?t(e):t}function nR(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==Pk(o,e.options))return!1}else if(!Nf(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function rR(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Du(e.options.mutationKey)!==Du(i))return!1}else if(!Nf(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Pk(t,e){return((e==null?void 0:e.queryKeyHashFn)||Du)(t)}function Du(t){return JSON.stringify(t,(e,n)=>tx(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Nf(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let r=0;r<e.length;r++)if(!Nf(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Nf(t[r],e[r]))return!1;return!0}return!1}const GN=Object.prototype.hasOwnProperty;function YN(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=sR(t)&&sR(e);if(!r&&!(tx(t)&&tx(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),o=i.length,l=r?new Array(o):{};let c=0;for(let d=0;d<o;d++){const f=r?d:i[d],h=t[f],m=e[f];if(h===m){l[f]=h,(r?d<s:GN.call(t,f))&&c++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){l[f]=m;continue}const v=YN(h,m,n+1);l[f]=v,v===h&&c++}return s===o&&c===s?t:l}function Zg(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n of Object.keys(t))if(!GN.call(e,n)||t[n]!==e[n])return!1;return!0}function sR(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function tx(t){if(!iR(t))return!1;const e=Object.getPrototypeOf(t),n=e==null?void 0:e.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!iR(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function iR(t){return Object.prototype.toString.call(t)==="[object Object]"}function zJ(t){return new Promise(e=>{ou.setTimeout(e,t)})}function nx(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?YN(t,e):e}function VJ(t){return t}function HJ(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(-n):r}function UJ(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,n):r}const Tk=Symbol();function XN(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Tk?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Rk(t,e){return typeof t=="function"?t(...e):!!t}const Ak=Symbol();function BJ(t,e,n,r){let s=!1,i;return Object.defineProperties(t,{[Ak]:{value:r},signal:{enumerable:!0,get:()=>(i??(i=e()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}}),t}let ZJ=()=>FJ;const Ik=()=>ZJ();var qf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},uu,Dl,sf,U4,WJ=(U4=class extends qf{constructor(){super();rt(this,uu);rt(this,Dl);rt(this,sf);Me(this,sf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Dl)||this.setEventListener(W(this,sf))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Dl))==null||e.call(this),Me(this,Dl,void 0))}setEventListener(e){var n;Me(this,sf,e),(n=W(this,Dl))==null||n.call(this),Me(this,Dl,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){W(this,uu)!==e&&(Me(this,uu,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof W(this,uu)=="boolean"?W(this,uu):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},uu=new WeakMap,Dl=new WeakMap,sf=new WeakMap,U4);const Ok=new WJ,KJ=$J;function qJ(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=KJ;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;e++;try{c=l()}finally{e--,e||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const Ir=qJ();var of,$l,af,B4,GJ=(B4=class extends qf{constructor(){super();rt(this,of,!0);rt(this,$l);rt(this,af);Me(this,af,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,$l)||this.setEventListener(W(this,af))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,$l))==null||e.call(this),Me(this,$l,void 0))}setEventListener(e){var n;Me(this,af,e),(n=W(this,$l))==null||n.call(this),Me(this,$l,e(this.setOnline.bind(this)))}setOnline(e){W(this,of)!==e&&(Me(this,of,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return W(this,of)}},of=new WeakMap,$l=new WeakMap,af=new WeakMap,B4);const qv=new GJ;function YJ(t){return Math.min(1e3*2**t,3e4)}function QN(t){return(t??"online")==="online"?qv.isOnline():!0}var rx=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function JN(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((k,C)=>{i=k,o=C});l.catch(Is);const c=()=>s!=="pending",d=k=>{var C;if(!c()){const P=new rx(k);_(P),(C=t.onCancel)==null||C.call(t,P)}},f=()=>{e=!0},h=()=>{e=!1},m=()=>Ok.isFocused()&&(t.networkMode==="always"||qv.isOnline())&&t.canRun(),v=()=>QN(t.networkMode)&&t.canRun(),y=k=>{c()||(r==null||r(),s="resolved",i(k))},_=k=>{c()||(r==null||r(),s="rejected",o(k))},b=k=>new Promise(C=>{var P;r=R=>{(c()||k())&&C(R)},(P=t.onPause)==null||P.call(t)}).then(()=>{var C;r=void 0,c()||(C=t.onContinue)==null||C.call(t)}),x=()=>{if(c())return;let k;const C=n===0?t.initialPromise:void 0;try{k=C??t.fn()}catch(P){k=Promise.reject(P)}Promise.resolve(k).then(y).catch(P=>{var M;if(c())return;const R=t.retry??(Ik()?0:3),O=t.retryDelay??YJ,I=typeof O=="function"?O(n,P):O,A=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,P);if(e||!A){_(P);return}n++,(M=t.onFail)==null||M.call(t,n,P),zJ(I).then(()=>c()||m()?void 0:b(m)).then(()=>{e?_(P):x()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:h,canStart:v,start:()=>(v()?x():b(v).then(x),l)}}var du,Z4,e9=(Z4=class{constructor(){rt(this,du)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),KN(this.gcTime)&&Me(this,du,ou.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ik()?1/0:3e5))}clearGcTimeout(){W(this,du)!==void 0&&(ou.clearTimeout(W(this,du)),Me(this,du,void 0))}},du=new WeakMap,Z4);function XJ(t){return{onFetch:(e,n)=>{var f,h,m,v,y;const r=e.options,s=(m=(h=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((y=e.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let _=!1;const b=e,x=P=>{BJ(P,()=>e.signal,()=>_=!0,b[Ak])},k=XN(e.options,e.fetchOptions),C=async(P,R,O)=>{if(_)return Promise.reject(e.signal.reason);if(R==null&&P.pages.length)return Promise.resolve(P);const A=(()=>{const $={client:e.client,queryKey:e.queryKey,pageParam:R,direction:O?"backward":"forward",meta:e.options.meta};return x($),$})(),M=await k(A),{maxPages:L}=e.options,z=O?UJ:HJ;return{pages:z(P.pages,M,L),pageParams:z(P.pageParams,R,L)}};if(s&&i.length){const P=s==="backward",R=P?QJ:oR,O={pages:i,pageParams:o};l=await C(O,R(r,O),P)}else{const P=t??i.length;do{const R=c===0?o[0]===void 0?r.initialPageParam:o[0]:oR(r,l);if(c>0&&R==null)break;l=await C(l,R),c++}while(c<P)}return l};e.options.persister?e.fetchFn=()=>{var _,b;return(b=(_=e.options).persister)==null?void 0:b.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function oR(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function QJ(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var lf,fu,cf,Zi,hu,Ur,ja,Sm,pu,go,Na,W4,JJ=(W4=class extends e9{constructor(e){super();rt(this,go);rt(this,lf);rt(this,fu);rt(this,cf);rt(this,Zi);rt(this,hu);rt(this,Ur);rt(this,ja);rt(this,Sm);rt(this,pu);Me(this,pu,!1),Me(this,Sm,e.defaultOptions),this.setOptions(e.options),this.observers=[],Me(this,hu,e.client),Me(this,Zi,W(this,hu).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Me(this,fu,lR(this.options)),this.state=e.state??W(this,fu),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,lf)}get promise(){var e;return(e=W(this,Ur))==null?void 0:e.promise}setOptions(e){if(this.options={...W(this,Sm),...e},e!=null&&e._type&&Me(this,lf,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=lR(this.options);n.data!==void 0&&(this.setState(aR(n.data,n.dataUpdatedAt)),Me(this,fu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,Zi).remove(this)}setData(e,n){const r=nx(this.state.data,e,this.options);return Et(this,go,Na).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){Et(this,go,Na).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=W(this,Ur))==null?void 0:r.promise;return(s=W(this,Ur))==null||s.cancel(e),n?n.then(Is).catch(Is):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,fu)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>zn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tk||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data===void 0?!1:this.getObserversCount()>0?this.observers.some(e=>zn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!qN(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Ur))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Ur))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,Zi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(W(this,Ur)&&(W(this,pu)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?W(this,Ur).cancel({revert:!0}):W(this,Ur).cancelRetry()),this.scheduleGc()),W(this,Zi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Et(this,go,Na).call(this,{type:"invalidate"})}async fetch(e,n){var f,h,m,v;if(this.state.fetchStatus!=="idle"&&((f=W(this,Ur))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Ur)&&W(this,ja))return W(this,Ur).continueRetry(),W(this,ja)}if(e&&this.setOptions(e),!this.options.queryFn){const y=this.observers.find(_=>_.options.queryFn);y&&this.setOptions(y.options)}const r=new AbortController,s=y=>{Object.defineProperties(y,{[Ak]:{value:r.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(Me(this,pu,!0),r.signal)}})},i=()=>{const y=XN(this.options,n),b=(()=>{const x={client:W(this,hu),queryKey:this.queryKey,meta:this.meta};return s(x),x})();return Me(this,pu,!1),this.options.persister?this.options.persister(y,b,this):y(b)},l=(()=>{const y={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,hu),state:this.state,fetchFn:i};return s(y),y})();(h=W(this,lf)==="infinite"?XJ(this.options.pages):this.options.behavior)==null||h.onFetch(l,this),Me(this,cf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=l.fetchOptions)==null?void 0:m.meta))&&Et(this,go,Na).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta});const c=Me(this,Ur,JN({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:y=>{y instanceof rx&&y.revert&&this.setState({...W(this,cf),fetchStatus:"idle"}),r.abort()},onFail:(y,_)=>{Et(this,go,Na).call(this,{type:"failed",failureCount:y,error:_})},onPause:()=>{Et(this,go,Na).call(this,{type:"pause"})},onContinue:()=>{Et(this,go,Na).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),d=(async()=>{var y,_,b,x,k,C,P,R;try{const O=await c.promise;if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(_=(y=W(this,Zi).config).onSuccess)==null||_.call(y,O,this),(x=(b=W(this,Zi).config).onSettled)==null||x.call(b,O,this.state.error,this),O}catch(O){if(O instanceof rx){if(O.silent){if(W(this,Ur)!==c&&W(this,ja))return W(this,ja);throw O}else if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw Et(this,go,Na).call(this,{type:"error",error:O}),(C=(k=W(this,Zi).config).onError)==null||C.call(k,O,this),(R=(P=W(this,Zi).config).onSettled)==null||R.call(P,this.state.data,O,this),O}finally{W(this,Ur)===c&&(Me(this,Ur,void 0),Me(this,ja,void 0)),this.scheduleGc()}})();return Me(this,ja,d),c.start(),d}},lf=new WeakMap,fu=new WeakMap,cf=new WeakMap,Zi=new WeakMap,hu=new WeakMap,Ur=new WeakMap,ja=new WeakMap,Sm=new WeakMap,pu=new WeakMap,go=new WeakSet,Na=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...t9(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...aR(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(this,cf,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Ir.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),W(this,Zi).notify({query:this,type:"updated",action:e})})},W4);function t9(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:QN(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function aR(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function lR(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ts,zt,km,Rs,mu,uf,za,Em,df,ff,gu,vu,Fl,hf,ln,op,sx,ix,ox,ax,lx,cx,ux,dx,K4,eee=(K4=class extends qf{constructor(e,n){super();rt(this,ln);rt(this,Ts);rt(this,zt);rt(this,km);rt(this,Rs);rt(this,mu);rt(this,uf);rt(this,za);rt(this,Em);rt(this,df);rt(this,ff);rt(this,gu);rt(this,vu);rt(this,Fl);rt(this,hf,new Set);this.options=n,Me(this,Ts,e),Me(this,za,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,zt).addObserver(this),cR(W(this,zt),this.options)?Et(this,ln,op).call(this):this.updateResult(),Et(this,ln,lx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fx(W(this,zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fx(W(this,zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Et(this,ln,cx).call(this),Et(this,ln,ux).call(this),W(this,zt).removeObserver(this)}setOptions(e){const n=this.options,r=W(this,zt);if(this.options=W(this,Ts).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zn(this.options.enabled,W(this,zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Et(this,ln,dx).call(this),W(this,zt).setOptions(this.options),n._defaulted&&!Zg(this.options,n)&&W(this,Ts).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,zt),observer:this});const s=this.hasListeners();s&&uR(W(this,zt),r,this.options,n)&&Et(this,ln,op).call(this),this.updateResult(),s&&(W(this,zt)!==r||zn(this.options.enabled,W(this,zt))!==zn(n.enabled,W(this,zt))||zn(this.options.staleTime,W(this,zt))!==zn(n.staleTime,W(this,zt)))&&Et(this,ln,ix).call(this);const i=Et(this,ln,ox).call(this);s&&(W(this,zt)!==r||zn(this.options.enabled,W(this,zt))!==zn(n.enabled,W(this,zt))||i!==W(this,Fl))&&Et(this,ln,ax).call(this,i)}getOptimisticResult(e){const n=W(this,Ts).getQueryCache().build(W(this,Ts),e),r=this.createResult(n,e);return Zg(this.getCurrentResult(),r)||(Me(this,Rs,r),Me(this,uf,this.options),Me(this,mu,W(this,zt).state)),r}getCurrentResult(){return W(this,Rs)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){W(this,hf).add(e)}getCurrentQuery(){return W(this,zt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=W(this,Ts).defaultQueryOptions(e),r=W(this,Ts).getQueryCache().build(W(this,Ts),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=W(this,Ts).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch(n).then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return Et(this,ln,op).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Rs)))}createResult(e,n){var O;const r=W(this,zt),s=this.options,i=W(this,Rs),o=W(this,mu),l=W(this,uf),c=e!==r?e.state:W(this,km),{state:d}=e;let f={...d},h=!1,m;if(n._optimisticResults){const I=this.hasListeners(),A=!I&&cR(e,n),M=I&&uR(e,r,n,s);(A||M)&&(f={...f,...t9(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:_}=f;m=f.data;let b=!1;if(n.placeholderData!==void 0&&m===void 0&&_==="pending"){let I;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=i.data,b=!0):I=typeof n.placeholderData=="function"?n.placeholderData((O=W(this,ff))==null?void 0:O.state.data,W(this,ff)):n.placeholderData,I!==void 0&&(_="success",m=nx(i==null?void 0:i.data,I,n),h=!0)}if(n.select&&m!==void 0&&!b)if(i&&m===(o==null?void 0:o.data)&&n.select===W(this,Em))m=W(this,df);else try{Me(this,Em,n.select),m=n.select(m),m=nx(i==null?void 0:i.data,m,n),Me(this,df,m),Me(this,za,null)}catch(I){Me(this,za,I)}else m===void 0&&Me(this,za,null);W(this,za)&&(v=W(this,za),m=W(this,df),y=Date.now(),_="error",h=!1);const x=f.fetchStatus==="fetching",k=_==="pending",C=_==="error",P=k&&x,R=m!==void 0;return{status:_,fetchStatus:f.fetchStatus,isPending:k,isSuccess:_==="success",isError:C,isInitialLoading:P,isLoading:P,data:m,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!k,isLoadingError:C&&!R,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:C&&R,isStale:Mk(e,n),refetch:this.refetch,isEnabled:zn(n.enabled,e)!==!1}}updateResult(){const e=W(this,Rs),n=this.createResult(W(this,zt),this.options);if(Me(this,mu,W(this,zt).state),Me(this,uf,this.options),W(this,mu).data!==void 0&&Me(this,ff,W(this,zt)),Zg(n,e))return;Me(this,Rs,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!W(this,hf).size||this.options.throwOnError&&W(this,Rs).error!==e.error)return!0;for(const l of o??W(this,hf))if(W(this,Rs)[l]!==e[l])return!0;return!1})();Ir.batch(()=>{s&&this.listeners.forEach(i=>{i(W(this,Rs))}),W(this,Ts).getQueryCache().notify({query:W(this,zt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Et(this,ln,lx).call(this)}},Ts=new WeakMap,zt=new WeakMap,km=new WeakMap,Rs=new WeakMap,mu=new WeakMap,uf=new WeakMap,za=new WeakMap,Em=new WeakMap,df=new WeakMap,ff=new WeakMap,gu=new WeakMap,vu=new WeakMap,Fl=new WeakMap,hf=new WeakMap,ln=new WeakSet,op=function(e){Et(this,ln,dx).call(this);let n=W(this,zt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Is)),n},sx=function(e){return!Ik()&&zn(this.options.enabled,W(this,zt))!==!1&&KN(e)},ix=function(){Et(this,ln,cx).call(this);const e=zn(this.options.staleTime,W(this,zt));if(W(this,Rs).isStale||!Et(this,ln,sx).call(this,e))return;const n=qN(W(this,Rs).dataUpdatedAt,e)+1;Me(this,gu,ou.setTimeout(()=>{W(this,Rs).isStale||this.updateResult()},n))},ox=function(){return zn(this.options.refetchInterval,W(this,zt))??!1},ax=function(e){Et(this,ln,ux).call(this),Me(this,Fl,e),!(W(this,Fl)===0||!Et(this,ln,sx).call(this,W(this,Fl)))&&Me(this,vu,ou.setInterval(()=>{(this.options.refetchIntervalInBackground||Ok.isFocused())&&Et(this,ln,op).call(this)},W(this,Fl)))},lx=function(){Et(this,ln,ix).call(this),Et(this,ln,ax).call(this,Et(this,ln,ox).call(this))},cx=function(){W(this,gu)!==void 0&&(ou.clearTimeout(W(this,gu)),Me(this,gu,void 0))},ux=function(){W(this,vu)!==void 0&&(ou.clearInterval(W(this,vu)),Me(this,vu,void 0))},dx=function(){const e=W(this,Ts).getQueryCache().build(W(this,Ts),this.options);if(e===W(this,zt))return;const n=W(this,zt);Me(this,zt,e),Me(this,km,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},K4);function tee(t,e){return zn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&zn(e.retryOnMount,t)===!1)}function cR(t,e){return tee(t,e)||t.state.data!==void 0&&fx(t,e,e.refetchOnMount)}function fx(t,e,n){if(zn(e.enabled,t)!==!1&&zn(e.staleTime,t)!=="static"){const r=zn(n,t);return r==="always"||r!==!1&&Mk(t,e)}return!1}function uR(t,e,n,r){return(t!==e||zn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Mk(t,n)}function Mk(t,e){return zn(e.enabled,t)!==!1&&t.isStaleByTime(zn(e.staleTime,t))}var Cm,Wo,hs,yu,Ko,Il,q4,nee=(q4=class extends e9{constructor(e){super();rt(this,Ko);rt(this,Cm);rt(this,Wo);rt(this,hs);rt(this,yu);Me(this,Cm,e.client),this.mutationId=e.mutationId,Me(this,hs,e.mutationCache),Me(this,Wo,[]),this.state=e.state||n9(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){W(this,Wo).includes(e)||(W(this,Wo).push(e),this.clearGcTimeout(),W(this,hs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Me(this,Wo,W(this,Wo).filter(n=>n!==e)),this.scheduleGc(),W(this,hs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,Wo).length||(this.state.status==="pending"?this.scheduleGc():W(this,hs).remove(this))}continue(){var e;return((e=W(this,yu))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,c,d,f,h,m,v,y,_,b,x,k,C,P,R,O,I,A;const n=()=>{Et(this,Ko,Il).call(this,{type:"continue"})},r={client:W(this,Cm),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Me(this,yu,JN({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,L)=>{Et(this,Ko,Il).call(this,{type:"failed",failureCount:M,error:L})},onPause:()=>{Et(this,Ko,Il).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,hs).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{Et(this,Ko,Il).call(this,{type:"pending",variables:e,isPaused:o}),W(this,hs).config.onMutate&&await W(this,hs).config.onMutate(e,this,r);const L=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,e,r));L!==this.state.context&&Et(this,Ko,Il).call(this,{type:"pending",context:L,variables:e,isPaused:o})}this.state.isPaused&&s.canStart()&&n();const M=await s.start();return await((f=(d=W(this,hs).config).onSuccess)==null?void 0:f.call(d,M,e,this.state.context,this,r)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,M,e,this.state.context,r)),await((y=(v=W(this,hs).config).onSettled)==null?void 0:y.call(v,M,null,this.state.variables,this.state.context,this,r)),await((b=(_=this.options).onSettled)==null?void 0:b.call(_,M,null,e,this.state.context,r)),Et(this,Ko,Il).call(this,{type:"success",data:M}),M}catch(M){try{await((k=(x=W(this,hs).config).onError)==null?void 0:k.call(x,M,e,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((P=(C=this.options).onError)==null?void 0:P.call(C,M,e,this.state.context,r))}catch(L){Promise.reject(L)}try{await((O=(R=W(this,hs).config).onSettled)==null?void 0:O.call(R,void 0,M,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((A=(I=this.options).onSettled)==null?void 0:A.call(I,void 0,M,e,this.state.context,r))}catch(L){Promise.reject(L)}throw Et(this,Ko,Il).call(this,{type:"error",error:M}),M}finally{W(this,yu)===s&&Me(this,yu,void 0),W(this,hs).runNext(this)}}},Cm=new WeakMap,Wo=new WeakMap,hs=new WeakMap,yu=new WeakMap,Ko=new WeakSet,Il=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ir.batch(()=>{W(this,Wo).forEach(r=>{r.onMutationUpdate(e)}),W(this,hs).notify({mutation:this,type:"updated",action:e})})},q4);function n9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,vo,Pm,G4,ree=(G4=class extends qf{constructor(e={}){super();rt(this,jl);rt(this,vo);rt(this,Pm);this.config=e,Me(this,jl,new Set),Me(this,vo,new Map),Me(this,Pm,0)}build(e,n,r){const s=new nee({client:e,mutationCache:this,mutationId:++B0(this,Pm)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){W(this,jl).add(e);const n=ug(e);if(typeof n=="string"){const r=W(this,vo).get(n);r?r.push(e):W(this,vo).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,jl).delete(e)){const n=ug(e);if(typeof n=="string"){const r=W(this,vo).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&W(this,vo).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=ug(e);if(typeof n=="string"){const s=(r=W(this,vo).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=ug(e);return typeof n=="string"?((s=(r=W(this,vo).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Ir.batch(()=>{const e=this.getAll();W(this,jl).clear(),W(this,vo).clear(),e.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(W(this,jl))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>rR(n,r))}findAll(e={}){return this.getAll().filter(n=>rR(e,n))}notify(e){Ir.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ir.batch(()=>Promise.all(e.map(n=>n.continue().catch(Is))))}},jl=new WeakMap,vo=new WeakMap,Pm=new WeakMap,G4);function ug(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Va,zl,ps,Tm,na,ap,hx,Y4,see=(Y4=class extends qf{constructor(n,r){super();rt(this,na);rt(this,Va);rt(this,zl);rt(this,ps);rt(this,Tm);Me(this,Va,n),this.setOptions(r),this.bindMethods(),Et(this,na,ap).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=W(this,Va).defaultMutationOptions(n),Zg(this.options,r)||W(this,Va).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,ps),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Du(r.mutationKey)!==Du(this.options.mutationKey)?this.reset():((s=W(this,ps))==null?void 0:s.state.status)==="pending"&&W(this,ps).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&W(this,ps)&&(W(this,ps).addObserver(this),Et(this,na,ap).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,ps))==null||n.removeObserver(this)}onMutationUpdate(n){Et(this,na,ap).call(this),Et(this,na,hx).call(this,n)}getCurrentResult(){return W(this,zl)}reset(){var n;(n=W(this,ps))==null||n.removeObserver(this),Me(this,ps,void 0),Et(this,na,ap).call(this),Et(this,na,hx).call(this)}mutate(n,r){var s;return Me(this,Tm,r),(s=W(this,ps))==null||s.removeObserver(this),Me(this,ps,W(this,Va).getMutationCache().build(W(this,Va),this.options)),W(this,ps).addObserver(this),W(this,ps).execute(n)}},Va=new WeakMap,zl=new WeakMap,ps=new WeakMap,Tm=new WeakMap,na=new WeakSet,ap=function(){var r;const n=((r=W(this,ps))==null?void 0:r.state)??n9();Me(this,zl,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},hx=function(n){Ir.batch(()=>{var s,i,o,l;const r=W(this,Tm);if(r&&this.hasListeners()){const c=W(this,zl).variables,d=W(this,zl).context,f={client:W(this,Va),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=r.onSuccess)==null||s.call(r,n.data,c,d,f)}catch(h){Promise.reject(h)}try{(i=r.onSettled)==null||i.call(r,n.data,null,c,d,f)}catch(h){Promise.reject(h)}}else if((n==null?void 0:n.type)==="error"){try{(o=r.onError)==null||o.call(r,n.error,c,d,f)}catch(h){Promise.reject(h)}try{(l=r.onSettled)==null||l.call(r,void 0,n.error,c,d,f)}catch(h){Promise.reject(h)}}}this.listeners.forEach(c=>{c(W(this,zl))})})},Y4),qo,X4,iee=(X4=class extends qf{constructor(e={}){super();rt(this,qo);this.config=e,Me(this,qo,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Pk(s,n);let o=this.get(i);return o||(o=new JJ({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){W(this,qo).has(e.queryHash)||(W(this,qo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){W(this,qo).get(e.queryHash)===e&&(e.destroy(),W(this,qo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ir.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,qo).get(e)}getAll(){return[...W(this,qo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>nR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>nR(e,r)):n}notify(e){Ir.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ir.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ir.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qo=new WeakMap,X4),Wn,Vl,Hl,pf,mf,Ul,gf,vf,Q4,oee=(Q4=class{constructor(t={}){rt(this,Wn);rt(this,Vl);rt(this,Hl);rt(this,pf);rt(this,mf);rt(this,Ul);rt(this,gf);rt(this,vf);Me(this,Wn,t.queryCache||new iee),Me(this,Vl,t.mutationCache||new ree),Me(this,Hl,t.defaultOptions||{}),Me(this,pf,new Map),Me(this,mf,new Map),Me(this,Ul,0)}mount(){B0(this,Ul)._++,W(this,Ul)===1&&(Me(this,gf,Ok.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Wn).onFocus())})),Me(this,vf,qv.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Wn).onOnline())})))}unmount(){var t,e;B0(this,Ul)._--,W(this,Ul)===0&&((t=W(this,gf))==null||t.call(this),Me(this,gf,void 0),(e=W(this,vf))==null||e.call(this),Me(this,vf,void 0))}isFetching(t){return W(this,Wn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return W(this,Vl).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Wn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=W(this,Wn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(zn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return W(this,Wn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=W(this,Wn).get(r.queryHash))==null?void 0:o.state.data,i=jJ(e,s);if(i!==void 0)return W(this,Wn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return Ir.batch(()=>W(this,Wn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Wn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=W(this,Wn);Ir.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=W(this,Wn);return Ir.batch(()=>{const r=n.findAll(t),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},r=Ir.batch(()=>W(this,Wn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Is).catch(Is)}invalidateQueries(t,e={}){return Ir.batch(()=>(W(this,Wn).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Ir.batch(()=>W(this,Wn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);const o=s.state.fetchStatus==="paused";return(!n.throwOnError||o)&&(i=i.catch(Is)),o?Promise.resolve():i}));return Promise.all(r).then(Is)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,Wn).build(this,e),r=n.isStaleByTime(zn(e.staleTime,n))?await n.fetch(e):n.state.data,s=e.select;return s?s(r):r}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,Wn).build(this,e);return n.isStaleByTime(zn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Is).catch(Is)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Is).catch(Is)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return qv.isOnline()?W(this,Vl).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Wn)}getMutationCache(){return W(this,Vl)}getDefaultOptions(){return W(this,Hl)}setDefaultOptions(t){Me(this,Hl,t)}setQueryDefaults(t,e){W(this,pf).set(Du(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...W(this,pf).values()],n={};return e.forEach(r=>{Nf(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){W(this,mf).set(Du(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...W(this,mf).values()],n={};return e.forEach(r=>{Nf(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...W(this,Hl).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Pk(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Tk&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...W(this,Hl).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){W(this,Wn).clear(),W(this,Vl).clear()}},Wn=new WeakMap,Vl=new WeakMap,Hl=new WeakMap,pf=new WeakMap,mf=new WeakMap,Ul=new WeakMap,gf=new WeakMap,vf=new WeakMap,Q4);const r9=g.createContext(!1),aee=()=>g.useContext(r9);r9.Provider;function lee(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const cee=g.createContext(lee()),uee=()=>g.useContext(cee),dee=(t,e,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof t.throwOnError=="function"?Rk(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},fee=t=>{g.useEffect(()=>{t.clearReset()},[t])},hee=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||Rk(n,[t.error,r])),pee=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},mee=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,gee=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function vee(t,e,n){const r=aee(),s=uee(),i=Om(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),c=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":c?"optimistic":void 0,pee(o),dee(o,s,l),fee(s);const[d]=g.useState(()=>new e(i,o)),f=d.getOptimisticResult(o);g.useEffect(()=>{d.setOptions(o)},[o,d]);const h=!r&&c;if(g.useSyncExternalStore(g.useCallback(m=>{const v=h?d.subscribe(Ir.batchCalls(m)):Is;return d.updateResult(),v},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),mee(o,f))throw gee(o,d,s);if(hee({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function ca(t,e){return vee(t,eee)}function s9(t,e){const n=Om(),[r]=g.useState(()=>new see(n,t));g.useEffect(()=>{r.setOptions(t)},[r,t]);const s=g.useSyncExternalStore(g.useCallback(o=>r.subscribe(Ir.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=g.useCallback((...o)=>{r.mutate(o[0],o[1]).catch(Is)},[r]);if(s.error&&Rk(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}var yee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var _ee=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},dg,dR="__POSTHOG_REACT_SHARED_STATE__",fR=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Qp;try{Qp=fR[dR]=fR[dR]||new WeakMap}catch{Qp=new WeakMap}Qp.has(g.createContext)||Qp.set(g.createContext,{});var Su=Qp.get(g.createContext),px;function wee(t){(!Su.defaultPostHogInstance||Su.defaultPostHogInstance===px)&&(Su.defaultPostHogInstance=t),px=t}function mx(){return px}Su.context||(Su.context=g.createContext({get client(){return mx()||Su.defaultPostHogInstance},bootstrap:void 0}));var Nk=Su.context;function i9(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var l=o[i];if(!s.includes(l)||!i9(t[l],e[l],n))return!1}return!0}function bee(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=g.useRef(null),c=g.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var d=mx();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),d},[s,i,JSON.stringify(o)]);return g.useEffect(function(){if(!(s||!i)){var d=mx(),f=l.current;f?(i!==f.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!i9(o,f.options)&&d.set_config(o),l.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),l.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),Ee.createElement(Nk.Provider,{value:{client:c,bootstrap:(e=o==null?void 0:o.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var X2=function(t){return typeof t=="function"},xee=function(t){return t===void 0},Ai=function(){var t=g.useContext(Nk).client;return t},Wg=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},See=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},kee=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!Wg(r.cause)){xee(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},Eee=function(t,e){if(!e)return t;var n=new Error(Wg(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return See(n,"React ErrorBoundary ".concat(Wg(t)?t.name:"Error")),n.stack=e,Wg(t)?(kee(t,n),t):n},hR={componentStack:null,exceptionEvent:null,error:null},Cee={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},Pee=(dg=(function(t){yee(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(hR)},r.state=hR,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;X2(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,c=o.captureException(Eee(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:c})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return X2(r)?r():r;var o=X2(s)?Ee.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return Ee.isValidElement(o)?o:(console.warn(Cee.INVALID_FALLBACK),Ee.createElement(Ee.Fragment,null))},e})(Ee.Component),_ee(dg,"PostHogErrorBoundary"),(function(){dg.contextType=Nk})(),dg);wee(Qe);const Tee="rivet-preview-bridge",Ree=["ArrowUp","ArrowDown"],Aee=new Set(["INPUT","TEXTAREA","SELECT"]),o9=t=>!t||!("tagName"in t)||typeof t.tagName!="string"?!1:Aee.has(t.tagName.toUpperCase())||"isContentEditable"in t&&t.isContentEditable===!0,Iee=t=>typeof t!="object"||t===null||!("channel"in t)||t.channel!==Tee||!("direction"in t)||t.direction!=="event"||!("type"in t)||t.type!=="keydown"||!("key"in t)?null:Ree.find(e=>e===t.key)??null,Oee=t=>{try{return new URL(t.src,window.location.href).origin}catch{return null}},Mee=t=>t.source===null?null:Array.from(document.querySelectorAll("iframe")).find(e=>e.contentWindow===t.source&&Oee(e)===t.origin)??null,Nee=t=>{const e=n=>{o9(n.target)||t(n)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},Lee=()=>{const t=e=>{const n=Iee(e.data),r=n?Mee(e):null;!n||!r||r.dispatchEvent(new KeyboardEvent("keydown",{key:n,bubbles:!0,cancelable:!0}))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)};var fg={},Q2={exports:{}},Us={},J2={exports:{}},ew={};/**
78
- * @license React
79
- * scheduler.production.min.js
80
- *
81
- * Copyright (c) Facebook, Inc. and its affiliates.
82
- *
83
- * This source code is licensed under the MIT license found in the
84
- * LICENSE file in the root directory of this source tree.
85
- */var pR;function Dee(){return pR||(pR=1,(function(t){function e(V,Q){var B=V.length;V.push(Q);e:for(;0<B;){var D=B-1>>>1,G=V[D];if(0<s(G,Q))V[D]=Q,V[B]=G,B=D;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var Q=V[0],B=V.pop();if(B!==Q){V[0]=B;e:for(var D=0,G=V.length,fe=G>>>1;D<fe;){var ie=2*(D+1)-1,ue=V[ie],he=ie+1,_e=V[he];if(0>s(ue,B))he<G&&0>s(_e,ue)?(V[D]=_e,V[he]=B,D=he):(V[D]=ue,V[ie]=B,D=ie);else if(he<G&&0>s(_e,B))V[D]=_e,V[he]=B,D=he;else break e}}return Q}function s(V,Q){var B=V.sortIndex-Q.sortIndex;return B!==0?B:V.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],d=[],f=1,h=null,m=3,v=!1,y=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(V){for(var Q=n(d);Q!==null;){if(Q.callback===null)r(d);else if(Q.startTime<=V)r(d),Q.sortIndex=Q.expirationTime,e(c,Q);else break;Q=n(d)}}function P(V){if(_=!1,C(V),!y)if(n(c)!==null)y=!0,H(R);else{var Q=n(d);Q!==null&&ee(P,Q.startTime-V)}}function R(V,Q){y=!1,_&&(_=!1,x(A),A=-1),v=!0;var B=m;try{for(C(Q),h=n(c);h!==null&&(!(h.expirationTime>Q)||V&&!z());){var D=h.callback;if(typeof D=="function"){h.callback=null,m=h.priorityLevel;var G=D(h.expirationTime<=Q);Q=t.unstable_now(),typeof G=="function"?h.callback=G:h===n(c)&&r(c),C(Q)}else r(c);h=n(c)}if(h!==null)var fe=!0;else{var ie=n(d);ie!==null&&ee(P,ie.startTime-Q),fe=!1}return fe}finally{h=null,m=B,v=!1}}var O=!1,I=null,A=-1,M=5,L=-1;function z(){return!(t.unstable_now()-L<M)}function $(){if(I!==null){var V=t.unstable_now();L=V;var Q=!0;try{Q=I(!0,V)}finally{Q?q():(O=!1,I=null)}}else O=!1}var q;if(typeof k=="function")q=function(){k($)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,K=X.port2;X.port1.onmessage=$,q=function(){K.postMessage(null)}}else q=function(){b($,0)};function H(V){I=V,O||(O=!0,q())}function ee(V,Q){A=b(function(){V(t.unstable_now())},Q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_continueExecution=function(){y||v||(y=!0,H(R))},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(V){switch(m){case 1:case 2:case 3:var Q=3;break;default:Q=m}var B=m;m=Q;try{return V()}finally{m=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,Q){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var B=m;m=V;try{return Q()}finally{m=B}},t.unstable_scheduleCallback=function(V,Q,B){var D=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?D+B:D):B=D,V){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=B+G,V={id:f++,callback:Q,priorityLevel:V,startTime:B,expirationTime:G,sortIndex:-1},B>D?(V.sortIndex=B,e(d,V),n(c)===null&&V===n(d)&&(_?(x(A),A=-1):_=!0,ee(P,B-D))):(V.sortIndex=G,e(c,V),y||v||(y=!0,H(R))),V},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(V){var Q=m;return function(){var B=m;m=Q;try{return V.apply(this,arguments)}finally{m=B}}}})(ew)),ew}var mR;function $ee(){return mR||(mR=1,J2.exports=Dee()),J2.exports}/**
86
- * @license React
87
- * react-dom.production.min.js
88
- *
89
- * Copyright (c) Facebook, Inc. and its affiliates.
90
- *
91
- * This source code is licensed under the MIT license found in the
92
- * LICENSE file in the root directory of this source tree.
93
- */var gR;function Fee(){if(gR)return Us;gR=1;var t=zS(),e=$ee();function n(a){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;p<arguments.length;p++)u+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+a+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(a,u){o(a,u),o(a+"Capture",u)}function o(a,u){for(s[a]=u,a=0;a<u.length;a++)r.add(u[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},h={};function m(a){return c.call(h,a)?!0:c.call(f,a)?!1:d.test(a)?h[a]=!0:(f[a]=!0,!1)}function v(a,u,p,w){if(p!==null&&p.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function y(a,u,p,w){if(u===null||typeof u>"u"||v(a,u,p,w))return!0;if(w)return!1;if(p!==null)switch(p.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function _(a,u,p,w,E,T,N){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=E,this.mustUseProperty=p,this.propertyName=a,this.type=u,this.sanitizeURL=T,this.removeEmptyString=N}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){b[a]=new _(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var u=a[0];b[u]=new _(u,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){b[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){b[a]=new _(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){b[a]=new _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){b[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){b[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){b[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){b[a]=new _(a,5,!1,a.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function k(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var u=a.replace(x,k);b[u]=new _(u,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var u=a.replace(x,k);b[u]=new _(u,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var u=a.replace(x,k);b[u]=new _(u,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){b[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){b[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,u,p,w){var E=b.hasOwnProperty(u)?b[u]:null;(E!==null?E.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(y(u,p,E,w)&&(p=null),w||E===null?m(u)&&(p===null?a.removeAttribute(u):a.setAttribute(u,""+p)):E.mustUseProperty?a[E.propertyName]=p===null?E.type===3?!1:"":p:(u=E.attributeName,w=E.attributeNamespace,p===null?a.removeAttribute(u):(E=E.type,p=E===3||E===4&&p===!0?"":""+p,w?a.setAttributeNS(w,u,p):a.setAttribute(u,p))))}var P=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),O=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),z=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),ee=Symbol.for("react.offscreen"),V=Symbol.iterator;function Q(a){return a===null||typeof a!="object"?null:(a=V&&a[V]||a["@@iterator"],typeof a=="function"?a:null)}var B=Object.assign,D;function G(a){if(D===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);D=u&&u[1]||""}return`
94
- `+D+a}var fe=!1;function ie(a,u){if(!a||fe)return"";fe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(oe){var w=oe}Reflect.construct(a,[],u)}else{try{u.call()}catch(oe){w=oe}a.call(u.prototype)}else{try{throw Error()}catch(oe){w=oe}a()}}catch(oe){if(oe&&w&&typeof oe.stack=="string"){for(var E=oe.stack.split(`
95
- `),T=w.stack.split(`
96
- `),N=E.length-1,Z=T.length-1;1<=N&&0<=Z&&E[N]!==T[Z];)Z--;for(;1<=N&&0<=Z;N--,Z--)if(E[N]!==T[Z]){if(N!==1||Z!==1)do if(N--,Z--,0>Z||E[N]!==T[Z]){var Y=`
97
- `+E[N].replace(" at new "," at ");return a.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",a.displayName)),Y}while(1<=N&&0<=Z);break}}}finally{fe=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?G(a):""}function ue(a){switch(a.tag){case 5:return G(a.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return a=ie(a.type,!1),a;case 11:return a=ie(a.type.render,!1),a;case 1:return a=ie(a.type,!0),a;default:return""}}function he(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case I:return"Fragment";case O:return"Portal";case M:return"Profiler";case A:return"StrictMode";case q:return"Suspense";case X:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case z:return(a.displayName||"Context")+".Consumer";case L:return(a._context.displayName||"Context")+".Provider";case $:var u=a.render;return a=a.displayName,a||(a=u.displayName||u.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case K:return u=a.displayName||null,u!==null?u:he(a.type)||"Memo";case H:u=a._payload,a=a._init;try{return he(a(u))}catch{}}return null}function _e(a){var u=a.type;switch(a.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=u.render,a=a.displayName||a.name||"",u.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(u);case 8:return u===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function le(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ne(a){var u=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function be(a){var u=ne(a)?"checked":"value",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,u),w=""+a[u];if(!a.hasOwnProperty(u)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var E=p.get,T=p.set;return Object.defineProperty(a,u,{configurable:!0,get:function(){return E.call(this)},set:function(N){w=""+N,T.call(this,N)}}),Object.defineProperty(a,u,{enumerable:p.enumerable}),{getValue:function(){return w},setValue:function(N){w=""+N},stopTracking:function(){a._valueTracker=null,delete a[u]}}}}function Ve(a){a._valueTracker||(a._valueTracker=be(a))}function De(a){if(!a)return!1;var u=a._valueTracker;if(!u)return!0;var p=u.getValue(),w="";return a&&(w=ne(a)?a.checked?"true":"false":a.value),a=w,a!==p?(u.setValue(a),!0):!1}function $e(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ut(a,u){var p=u.checked;return B({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function nn(a,u){var p=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;p=le(u.value!=null?u.value:p),a._wrapperState={initialChecked:w,initialValue:p,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function kt(a,u){u=u.checked,u!=null&&C(a,"checked",u,!1)}function Dt(a,u){kt(a,u);var p=le(u.value),w=u.type;if(p!=null)w==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(w==="submit"||w==="reset"){a.removeAttribute("value");return}u.hasOwnProperty("value")?qt(a,u.type,p):u.hasOwnProperty("defaultValue")&&qt(a,u.type,le(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(a.defaultChecked=!!u.defaultChecked)}function un(a,u,p){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var w=u.type;if(!(w!=="submit"&&w!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+a._wrapperState.initialValue,p||u===a.value||(a.value=u),a.defaultValue=u}p=a.name,p!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,p!==""&&(a.name=p)}function qt(a,u,p){(u!=="number"||$e(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var Ne=Array.isArray;function Je(a,u,p,w){if(a=a.options,u){u={};for(var E=0;E<p.length;E++)u["$"+p[E]]=!0;for(p=0;p<a.length;p++)E=u.hasOwnProperty("$"+a[p].value),a[p].selected!==E&&(a[p].selected=E),E&&w&&(a[p].defaultSelected=!0)}else{for(p=""+le(p),u=null,E=0;E<a.length;E++){if(a[E].value===p){a[E].selected=!0,w&&(a[E].defaultSelected=!0);return}u!==null||a[E].disabled||(u=a[E])}u!==null&&(u.selected=!0)}}function Re(a,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return B({},u,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Ct(a,u){var p=u.value;if(p==null){if(p=u.children,u=u.defaultValue,p!=null){if(u!=null)throw Error(n(92));if(Ne(p)){if(1<p.length)throw Error(n(93));p=p[0]}u=p}u==null&&(u=""),p=u}a._wrapperState={initialValue:le(p)}}function Se(a,u){var p=le(u.value),w=le(u.defaultValue);p!=null&&(p=""+p,p!==a.value&&(a.value=p),u.defaultValue==null&&a.defaultValue!==p&&(a.defaultValue=p)),w!=null&&(a.defaultValue=""+w)}function $t(a){var u=a.textContent;u===a._wrapperState.initialValue&&u!==""&&u!==null&&(a.value=u)}function ht(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mt(a,u){return a==null||a==="http://www.w3.org/1999/xhtml"?ht(u):a==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var tr,Oi=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,p,w,E){MSApp.execUnsafeLocalFunction(function(){return a(u,p,w,E)})}:a})(function(a,u){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=u;else{for(tr=tr||document.createElement("div"),tr.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=tr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;u.firstChild;)a.appendChild(u.firstChild)}});function Pn(a,u){if(u){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=u;return}}a.textContent=u}var lr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},to=["Webkit","ms","Moz","O"];Object.keys(lr).forEach(function(a){to.forEach(function(u){u=u+a.charAt(0).toUpperCase()+a.substring(1),lr[u]=lr[a]})});function bs(a,u,p){return u==null||typeof u=="boolean"||u===""?"":p||typeof u!="number"||u===0||lr.hasOwnProperty(a)&&lr[a]?(""+u).trim():u+"px"}function rs(a,u){a=a.style;for(var p in u)if(u.hasOwnProperty(p)){var w=p.indexOf("--")===0,E=bs(p,u[p],w);p==="float"&&(p="cssFloat"),w?a.setProperty(p,E):a[p]=E}}var nr=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vn(a,u){if(u){if(nr[a]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function ss(a,u){if(a.indexOf("-")===-1)return typeof u.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pr=null;function Co(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Wr=null,rr=null,Nr=null;function ai(a){if(a=gh(a)){if(typeof Wr!="function")throw Error(n(280));var u=a.stateNode;u&&(u=i0(u),Wr(a.stateNode,a.type,u))}}function cr(a){rr?Nr?Nr.push(a):Nr=[a]:rr=a}function xs(){if(rr){var a=rr,u=Nr;if(Nr=rr=null,ai(a),u)for(a=0;a<u.length;a++)ai(u[a])}}function it(a,u){return a(u)}function cn(){}var rn=!1;function yn(a,u,p){if(rn)return a(u,p);rn=!0;try{return it(a,u,p)}finally{rn=!1,(rr!==null||Nr!==null)&&(cn(),xs())}}function Tn(a,u){var p=a.stateNode;if(p===null)return null;var w=i0(p);if(w===null)return null;p=w[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(w=!w.disabled)||(a=a.type,w=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!w;break e;default:a=!1}if(a)return null;if(p&&typeof p!="function")throw Error(n(231,u,typeof p));return p}var Gt=!1;if(l)try{var $n={};Object.defineProperty($n,"passive",{get:function(){Gt=!0}}),window.addEventListener("test",$n,$n),window.removeEventListener("test",$n,$n)}catch{Gt=!1}function is(a,u,p,w,E,T,N,Z,Y){var oe=Array.prototype.slice.call(arguments,3);try{u.apply(p,oe)}catch(we){this.onError(we)}}var sr=!1,kr=null,Bt=!1,Mi=null,rh={onError:function(a){sr=!0,kr=a}};function ol(a,u,p,w,E,T,N,Z,Y){sr=!1,kr=null,is.apply(rh,arguments)}function Po(a,u,p,w,E,T,N,Z,Y){if(ol.apply(this,arguments),sr){if(sr){var oe=kr;sr=!1,kr=null}else throw Error(n(198));Bt||(Bt=!0,Mi=oe)}}function Lr(a){var u=a,p=a;if(a.alternate)for(;u.return;)u=u.return;else{a=u;do u=a,(u.flags&4098)!==0&&(p=u.return),a=u.return;while(a)}return u.tag===3?p:null}function Ni(a){if(a.tag===13){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function Ls(a){if(Lr(a)!==a)throw Error(n(188))}function no(a){var u=a.alternate;if(!u){if(u=Lr(a),u===null)throw Error(n(188));return u!==a?null:a}for(var p=a,w=u;;){var E=p.return;if(E===null)break;var T=E.alternate;if(T===null){if(w=E.return,w!==null){p=w;continue}break}if(E.child===T.child){for(T=E.child;T;){if(T===p)return Ls(E),a;if(T===w)return Ls(E),u;T=T.sibling}throw Error(n(188))}if(p.return!==w.return)p=E,w=T;else{for(var N=!1,Z=E.child;Z;){if(Z===p){N=!0,p=E,w=T;break}if(Z===w){N=!0,w=E,p=T;break}Z=Z.sibling}if(!N){for(Z=T.child;Z;){if(Z===p){N=!0,p=T,w=E;break}if(Z===w){N=!0,w=T,p=E;break}Z=Z.sibling}if(!N)throw Error(n(189))}}if(p.alternate!==w)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?a:u}function Ds(a){return a=no(a),a!==null?al(a):null}function al(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var u=al(a);if(u!==null)return u;a=a.sibling}return null}var li=e.unstable_scheduleCallback,Cc=e.unstable_cancelCallback,Uu=e.unstable_shouldYield,ll=e.unstable_requestPaint,dn=e.unstable_now,To=e.unstable_getCurrentPriorityLevel,ci=e.unstable_ImmediatePriority,Ro=e.unstable_UserBlockingPriority,Kr=e.unstable_NormalPriority,Pc=e.unstable_LowPriority,Tc=e.unstable_IdlePriority,ga=null,os=null;function Bu(a){if(os&&typeof os.onCommitFiberRoot=="function")try{os.onCommitFiberRoot(ga,a,void 0,(a.current.flags&128)===128)}catch{}}var Ss=Math.clz32?Math.clz32:Ao,sh=Math.log,Zu=Math.LN2;function Ao(a){return a>>>=0,a===0?32:31-(sh(a)/Zu|0)|0}var Io=64,F=4194304;function pe(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function ge(a,u){var p=a.pendingLanes;if(p===0)return 0;var w=0,E=a.suspendedLanes,T=a.pingedLanes,N=p&268435455;if(N!==0){var Z=N&~E;Z!==0?w=pe(Z):(T&=N,T!==0&&(w=pe(T)))}else N=p&~E,N!==0?w=pe(N):T!==0&&(w=pe(T));if(w===0)return 0;if(u!==0&&u!==w&&(u&E)===0&&(E=w&-w,T=u&-u,E>=T||E===16&&(T&4194240)!==0))return u;if((w&4)!==0&&(w|=p&16),u=a.entangledLanes,u!==0)for(a=a.entanglements,u&=w;0<u;)p=31-Ss(u),E=1<<p,w|=a[p],u&=~E;return w}function ke(a,u){switch(a){case 1:case 2:case 4:return u+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function We(a,u){for(var p=a.suspendedLanes,w=a.pingedLanes,E=a.expirationTimes,T=a.pendingLanes;0<T;){var N=31-Ss(T),Z=1<<N,Y=E[N];Y===-1?((Z&p)===0||(Z&w)!==0)&&(E[N]=ke(Z,u)):Y<=u&&(a.expiredLanes|=Z),T&=~Z}}function _t(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function gt(){var a=Io;return Io<<=1,(Io&4194240)===0&&(Io=64),a}function jt(a){for(var u=[],p=0;31>p;p++)u.push(a);return u}function Jt(a,u,p){a.pendingLanes|=u,u!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,u=31-Ss(u),a[u]=p}function wt(a,u){var p=a.pendingLanes&~u;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=u,a.mutableReadLanes&=u,a.entangledLanes&=u,u=a.entanglements;var w=a.eventTimes;for(a=a.expirationTimes;0<p;){var E=31-Ss(p),T=1<<E;u[E]=0,w[E]=-1,a[E]=-1,p&=~T}}function Fn(a,u){var p=a.entangledLanes|=u;for(a=a.entanglements;p;){var w=31-Ss(p),E=1<<w;E&u|a[w]&u&&(a[w]|=u),p&=~E}}var ot=0;function Dr(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var cl,Oo,Er,va,Wu,Ku=!1,Rc=[],U=null,ae=null,Ie=null,Ce=new Map,Ae=new Map,Le=[],Pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function dt(a,u){switch(a){case"focusin":case"focusout":U=null;break;case"dragenter":case"dragleave":ae=null;break;case"mouseover":case"mouseout":Ie=null;break;case"pointerover":case"pointerout":Ce.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ae.delete(u.pointerId)}}function vt(a,u,p,w,E,T){return a===null||a.nativeEvent!==T?(a={blockedOn:u,domEventName:p,eventSystemFlags:w,nativeEvent:T,targetContainers:[E]},u!==null&&(u=gh(u),u!==null&&Oo(u)),a):(a.eventSystemFlags|=w,u=a.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),a)}function Cr(a,u,p,w,E){switch(u){case"focusin":return U=vt(U,a,u,p,w,E),!0;case"dragenter":return ae=vt(ae,a,u,p,w,E),!0;case"mouseover":return Ie=vt(Ie,a,u,p,w,E),!0;case"pointerover":var T=E.pointerId;return Ce.set(T,vt(Ce.get(T)||null,a,u,p,w,E)),!0;case"gotpointercapture":return T=E.pointerId,Ae.set(T,vt(Ae.get(T)||null,a,u,p,w,E)),!0}return!1}function as(a){var u=Ac(a.target);if(u!==null){var p=Lr(u);if(p!==null){if(u=p.tag,u===13){if(u=Ni(p),u!==null){a.blockedOn=u,Wu(a.priority,function(){Er(p)});return}}else if(u===3&&p.stateNode.current.memoizedState.isDehydrated){a.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}a.blockedOn=null}function ks(a){if(a.blockedOn!==null)return!1;for(var u=a.targetContainers;0<u.length;){var p=by(a.domEventName,a.eventSystemFlags,u[0],a.nativeEvent);if(p===null){p=a.nativeEvent;var w=new p.constructor(p.type,p);pr=w,p.target.dispatchEvent(w),pr=null}else return u=gh(p),u!==null&&Oo(u),a.blockedOn=p,!1;u.shift()}return!0}function $s(a,u,p){ks(a)&&p.delete(u)}function sn(){Ku=!1,U!==null&&ks(U)&&(U=null),ae!==null&&ks(ae)&&(ae=null),Ie!==null&&ks(Ie)&&(Ie=null),Ce.forEach($s),Ae.forEach($s)}function Tt(a,u){a.blockedOn===u&&(a.blockedOn=null,Ku||(Ku=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sn)))}function Mo(a){function u(E){return Tt(E,a)}if(0<Rc.length){Tt(Rc[0],a);for(var p=1;p<Rc.length;p++){var w=Rc[p];w.blockedOn===a&&(w.blockedOn=null)}}for(U!==null&&Tt(U,a),ae!==null&&Tt(ae,a),Ie!==null&&Tt(Ie,a),Ce.forEach(u),Ae.forEach(u),p=0;p<Le.length;p++)w=Le[p],w.blockedOn===a&&(w.blockedOn=null);for(;0<Le.length&&(p=Le[0],p.blockedOn===null);)as(p),p.blockedOn===null&&Le.shift()}var Li=P.ReactCurrentBatchConfig,Wm=!0;function zz(a,u,p,w){var E=ot,T=Li.transition;Li.transition=null;try{ot=1,wy(a,u,p,w)}finally{ot=E,Li.transition=T}}function Vz(a,u,p,w){var E=ot,T=Li.transition;Li.transition=null;try{ot=4,wy(a,u,p,w)}finally{ot=E,Li.transition=T}}function wy(a,u,p,w){if(Wm){var E=by(a,u,p,w);if(E===null)Fy(a,u,w,Km,p),dt(a,w);else if(Cr(E,a,u,p,w))w.stopPropagation();else if(dt(a,w),u&4&&-1<Pt.indexOf(a)){for(;E!==null;){var T=gh(E);if(T!==null&&cl(T),T=by(a,u,p,w),T===null&&Fy(a,u,w,Km,p),T===E)break;E=T}E!==null&&w.stopPropagation()}else Fy(a,u,w,null,p)}}var Km=null;function by(a,u,p,w){if(Km=null,a=Co(w),a=Ac(a),a!==null)if(u=Lr(a),u===null)a=null;else if(p=u.tag,p===13){if(a=Ni(u),a!==null)return a;a=null}else if(p===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;a=null}else u!==a&&(a=null);return Km=a,null}function IE(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(To()){case ci:return 1;case Ro:return 4;case Kr:case Pc:return 16;case Tc:return 536870912;default:return 16}default:return 16}}var ul=null,xy=null,qm=null;function OE(){if(qm)return qm;var a,u=xy,p=u.length,w,E="value"in ul?ul.value:ul.textContent,T=E.length;for(a=0;a<p&&u[a]===E[a];a++);var N=p-a;for(w=1;w<=N&&u[p-w]===E[T-w];w++);return qm=E.slice(a,1<w?1-w:void 0)}function Gm(a){var u=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&u===13&&(a=13)):a=u,a===10&&(a=13),32<=a||a===13?a:0}function Ym(){return!0}function ME(){return!1}function ui(a){function u(p,w,E,T,N){this._reactName=p,this._targetInst=E,this.type=w,this.nativeEvent=T,this.target=N,this.currentTarget=null;for(var Z in a)a.hasOwnProperty(Z)&&(p=a[Z],this[Z]=p?p(T):T[Z]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Ym:ME,this.isPropagationStopped=ME,this}return B(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Ym)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Ym)},persist:function(){},isPersistent:Ym}),u}var qu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sy=ui(qu),ih=B({},qu,{view:0,detail:0}),Hz=ui(ih),ky,Ey,oh,Xm=B({},ih,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Py,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==oh&&(oh&&a.type==="mousemove"?(ky=a.screenX-oh.screenX,Ey=a.screenY-oh.screenY):Ey=ky=0,oh=a),ky)},movementY:function(a){return"movementY"in a?a.movementY:Ey}}),NE=ui(Xm),Uz=B({},Xm,{dataTransfer:0}),Bz=ui(Uz),Zz=B({},ih,{relatedTarget:0}),Cy=ui(Zz),Wz=B({},qu,{animationName:0,elapsedTime:0,pseudoElement:0}),Kz=ui(Wz),qz=B({},qu,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Gz=ui(qz),Yz=B({},qu,{data:0}),LE=ui(Yz),Xz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qz={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Jz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eV(a){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(a):(a=Jz[a])?!!u[a]:!1}function Py(){return eV}var tV=B({},ih,{key:function(a){if(a.key){var u=Xz[a.key]||a.key;if(u!=="Unidentified")return u}return a.type==="keypress"?(a=Gm(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Qz[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Py,charCode:function(a){return a.type==="keypress"?Gm(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Gm(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),nV=ui(tV),rV=B({},Xm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),DE=ui(rV),sV=B({},ih,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Py}),iV=ui(sV),oV=B({},qu,{propertyName:0,elapsedTime:0,pseudoElement:0}),aV=ui(oV),lV=B({},Xm,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),cV=ui(lV),uV=[9,13,27,32],Ty=l&&"CompositionEvent"in window,ah=null;l&&"documentMode"in document&&(ah=document.documentMode);var dV=l&&"TextEvent"in window&&!ah,$E=l&&(!Ty||ah&&8<ah&&11>=ah),FE=" ",jE=!1;function zE(a,u){switch(a){case"keyup":return uV.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VE(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Gu=!1;function fV(a,u){switch(a){case"compositionend":return VE(u);case"keypress":return u.which!==32?null:(jE=!0,FE);case"textInput":return a=u.data,a===FE&&jE?null:a;default:return null}}function hV(a,u){if(Gu)return a==="compositionend"||!Ty&&zE(a,u)?(a=OE(),qm=xy=ul=null,Gu=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return $E&&u.locale!=="ko"?null:u.data;default:return null}}var pV={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function HE(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u==="input"?!!pV[a.type]:u==="textarea"}function UE(a,u,p,w){cr(w),u=n0(u,"onChange"),0<u.length&&(p=new Sy("onChange","change",null,p,w),a.push({event:p,listeners:u}))}var lh=null,ch=null;function mV(a){a8(a,0)}function Qm(a){var u=ed(a);if(De(u))return a}function gV(a,u){if(a==="change")return u}var BE=!1;if(l){var Ry;if(l){var Ay="oninput"in document;if(!Ay){var ZE=document.createElement("div");ZE.setAttribute("oninput","return;"),Ay=typeof ZE.oninput=="function"}Ry=Ay}else Ry=!1;BE=Ry&&(!document.documentMode||9<document.documentMode)}function WE(){lh&&(lh.detachEvent("onpropertychange",KE),ch=lh=null)}function KE(a){if(a.propertyName==="value"&&Qm(ch)){var u=[];UE(u,ch,a,Co(a)),yn(mV,u)}}function vV(a,u,p){a==="focusin"?(WE(),lh=u,ch=p,lh.attachEvent("onpropertychange",KE)):a==="focusout"&&WE()}function yV(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Qm(ch)}function _V(a,u){if(a==="click")return Qm(u)}function wV(a,u){if(a==="input"||a==="change")return Qm(u)}function bV(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}var ro=typeof Object.is=="function"?Object.is:bV;function uh(a,u){if(ro(a,u))return!0;if(typeof a!="object"||a===null||typeof u!="object"||u===null)return!1;var p=Object.keys(a),w=Object.keys(u);if(p.length!==w.length)return!1;for(w=0;w<p.length;w++){var E=p[w];if(!c.call(u,E)||!ro(a[E],u[E]))return!1}return!0}function qE(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function GE(a,u){var p=qE(a);a=0;for(var w;p;){if(p.nodeType===3){if(w=a+p.textContent.length,a<=u&&w>=u)return{node:p,offset:u-a};a=w}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=qE(p)}}function YE(a,u){return a&&u?a===u?!0:a&&a.nodeType===3?!1:u&&u.nodeType===3?YE(a,u.parentNode):"contains"in a?a.contains(u):a.compareDocumentPosition?!!(a.compareDocumentPosition(u)&16):!1:!1}function XE(){for(var a=window,u=$e();u instanceof a.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)a=u.contentWindow;else break;u=$e(a.document)}return u}function Iy(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u&&(u==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||u==="textarea"||a.contentEditable==="true")}function xV(a){var u=XE(),p=a.focusedElem,w=a.selectionRange;if(u!==p&&p&&p.ownerDocument&&YE(p.ownerDocument.documentElement,p)){if(w!==null&&Iy(p)){if(u=w.start,a=w.end,a===void 0&&(a=u),"selectionStart"in p)p.selectionStart=u,p.selectionEnd=Math.min(a,p.value.length);else if(a=(u=p.ownerDocument||document)&&u.defaultView||window,a.getSelection){a=a.getSelection();var E=p.textContent.length,T=Math.min(w.start,E);w=w.end===void 0?T:Math.min(w.end,E),!a.extend&&T>w&&(E=w,w=T,T=E),E=GE(p,T);var N=GE(p,w);E&&N&&(a.rangeCount!==1||a.anchorNode!==E.node||a.anchorOffset!==E.offset||a.focusNode!==N.node||a.focusOffset!==N.offset)&&(u=u.createRange(),u.setStart(E.node,E.offset),a.removeAllRanges(),T>w?(a.addRange(u),a.extend(N.node,N.offset)):(u.setEnd(N.node,N.offset),a.addRange(u)))}}for(u=[],a=p;a=a.parentNode;)a.nodeType===1&&u.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<u.length;p++)a=u[p],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var SV=l&&"documentMode"in document&&11>=document.documentMode,Yu=null,Oy=null,dh=null,My=!1;function QE(a,u,p){var w=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;My||Yu==null||Yu!==$e(w)||(w=Yu,"selectionStart"in w&&Iy(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),dh&&uh(dh,w)||(dh=w,w=n0(Oy,"onSelect"),0<w.length&&(u=new Sy("onSelect","select",null,u,p),a.push({event:u,listeners:w}),u.target=Yu)))}function Jm(a,u){var p={};return p[a.toLowerCase()]=u.toLowerCase(),p["Webkit"+a]="webkit"+u,p["Moz"+a]="moz"+u,p}var Xu={animationend:Jm("Animation","AnimationEnd"),animationiteration:Jm("Animation","AnimationIteration"),animationstart:Jm("Animation","AnimationStart"),transitionend:Jm("Transition","TransitionEnd")},Ny={},JE={};l&&(JE=document.createElement("div").style,"AnimationEvent"in window||(delete Xu.animationend.animation,delete Xu.animationiteration.animation,delete Xu.animationstart.animation),"TransitionEvent"in window||delete Xu.transitionend.transition);function e0(a){if(Ny[a])return Ny[a];if(!Xu[a])return a;var u=Xu[a],p;for(p in u)if(u.hasOwnProperty(p)&&p in JE)return Ny[a]=u[p];return a}var e8=e0("animationend"),t8=e0("animationiteration"),n8=e0("animationstart"),r8=e0("transitionend"),s8=new Map,i8="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function dl(a,u){s8.set(a,u),i(u,[a])}for(var Ly=0;Ly<i8.length;Ly++){var Dy=i8[Ly],kV=Dy.toLowerCase(),EV=Dy[0].toUpperCase()+Dy.slice(1);dl(kV,"on"+EV)}dl(e8,"onAnimationEnd"),dl(t8,"onAnimationIteration"),dl(n8,"onAnimationStart"),dl("dblclick","onDoubleClick"),dl("focusin","onFocus"),dl("focusout","onBlur"),dl(r8,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fh="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),CV=new Set("cancel close invalid load scroll toggle".split(" ").concat(fh));function o8(a,u,p){var w=a.type||"unknown-event";a.currentTarget=p,Po(w,u,void 0,a),a.currentTarget=null}function a8(a,u){u=(u&4)!==0;for(var p=0;p<a.length;p++){var w=a[p],E=w.event;w=w.listeners;e:{var T=void 0;if(u)for(var N=w.length-1;0<=N;N--){var Z=w[N],Y=Z.instance,oe=Z.currentTarget;if(Z=Z.listener,Y!==T&&E.isPropagationStopped())break e;o8(E,Z,oe),T=Y}else for(N=0;N<w.length;N++){if(Z=w[N],Y=Z.instance,oe=Z.currentTarget,Z=Z.listener,Y!==T&&E.isPropagationStopped())break e;o8(E,Z,oe),T=Y}}}if(Bt)throw a=Mi,Bt=!1,Mi=null,a}function On(a,u){var p=u[By];p===void 0&&(p=u[By]=new Set);var w=a+"__bubble";p.has(w)||(l8(u,a,2,!1),p.add(w))}function $y(a,u,p){var w=0;u&&(w|=4),l8(p,a,w,u)}var t0="_reactListening"+Math.random().toString(36).slice(2);function hh(a){if(!a[t0]){a[t0]=!0,r.forEach(function(p){p!=="selectionchange"&&(CV.has(p)||$y(p,!1,a),$y(p,!0,a))});var u=a.nodeType===9?a:a.ownerDocument;u===null||u[t0]||(u[t0]=!0,$y("selectionchange",!1,u))}}function l8(a,u,p,w){switch(IE(u)){case 1:var E=zz;break;case 4:E=Vz;break;default:E=wy}p=E.bind(null,u,p,a),E=void 0,!Gt||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),w?E!==void 0?a.addEventListener(u,p,{capture:!0,passive:E}):a.addEventListener(u,p,!0):E!==void 0?a.addEventListener(u,p,{passive:E}):a.addEventListener(u,p,!1)}function Fy(a,u,p,w,E){var T=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var N=w.tag;if(N===3||N===4){var Z=w.stateNode.containerInfo;if(Z===E||Z.nodeType===8&&Z.parentNode===E)break;if(N===4)for(N=w.return;N!==null;){var Y=N.tag;if((Y===3||Y===4)&&(Y=N.stateNode.containerInfo,Y===E||Y.nodeType===8&&Y.parentNode===E))return;N=N.return}for(;Z!==null;){if(N=Ac(Z),N===null)return;if(Y=N.tag,Y===5||Y===6){w=T=N;continue e}Z=Z.parentNode}}w=w.return}yn(function(){var oe=T,we=Co(p),xe=[];e:{var ye=s8.get(a);if(ye!==void 0){var Fe=Sy,qe=a;switch(a){case"keypress":if(Gm(p)===0)break e;case"keydown":case"keyup":Fe=nV;break;case"focusin":qe="focus",Fe=Cy;break;case"focusout":qe="blur",Fe=Cy;break;case"beforeblur":case"afterblur":Fe=Cy;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=NE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=Bz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=iV;break;case e8:case t8:case n8:Fe=Kz;break;case r8:Fe=aV;break;case"scroll":Fe=Hz;break;case"wheel":Fe=cV;break;case"copy":case"cut":case"paste":Fe=Gz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=DE}var Ye=(u&4)!==0,ur=!Ye&&a==="scroll",te=Ye?ye!==null?ye+"Capture":null:ye;Ye=[];for(var J=oe,re;J!==null;){re=J;var Pe=re.stateNode;if(re.tag===5&&Pe!==null&&(re=Pe,te!==null&&(Pe=Tn(J,te),Pe!=null&&Ye.push(ph(J,Pe,re)))),ur)break;J=J.return}0<Ye.length&&(ye=new Fe(ye,qe,null,p,we),xe.push({event:ye,listeners:Ye}))}}if((u&7)===0){e:{if(ye=a==="mouseover"||a==="pointerover",Fe=a==="mouseout"||a==="pointerout",ye&&p!==pr&&(qe=p.relatedTarget||p.fromElement)&&(Ac(qe)||qe[ya]))break e;if((Fe||ye)&&(ye=we.window===we?we:(ye=we.ownerDocument)?ye.defaultView||ye.parentWindow:window,Fe?(qe=p.relatedTarget||p.toElement,Fe=oe,qe=qe?Ac(qe):null,qe!==null&&(ur=Lr(qe),qe!==ur||qe.tag!==5&&qe.tag!==6)&&(qe=null)):(Fe=null,qe=oe),Fe!==qe)){if(Ye=NE,Pe="onMouseLeave",te="onMouseEnter",J="mouse",(a==="pointerout"||a==="pointerover")&&(Ye=DE,Pe="onPointerLeave",te="onPointerEnter",J="pointer"),ur=Fe==null?ye:ed(Fe),re=qe==null?ye:ed(qe),ye=new Ye(Pe,J+"leave",Fe,p,we),ye.target=ur,ye.relatedTarget=re,Pe=null,Ac(we)===oe&&(Ye=new Ye(te,J+"enter",qe,p,we),Ye.target=re,Ye.relatedTarget=ur,Pe=Ye),ur=Pe,Fe&&qe)t:{for(Ye=Fe,te=qe,J=0,re=Ye;re;re=Qu(re))J++;for(re=0,Pe=te;Pe;Pe=Qu(Pe))re++;for(;0<J-re;)Ye=Qu(Ye),J--;for(;0<re-J;)te=Qu(te),re--;for(;J--;){if(Ye===te||te!==null&&Ye===te.alternate)break t;Ye=Qu(Ye),te=Qu(te)}Ye=null}else Ye=null;Fe!==null&&c8(xe,ye,Fe,Ye,!1),qe!==null&&ur!==null&&c8(xe,ur,qe,Ye,!0)}}e:{if(ye=oe?ed(oe):window,Fe=ye.nodeName&&ye.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&ye.type==="file")var et=gV;else if(HE(ye))if(BE)et=wV;else{et=yV;var lt=vV}else(Fe=ye.nodeName)&&Fe.toLowerCase()==="input"&&(ye.type==="checkbox"||ye.type==="radio")&&(et=_V);if(et&&(et=et(a,oe))){UE(xe,et,p,we);break e}lt&&lt(a,ye,oe),a==="focusout"&&(lt=ye._wrapperState)&&lt.controlled&&ye.type==="number"&&qt(ye,"number",ye.value)}switch(lt=oe?ed(oe):window,a){case"focusin":(HE(lt)||lt.contentEditable==="true")&&(Yu=lt,Oy=oe,dh=null);break;case"focusout":dh=Oy=Yu=null;break;case"mousedown":My=!0;break;case"contextmenu":case"mouseup":case"dragend":My=!1,QE(xe,p,we);break;case"selectionchange":if(SV)break;case"keydown":case"keyup":QE(xe,p,we)}var ct;if(Ty)e:{switch(a){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else Gu?zE(a,p)&&(pt="onCompositionEnd"):a==="keydown"&&p.keyCode===229&&(pt="onCompositionStart");pt&&($E&&p.locale!=="ko"&&(Gu||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&Gu&&(ct=OE()):(ul=we,xy="value"in ul?ul.value:ul.textContent,Gu=!0)),lt=n0(oe,pt),0<lt.length&&(pt=new LE(pt,a,null,p,we),xe.push({event:pt,listeners:lt}),ct?pt.data=ct:(ct=VE(p),ct!==null&&(pt.data=ct)))),(ct=dV?fV(a,p):hV(a,p))&&(oe=n0(oe,"onBeforeInput"),0<oe.length&&(we=new LE("onBeforeInput","beforeinput",null,p,we),xe.push({event:we,listeners:oe}),we.data=ct))}a8(xe,u)})}function ph(a,u,p){return{instance:a,listener:u,currentTarget:p}}function n0(a,u){for(var p=u+"Capture",w=[];a!==null;){var E=a,T=E.stateNode;E.tag===5&&T!==null&&(E=T,T=Tn(a,p),T!=null&&w.unshift(ph(a,T,E)),T=Tn(a,u),T!=null&&w.push(ph(a,T,E))),a=a.return}return w}function Qu(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function c8(a,u,p,w,E){for(var T=u._reactName,N=[];p!==null&&p!==w;){var Z=p,Y=Z.alternate,oe=Z.stateNode;if(Y!==null&&Y===w)break;Z.tag===5&&oe!==null&&(Z=oe,E?(Y=Tn(p,T),Y!=null&&N.unshift(ph(p,Y,Z))):E||(Y=Tn(p,T),Y!=null&&N.push(ph(p,Y,Z)))),p=p.return}N.length!==0&&a.push({event:u,listeners:N})}var PV=/\r\n?/g,TV=/\u0000|\uFFFD/g;function u8(a){return(typeof a=="string"?a:""+a).replace(PV,`
98
- `).replace(TV,"")}function r0(a,u,p){if(u=u8(u),u8(a)!==u&&p)throw Error(n(425))}function s0(){}var jy=null,zy=null;function Vy(a,u){return a==="textarea"||a==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Hy=typeof setTimeout=="function"?setTimeout:void 0,RV=typeof clearTimeout=="function"?clearTimeout:void 0,d8=typeof Promise=="function"?Promise:void 0,AV=typeof queueMicrotask=="function"?queueMicrotask:typeof d8<"u"?function(a){return d8.resolve(null).then(a).catch(IV)}:Hy;function IV(a){setTimeout(function(){throw a})}function Uy(a,u){var p=u,w=0;do{var E=p.nextSibling;if(a.removeChild(p),E&&E.nodeType===8)if(p=E.data,p==="/$"){if(w===0){a.removeChild(E),Mo(u);return}w--}else p!=="$"&&p!=="$?"&&p!=="$!"||w++;p=E}while(p);Mo(u)}function fl(a){for(;a!=null;a=a.nextSibling){var u=a.nodeType;if(u===1||u===3)break;if(u===8){if(u=a.data,u==="$"||u==="$!"||u==="$?")break;if(u==="/$")return null}}return a}function f8(a){a=a.previousSibling;for(var u=0;a;){if(a.nodeType===8){var p=a.data;if(p==="$"||p==="$!"||p==="$?"){if(u===0)return a;u--}else p==="/$"&&u++}a=a.previousSibling}return null}var Ju=Math.random().toString(36).slice(2),No="__reactFiber$"+Ju,mh="__reactProps$"+Ju,ya="__reactContainer$"+Ju,By="__reactEvents$"+Ju,OV="__reactListeners$"+Ju,MV="__reactHandles$"+Ju;function Ac(a){var u=a[No];if(u)return u;for(var p=a.parentNode;p;){if(u=p[ya]||p[No]){if(p=u.alternate,u.child!==null||p!==null&&p.child!==null)for(a=f8(a);a!==null;){if(p=a[No])return p;a=f8(a)}return u}a=p,p=a.parentNode}return null}function gh(a){return a=a[No]||a[ya],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function ed(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function i0(a){return a[mh]||null}var Zy=[],td=-1;function hl(a){return{current:a}}function Mn(a){0>td||(a.current=Zy[td],Zy[td]=null,td--)}function Rn(a,u){td++,Zy[td]=a.current,a.current=u}var pl={},ls=hl(pl),Fs=hl(!1),Ic=pl;function nd(a,u){var p=a.type.contextTypes;if(!p)return pl;var w=a.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var E={},T;for(T in p)E[T]=u[T];return w&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=u,a.__reactInternalMemoizedMaskedChildContext=E),E}function js(a){return a=a.childContextTypes,a!=null}function o0(){Mn(Fs),Mn(ls)}function h8(a,u,p){if(ls.current!==pl)throw Error(n(168));Rn(ls,u),Rn(Fs,p)}function p8(a,u,p){var w=a.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return p;w=w.getChildContext();for(var E in w)if(!(E in u))throw Error(n(108,_e(a)||"Unknown",E));return B({},p,w)}function a0(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||pl,Ic=ls.current,Rn(ls,a),Rn(Fs,Fs.current),!0}function m8(a,u,p){var w=a.stateNode;if(!w)throw Error(n(169));p?(a=p8(a,u,Ic),w.__reactInternalMemoizedMergedChildContext=a,Mn(Fs),Mn(ls),Rn(ls,a)):Mn(Fs),Rn(Fs,p)}var _a=null,l0=!1,Wy=!1;function g8(a){_a===null?_a=[a]:_a.push(a)}function NV(a){l0=!0,g8(a)}function ml(){if(!Wy&&_a!==null){Wy=!0;var a=0,u=ot;try{var p=_a;for(ot=1;a<p.length;a++){var w=p[a];do w=w(!0);while(w!==null)}_a=null,l0=!1}catch(E){throw _a!==null&&(_a=_a.slice(a+1)),li(ci,ml),E}finally{ot=u,Wy=!1}}return null}var rd=[],sd=0,c0=null,u0=0,Di=[],$i=0,Oc=null,wa=1,ba="";function Mc(a,u){rd[sd++]=u0,rd[sd++]=c0,c0=a,u0=u}function v8(a,u,p){Di[$i++]=wa,Di[$i++]=ba,Di[$i++]=Oc,Oc=a;var w=wa;a=ba;var E=32-Ss(w)-1;w&=~(1<<E),p+=1;var T=32-Ss(u)+E;if(30<T){var N=E-E%5;T=(w&(1<<N)-1).toString(32),w>>=N,E-=N,wa=1<<32-Ss(u)+E|p<<E|w,ba=T+a}else wa=1<<T|p<<E|w,ba=a}function Ky(a){a.return!==null&&(Mc(a,1),v8(a,1,0))}function qy(a){for(;a===c0;)c0=rd[--sd],rd[sd]=null,u0=rd[--sd],rd[sd]=null;for(;a===Oc;)Oc=Di[--$i],Di[$i]=null,ba=Di[--$i],Di[$i]=null,wa=Di[--$i],Di[$i]=null}var di=null,fi=null,jn=!1,so=null;function y8(a,u){var p=Vi(5,null,null,0);p.elementType="DELETED",p.stateNode=u,p.return=a,u=a.deletions,u===null?(a.deletions=[p],a.flags|=16):u.push(p)}function _8(a,u){switch(a.tag){case 5:var p=a.type;return u=u.nodeType!==1||p.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(a.stateNode=u,di=a,fi=fl(u.firstChild),!0):!1;case 6:return u=a.pendingProps===""||u.nodeType!==3?null:u,u!==null?(a.stateNode=u,di=a,fi=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(p=Oc!==null?{id:wa,overflow:ba}:null,a.memoizedState={dehydrated:u,treeContext:p,retryLane:1073741824},p=Vi(18,null,null,0),p.stateNode=u,p.return=a,a.child=p,di=a,fi=null,!0):!1;default:return!1}}function Gy(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Yy(a){if(jn){var u=fi;if(u){var p=u;if(!_8(a,u)){if(Gy(a))throw Error(n(418));u=fl(p.nextSibling);var w=di;u&&_8(a,u)?y8(w,p):(a.flags=a.flags&-4097|2,jn=!1,di=a)}}else{if(Gy(a))throw Error(n(418));a.flags=a.flags&-4097|2,jn=!1,di=a}}}function w8(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;di=a}function d0(a){if(a!==di)return!1;if(!jn)return w8(a),jn=!0,!1;var u;if((u=a.tag!==3)&&!(u=a.tag!==5)&&(u=a.type,u=u!=="head"&&u!=="body"&&!Vy(a.type,a.memoizedProps)),u&&(u=fi)){if(Gy(a))throw b8(),Error(n(418));for(;u;)y8(a,u),u=fl(u.nextSibling)}if(w8(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,u=0;a;){if(a.nodeType===8){var p=a.data;if(p==="/$"){if(u===0){fi=fl(a.nextSibling);break e}u--}else p!=="$"&&p!=="$!"&&p!=="$?"||u++}a=a.nextSibling}fi=null}}else fi=di?fl(a.stateNode.nextSibling):null;return!0}function b8(){for(var a=fi;a;)a=fl(a.nextSibling)}function id(){fi=di=null,jn=!1}function Xy(a){so===null?so=[a]:so.push(a)}var LV=P.ReactCurrentBatchConfig;function vh(a,u,p){if(a=p.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var w=p.stateNode}if(!w)throw Error(n(147,a));var E=w,T=""+a;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===T?u.ref:(u=function(N){var Z=E.refs;N===null?delete Z[T]:Z[T]=N},u._stringRef=T,u)}if(typeof a!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,a))}return a}function f0(a,u){throw a=Object.prototype.toString.call(u),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":a))}function x8(a){var u=a._init;return u(a._payload)}function S8(a){function u(te,J){if(a){var re=te.deletions;re===null?(te.deletions=[J],te.flags|=16):re.push(J)}}function p(te,J){if(!a)return null;for(;J!==null;)u(te,J),J=J.sibling;return null}function w(te,J){for(te=new Map;J!==null;)J.key!==null?te.set(J.key,J):te.set(J.index,J),J=J.sibling;return te}function E(te,J){return te=Sl(te,J),te.index=0,te.sibling=null,te}function T(te,J,re){return te.index=re,a?(re=te.alternate,re!==null?(re=re.index,re<J?(te.flags|=2,J):re):(te.flags|=2,J)):(te.flags|=1048576,J)}function N(te){return a&&te.alternate===null&&(te.flags|=2),te}function Z(te,J,re,Pe){return J===null||J.tag!==6?(J=H_(re,te.mode,Pe),J.return=te,J):(J=E(J,re),J.return=te,J)}function Y(te,J,re,Pe){var et=re.type;return et===I?we(te,J,re.props.children,Pe,re.key):J!==null&&(J.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===H&&x8(et)===J.type)?(Pe=E(J,re.props),Pe.ref=vh(te,J,re),Pe.return=te,Pe):(Pe=D0(re.type,re.key,re.props,null,te.mode,Pe),Pe.ref=vh(te,J,re),Pe.return=te,Pe)}function oe(te,J,re,Pe){return J===null||J.tag!==4||J.stateNode.containerInfo!==re.containerInfo||J.stateNode.implementation!==re.implementation?(J=U_(re,te.mode,Pe),J.return=te,J):(J=E(J,re.children||[]),J.return=te,J)}function we(te,J,re,Pe,et){return J===null||J.tag!==7?(J=Vc(re,te.mode,Pe,et),J.return=te,J):(J=E(J,re),J.return=te,J)}function xe(te,J,re){if(typeof J=="string"&&J!==""||typeof J=="number")return J=H_(""+J,te.mode,re),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case R:return re=D0(J.type,J.key,J.props,null,te.mode,re),re.ref=vh(te,null,J),re.return=te,re;case O:return J=U_(J,te.mode,re),J.return=te,J;case H:var Pe=J._init;return xe(te,Pe(J._payload),re)}if(Ne(J)||Q(J))return J=Vc(J,te.mode,re,null),J.return=te,J;f0(te,J)}return null}function ye(te,J,re,Pe){var et=J!==null?J.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return et!==null?null:Z(te,J,""+re,Pe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case R:return re.key===et?Y(te,J,re,Pe):null;case O:return re.key===et?oe(te,J,re,Pe):null;case H:return et=re._init,ye(te,J,et(re._payload),Pe)}if(Ne(re)||Q(re))return et!==null?null:we(te,J,re,Pe,null);f0(te,re)}return null}function Fe(te,J,re,Pe,et){if(typeof Pe=="string"&&Pe!==""||typeof Pe=="number")return te=te.get(re)||null,Z(J,te,""+Pe,et);if(typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case R:return te=te.get(Pe.key===null?re:Pe.key)||null,Y(J,te,Pe,et);case O:return te=te.get(Pe.key===null?re:Pe.key)||null,oe(J,te,Pe,et);case H:var lt=Pe._init;return Fe(te,J,re,lt(Pe._payload),et)}if(Ne(Pe)||Q(Pe))return te=te.get(re)||null,we(J,te,Pe,et,null);f0(J,Pe)}return null}function qe(te,J,re,Pe){for(var et=null,lt=null,ct=J,pt=J=0,jr=null;ct!==null&&pt<re.length;pt++){ct.index>pt?(jr=ct,ct=null):jr=ct.sibling;var en=ye(te,ct,re[pt],Pe);if(en===null){ct===null&&(ct=jr);break}a&&ct&&en.alternate===null&&u(te,ct),J=T(en,J,pt),lt===null?et=en:lt.sibling=en,lt=en,ct=jr}if(pt===re.length)return p(te,ct),jn&&Mc(te,pt),et;if(ct===null){for(;pt<re.length;pt++)ct=xe(te,re[pt],Pe),ct!==null&&(J=T(ct,J,pt),lt===null?et=ct:lt.sibling=ct,lt=ct);return jn&&Mc(te,pt),et}for(ct=w(te,ct);pt<re.length;pt++)jr=Fe(ct,te,pt,re[pt],Pe),jr!==null&&(a&&jr.alternate!==null&&ct.delete(jr.key===null?pt:jr.key),J=T(jr,J,pt),lt===null?et=jr:lt.sibling=jr,lt=jr);return a&&ct.forEach(function(kl){return u(te,kl)}),jn&&Mc(te,pt),et}function Ye(te,J,re,Pe){var et=Q(re);if(typeof et!="function")throw Error(n(150));if(re=et.call(re),re==null)throw Error(n(151));for(var lt=et=null,ct=J,pt=J=0,jr=null,en=re.next();ct!==null&&!en.done;pt++,en=re.next()){ct.index>pt?(jr=ct,ct=null):jr=ct.sibling;var kl=ye(te,ct,en.value,Pe);if(kl===null){ct===null&&(ct=jr);break}a&&ct&&kl.alternate===null&&u(te,ct),J=T(kl,J,pt),lt===null?et=kl:lt.sibling=kl,lt=kl,ct=jr}if(en.done)return p(te,ct),jn&&Mc(te,pt),et;if(ct===null){for(;!en.done;pt++,en=re.next())en=xe(te,en.value,Pe),en!==null&&(J=T(en,J,pt),lt===null?et=en:lt.sibling=en,lt=en);return jn&&Mc(te,pt),et}for(ct=w(te,ct);!en.done;pt++,en=re.next())en=Fe(ct,te,pt,en.value,Pe),en!==null&&(a&&en.alternate!==null&&ct.delete(en.key===null?pt:en.key),J=T(en,J,pt),lt===null?et=en:lt.sibling=en,lt=en);return a&&ct.forEach(function(pH){return u(te,pH)}),jn&&Mc(te,pt),et}function ur(te,J,re,Pe){if(typeof re=="object"&&re!==null&&re.type===I&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case R:e:{for(var et=re.key,lt=J;lt!==null;){if(lt.key===et){if(et=re.type,et===I){if(lt.tag===7){p(te,lt.sibling),J=E(lt,re.props.children),J.return=te,te=J;break e}}else if(lt.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===H&&x8(et)===lt.type){p(te,lt.sibling),J=E(lt,re.props),J.ref=vh(te,lt,re),J.return=te,te=J;break e}p(te,lt);break}else u(te,lt);lt=lt.sibling}re.type===I?(J=Vc(re.props.children,te.mode,Pe,re.key),J.return=te,te=J):(Pe=D0(re.type,re.key,re.props,null,te.mode,Pe),Pe.ref=vh(te,J,re),Pe.return=te,te=Pe)}return N(te);case O:e:{for(lt=re.key;J!==null;){if(J.key===lt)if(J.tag===4&&J.stateNode.containerInfo===re.containerInfo&&J.stateNode.implementation===re.implementation){p(te,J.sibling),J=E(J,re.children||[]),J.return=te,te=J;break e}else{p(te,J);break}else u(te,J);J=J.sibling}J=U_(re,te.mode,Pe),J.return=te,te=J}return N(te);case H:return lt=re._init,ur(te,J,lt(re._payload),Pe)}if(Ne(re))return qe(te,J,re,Pe);if(Q(re))return Ye(te,J,re,Pe);f0(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,J!==null&&J.tag===6?(p(te,J.sibling),J=E(J,re),J.return=te,te=J):(p(te,J),J=H_(re,te.mode,Pe),J.return=te,te=J),N(te)):p(te,J)}return ur}var od=S8(!0),k8=S8(!1),h0=hl(null),p0=null,ad=null,Qy=null;function Jy(){Qy=ad=p0=null}function e_(a){var u=h0.current;Mn(h0),a._currentValue=u}function t_(a,u,p){for(;a!==null;){var w=a.alternate;if((a.childLanes&u)!==u?(a.childLanes|=u,w!==null&&(w.childLanes|=u)):w!==null&&(w.childLanes&u)!==u&&(w.childLanes|=u),a===p)break;a=a.return}}function ld(a,u){p0=a,Qy=ad=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&u)!==0&&(zs=!0),a.firstContext=null)}function Fi(a){var u=a._currentValue;if(Qy!==a)if(a={context:a,memoizedValue:u,next:null},ad===null){if(p0===null)throw Error(n(308));ad=a,p0.dependencies={lanes:0,firstContext:a}}else ad=ad.next=a;return u}var Nc=null;function n_(a){Nc===null?Nc=[a]:Nc.push(a)}function E8(a,u,p,w){var E=u.interleaved;return E===null?(p.next=p,n_(u)):(p.next=E.next,E.next=p),u.interleaved=p,xa(a,w)}function xa(a,u){a.lanes|=u;var p=a.alternate;for(p!==null&&(p.lanes|=u),p=a,a=a.return;a!==null;)a.childLanes|=u,p=a.alternate,p!==null&&(p.childLanes|=u),p=a,a=a.return;return p.tag===3?p.stateNode:null}var gl=!1;function r_(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function C8(a,u){a=a.updateQueue,u.updateQueue===a&&(u.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Sa(a,u){return{eventTime:a,lane:u,tag:0,payload:null,callback:null,next:null}}function vl(a,u,p){var w=a.updateQueue;if(w===null)return null;if(w=w.shared,(Yt&2)!==0){var E=w.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),w.pending=u,xa(a,p)}return E=w.interleaved,E===null?(u.next=u,n_(w)):(u.next=E.next,E.next=u),w.interleaved=u,xa(a,p)}function m0(a,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194240)!==0)){var w=u.lanes;w&=a.pendingLanes,p|=w,u.lanes=p,Fn(a,p)}}function P8(a,u){var p=a.updateQueue,w=a.alternate;if(w!==null&&(w=w.updateQueue,p===w)){var E=null,T=null;if(p=p.firstBaseUpdate,p!==null){do{var N={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};T===null?E=T=N:T=T.next=N,p=p.next}while(p!==null);T===null?E=T=u:T=T.next=u}else E=T=u;p={baseState:w.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:w.shared,effects:w.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=u}function g0(a,u,p,w){var E=a.updateQueue;gl=!1;var T=E.firstBaseUpdate,N=E.lastBaseUpdate,Z=E.shared.pending;if(Z!==null){E.shared.pending=null;var Y=Z,oe=Y.next;Y.next=null,N===null?T=oe:N.next=oe,N=Y;var we=a.alternate;we!==null&&(we=we.updateQueue,Z=we.lastBaseUpdate,Z!==N&&(Z===null?we.firstBaseUpdate=oe:Z.next=oe,we.lastBaseUpdate=Y))}if(T!==null){var xe=E.baseState;N=0,we=oe=Y=null,Z=T;do{var ye=Z.lane,Fe=Z.eventTime;if((w&ye)===ye){we!==null&&(we=we.next={eventTime:Fe,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var qe=a,Ye=Z;switch(ye=u,Fe=p,Ye.tag){case 1:if(qe=Ye.payload,typeof qe=="function"){xe=qe.call(Fe,xe,ye);break e}xe=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=Ye.payload,ye=typeof qe=="function"?qe.call(Fe,xe,ye):qe,ye==null)break e;xe=B({},xe,ye);break e;case 2:gl=!0}}Z.callback!==null&&Z.lane!==0&&(a.flags|=64,ye=E.effects,ye===null?E.effects=[Z]:ye.push(Z))}else Fe={eventTime:Fe,lane:ye,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},we===null?(oe=we=Fe,Y=xe):we=we.next=Fe,N|=ye;if(Z=Z.next,Z===null){if(Z=E.shared.pending,Z===null)break;ye=Z,Z=ye.next,ye.next=null,E.lastBaseUpdate=ye,E.shared.pending=null}}while(!0);if(we===null&&(Y=xe),E.baseState=Y,E.firstBaseUpdate=oe,E.lastBaseUpdate=we,u=E.shared.interleaved,u!==null){E=u;do N|=E.lane,E=E.next;while(E!==u)}else T===null&&(E.shared.lanes=0);$c|=N,a.lanes=N,a.memoizedState=xe}}function T8(a,u,p){if(a=u.effects,u.effects=null,a!==null)for(u=0;u<a.length;u++){var w=a[u],E=w.callback;if(E!==null){if(w.callback=null,w=p,typeof E!="function")throw Error(n(191,E));E.call(w)}}}var yh={},Lo=hl(yh),_h=hl(yh),wh=hl(yh);function Lc(a){if(a===yh)throw Error(n(174));return a}function s_(a,u){switch(Rn(wh,u),Rn(_h,a),Rn(Lo,yh),a=u.nodeType,a){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:mt(null,"");break;default:a=a===8?u.parentNode:u,u=a.namespaceURI||null,a=a.tagName,u=mt(u,a)}Mn(Lo),Rn(Lo,u)}function cd(){Mn(Lo),Mn(_h),Mn(wh)}function R8(a){Lc(wh.current);var u=Lc(Lo.current),p=mt(u,a.type);u!==p&&(Rn(_h,a),Rn(Lo,p))}function i_(a){_h.current===a&&(Mn(Lo),Mn(_h))}var Bn=hl(0);function v0(a){for(var u=a;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var o_=[];function a_(){for(var a=0;a<o_.length;a++)o_[a]._workInProgressVersionPrimary=null;o_.length=0}var y0=P.ReactCurrentDispatcher,l_=P.ReactCurrentBatchConfig,Dc=0,Zn=null,Pr=null,$r=null,_0=!1,bh=!1,xh=0,DV=0;function cs(){throw Error(n(321))}function c_(a,u){if(u===null)return!1;for(var p=0;p<u.length&&p<a.length;p++)if(!ro(a[p],u[p]))return!1;return!0}function u_(a,u,p,w,E,T){if(Dc=T,Zn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,y0.current=a===null||a.memoizedState===null?zV:VV,a=p(w,E),bh){T=0;do{if(bh=!1,xh=0,25<=T)throw Error(n(301));T+=1,$r=Pr=null,u.updateQueue=null,y0.current=HV,a=p(w,E)}while(bh)}if(y0.current=x0,u=Pr!==null&&Pr.next!==null,Dc=0,$r=Pr=Zn=null,_0=!1,u)throw Error(n(300));return a}function d_(){var a=xh!==0;return xh=0,a}function Do(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $r===null?Zn.memoizedState=$r=a:$r=$r.next=a,$r}function ji(){if(Pr===null){var a=Zn.alternate;a=a!==null?a.memoizedState:null}else a=Pr.next;var u=$r===null?Zn.memoizedState:$r.next;if(u!==null)$r=u,Pr=a;else{if(a===null)throw Error(n(310));Pr=a,a={memoizedState:Pr.memoizedState,baseState:Pr.baseState,baseQueue:Pr.baseQueue,queue:Pr.queue,next:null},$r===null?Zn.memoizedState=$r=a:$r=$r.next=a}return $r}function Sh(a,u){return typeof u=="function"?u(a):u}function f_(a){var u=ji(),p=u.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var w=Pr,E=w.baseQueue,T=p.pending;if(T!==null){if(E!==null){var N=E.next;E.next=T.next,T.next=N}w.baseQueue=E=T,p.pending=null}if(E!==null){T=E.next,w=w.baseState;var Z=N=null,Y=null,oe=T;do{var we=oe.lane;if((Dc&we)===we)Y!==null&&(Y=Y.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),w=oe.hasEagerState?oe.eagerState:a(w,oe.action);else{var xe={lane:we,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};Y===null?(Z=Y=xe,N=w):Y=Y.next=xe,Zn.lanes|=we,$c|=we}oe=oe.next}while(oe!==null&&oe!==T);Y===null?N=w:Y.next=Z,ro(w,u.memoizedState)||(zs=!0),u.memoizedState=w,u.baseState=N,u.baseQueue=Y,p.lastRenderedState=w}if(a=p.interleaved,a!==null){E=a;do T=E.lane,Zn.lanes|=T,$c|=T,E=E.next;while(E!==a)}else E===null&&(p.lanes=0);return[u.memoizedState,p.dispatch]}function h_(a){var u=ji(),p=u.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var w=p.dispatch,E=p.pending,T=u.memoizedState;if(E!==null){p.pending=null;var N=E=E.next;do T=a(T,N.action),N=N.next;while(N!==E);ro(T,u.memoizedState)||(zs=!0),u.memoizedState=T,u.baseQueue===null&&(u.baseState=T),p.lastRenderedState=T}return[T,w]}function A8(){}function I8(a,u){var p=Zn,w=ji(),E=u(),T=!ro(w.memoizedState,E);if(T&&(w.memoizedState=E,zs=!0),w=w.queue,p_(N8.bind(null,p,w,a),[a]),w.getSnapshot!==u||T||$r!==null&&$r.memoizedState.tag&1){if(p.flags|=2048,kh(9,M8.bind(null,p,w,E,u),void 0,null),Fr===null)throw Error(n(349));(Dc&30)!==0||O8(p,u,E)}return E}function O8(a,u,p){a.flags|=16384,a={getSnapshot:u,value:p},u=Zn.updateQueue,u===null?(u={lastEffect:null,stores:null},Zn.updateQueue=u,u.stores=[a]):(p=u.stores,p===null?u.stores=[a]:p.push(a))}function M8(a,u,p,w){u.value=p,u.getSnapshot=w,L8(u)&&D8(a)}function N8(a,u,p){return p(function(){L8(u)&&D8(a)})}function L8(a){var u=a.getSnapshot;a=a.value;try{var p=u();return!ro(a,p)}catch{return!0}}function D8(a){var u=xa(a,1);u!==null&&lo(u,a,1,-1)}function $8(a){var u=Do();return typeof a=="function"&&(a=a()),u.memoizedState=u.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Sh,lastRenderedState:a},u.queue=a,a=a.dispatch=jV.bind(null,Zn,a),[u.memoizedState,a]}function kh(a,u,p,w){return a={tag:a,create:u,destroy:p,deps:w,next:null},u=Zn.updateQueue,u===null?(u={lastEffect:null,stores:null},Zn.updateQueue=u,u.lastEffect=a.next=a):(p=u.lastEffect,p===null?u.lastEffect=a.next=a:(w=p.next,p.next=a,a.next=w,u.lastEffect=a)),a}function F8(){return ji().memoizedState}function w0(a,u,p,w){var E=Do();Zn.flags|=a,E.memoizedState=kh(1|u,p,void 0,w===void 0?null:w)}function b0(a,u,p,w){var E=ji();w=w===void 0?null:w;var T=void 0;if(Pr!==null){var N=Pr.memoizedState;if(T=N.destroy,w!==null&&c_(w,N.deps)){E.memoizedState=kh(u,p,T,w);return}}Zn.flags|=a,E.memoizedState=kh(1|u,p,T,w)}function j8(a,u){return w0(8390656,8,a,u)}function p_(a,u){return b0(2048,8,a,u)}function z8(a,u){return b0(4,2,a,u)}function V8(a,u){return b0(4,4,a,u)}function H8(a,u){if(typeof u=="function")return a=a(),u(a),function(){u(null)};if(u!=null)return a=a(),u.current=a,function(){u.current=null}}function U8(a,u,p){return p=p!=null?p.concat([a]):null,b0(4,4,H8.bind(null,u,a),p)}function m_(){}function B8(a,u){var p=ji();u=u===void 0?null:u;var w=p.memoizedState;return w!==null&&u!==null&&c_(u,w[1])?w[0]:(p.memoizedState=[a,u],a)}function Z8(a,u){var p=ji();u=u===void 0?null:u;var w=p.memoizedState;return w!==null&&u!==null&&c_(u,w[1])?w[0]:(a=a(),p.memoizedState=[a,u],a)}function W8(a,u,p){return(Dc&21)===0?(a.baseState&&(a.baseState=!1,zs=!0),a.memoizedState=p):(ro(p,u)||(p=gt(),Zn.lanes|=p,$c|=p,a.baseState=!0),u)}function $V(a,u){var p=ot;ot=p!==0&&4>p?p:4,a(!0);var w=l_.transition;l_.transition={};try{a(!1),u()}finally{ot=p,l_.transition=w}}function K8(){return ji().memoizedState}function FV(a,u,p){var w=bl(a);if(p={lane:w,action:p,hasEagerState:!1,eagerState:null,next:null},q8(a))G8(u,p);else if(p=E8(a,u,p,w),p!==null){var E=Cs();lo(p,a,w,E),Y8(p,u,w)}}function jV(a,u,p){var w=bl(a),E={lane:w,action:p,hasEagerState:!1,eagerState:null,next:null};if(q8(a))G8(u,E);else{var T=a.alternate;if(a.lanes===0&&(T===null||T.lanes===0)&&(T=u.lastRenderedReducer,T!==null))try{var N=u.lastRenderedState,Z=T(N,p);if(E.hasEagerState=!0,E.eagerState=Z,ro(Z,N)){var Y=u.interleaved;Y===null?(E.next=E,n_(u)):(E.next=Y.next,Y.next=E),u.interleaved=E;return}}catch{}finally{}p=E8(a,u,E,w),p!==null&&(E=Cs(),lo(p,a,w,E),Y8(p,u,w))}}function q8(a){var u=a.alternate;return a===Zn||u!==null&&u===Zn}function G8(a,u){bh=_0=!0;var p=a.pending;p===null?u.next=u:(u.next=p.next,p.next=u),a.pending=u}function Y8(a,u,p){if((p&4194240)!==0){var w=u.lanes;w&=a.pendingLanes,p|=w,u.lanes=p,Fn(a,p)}}var x0={readContext:Fi,useCallback:cs,useContext:cs,useEffect:cs,useImperativeHandle:cs,useInsertionEffect:cs,useLayoutEffect:cs,useMemo:cs,useReducer:cs,useRef:cs,useState:cs,useDebugValue:cs,useDeferredValue:cs,useTransition:cs,useMutableSource:cs,useSyncExternalStore:cs,useId:cs,unstable_isNewReconciler:!1},zV={readContext:Fi,useCallback:function(a,u){return Do().memoizedState=[a,u===void 0?null:u],a},useContext:Fi,useEffect:j8,useImperativeHandle:function(a,u,p){return p=p!=null?p.concat([a]):null,w0(4194308,4,H8.bind(null,u,a),p)},useLayoutEffect:function(a,u){return w0(4194308,4,a,u)},useInsertionEffect:function(a,u){return w0(4,2,a,u)},useMemo:function(a,u){var p=Do();return u=u===void 0?null:u,a=a(),p.memoizedState=[a,u],a},useReducer:function(a,u,p){var w=Do();return u=p!==void 0?p(u):u,w.memoizedState=w.baseState=u,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:u},w.queue=a,a=a.dispatch=FV.bind(null,Zn,a),[w.memoizedState,a]},useRef:function(a){var u=Do();return a={current:a},u.memoizedState=a},useState:$8,useDebugValue:m_,useDeferredValue:function(a){return Do().memoizedState=a},useTransition:function(){var a=$8(!1),u=a[0];return a=$V.bind(null,a[1]),Do().memoizedState=a,[u,a]},useMutableSource:function(){},useSyncExternalStore:function(a,u,p){var w=Zn,E=Do();if(jn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=u(),Fr===null)throw Error(n(349));(Dc&30)!==0||O8(w,u,p)}E.memoizedState=p;var T={value:p,getSnapshot:u};return E.queue=T,j8(N8.bind(null,w,T,a),[a]),w.flags|=2048,kh(9,M8.bind(null,w,T,p,u),void 0,null),p},useId:function(){var a=Do(),u=Fr.identifierPrefix;if(jn){var p=ba,w=wa;p=(w&~(1<<32-Ss(w)-1)).toString(32)+p,u=":"+u+"R"+p,p=xh++,0<p&&(u+="H"+p.toString(32)),u+=":"}else p=DV++,u=":"+u+"r"+p.toString(32)+":";return a.memoizedState=u},unstable_isNewReconciler:!1},VV={readContext:Fi,useCallback:B8,useContext:Fi,useEffect:p_,useImperativeHandle:U8,useInsertionEffect:z8,useLayoutEffect:V8,useMemo:Z8,useReducer:f_,useRef:F8,useState:function(){return f_(Sh)},useDebugValue:m_,useDeferredValue:function(a){var u=ji();return W8(u,Pr.memoizedState,a)},useTransition:function(){var a=f_(Sh)[0],u=ji().memoizedState;return[a,u]},useMutableSource:A8,useSyncExternalStore:I8,useId:K8,unstable_isNewReconciler:!1},HV={readContext:Fi,useCallback:B8,useContext:Fi,useEffect:p_,useImperativeHandle:U8,useInsertionEffect:z8,useLayoutEffect:V8,useMemo:Z8,useReducer:h_,useRef:F8,useState:function(){return h_(Sh)},useDebugValue:m_,useDeferredValue:function(a){var u=ji();return Pr===null?u.memoizedState=a:W8(u,Pr.memoizedState,a)},useTransition:function(){var a=h_(Sh)[0],u=ji().memoizedState;return[a,u]},useMutableSource:A8,useSyncExternalStore:I8,useId:K8,unstable_isNewReconciler:!1};function io(a,u){if(a&&a.defaultProps){u=B({},u),a=a.defaultProps;for(var p in a)u[p]===void 0&&(u[p]=a[p]);return u}return u}function g_(a,u,p,w){u=a.memoizedState,p=p(w,u),p=p==null?u:B({},u,p),a.memoizedState=p,a.lanes===0&&(a.updateQueue.baseState=p)}var S0={isMounted:function(a){return(a=a._reactInternals)?Lr(a)===a:!1},enqueueSetState:function(a,u,p){a=a._reactInternals;var w=Cs(),E=bl(a),T=Sa(w,E);T.payload=u,p!=null&&(T.callback=p),u=vl(a,T,E),u!==null&&(lo(u,a,E,w),m0(u,a,E))},enqueueReplaceState:function(a,u,p){a=a._reactInternals;var w=Cs(),E=bl(a),T=Sa(w,E);T.tag=1,T.payload=u,p!=null&&(T.callback=p),u=vl(a,T,E),u!==null&&(lo(u,a,E,w),m0(u,a,E))},enqueueForceUpdate:function(a,u){a=a._reactInternals;var p=Cs(),w=bl(a),E=Sa(p,w);E.tag=2,u!=null&&(E.callback=u),u=vl(a,E,w),u!==null&&(lo(u,a,w,p),m0(u,a,w))}};function X8(a,u,p,w,E,T,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(w,T,N):u.prototype&&u.prototype.isPureReactComponent?!uh(p,w)||!uh(E,T):!0}function Q8(a,u,p){var w=!1,E=pl,T=u.contextType;return typeof T=="object"&&T!==null?T=Fi(T):(E=js(u)?Ic:ls.current,w=u.contextTypes,T=(w=w!=null)?nd(a,E):pl),u=new u(p,T),a.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=S0,a.stateNode=u,u._reactInternals=a,w&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=E,a.__reactInternalMemoizedMaskedChildContext=T),u}function J8(a,u,p,w){a=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(p,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(p,w),u.state!==a&&S0.enqueueReplaceState(u,u.state,null)}function v_(a,u,p,w){var E=a.stateNode;E.props=p,E.state=a.memoizedState,E.refs={},r_(a);var T=u.contextType;typeof T=="object"&&T!==null?E.context=Fi(T):(T=js(u)?Ic:ls.current,E.context=nd(a,T)),E.state=a.memoizedState,T=u.getDerivedStateFromProps,typeof T=="function"&&(g_(a,u,T,p),E.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(u=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),u!==E.state&&S0.enqueueReplaceState(E,E.state,null),g0(a,p,E,w),E.state=a.memoizedState),typeof E.componentDidMount=="function"&&(a.flags|=4194308)}function ud(a,u){try{var p="",w=u;do p+=ue(w),w=w.return;while(w);var E=p}catch(T){E=`
99
- Error generating stack: `+T.message+`
100
- `+T.stack}return{value:a,source:u,stack:E,digest:null}}function y_(a,u,p){return{value:a,source:null,stack:p??null,digest:u??null}}function __(a,u){try{console.error(u.value)}catch(p){setTimeout(function(){throw p})}}var UV=typeof WeakMap=="function"?WeakMap:Map;function eC(a,u,p){p=Sa(-1,p),p.tag=3,p.payload={element:null};var w=u.value;return p.callback=function(){A0||(A0=!0,N_=w),__(a,u)},p}function tC(a,u,p){p=Sa(-1,p),p.tag=3;var w=a.type.getDerivedStateFromError;if(typeof w=="function"){var E=u.value;p.payload=function(){return w(E)},p.callback=function(){__(a,u)}}var T=a.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(p.callback=function(){__(a,u),typeof w!="function"&&(_l===null?_l=new Set([this]):_l.add(this));var N=u.stack;this.componentDidCatch(u.value,{componentStack:N!==null?N:""})}),p}function nC(a,u,p){var w=a.pingCache;if(w===null){w=a.pingCache=new UV;var E=new Set;w.set(u,E)}else E=w.get(u),E===void 0&&(E=new Set,w.set(u,E));E.has(p)||(E.add(p),a=rH.bind(null,a,u,p),u.then(a,a))}function rC(a){do{var u;if((u=a.tag===13)&&(u=a.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return a;a=a.return}while(a!==null);return null}function sC(a,u,p,w,E){return(a.mode&1)===0?(a===u?a.flags|=65536:(a.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(u=Sa(-1,1),u.tag=2,vl(p,u,1))),p.lanes|=1),a):(a.flags|=65536,a.lanes=E,a)}var BV=P.ReactCurrentOwner,zs=!1;function Es(a,u,p,w){u.child=a===null?k8(u,null,p,w):od(u,a.child,p,w)}function iC(a,u,p,w,E){p=p.render;var T=u.ref;return ld(u,E),w=u_(a,u,p,w,T,E),p=d_(),a!==null&&!zs?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~E,ka(a,u,E)):(jn&&p&&Ky(u),u.flags|=1,Es(a,u,w,E),u.child)}function oC(a,u,p,w,E){if(a===null){var T=p.type;return typeof T=="function"&&!V_(T)&&T.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(u.tag=15,u.type=T,aC(a,u,T,w,E)):(a=D0(p.type,null,w,u,u.mode,E),a.ref=u.ref,a.return=u,u.child=a)}if(T=a.child,(a.lanes&E)===0){var N=T.memoizedProps;if(p=p.compare,p=p!==null?p:uh,p(N,w)&&a.ref===u.ref)return ka(a,u,E)}return u.flags|=1,a=Sl(T,w),a.ref=u.ref,a.return=u,u.child=a}function aC(a,u,p,w,E){if(a!==null){var T=a.memoizedProps;if(uh(T,w)&&a.ref===u.ref)if(zs=!1,u.pendingProps=w=T,(a.lanes&E)!==0)(a.flags&131072)!==0&&(zs=!0);else return u.lanes=a.lanes,ka(a,u,E)}return w_(a,u,p,w,E)}function lC(a,u,p){var w=u.pendingProps,E=w.children,T=a!==null?a.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rn(fd,hi),hi|=p;else{if((p&1073741824)===0)return a=T!==null?T.baseLanes|p:p,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:a,cachePool:null,transitions:null},u.updateQueue=null,Rn(fd,hi),hi|=a,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=T!==null?T.baseLanes:p,Rn(fd,hi),hi|=w}else T!==null?(w=T.baseLanes|p,u.memoizedState=null):w=p,Rn(fd,hi),hi|=w;return Es(a,u,E,p),u.child}function cC(a,u){var p=u.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(u.flags|=512,u.flags|=2097152)}function w_(a,u,p,w,E){var T=js(p)?Ic:ls.current;return T=nd(u,T),ld(u,E),p=u_(a,u,p,w,T,E),w=d_(),a!==null&&!zs?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~E,ka(a,u,E)):(jn&&w&&Ky(u),u.flags|=1,Es(a,u,p,E),u.child)}function uC(a,u,p,w,E){if(js(p)){var T=!0;a0(u)}else T=!1;if(ld(u,E),u.stateNode===null)E0(a,u),Q8(u,p,w),v_(u,p,w,E),w=!0;else if(a===null){var N=u.stateNode,Z=u.memoizedProps;N.props=Z;var Y=N.context,oe=p.contextType;typeof oe=="object"&&oe!==null?oe=Fi(oe):(oe=js(p)?Ic:ls.current,oe=nd(u,oe));var we=p.getDerivedStateFromProps,xe=typeof we=="function"||typeof N.getSnapshotBeforeUpdate=="function";xe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==w||Y!==oe)&&J8(u,N,w,oe),gl=!1;var ye=u.memoizedState;N.state=ye,g0(u,w,N,E),Y=u.memoizedState,Z!==w||ye!==Y||Fs.current||gl?(typeof we=="function"&&(g_(u,p,we,w),Y=u.memoizedState),(Z=gl||X8(u,p,Z,w,ye,Y,oe))?(xe||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=Y),N.props=w,N.state=Y,N.context=oe,w=Z):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{N=u.stateNode,C8(a,u),Z=u.memoizedProps,oe=u.type===u.elementType?Z:io(u.type,Z),N.props=oe,xe=u.pendingProps,ye=N.context,Y=p.contextType,typeof Y=="object"&&Y!==null?Y=Fi(Y):(Y=js(p)?Ic:ls.current,Y=nd(u,Y));var Fe=p.getDerivedStateFromProps;(we=typeof Fe=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==xe||ye!==Y)&&J8(u,N,w,Y),gl=!1,ye=u.memoizedState,N.state=ye,g0(u,w,N,E);var qe=u.memoizedState;Z!==xe||ye!==qe||Fs.current||gl?(typeof Fe=="function"&&(g_(u,p,Fe,w),qe=u.memoizedState),(oe=gl||X8(u,p,oe,w,ye,qe,Y)||!1)?(we||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(w,qe,Y),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(w,qe,Y)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||Z===a.memoizedProps&&ye===a.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===a.memoizedProps&&ye===a.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=qe),N.props=w,N.state=qe,N.context=Y,w=oe):(typeof N.componentDidUpdate!="function"||Z===a.memoizedProps&&ye===a.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===a.memoizedProps&&ye===a.memoizedState||(u.flags|=1024),w=!1)}return b_(a,u,p,w,T,E)}function b_(a,u,p,w,E,T){cC(a,u);var N=(u.flags&128)!==0;if(!w&&!N)return E&&m8(u,p,!1),ka(a,u,T);w=u.stateNode,BV.current=u;var Z=N&&typeof p.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,a!==null&&N?(u.child=od(u,a.child,null,T),u.child=od(u,null,Z,T)):Es(a,u,Z,T),u.memoizedState=w.state,E&&m8(u,p,!0),u.child}function dC(a){var u=a.stateNode;u.pendingContext?h8(a,u.pendingContext,u.pendingContext!==u.context):u.context&&h8(a,u.context,!1),s_(a,u.containerInfo)}function fC(a,u,p,w,E){return id(),Xy(E),u.flags|=256,Es(a,u,p,w),u.child}var x_={dehydrated:null,treeContext:null,retryLane:0};function S_(a){return{baseLanes:a,cachePool:null,transitions:null}}function hC(a,u,p){var w=u.pendingProps,E=Bn.current,T=!1,N=(u.flags&128)!==0,Z;if((Z=N)||(Z=a!==null&&a.memoizedState===null?!1:(E&2)!==0),Z?(T=!0,u.flags&=-129):(a===null||a.memoizedState!==null)&&(E|=1),Rn(Bn,E&1),a===null)return Yy(u),a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((u.mode&1)===0?u.lanes=1:a.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(N=w.children,a=w.fallback,T?(w=u.mode,T=u.child,N={mode:"hidden",children:N},(w&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=N):T=$0(N,w,0,null),a=Vc(a,w,p,null),T.return=u,a.return=u,T.sibling=a,u.child=T,u.child.memoizedState=S_(p),u.memoizedState=x_,a):k_(u,N));if(E=a.memoizedState,E!==null&&(Z=E.dehydrated,Z!==null))return ZV(a,u,N,w,Z,E,p);if(T){T=w.fallback,N=u.mode,E=a.child,Z=E.sibling;var Y={mode:"hidden",children:w.children};return(N&1)===0&&u.child!==E?(w=u.child,w.childLanes=0,w.pendingProps=Y,u.deletions=null):(w=Sl(E,Y),w.subtreeFlags=E.subtreeFlags&14680064),Z!==null?T=Sl(Z,T):(T=Vc(T,N,p,null),T.flags|=2),T.return=u,w.return=u,w.sibling=T,u.child=w,w=T,T=u.child,N=a.child.memoizedState,N=N===null?S_(p):{baseLanes:N.baseLanes|p,cachePool:null,transitions:N.transitions},T.memoizedState=N,T.childLanes=a.childLanes&~p,u.memoizedState=x_,w}return T=a.child,a=T.sibling,w=Sl(T,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=p),w.return=u,w.sibling=null,a!==null&&(p=u.deletions,p===null?(u.deletions=[a],u.flags|=16):p.push(a)),u.child=w,u.memoizedState=null,w}function k_(a,u){return u=$0({mode:"visible",children:u},a.mode,0,null),u.return=a,a.child=u}function k0(a,u,p,w){return w!==null&&Xy(w),od(u,a.child,null,p),a=k_(u,u.pendingProps.children),a.flags|=2,u.memoizedState=null,a}function ZV(a,u,p,w,E,T,N){if(p)return u.flags&256?(u.flags&=-257,w=y_(Error(n(422))),k0(a,u,N,w)):u.memoizedState!==null?(u.child=a.child,u.flags|=128,null):(T=w.fallback,E=u.mode,w=$0({mode:"visible",children:w.children},E,0,null),T=Vc(T,E,N,null),T.flags|=2,w.return=u,T.return=u,w.sibling=T,u.child=w,(u.mode&1)!==0&&od(u,a.child,null,N),u.child.memoizedState=S_(N),u.memoizedState=x_,T);if((u.mode&1)===0)return k0(a,u,N,null);if(E.data==="$!"){if(w=E.nextSibling&&E.nextSibling.dataset,w)var Z=w.dgst;return w=Z,T=Error(n(419)),w=y_(T,w,void 0),k0(a,u,N,w)}if(Z=(N&a.childLanes)!==0,zs||Z){if(w=Fr,w!==null){switch(N&-N){case 4:E=2;break;case 16:E=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(w.suspendedLanes|N))!==0?0:E,E!==0&&E!==T.retryLane&&(T.retryLane=E,xa(a,E),lo(w,a,E,-1))}return z_(),w=y_(Error(n(421))),k0(a,u,N,w)}return E.data==="$?"?(u.flags|=128,u.child=a.child,u=sH.bind(null,a),E._reactRetry=u,null):(a=T.treeContext,fi=fl(E.nextSibling),di=u,jn=!0,so=null,a!==null&&(Di[$i++]=wa,Di[$i++]=ba,Di[$i++]=Oc,wa=a.id,ba=a.overflow,Oc=u),u=k_(u,w.children),u.flags|=4096,u)}function pC(a,u,p){a.lanes|=u;var w=a.alternate;w!==null&&(w.lanes|=u),t_(a.return,u,p)}function E_(a,u,p,w,E){var T=a.memoizedState;T===null?a.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:p,tailMode:E}:(T.isBackwards=u,T.rendering=null,T.renderingStartTime=0,T.last=w,T.tail=p,T.tailMode=E)}function mC(a,u,p){var w=u.pendingProps,E=w.revealOrder,T=w.tail;if(Es(a,u,w.children,p),w=Bn.current,(w&2)!==0)w=w&1|2,u.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=u.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&pC(a,p,u);else if(a.tag===19)pC(a,p,u);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===u)break e;for(;a.sibling===null;){if(a.return===null||a.return===u)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}w&=1}if(Rn(Bn,w),(u.mode&1)===0)u.memoizedState=null;else switch(E){case"forwards":for(p=u.child,E=null;p!==null;)a=p.alternate,a!==null&&v0(a)===null&&(E=p),p=p.sibling;p=E,p===null?(E=u.child,u.child=null):(E=p.sibling,p.sibling=null),E_(u,!1,E,p,T);break;case"backwards":for(p=null,E=u.child,u.child=null;E!==null;){if(a=E.alternate,a!==null&&v0(a)===null){u.child=E;break}a=E.sibling,E.sibling=p,p=E,E=a}E_(u,!0,p,null,T);break;case"together":E_(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function E0(a,u){(u.mode&1)===0&&a!==null&&(a.alternate=null,u.alternate=null,u.flags|=2)}function ka(a,u,p){if(a!==null&&(u.dependencies=a.dependencies),$c|=u.lanes,(p&u.childLanes)===0)return null;if(a!==null&&u.child!==a.child)throw Error(n(153));if(u.child!==null){for(a=u.child,p=Sl(a,a.pendingProps),u.child=p,p.return=u;a.sibling!==null;)a=a.sibling,p=p.sibling=Sl(a,a.pendingProps),p.return=u;p.sibling=null}return u.child}function WV(a,u,p){switch(u.tag){case 3:dC(u),id();break;case 5:R8(u);break;case 1:js(u.type)&&a0(u);break;case 4:s_(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,E=u.memoizedProps.value;Rn(h0,w._currentValue),w._currentValue=E;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(Rn(Bn,Bn.current&1),u.flags|=128,null):(p&u.child.childLanes)!==0?hC(a,u,p):(Rn(Bn,Bn.current&1),a=ka(a,u,p),a!==null?a.sibling:null);Rn(Bn,Bn.current&1);break;case 19:if(w=(p&u.childLanes)!==0,(a.flags&128)!==0){if(w)return mC(a,u,p);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Rn(Bn,Bn.current),w)break;return null;case 22:case 23:return u.lanes=0,lC(a,u,p)}return ka(a,u,p)}var gC,C_,vC,yC;gC=function(a,u){for(var p=u.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===u)break;for(;p.sibling===null;){if(p.return===null||p.return===u)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},C_=function(){},vC=function(a,u,p,w){var E=a.memoizedProps;if(E!==w){a=u.stateNode,Lc(Lo.current);var T=null;switch(p){case"input":E=Ut(a,E),w=Ut(a,w),T=[];break;case"select":E=B({},E,{value:void 0}),w=B({},w,{value:void 0}),T=[];break;case"textarea":E=Re(a,E),w=Re(a,w),T=[];break;default:typeof E.onClick!="function"&&typeof w.onClick=="function"&&(a.onclick=s0)}vn(p,w);var N;p=null;for(oe in E)if(!w.hasOwnProperty(oe)&&E.hasOwnProperty(oe)&&E[oe]!=null)if(oe==="style"){var Z=E[oe];for(N in Z)Z.hasOwnProperty(N)&&(p||(p={}),p[N]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(s.hasOwnProperty(oe)?T||(T=[]):(T=T||[]).push(oe,null));for(oe in w){var Y=w[oe];if(Z=E!=null?E[oe]:void 0,w.hasOwnProperty(oe)&&Y!==Z&&(Y!=null||Z!=null))if(oe==="style")if(Z){for(N in Z)!Z.hasOwnProperty(N)||Y&&Y.hasOwnProperty(N)||(p||(p={}),p[N]="");for(N in Y)Y.hasOwnProperty(N)&&Z[N]!==Y[N]&&(p||(p={}),p[N]=Y[N])}else p||(T||(T=[]),T.push(oe,p)),p=Y;else oe==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Z=Z?Z.__html:void 0,Y!=null&&Z!==Y&&(T=T||[]).push(oe,Y)):oe==="children"?typeof Y!="string"&&typeof Y!="number"||(T=T||[]).push(oe,""+Y):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(s.hasOwnProperty(oe)?(Y!=null&&oe==="onScroll"&&On("scroll",a),T||Z===Y||(T=[])):(T=T||[]).push(oe,Y))}p&&(T=T||[]).push("style",p);var oe=T;(u.updateQueue=oe)&&(u.flags|=4)}},yC=function(a,u,p,w){p!==w&&(u.flags|=4)};function Eh(a,u){if(!jn)switch(a.tailMode){case"hidden":u=a.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?a.tail=null:p.sibling=null;break;case"collapsed":p=a.tail;for(var w=null;p!==null;)p.alternate!==null&&(w=p),p=p.sibling;w===null?u||a.tail===null?a.tail=null:a.tail.sibling=null:w.sibling=null}}function us(a){var u=a.alternate!==null&&a.alternate.child===a.child,p=0,w=0;if(u)for(var E=a.child;E!==null;)p|=E.lanes|E.childLanes,w|=E.subtreeFlags&14680064,w|=E.flags&14680064,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)p|=E.lanes|E.childLanes,w|=E.subtreeFlags,w|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=w,a.childLanes=p,u}function KV(a,u,p){var w=u.pendingProps;switch(qy(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return us(u),null;case 1:return js(u.type)&&o0(),us(u),null;case 3:return w=u.stateNode,cd(),Mn(Fs),Mn(ls),a_(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(a===null||a.child===null)&&(d0(u)?u.flags|=4:a===null||a.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,so!==null&&($_(so),so=null))),C_(a,u),us(u),null;case 5:i_(u);var E=Lc(wh.current);if(p=u.type,a!==null&&u.stateNode!=null)vC(a,u,p,w,E),a.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return us(u),null}if(a=Lc(Lo.current),d0(u)){w=u.stateNode,p=u.type;var T=u.memoizedProps;switch(w[No]=u,w[mh]=T,a=(u.mode&1)!==0,p){case"dialog":On("cancel",w),On("close",w);break;case"iframe":case"object":case"embed":On("load",w);break;case"video":case"audio":for(E=0;E<fh.length;E++)On(fh[E],w);break;case"source":On("error",w);break;case"img":case"image":case"link":On("error",w),On("load",w);break;case"details":On("toggle",w);break;case"input":nn(w,T),On("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!T.multiple},On("invalid",w);break;case"textarea":Ct(w,T),On("invalid",w)}vn(p,T),E=null;for(var N in T)if(T.hasOwnProperty(N)){var Z=T[N];N==="children"?typeof Z=="string"?w.textContent!==Z&&(T.suppressHydrationWarning!==!0&&r0(w.textContent,Z,a),E=["children",Z]):typeof Z=="number"&&w.textContent!==""+Z&&(T.suppressHydrationWarning!==!0&&r0(w.textContent,Z,a),E=["children",""+Z]):s.hasOwnProperty(N)&&Z!=null&&N==="onScroll"&&On("scroll",w)}switch(p){case"input":Ve(w),un(w,T,!0);break;case"textarea":Ve(w),$t(w);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(w.onclick=s0)}w=E,u.updateQueue=w,w!==null&&(u.flags|=4)}else{N=E.nodeType===9?E:E.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ht(p)),a==="http://www.w3.org/1999/xhtml"?p==="script"?(a=N.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof w.is=="string"?a=N.createElement(p,{is:w.is}):(a=N.createElement(p),p==="select"&&(N=a,w.multiple?N.multiple=!0:w.size&&(N.size=w.size))):a=N.createElementNS(a,p),a[No]=u,a[mh]=w,gC(a,u,!1,!1),u.stateNode=a;e:{switch(N=ss(p,w),p){case"dialog":On("cancel",a),On("close",a),E=w;break;case"iframe":case"object":case"embed":On("load",a),E=w;break;case"video":case"audio":for(E=0;E<fh.length;E++)On(fh[E],a);E=w;break;case"source":On("error",a),E=w;break;case"img":case"image":case"link":On("error",a),On("load",a),E=w;break;case"details":On("toggle",a),E=w;break;case"input":nn(a,w),E=Ut(a,w),On("invalid",a);break;case"option":E=w;break;case"select":a._wrapperState={wasMultiple:!!w.multiple},E=B({},w,{value:void 0}),On("invalid",a);break;case"textarea":Ct(a,w),E=Re(a,w),On("invalid",a);break;default:E=w}vn(p,E),Z=E;for(T in Z)if(Z.hasOwnProperty(T)){var Y=Z[T];T==="style"?rs(a,Y):T==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Y!=null&&Oi(a,Y)):T==="children"?typeof Y=="string"?(p!=="textarea"||Y!=="")&&Pn(a,Y):typeof Y=="number"&&Pn(a,""+Y):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(s.hasOwnProperty(T)?Y!=null&&T==="onScroll"&&On("scroll",a):Y!=null&&C(a,T,Y,N))}switch(p){case"input":Ve(a),un(a,w,!1);break;case"textarea":Ve(a),$t(a);break;case"option":w.value!=null&&a.setAttribute("value",""+le(w.value));break;case"select":a.multiple=!!w.multiple,T=w.value,T!=null?Je(a,!!w.multiple,T,!1):w.defaultValue!=null&&Je(a,!!w.multiple,w.defaultValue,!0);break;default:typeof E.onClick=="function"&&(a.onclick=s0)}switch(p){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return us(u),null;case 6:if(a&&u.stateNode!=null)yC(a,u,a.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(p=Lc(wh.current),Lc(Lo.current),d0(u)){if(w=u.stateNode,p=u.memoizedProps,w[No]=u,(T=w.nodeValue!==p)&&(a=di,a!==null))switch(a.tag){case 3:r0(w.nodeValue,p,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&r0(w.nodeValue,p,(a.mode&1)!==0)}T&&(u.flags|=4)}else w=(p.nodeType===9?p:p.ownerDocument).createTextNode(w),w[No]=u,u.stateNode=w}return us(u),null;case 13:if(Mn(Bn),w=u.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(jn&&fi!==null&&(u.mode&1)!==0&&(u.flags&128)===0)b8(),id(),u.flags|=98560,T=!1;else if(T=d0(u),w!==null&&w.dehydrated!==null){if(a===null){if(!T)throw Error(n(318));if(T=u.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[No]=u}else id(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;us(u),T=!1}else so!==null&&($_(so),so=null),T=!0;if(!T)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=p,u):(w=w!==null,w!==(a!==null&&a.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(a===null||(Bn.current&1)!==0?Tr===0&&(Tr=3):z_())),u.updateQueue!==null&&(u.flags|=4),us(u),null);case 4:return cd(),C_(a,u),a===null&&hh(u.stateNode.containerInfo),us(u),null;case 10:return e_(u.type._context),us(u),null;case 17:return js(u.type)&&o0(),us(u),null;case 19:if(Mn(Bn),T=u.memoizedState,T===null)return us(u),null;if(w=(u.flags&128)!==0,N=T.rendering,N===null)if(w)Eh(T,!1);else{if(Tr!==0||a!==null&&(a.flags&128)!==0)for(a=u.child;a!==null;){if(N=v0(a),N!==null){for(u.flags|=128,Eh(T,!1),w=N.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=p,p=u.child;p!==null;)T=p,a=w,T.flags&=14680066,N=T.alternate,N===null?(T.childLanes=0,T.lanes=a,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=N.childLanes,T.lanes=N.lanes,T.child=N.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=N.memoizedProps,T.memoizedState=N.memoizedState,T.updateQueue=N.updateQueue,T.type=N.type,a=N.dependencies,T.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),p=p.sibling;return Rn(Bn,Bn.current&1|2),u.child}a=a.sibling}T.tail!==null&&dn()>hd&&(u.flags|=128,w=!0,Eh(T,!1),u.lanes=4194304)}else{if(!w)if(a=v0(N),a!==null){if(u.flags|=128,w=!0,p=a.updateQueue,p!==null&&(u.updateQueue=p,u.flags|=4),Eh(T,!0),T.tail===null&&T.tailMode==="hidden"&&!N.alternate&&!jn)return us(u),null}else 2*dn()-T.renderingStartTime>hd&&p!==1073741824&&(u.flags|=128,w=!0,Eh(T,!1),u.lanes=4194304);T.isBackwards?(N.sibling=u.child,u.child=N):(p=T.last,p!==null?p.sibling=N:u.child=N,T.last=N)}return T.tail!==null?(u=T.tail,T.rendering=u,T.tail=u.sibling,T.renderingStartTime=dn(),u.sibling=null,p=Bn.current,Rn(Bn,w?p&1|2:p&1),u):(us(u),null);case 22:case 23:return j_(),w=u.memoizedState!==null,a!==null&&a.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(hi&1073741824)!==0&&(us(u),u.subtreeFlags&6&&(u.flags|=8192)):us(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function qV(a,u){switch(qy(u),u.tag){case 1:return js(u.type)&&o0(),a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 3:return cd(),Mn(Fs),Mn(ls),a_(),a=u.flags,(a&65536)!==0&&(a&128)===0?(u.flags=a&-65537|128,u):null;case 5:return i_(u),null;case 13:if(Mn(Bn),a=u.memoizedState,a!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(n(340));id()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 19:return Mn(Bn),null;case 4:return cd(),null;case 10:return e_(u.type._context),null;case 22:case 23:return j_(),null;case 24:return null;default:return null}}var C0=!1,ds=!1,GV=typeof WeakSet=="function"?WeakSet:Set,Be=null;function dd(a,u){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(w){ir(a,u,w)}else p.current=null}function P_(a,u,p){try{p()}catch(w){ir(a,u,w)}}var _C=!1;function YV(a,u){if(jy=Wm,a=XE(),Iy(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var w=p.getSelection&&p.getSelection();if(w&&w.rangeCount!==0){p=w.anchorNode;var E=w.anchorOffset,T=w.focusNode;w=w.focusOffset;try{p.nodeType,T.nodeType}catch{p=null;break e}var N=0,Z=-1,Y=-1,oe=0,we=0,xe=a,ye=null;t:for(;;){for(var Fe;xe!==p||E!==0&&xe.nodeType!==3||(Z=N+E),xe!==T||w!==0&&xe.nodeType!==3||(Y=N+w),xe.nodeType===3&&(N+=xe.nodeValue.length),(Fe=xe.firstChild)!==null;)ye=xe,xe=Fe;for(;;){if(xe===a)break t;if(ye===p&&++oe===E&&(Z=N),ye===T&&++we===w&&(Y=N),(Fe=xe.nextSibling)!==null)break;xe=ye,ye=xe.parentNode}xe=Fe}p=Z===-1||Y===-1?null:{start:Z,end:Y}}else p=null}p=p||{start:0,end:0}}else p=null;for(zy={focusedElem:a,selectionRange:p},Wm=!1,Be=u;Be!==null;)if(u=Be,a=u.child,(u.subtreeFlags&1028)!==0&&a!==null)a.return=u,Be=a;else for(;Be!==null;){u=Be;try{var qe=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(qe!==null){var Ye=qe.memoizedProps,ur=qe.memoizedState,te=u.stateNode,J=te.getSnapshotBeforeUpdate(u.elementType===u.type?Ye:io(u.type,Ye),ur);te.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var re=u.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Pe){ir(u,u.return,Pe)}if(a=u.sibling,a!==null){a.return=u.return,Be=a;break}Be=u.return}return qe=_C,_C=!1,qe}function Ch(a,u,p){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var E=w=w.next;do{if((E.tag&a)===a){var T=E.destroy;E.destroy=void 0,T!==void 0&&P_(u,p,T)}E=E.next}while(E!==w)}}function P0(a,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&a)===a){var w=p.create;p.destroy=w()}p=p.next}while(p!==u)}}function T_(a){var u=a.ref;if(u!==null){var p=a.stateNode;switch(a.tag){case 5:a=p;break;default:a=p}typeof u=="function"?u(a):u.current=a}}function wC(a){var u=a.alternate;u!==null&&(a.alternate=null,wC(u)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(u=a.stateNode,u!==null&&(delete u[No],delete u[mh],delete u[By],delete u[OV],delete u[MV])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function bC(a){return a.tag===5||a.tag===3||a.tag===4}function xC(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||bC(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function R_(a,u,p){var w=a.tag;if(w===5||w===6)a=a.stateNode,u?p.nodeType===8?p.parentNode.insertBefore(a,u):p.insertBefore(a,u):(p.nodeType===8?(u=p.parentNode,u.insertBefore(a,p)):(u=p,u.appendChild(a)),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=s0));else if(w!==4&&(a=a.child,a!==null))for(R_(a,u,p),a=a.sibling;a!==null;)R_(a,u,p),a=a.sibling}function A_(a,u,p){var w=a.tag;if(w===5||w===6)a=a.stateNode,u?p.insertBefore(a,u):p.appendChild(a);else if(w!==4&&(a=a.child,a!==null))for(A_(a,u,p),a=a.sibling;a!==null;)A_(a,u,p),a=a.sibling}var qr=null,oo=!1;function yl(a,u,p){for(p=p.child;p!==null;)SC(a,u,p),p=p.sibling}function SC(a,u,p){if(os&&typeof os.onCommitFiberUnmount=="function")try{os.onCommitFiberUnmount(ga,p)}catch{}switch(p.tag){case 5:ds||dd(p,u);case 6:var w=qr,E=oo;qr=null,yl(a,u,p),qr=w,oo=E,qr!==null&&(oo?(a=qr,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):qr.removeChild(p.stateNode));break;case 18:qr!==null&&(oo?(a=qr,p=p.stateNode,a.nodeType===8?Uy(a.parentNode,p):a.nodeType===1&&Uy(a,p),Mo(a)):Uy(qr,p.stateNode));break;case 4:w=qr,E=oo,qr=p.stateNode.containerInfo,oo=!0,yl(a,u,p),qr=w,oo=E;break;case 0:case 11:case 14:case 15:if(!ds&&(w=p.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){E=w=w.next;do{var T=E,N=T.destroy;T=T.tag,N!==void 0&&((T&2)!==0||(T&4)!==0)&&P_(p,u,N),E=E.next}while(E!==w)}yl(a,u,p);break;case 1:if(!ds&&(dd(p,u),w=p.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=p.memoizedProps,w.state=p.memoizedState,w.componentWillUnmount()}catch(Z){ir(p,u,Z)}yl(a,u,p);break;case 21:yl(a,u,p);break;case 22:p.mode&1?(ds=(w=ds)||p.memoizedState!==null,yl(a,u,p),ds=w):yl(a,u,p);break;default:yl(a,u,p)}}function kC(a){var u=a.updateQueue;if(u!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new GV),u.forEach(function(w){var E=iH.bind(null,a,w);p.has(w)||(p.add(w),w.then(E,E))})}}function ao(a,u){var p=u.deletions;if(p!==null)for(var w=0;w<p.length;w++){var E=p[w];try{var T=a,N=u,Z=N;e:for(;Z!==null;){switch(Z.tag){case 5:qr=Z.stateNode,oo=!1;break e;case 3:qr=Z.stateNode.containerInfo,oo=!0;break e;case 4:qr=Z.stateNode.containerInfo,oo=!0;break e}Z=Z.return}if(qr===null)throw Error(n(160));SC(T,N,E),qr=null,oo=!1;var Y=E.alternate;Y!==null&&(Y.return=null),E.return=null}catch(oe){ir(E,u,oe)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)EC(u,a),u=u.sibling}function EC(a,u){var p=a.alternate,w=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(ao(u,a),$o(a),w&4){try{Ch(3,a,a.return),P0(3,a)}catch(Ye){ir(a,a.return,Ye)}try{Ch(5,a,a.return)}catch(Ye){ir(a,a.return,Ye)}}break;case 1:ao(u,a),$o(a),w&512&&p!==null&&dd(p,p.return);break;case 5:if(ao(u,a),$o(a),w&512&&p!==null&&dd(p,p.return),a.flags&32){var E=a.stateNode;try{Pn(E,"")}catch(Ye){ir(a,a.return,Ye)}}if(w&4&&(E=a.stateNode,E!=null)){var T=a.memoizedProps,N=p!==null?p.memoizedProps:T,Z=a.type,Y=a.updateQueue;if(a.updateQueue=null,Y!==null)try{Z==="input"&&T.type==="radio"&&T.name!=null&&kt(E,T),ss(Z,N);var oe=ss(Z,T);for(N=0;N<Y.length;N+=2){var we=Y[N],xe=Y[N+1];we==="style"?rs(E,xe):we==="dangerouslySetInnerHTML"?Oi(E,xe):we==="children"?Pn(E,xe):C(E,we,xe,oe)}switch(Z){case"input":Dt(E,T);break;case"textarea":Se(E,T);break;case"select":var ye=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!T.multiple;var Fe=T.value;Fe!=null?Je(E,!!T.multiple,Fe,!1):ye!==!!T.multiple&&(T.defaultValue!=null?Je(E,!!T.multiple,T.defaultValue,!0):Je(E,!!T.multiple,T.multiple?[]:"",!1))}E[mh]=T}catch(Ye){ir(a,a.return,Ye)}}break;case 6:if(ao(u,a),$o(a),w&4){if(a.stateNode===null)throw Error(n(162));E=a.stateNode,T=a.memoizedProps;try{E.nodeValue=T}catch(Ye){ir(a,a.return,Ye)}}break;case 3:if(ao(u,a),$o(a),w&4&&p!==null&&p.memoizedState.isDehydrated)try{Mo(u.containerInfo)}catch(Ye){ir(a,a.return,Ye)}break;case 4:ao(u,a),$o(a);break;case 13:ao(u,a),$o(a),E=a.child,E.flags&8192&&(T=E.memoizedState!==null,E.stateNode.isHidden=T,!T||E.alternate!==null&&E.alternate.memoizedState!==null||(M_=dn())),w&4&&kC(a);break;case 22:if(we=p!==null&&p.memoizedState!==null,a.mode&1?(ds=(oe=ds)||we,ao(u,a),ds=oe):ao(u,a),$o(a),w&8192){if(oe=a.memoizedState!==null,(a.stateNode.isHidden=oe)&&!we&&(a.mode&1)!==0)for(Be=a,we=a.child;we!==null;){for(xe=Be=we;Be!==null;){switch(ye=Be,Fe=ye.child,ye.tag){case 0:case 11:case 14:case 15:Ch(4,ye,ye.return);break;case 1:dd(ye,ye.return);var qe=ye.stateNode;if(typeof qe.componentWillUnmount=="function"){w=ye,p=ye.return;try{u=w,qe.props=u.memoizedProps,qe.state=u.memoizedState,qe.componentWillUnmount()}catch(Ye){ir(w,p,Ye)}}break;case 5:dd(ye,ye.return);break;case 22:if(ye.memoizedState!==null){TC(xe);continue}}Fe!==null?(Fe.return=ye,Be=Fe):TC(xe)}we=we.sibling}e:for(we=null,xe=a;;){if(xe.tag===5){if(we===null){we=xe;try{E=xe.stateNode,oe?(T=E.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(Z=xe.stateNode,Y=xe.memoizedProps.style,N=Y!=null&&Y.hasOwnProperty("display")?Y.display:null,Z.style.display=bs("display",N))}catch(Ye){ir(a,a.return,Ye)}}}else if(xe.tag===6){if(we===null)try{xe.stateNode.nodeValue=oe?"":xe.memoizedProps}catch(Ye){ir(a,a.return,Ye)}}else if((xe.tag!==22&&xe.tag!==23||xe.memoizedState===null||xe===a)&&xe.child!==null){xe.child.return=xe,xe=xe.child;continue}if(xe===a)break e;for(;xe.sibling===null;){if(xe.return===null||xe.return===a)break e;we===xe&&(we=null),xe=xe.return}we===xe&&(we=null),xe.sibling.return=xe.return,xe=xe.sibling}}break;case 19:ao(u,a),$o(a),w&4&&kC(a);break;case 21:break;default:ao(u,a),$o(a)}}function $o(a){var u=a.flags;if(u&2){try{e:{for(var p=a.return;p!==null;){if(bC(p)){var w=p;break e}p=p.return}throw Error(n(160))}switch(w.tag){case 5:var E=w.stateNode;w.flags&32&&(Pn(E,""),w.flags&=-33);var T=xC(a);A_(a,T,E);break;case 3:case 4:var N=w.stateNode.containerInfo,Z=xC(a);R_(a,Z,N);break;default:throw Error(n(161))}}catch(Y){ir(a,a.return,Y)}a.flags&=-3}u&4096&&(a.flags&=-4097)}function XV(a,u,p){Be=a,CC(a)}function CC(a,u,p){for(var w=(a.mode&1)!==0;Be!==null;){var E=Be,T=E.child;if(E.tag===22&&w){var N=E.memoizedState!==null||C0;if(!N){var Z=E.alternate,Y=Z!==null&&Z.memoizedState!==null||ds;Z=C0;var oe=ds;if(C0=N,(ds=Y)&&!oe)for(Be=E;Be!==null;)N=Be,Y=N.child,N.tag===22&&N.memoizedState!==null?RC(E):Y!==null?(Y.return=N,Be=Y):RC(E);for(;T!==null;)Be=T,CC(T),T=T.sibling;Be=E,C0=Z,ds=oe}PC(a)}else(E.subtreeFlags&8772)!==0&&T!==null?(T.return=E,Be=T):PC(a)}}function PC(a){for(;Be!==null;){var u=Be;if((u.flags&8772)!==0){var p=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:ds||P0(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!ds)if(p===null)w.componentDidMount();else{var E=u.elementType===u.type?p.memoizedProps:io(u.type,p.memoizedProps);w.componentDidUpdate(E,p.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var T=u.updateQueue;T!==null&&T8(u,T,w);break;case 3:var N=u.updateQueue;if(N!==null){if(p=null,u.child!==null)switch(u.child.tag){case 5:p=u.child.stateNode;break;case 1:p=u.child.stateNode}T8(u,N,p)}break;case 5:var Z=u.stateNode;if(p===null&&u.flags&4){p=Z;var Y=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":Y.autoFocus&&p.focus();break;case"img":Y.src&&(p.src=Y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var oe=u.alternate;if(oe!==null){var we=oe.memoizedState;if(we!==null){var xe=we.dehydrated;xe!==null&&Mo(xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}ds||u.flags&512&&T_(u)}catch(ye){ir(u,u.return,ye)}}if(u===a){Be=null;break}if(p=u.sibling,p!==null){p.return=u.return,Be=p;break}Be=u.return}}function TC(a){for(;Be!==null;){var u=Be;if(u===a){Be=null;break}var p=u.sibling;if(p!==null){p.return=u.return,Be=p;break}Be=u.return}}function RC(a){for(;Be!==null;){var u=Be;try{switch(u.tag){case 0:case 11:case 15:var p=u.return;try{P0(4,u)}catch(Y){ir(u,p,Y)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var E=u.return;try{w.componentDidMount()}catch(Y){ir(u,E,Y)}}var T=u.return;try{T_(u)}catch(Y){ir(u,T,Y)}break;case 5:var N=u.return;try{T_(u)}catch(Y){ir(u,N,Y)}}}catch(Y){ir(u,u.return,Y)}if(u===a){Be=null;break}var Z=u.sibling;if(Z!==null){Z.return=u.return,Be=Z;break}Be=u.return}}var QV=Math.ceil,T0=P.ReactCurrentDispatcher,I_=P.ReactCurrentOwner,zi=P.ReactCurrentBatchConfig,Yt=0,Fr=null,mr=null,Gr=0,hi=0,fd=hl(0),Tr=0,Ph=null,$c=0,R0=0,O_=0,Th=null,Vs=null,M_=0,hd=1/0,Ea=null,A0=!1,N_=null,_l=null,I0=!1,wl=null,O0=0,Rh=0,L_=null,M0=-1,N0=0;function Cs(){return(Yt&6)!==0?dn():M0!==-1?M0:M0=dn()}function bl(a){return(a.mode&1)===0?1:(Yt&2)!==0&&Gr!==0?Gr&-Gr:LV.transition!==null?(N0===0&&(N0=gt()),N0):(a=ot,a!==0||(a=window.event,a=a===void 0?16:IE(a.type)),a)}function lo(a,u,p,w){if(50<Rh)throw Rh=0,L_=null,Error(n(185));Jt(a,p,w),((Yt&2)===0||a!==Fr)&&(a===Fr&&((Yt&2)===0&&(R0|=p),Tr===4&&xl(a,Gr)),Hs(a,w),p===1&&Yt===0&&(u.mode&1)===0&&(hd=dn()+500,l0&&ml()))}function Hs(a,u){var p=a.callbackNode;We(a,u);var w=ge(a,a===Fr?Gr:0);if(w===0)p!==null&&Cc(p),a.callbackNode=null,a.callbackPriority=0;else if(u=w&-w,a.callbackPriority!==u){if(p!=null&&Cc(p),u===1)a.tag===0?NV(IC.bind(null,a)):g8(IC.bind(null,a)),AV(function(){(Yt&6)===0&&ml()}),p=null;else{switch(Dr(w)){case 1:p=ci;break;case 4:p=Ro;break;case 16:p=Kr;break;case 536870912:p=Tc;break;default:p=Kr}p=jC(p,AC.bind(null,a))}a.callbackPriority=u,a.callbackNode=p}}function AC(a,u){if(M0=-1,N0=0,(Yt&6)!==0)throw Error(n(327));var p=a.callbackNode;if(pd()&&a.callbackNode!==p)return null;var w=ge(a,a===Fr?Gr:0);if(w===0)return null;if((w&30)!==0||(w&a.expiredLanes)!==0||u)u=L0(a,w);else{u=w;var E=Yt;Yt|=2;var T=MC();(Fr!==a||Gr!==u)&&(Ea=null,hd=dn()+500,jc(a,u));do try{tH();break}catch(Z){OC(a,Z)}while(!0);Jy(),T0.current=T,Yt=E,mr!==null?u=0:(Fr=null,Gr=0,u=Tr)}if(u!==0){if(u===2&&(E=_t(a),E!==0&&(w=E,u=D_(a,E))),u===1)throw p=Ph,jc(a,0),xl(a,w),Hs(a,dn()),p;if(u===6)xl(a,w);else{if(E=a.current.alternate,(w&30)===0&&!JV(E)&&(u=L0(a,w),u===2&&(T=_t(a),T!==0&&(w=T,u=D_(a,T))),u===1))throw p=Ph,jc(a,0),xl(a,w),Hs(a,dn()),p;switch(a.finishedWork=E,a.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:zc(a,Vs,Ea);break;case 3:if(xl(a,w),(w&130023424)===w&&(u=M_+500-dn(),10<u)){if(ge(a,0)!==0)break;if(E=a.suspendedLanes,(E&w)!==w){Cs(),a.pingedLanes|=a.suspendedLanes&E;break}a.timeoutHandle=Hy(zc.bind(null,a,Vs,Ea),u);break}zc(a,Vs,Ea);break;case 4:if(xl(a,w),(w&4194240)===w)break;for(u=a.eventTimes,E=-1;0<w;){var N=31-Ss(w);T=1<<N,N=u[N],N>E&&(E=N),w&=~T}if(w=E,w=dn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*QV(w/1960))-w,10<w){a.timeoutHandle=Hy(zc.bind(null,a,Vs,Ea),w);break}zc(a,Vs,Ea);break;case 5:zc(a,Vs,Ea);break;default:throw Error(n(329))}}}return Hs(a,dn()),a.callbackNode===p?AC.bind(null,a):null}function D_(a,u){var p=Th;return a.current.memoizedState.isDehydrated&&(jc(a,u).flags|=256),a=L0(a,u),a!==2&&(u=Vs,Vs=p,u!==null&&$_(u)),a}function $_(a){Vs===null?Vs=a:Vs.push.apply(Vs,a)}function JV(a){for(var u=a;;){if(u.flags&16384){var p=u.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var w=0;w<p.length;w++){var E=p[w],T=E.getSnapshot;E=E.value;try{if(!ro(T(),E))return!1}catch{return!1}}}if(p=u.child,u.subtreeFlags&16384&&p!==null)p.return=u,u=p;else{if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function xl(a,u){for(u&=~O_,u&=~R0,a.suspendedLanes|=u,a.pingedLanes&=~u,a=a.expirationTimes;0<u;){var p=31-Ss(u),w=1<<p;a[p]=-1,u&=~w}}function IC(a){if((Yt&6)!==0)throw Error(n(327));pd();var u=ge(a,0);if((u&1)===0)return Hs(a,dn()),null;var p=L0(a,u);if(a.tag!==0&&p===2){var w=_t(a);w!==0&&(u=w,p=D_(a,w))}if(p===1)throw p=Ph,jc(a,0),xl(a,u),Hs(a,dn()),p;if(p===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=u,zc(a,Vs,Ea),Hs(a,dn()),null}function F_(a,u){var p=Yt;Yt|=1;try{return a(u)}finally{Yt=p,Yt===0&&(hd=dn()+500,l0&&ml())}}function Fc(a){wl!==null&&wl.tag===0&&(Yt&6)===0&&pd();var u=Yt;Yt|=1;var p=zi.transition,w=ot;try{if(zi.transition=null,ot=1,a)return a()}finally{ot=w,zi.transition=p,Yt=u,(Yt&6)===0&&ml()}}function j_(){hi=fd.current,Mn(fd)}function jc(a,u){a.finishedWork=null,a.finishedLanes=0;var p=a.timeoutHandle;if(p!==-1&&(a.timeoutHandle=-1,RV(p)),mr!==null)for(p=mr.return;p!==null;){var w=p;switch(qy(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&o0();break;case 3:cd(),Mn(Fs),Mn(ls),a_();break;case 5:i_(w);break;case 4:cd();break;case 13:Mn(Bn);break;case 19:Mn(Bn);break;case 10:e_(w.type._context);break;case 22:case 23:j_()}p=p.return}if(Fr=a,mr=a=Sl(a.current,null),Gr=hi=u,Tr=0,Ph=null,O_=R0=$c=0,Vs=Th=null,Nc!==null){for(u=0;u<Nc.length;u++)if(p=Nc[u],w=p.interleaved,w!==null){p.interleaved=null;var E=w.next,T=p.pending;if(T!==null){var N=T.next;T.next=E,w.next=N}p.pending=w}Nc=null}return a}function OC(a,u){do{var p=mr;try{if(Jy(),y0.current=x0,_0){for(var w=Zn.memoizedState;w!==null;){var E=w.queue;E!==null&&(E.pending=null),w=w.next}_0=!1}if(Dc=0,$r=Pr=Zn=null,bh=!1,xh=0,I_.current=null,p===null||p.return===null){Tr=1,Ph=u,mr=null;break}e:{var T=a,N=p.return,Z=p,Y=u;if(u=Gr,Z.flags|=32768,Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var oe=Y,we=Z,xe=we.tag;if((we.mode&1)===0&&(xe===0||xe===11||xe===15)){var ye=we.alternate;ye?(we.updateQueue=ye.updateQueue,we.memoizedState=ye.memoizedState,we.lanes=ye.lanes):(we.updateQueue=null,we.memoizedState=null)}var Fe=rC(N);if(Fe!==null){Fe.flags&=-257,sC(Fe,N,Z,T,u),Fe.mode&1&&nC(T,oe,u),u=Fe,Y=oe;var qe=u.updateQueue;if(qe===null){var Ye=new Set;Ye.add(Y),u.updateQueue=Ye}else qe.add(Y);break e}else{if((u&1)===0){nC(T,oe,u),z_();break e}Y=Error(n(426))}}else if(jn&&Z.mode&1){var ur=rC(N);if(ur!==null){(ur.flags&65536)===0&&(ur.flags|=256),sC(ur,N,Z,T,u),Xy(ud(Y,Z));break e}}T=Y=ud(Y,Z),Tr!==4&&(Tr=2),Th===null?Th=[T]:Th.push(T),T=N;do{switch(T.tag){case 3:T.flags|=65536,u&=-u,T.lanes|=u;var te=eC(T,Y,u);P8(T,te);break e;case 1:Z=Y;var J=T.type,re=T.stateNode;if((T.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(_l===null||!_l.has(re)))){T.flags|=65536,u&=-u,T.lanes|=u;var Pe=tC(T,Z,u);P8(T,Pe);break e}}T=T.return}while(T!==null)}LC(p)}catch(et){u=et,mr===p&&p!==null&&(mr=p=p.return);continue}break}while(!0)}function MC(){var a=T0.current;return T0.current=x0,a===null?x0:a}function z_(){(Tr===0||Tr===3||Tr===2)&&(Tr=4),Fr===null||($c&268435455)===0&&(R0&268435455)===0||xl(Fr,Gr)}function L0(a,u){var p=Yt;Yt|=2;var w=MC();(Fr!==a||Gr!==u)&&(Ea=null,jc(a,u));do try{eH();break}catch(E){OC(a,E)}while(!0);if(Jy(),Yt=p,T0.current=w,mr!==null)throw Error(n(261));return Fr=null,Gr=0,Tr}function eH(){for(;mr!==null;)NC(mr)}function tH(){for(;mr!==null&&!Uu();)NC(mr)}function NC(a){var u=FC(a.alternate,a,hi);a.memoizedProps=a.pendingProps,u===null?LC(a):mr=u,I_.current=null}function LC(a){var u=a;do{var p=u.alternate;if(a=u.return,(u.flags&32768)===0){if(p=KV(p,u,hi),p!==null){mr=p;return}}else{if(p=qV(p,u),p!==null){p.flags&=32767,mr=p;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Tr=6,mr=null;return}}if(u=u.sibling,u!==null){mr=u;return}mr=u=a}while(u!==null);Tr===0&&(Tr=5)}function zc(a,u,p){var w=ot,E=zi.transition;try{zi.transition=null,ot=1,nH(a,u,p,w)}finally{zi.transition=E,ot=w}return null}function nH(a,u,p,w){do pd();while(wl!==null);if((Yt&6)!==0)throw Error(n(327));p=a.finishedWork;var E=a.finishedLanes;if(p===null)return null;if(a.finishedWork=null,a.finishedLanes=0,p===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var T=p.lanes|p.childLanes;if(wt(a,T),a===Fr&&(mr=Fr=null,Gr=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||I0||(I0=!0,jC(Kr,function(){return pd(),null})),T=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||T){T=zi.transition,zi.transition=null;var N=ot;ot=1;var Z=Yt;Yt|=4,I_.current=null,YV(a,p),EC(p,a),xV(zy),Wm=!!jy,zy=jy=null,a.current=p,XV(p),ll(),Yt=Z,ot=N,zi.transition=T}else a.current=p;if(I0&&(I0=!1,wl=a,O0=E),T=a.pendingLanes,T===0&&(_l=null),Bu(p.stateNode),Hs(a,dn()),u!==null)for(w=a.onRecoverableError,p=0;p<u.length;p++)E=u[p],w(E.value,{componentStack:E.stack,digest:E.digest});if(A0)throw A0=!1,a=N_,N_=null,a;return(O0&1)!==0&&a.tag!==0&&pd(),T=a.pendingLanes,(T&1)!==0?a===L_?Rh++:(Rh=0,L_=a):Rh=0,ml(),null}function pd(){if(wl!==null){var a=Dr(O0),u=zi.transition,p=ot;try{if(zi.transition=null,ot=16>a?16:a,wl===null)var w=!1;else{if(a=wl,wl=null,O0=0,(Yt&6)!==0)throw Error(n(331));var E=Yt;for(Yt|=4,Be=a.current;Be!==null;){var T=Be,N=T.child;if((Be.flags&16)!==0){var Z=T.deletions;if(Z!==null){for(var Y=0;Y<Z.length;Y++){var oe=Z[Y];for(Be=oe;Be!==null;){var we=Be;switch(we.tag){case 0:case 11:case 15:Ch(8,we,T)}var xe=we.child;if(xe!==null)xe.return=we,Be=xe;else for(;Be!==null;){we=Be;var ye=we.sibling,Fe=we.return;if(wC(we),we===oe){Be=null;break}if(ye!==null){ye.return=Fe,Be=ye;break}Be=Fe}}}var qe=T.alternate;if(qe!==null){var Ye=qe.child;if(Ye!==null){qe.child=null;do{var ur=Ye.sibling;Ye.sibling=null,Ye=ur}while(Ye!==null)}}Be=T}}if((T.subtreeFlags&2064)!==0&&N!==null)N.return=T,Be=N;else e:for(;Be!==null;){if(T=Be,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:Ch(9,T,T.return)}var te=T.sibling;if(te!==null){te.return=T.return,Be=te;break e}Be=T.return}}var J=a.current;for(Be=J;Be!==null;){N=Be;var re=N.child;if((N.subtreeFlags&2064)!==0&&re!==null)re.return=N,Be=re;else e:for(N=J;Be!==null;){if(Z=Be,(Z.flags&2048)!==0)try{switch(Z.tag){case 0:case 11:case 15:P0(9,Z)}}catch(et){ir(Z,Z.return,et)}if(Z===N){Be=null;break e}var Pe=Z.sibling;if(Pe!==null){Pe.return=Z.return,Be=Pe;break e}Be=Z.return}}if(Yt=E,ml(),os&&typeof os.onPostCommitFiberRoot=="function")try{os.onPostCommitFiberRoot(ga,a)}catch{}w=!0}return w}finally{ot=p,zi.transition=u}}return!1}function DC(a,u,p){u=ud(p,u),u=eC(a,u,1),a=vl(a,u,1),u=Cs(),a!==null&&(Jt(a,1,u),Hs(a,u))}function ir(a,u,p){if(a.tag===3)DC(a,a,p);else for(;u!==null;){if(u.tag===3){DC(u,a,p);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(_l===null||!_l.has(w))){a=ud(p,a),a=tC(u,a,1),u=vl(u,a,1),a=Cs(),u!==null&&(Jt(u,1,a),Hs(u,a));break}}u=u.return}}function rH(a,u,p){var w=a.pingCache;w!==null&&w.delete(u),u=Cs(),a.pingedLanes|=a.suspendedLanes&p,Fr===a&&(Gr&p)===p&&(Tr===4||Tr===3&&(Gr&130023424)===Gr&&500>dn()-M_?jc(a,0):O_|=p),Hs(a,u)}function $C(a,u){u===0&&((a.mode&1)===0?u=1:(u=F,F<<=1,(F&130023424)===0&&(F=4194304)));var p=Cs();a=xa(a,u),a!==null&&(Jt(a,u,p),Hs(a,p))}function sH(a){var u=a.memoizedState,p=0;u!==null&&(p=u.retryLane),$C(a,p)}function iH(a,u){var p=0;switch(a.tag){case 13:var w=a.stateNode,E=a.memoizedState;E!==null&&(p=E.retryLane);break;case 19:w=a.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),$C(a,p)}var FC;FC=function(a,u,p){if(a!==null)if(a.memoizedProps!==u.pendingProps||Fs.current)zs=!0;else{if((a.lanes&p)===0&&(u.flags&128)===0)return zs=!1,WV(a,u,p);zs=(a.flags&131072)!==0}else zs=!1,jn&&(u.flags&1048576)!==0&&v8(u,u0,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;E0(a,u),a=u.pendingProps;var E=nd(u,ls.current);ld(u,p),E=u_(null,u,w,a,E,p);var T=d_();return u.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,js(w)?(T=!0,a0(u)):T=!1,u.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,r_(u),E.updater=S0,u.stateNode=E,E._reactInternals=u,v_(u,w,a,p),u=b_(null,u,w,!0,T,p)):(u.tag=0,jn&&T&&Ky(u),Es(null,u,E,p),u=u.child),u;case 16:w=u.elementType;e:{switch(E0(a,u),a=u.pendingProps,E=w._init,w=E(w._payload),u.type=w,E=u.tag=aH(w),a=io(w,a),E){case 0:u=w_(null,u,w,a,p);break e;case 1:u=uC(null,u,w,a,p);break e;case 11:u=iC(null,u,w,a,p);break e;case 14:u=oC(null,u,w,io(w.type,a),p);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,E=u.pendingProps,E=u.elementType===w?E:io(w,E),w_(a,u,w,E,p);case 1:return w=u.type,E=u.pendingProps,E=u.elementType===w?E:io(w,E),uC(a,u,w,E,p);case 3:e:{if(dC(u),a===null)throw Error(n(387));w=u.pendingProps,T=u.memoizedState,E=T.element,C8(a,u),g0(u,w,null,p);var N=u.memoizedState;if(w=N.element,T.isDehydrated)if(T={element:w,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},u.updateQueue.baseState=T,u.memoizedState=T,u.flags&256){E=ud(Error(n(423)),u),u=fC(a,u,w,p,E);break e}else if(w!==E){E=ud(Error(n(424)),u),u=fC(a,u,w,p,E);break e}else for(fi=fl(u.stateNode.containerInfo.firstChild),di=u,jn=!0,so=null,p=k8(u,null,w,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(id(),w===E){u=ka(a,u,p);break e}Es(a,u,w,p)}u=u.child}return u;case 5:return R8(u),a===null&&Yy(u),w=u.type,E=u.pendingProps,T=a!==null?a.memoizedProps:null,N=E.children,Vy(w,E)?N=null:T!==null&&Vy(w,T)&&(u.flags|=32),cC(a,u),Es(a,u,N,p),u.child;case 6:return a===null&&Yy(u),null;case 13:return hC(a,u,p);case 4:return s_(u,u.stateNode.containerInfo),w=u.pendingProps,a===null?u.child=od(u,null,w,p):Es(a,u,w,p),u.child;case 11:return w=u.type,E=u.pendingProps,E=u.elementType===w?E:io(w,E),iC(a,u,w,E,p);case 7:return Es(a,u,u.pendingProps,p),u.child;case 8:return Es(a,u,u.pendingProps.children,p),u.child;case 12:return Es(a,u,u.pendingProps.children,p),u.child;case 10:e:{if(w=u.type._context,E=u.pendingProps,T=u.memoizedProps,N=E.value,Rn(h0,w._currentValue),w._currentValue=N,T!==null)if(ro(T.value,N)){if(T.children===E.children&&!Fs.current){u=ka(a,u,p);break e}}else for(T=u.child,T!==null&&(T.return=u);T!==null;){var Z=T.dependencies;if(Z!==null){N=T.child;for(var Y=Z.firstContext;Y!==null;){if(Y.context===w){if(T.tag===1){Y=Sa(-1,p&-p),Y.tag=2;var oe=T.updateQueue;if(oe!==null){oe=oe.shared;var we=oe.pending;we===null?Y.next=Y:(Y.next=we.next,we.next=Y),oe.pending=Y}}T.lanes|=p,Y=T.alternate,Y!==null&&(Y.lanes|=p),t_(T.return,p,u),Z.lanes|=p;break}Y=Y.next}}else if(T.tag===10)N=T.type===u.type?null:T.child;else if(T.tag===18){if(N=T.return,N===null)throw Error(n(341));N.lanes|=p,Z=N.alternate,Z!==null&&(Z.lanes|=p),t_(N,p,u),N=T.sibling}else N=T.child;if(N!==null)N.return=T;else for(N=T;N!==null;){if(N===u){N=null;break}if(T=N.sibling,T!==null){T.return=N.return,N=T;break}N=N.return}T=N}Es(a,u,E.children,p),u=u.child}return u;case 9:return E=u.type,w=u.pendingProps.children,ld(u,p),E=Fi(E),w=w(E),u.flags|=1,Es(a,u,w,p),u.child;case 14:return w=u.type,E=io(w,u.pendingProps),E=io(w.type,E),oC(a,u,w,E,p);case 15:return aC(a,u,u.type,u.pendingProps,p);case 17:return w=u.type,E=u.pendingProps,E=u.elementType===w?E:io(w,E),E0(a,u),u.tag=1,js(w)?(a=!0,a0(u)):a=!1,ld(u,p),Q8(u,w,E),v_(u,w,E,p),b_(null,u,w,!0,a,p);case 19:return mC(a,u,p);case 22:return lC(a,u,p)}throw Error(n(156,u.tag))};function jC(a,u){return li(a,u)}function oH(a,u,p,w){this.tag=a,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vi(a,u,p,w){return new oH(a,u,p,w)}function V_(a){return a=a.prototype,!(!a||!a.isReactComponent)}function aH(a){if(typeof a=="function")return V_(a)?1:0;if(a!=null){if(a=a.$$typeof,a===$)return 11;if(a===K)return 14}return 2}function Sl(a,u){var p=a.alternate;return p===null?(p=Vi(a.tag,u,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=u,p.type=a.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=a.flags&14680064,p.childLanes=a.childLanes,p.lanes=a.lanes,p.child=a.child,p.memoizedProps=a.memoizedProps,p.memoizedState=a.memoizedState,p.updateQueue=a.updateQueue,u=a.dependencies,p.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function D0(a,u,p,w,E,T){var N=2;if(w=a,typeof a=="function")V_(a)&&(N=1);else if(typeof a=="string")N=5;else e:switch(a){case I:return Vc(p.children,E,T,u);case A:N=8,E|=8;break;case M:return a=Vi(12,p,u,E|2),a.elementType=M,a.lanes=T,a;case q:return a=Vi(13,p,u,E),a.elementType=q,a.lanes=T,a;case X:return a=Vi(19,p,u,E),a.elementType=X,a.lanes=T,a;case ee:return $0(p,E,T,u);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case L:N=10;break e;case z:N=9;break e;case $:N=11;break e;case K:N=14;break e;case H:N=16,w=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return u=Vi(N,p,u,E),u.elementType=a,u.type=w,u.lanes=T,u}function Vc(a,u,p,w){return a=Vi(7,a,w,u),a.lanes=p,a}function $0(a,u,p,w){return a=Vi(22,a,w,u),a.elementType=ee,a.lanes=p,a.stateNode={isHidden:!1},a}function H_(a,u,p){return a=Vi(6,a,null,u),a.lanes=p,a}function U_(a,u,p){return u=Vi(4,a.children!==null?a.children:[],a.key,u),u.lanes=p,u.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},u}function lH(a,u,p,w,E){this.tag=u,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jt(0),this.expirationTimes=jt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jt(0),this.identifierPrefix=w,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function B_(a,u,p,w,E,T,N,Z,Y){return a=new lH(a,u,p,Z,Y),u===1?(u=1,T===!0&&(u|=8)):u=0,T=Vi(3,null,null,u),a.current=T,T.stateNode=a,T.memoizedState={element:w,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},r_(T),a}function cH(a,u,p){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:w==null?null:""+w,children:a,containerInfo:u,implementation:p}}function zC(a){if(!a)return pl;a=a._reactInternals;e:{if(Lr(a)!==a||a.tag!==1)throw Error(n(170));var u=a;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(js(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(a.tag===1){var p=a.type;if(js(p))return p8(a,p,u)}return u}function VC(a,u,p,w,E,T,N,Z,Y){return a=B_(p,w,!0,a,E,T,N,Z,Y),a.context=zC(null),p=a.current,w=Cs(),E=bl(p),T=Sa(w,E),T.callback=u??null,vl(p,T,E),a.current.lanes=E,Jt(a,E,w),Hs(a,w),a}function F0(a,u,p,w){var E=u.current,T=Cs(),N=bl(E);return p=zC(p),u.context===null?u.context=p:u.pendingContext=p,u=Sa(T,N),u.payload={element:a},w=w===void 0?null:w,w!==null&&(u.callback=w),a=vl(E,u,N),a!==null&&(lo(a,E,N,T),m0(a,E,N)),N}function j0(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function HC(a,u){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p<u?p:u}}function Z_(a,u){HC(a,u),(a=a.alternate)&&HC(a,u)}function uH(){return null}var UC=typeof reportError=="function"?reportError:function(a){console.error(a)};function W_(a){this._internalRoot=a}z0.prototype.render=W_.prototype.render=function(a){var u=this._internalRoot;if(u===null)throw Error(n(409));F0(a,u,null,null)},z0.prototype.unmount=W_.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var u=a.containerInfo;Fc(function(){F0(null,a,null,null)}),u[ya]=null}};function z0(a){this._internalRoot=a}z0.prototype.unstable_scheduleHydration=function(a){if(a){var u=va();a={blockedOn:null,target:a,priority:u};for(var p=0;p<Le.length&&u!==0&&u<Le[p].priority;p++);Le.splice(p,0,a),p===0&&as(a)}};function K_(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function V0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function BC(){}function dH(a,u,p,w,E){if(E){if(typeof w=="function"){var T=w;w=function(){var oe=j0(N);T.call(oe)}}var N=VC(u,w,a,0,null,!1,!1,"",BC);return a._reactRootContainer=N,a[ya]=N.current,hh(a.nodeType===8?a.parentNode:a),Fc(),N}for(;E=a.lastChild;)a.removeChild(E);if(typeof w=="function"){var Z=w;w=function(){var oe=j0(Y);Z.call(oe)}}var Y=B_(a,0,!1,null,null,!1,!1,"",BC);return a._reactRootContainer=Y,a[ya]=Y.current,hh(a.nodeType===8?a.parentNode:a),Fc(function(){F0(u,Y,p,w)}),Y}function H0(a,u,p,w,E){var T=p._reactRootContainer;if(T){var N=T;if(typeof E=="function"){var Z=E;E=function(){var Y=j0(N);Z.call(Y)}}F0(u,N,a,E)}else N=dH(p,u,a,E,w);return j0(N)}cl=function(a){switch(a.tag){case 3:var u=a.stateNode;if(u.current.memoizedState.isDehydrated){var p=pe(u.pendingLanes);p!==0&&(Fn(u,p|1),Hs(u,dn()),(Yt&6)===0&&(hd=dn()+500,ml()))}break;case 13:Fc(function(){var w=xa(a,1);if(w!==null){var E=Cs();lo(w,a,1,E)}}),Z_(a,1)}},Oo=function(a){if(a.tag===13){var u=xa(a,134217728);if(u!==null){var p=Cs();lo(u,a,134217728,p)}Z_(a,134217728)}},Er=function(a){if(a.tag===13){var u=bl(a),p=xa(a,u);if(p!==null){var w=Cs();lo(p,a,u,w)}Z_(a,u)}},va=function(){return ot},Wu=function(a,u){var p=ot;try{return ot=a,u()}finally{ot=p}},Wr=function(a,u,p){switch(u){case"input":if(Dt(a,p),u=p.name,p.type==="radio"&&u!=null){for(p=a;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<p.length;u++){var w=p[u];if(w!==a&&w.form===a.form){var E=i0(w);if(!E)throw Error(n(90));De(w),Dt(w,E)}}}break;case"textarea":Se(a,p);break;case"select":u=p.value,u!=null&&Je(a,!!p.multiple,u,!1)}},it=F_,cn=Fc;var fH={usingClientEntryPoint:!1,Events:[gh,ed,i0,cr,xs,F_]},Ah={findFiberByHostInstance:Ac,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hH={bundleType:Ah.bundleType,version:Ah.version,rendererPackageName:Ah.rendererPackageName,rendererConfig:Ah.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Ds(a),a===null?null:a.stateNode},findFiberByHostInstance:Ah.findFiberByHostInstance||uH,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var U0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!U0.isDisabled&&U0.supportsFiber)try{ga=U0.inject(hH),os=U0}catch{}}return Us.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fH,Us.createPortal=function(a,u){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!K_(u))throw Error(n(200));return cH(a,u,null,p)},Us.createRoot=function(a,u){if(!K_(a))throw Error(n(299));var p=!1,w="",E=UC;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(E=u.onRecoverableError)),u=B_(a,1,!1,null,null,p,!1,w,E),a[ya]=u.current,hh(a.nodeType===8?a.parentNode:a),new W_(u)},Us.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var u=a._reactInternals;if(u===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Ds(u),a=a===null?null:a.stateNode,a},Us.flushSync=function(a){return Fc(a)},Us.hydrate=function(a,u,p){if(!V0(u))throw Error(n(200));return H0(null,a,u,!0,p)},Us.hydrateRoot=function(a,u,p){if(!K_(a))throw Error(n(405));var w=p!=null&&p.hydratedSources||null,E=!1,T="",N=UC;if(p!=null&&(p.unstable_strictMode===!0&&(E=!0),p.identifierPrefix!==void 0&&(T=p.identifierPrefix),p.onRecoverableError!==void 0&&(N=p.onRecoverableError)),u=VC(u,null,a,1,p??null,E,!1,T,N),a[ya]=u.current,hh(a),w)for(a=0;a<w.length;a++)p=w[a],E=p._getVersion,E=E(p._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[p,E]:u.mutableSourceEagerHydrationData.push(p,E);return new z0(u)},Us.render=function(a,u,p){if(!V0(u))throw Error(n(200));return H0(null,a,u,!1,p)},Us.unmountComponentAtNode=function(a){if(!V0(a))throw Error(n(40));return a._reactRootContainer?(Fc(function(){H0(null,null,a,!1,function(){a._reactRootContainer=null,a[ya]=null})}),!0):!1},Us.unstable_batchedUpdates=F_,Us.unstable_renderSubtreeIntoContainer=function(a,u,p,w){if(!V0(p))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return H0(a,u,p,!1,w)},Us.version="18.3.1-next-f1338f8080-20240426",Us}var vR;function a9(){if(vR)return Q2.exports;vR=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Q2.exports=Fee(),Q2.exports}var yR;function jee(){if(yR)return fg;yR=1;var t=a9();return fg.createRoot=t.createRoot,fg.hydrateRoot=t.hydrateRoot,fg}var zee=jee();const Vee=R1(zee),Hee=t=>{const e=t==null?void 0:t.userId,n=t==null?void 0:t.email;g.useEffect(()=>{ZN({userId:e,email:n})},[e,n])},Ba={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SENTRY_DSN:""};function l9(t){return"init"in t}function gx(t){return typeof t.write=="function"}function Uee(t){return!!t.onMount}function _R(t){return"v"in t||"e"in t}function Gv(t){if("e"in t)throw t.e;if((Ba?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Yv(t){return typeof(t==null?void 0:t.then)=="function"}function Bee(t){if(!(t instanceof Error))return!1;const e=t.name,n=t.message.toLowerCase();return(e==="RangeError"||e==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function c9(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function u9(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const l of i)o.add(l);return o}function Zee(t){return!!t.INTERNAL_onInit}const Wee=(t,e,n,...r)=>n.read(...r),Kee=(t,e,n,...r)=>n.write(...r),qee=(t,e,n)=>n.INTERNAL_onInit(e),Gee=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},Yee=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const o=t[6],l=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),Zee(n)&&l(t,e,n)}return i},Xee=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],c=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=h=>{try{h()}catch(m){d.push(m)}};do{l.f&&f(l.f);const h=new Set;for(const m of s){const v=(n=r.get(m))==null?void 0:n.l;if(v)for(const y of v)h.add(y)}s.clear();for(const m of o)h.add(m);o.clear();for(const m of i)h.add(m);i.clear();for(const m of h)f(m);s.size&&c(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},Qee=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],o=t[14],l=t[17];if(!s.size)return;const c=[],d=[],f=new WeakSet,h=new WeakSet,m=[],v=[];for(const y of s)m.push(y),v.push(i(t,e,y));for(;m.length;){const y=m.length-1,_=m[y],b=v[y];if(h.has(_)){m.pop(),v.pop();continue}if(f.has(_)){if(r.get(_)===b.n)c.push(_),d.push(b);else if((Ba?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");h.add(_),m.pop(),v.pop();continue}f.add(_);for(const x of u9(_,b,n))f.has(x)||(m.push(x),v.push(i(t,e,x)))}for(let y=c.length-1;y>=0;--y){const _=c[y],b=d[y];let x=!1;for(const k of b.d.keys())if(k!==_&&s.has(k)){x=!0;break}x&&(r.set(_,b.n),o(t,e,_),l(t,e,_)),r.delete(_)}},vx=new WeakSet,Jee=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],c=t[6],d=t[7],f=t[11],h=t[12],m=t[13],v=t[14],y=t[16],_=t[17],b=t[20],x=t[26],k=t[28],C=f(t,e,n),P=k[0];if(_R(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===P)return C.m=P,C;let K=!1;for(const[H,ee]of C.d)if(v(t,e,H).n!==ee){K=!0;break}if(!K)return C.m=P,C}let R=!0;const O=new Set(C.d.keys()),I=()=>{for(const K of O)C.d.delete(K)},A=()=>{if(i.has(n)){const K=!l.size;_(t,e,n),K&&(m(t,e),h(t,e))}},M=K=>{var H;if(K===n){const V=f(t,e,K);if(!_R(V))if(l9(K))b(t,e,K,K.init);else throw new Error("no atom init");return Gv(V)}const ee=v(t,e,K);try{return Gv(ee)}finally{O.delete(K),C.d.set(K,ee.n),Yv(C.v)&&c9(n,C.v,ee),i.has(n)&&((H=i.get(K))==null||H.t.add(n)),R||A()}};let L,z;const $={get signal(){return L||(L=new AbortController),L.signal},get setSelf(){return(Ba?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Ba?"production":void 0)!=="production"&&!gx(n)&&console.warn("setSelf function cannot be used with read-only atom"),!z&&gx(n)&&(z=(...K)=>{if((Ba?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)try{return y(t,e,n,K)}finally{m(t,e),h(t,e)}}),z}},q=C.n,X=o.get(n)===q;try{(Ba?"production":void 0)!=="production"&&vx.delete(e);const K=d(t,e,n,M,$);if((Ba?"production":void 0)!=="production"&&vx.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),b(t,e,n,K),Yv(K)){x(t,e,K,()=>L==null?void 0:L.abort());const H=()=>{I(),A()};K.then(H,H)}else I();return(r=c.r)==null||r.call(c,n),C.m=P,C}catch(K){if(Bee(K))throw K;return delete C.v,C.e=K,++C.n,C.m=P,C}finally{R=!1,C.n!==q&&X&&(o.set(n,C.n),l.add(n),(s=c.c)==null||s.call(c,n))}},ete=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),c=i(t,e,l);for(const d of u9(l,c,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},tte=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],c=t[12],d=t[13],f=t[14],h=t[15],m=t[16],v=t[17],y=t[20],_=t[28];let b=!0;const x=C=>Gv(f(t,e,C)),k=(C,...P)=>{var R;const O=l(t,e,C);try{if(C===n){if(!l9(C))throw new Error("atom not writable");(Ba?"production":void 0)!=="production"&&vx.add(e);const I=O.n,A=P[0];y(t,e,C,A),v(t,e,C),I!==O.n&&(++_[0],s.add(C),h(t,e,C),(R=i.c)==null||R.call(i,C));return}else return m(t,e,C,P)}finally{b||(d(t,e),c(t,e))}};try{return o(t,e,n,x,k,...r)}finally{b=!1}},nte=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],c=t[15],d=t[18],f=t[19],h=l(t,e,n),m=s.get(n);if(m&&h.d.size>0){for(const[v,y]of h.d)if(!m.d.has(v)){const _=l(t,e,v);d(t,e,v).t.add(n),m.d.add(v),y!==_.n&&(i.add(v),c(t,e,v),(r=o.c)==null||r.call(o,v))}for(const v of m.d)if(!h.d.has(v)){m.d.delete(v);const y=f(t,e,v);y==null||y.t.delete(n)}}},rte=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],c=t[11],d=t[12],f=t[13],h=t[14],m=t[16],v=t[18],y=c(t,e,n);let _=s.get(n);if(!_){h(t,e,n);for(const b of y.d.keys())v(t,e,b).t.add(n);if(_={l:new Set,d:new Set(y.d.keys()),t:new Set},s.set(n,_),gx(n)&&Uee(n)){const b=()=>{let x=!0;const k=(...C)=>{try{return m(t,e,n,C)}finally{x||(f(t,e),d(t,e))}};try{const C=l(t,e,n,k);C&&(_.u=()=>{x=!0;try{C()}finally{x=!1}})}finally{x=!1}};i.add(b)}(r=o.m)==null||r.call(o,n)}return _},ste=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],c=t[11],d=t[19],f=c(t,e,n);let h=i.get(n);if(!h||h.l.size)return h;let m=!1;for(const v of h.t)if((r=i.get(v))!=null&&r.d.has(n)){m=!0;break}if(!m){h.u&&o.add(h.u),h=void 0,i.delete(n);for(const v of f.d.keys()){const y=d(t,e,v);y==null||y.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return h},ite=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,c=o.v;if(Yv(r))for(const d of o.d.keys())c9(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(c,o.v))&&(++o.n,Yv(c)&&i(t,e,c))},ote=(t,e,n)=>{const r=t[14];return Gv(r(t,e,n))},ate=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],c=s.size;try{return l(t,e,n,r)}finally{s.size!==c&&(o(t,e),i(t,e))}},lte=(t,e,n,r)=>{const s=t[12],i=t[13],o=t[18],l=t[19],d=o(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),l(t,e,n),i(t,e),s(t,e)}},cte=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const o=()=>s.delete(n);n.then(o,o)}i.add(r)},ute=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},d9=new WeakMap;function dte(t){const e=d9.get(t);if((Ba?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");const n=e[24];return n?n(e,t):e}function fte(...t){const e={get(o){return r(n,e,o)},set(o,...l){return s(n,e,o,...l)},sub(o,l){return i(n,e,o,l)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Wee,Kee,qee,Gee,Yee,Xee,Qee,Jee,ete,tte,nte,rte,ste,ite,ote,ate,lte,void 0,new WeakMap,cte,ute,[0]].map((o,l)=>t[l]||o);d9.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const f9={};let hte=0;function gn(t,e){const n=`atom${++hte}`,r={toString(){return(f9?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=pte,r.write=mte),r}function pte(t){return t(this)}function mte(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function gte(){return fte()}let Zh;function vte(){return Zh||(Zh=gte(),(f9?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Zh),globalThis.__JOTAI_DEFAULT_STORE__!==Zh&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Zh}const yte={},_te=g.createContext(void 0);function Lk(t){return g.useContext(_te)||vte()}const yx=t=>typeof(t==null?void 0:t.then)=="function",_x=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},wte=Ee.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(_x(t),t)}),tw=new WeakMap,wR=(t,e,n)=>{const r=dte(t),s=r[26];let i=tw.get(e);return i||(i=new Promise((o,l)=>{let c=e;const d=m=>v=>{c===m&&o(v)},f=m=>v=>{c===m&&l(v)},h=()=>{try{const m=n();yx(m)?(tw.set(m,i),c=m,m.then(d(m),f(m)),s(r,t,m,h)):o(m)}catch(m){l(m)}};e.then(d(e),f(e)),s(r,t,e,h)}),tw.set(e,i)),i};function bt(t,e){const{delay:n,unstable_promiseStatus:r=!Ee.use}={},s=Lk(),[[i,o,l],c]=g.useReducer(f=>{const h=s.get(t);return Object.is(f[0],h)&&f[1]===s&&f[2]===t?f:[h,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(c(),d=s.get(t)),g.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const h=s.get(t);yx(h)&&_x(wR(s,h,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
101
-
102
- Migration guide:
103
-
104
- Create a custom hook like the following.
105
-
106
- function useAtomValueWithDelay<Value>(
107
- atom: Atom<Value>,
108
- options: { delay: number },
109
- ): Value {
110
- const { delay } = options
111
- const store = useStore(options)
112
- const [value, setValue] = useState(() => store.get(atom))
113
- useEffect(() => {
114
- const unsub = store.sub(atom, () => {
115
- setTimeout(() => setValue(store.get(atom)), delay)
116
- })
117
- return unsub
118
- }, [store, atom, delay])
119
- return value
120
- }
121
- `),setTimeout(c,n);return}c()});return c(),f},[s,t,n,r]),g.useDebugValue(d),yx(d)){const f=wR(s,d,()=>s.get(t));return r&&_x(f),wte(f)}return d}function Nt(t,e){const n=Lk();return g.useCallback((...s)=>{if((yte?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function h9(t,e){return[bt(t),Nt(t)]}const Dk=g.createContext({});function $k(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const bte=typeof window<"u",Fk=bte?g.useLayoutEffect:g.useEffect,z1=g.createContext(null);function jk(t,e){t.indexOf(e)===-1&&t.push(e)}function Xv(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ua=(t,e,n)=>n>e?e:n<t?t:n;let V1=()=>{};const uc={},p9=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),m9=t=>typeof t=="object"&&t!==null,g9=t=>/^0[^.\s]+$/u.test(t);function v9(t){let e;return()=>(e===void 0&&(e=t()),e)}const Qi=t=>t,Mm=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Jp=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class zk{constructor(){this.subscriptions=[]}add(e){return jk(this.subscriptions,e),()=>Xv(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Si=t=>t*1e3,Ki=t=>t/1e3,y9=(t,e)=>e?t*(1e3/e):0,_9=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,xte=1e-7,Ste=12;function kte(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=_9(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>xte&&++l<Ste);return o}function Nm(t,e,n,r){if(t===e&&n===r)return Qi;const s=i=>kte(i,0,1,t,n);return i=>i===0||i===1?i:_9(s(i),e,r)}const w9=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,b9=t=>e=>1-t(1-e),x9=Nm(.33,1.53,.69,.99),Vk=b9(x9),S9=w9(Vk),k9=t=>t>=1?1:(t*=2)<1?.5*Vk(t):.5*(2-Math.pow(2,-10*(t-1))),Hk=t=>1-Math.sin(Math.acos(t)),E9=b9(Hk),C9=w9(Hk),Ete=Nm(.42,0,1,1),Cte=Nm(0,0,.58,1),P9=Nm(.42,0,.58,1),Pte=t=>Array.isArray(t)&&typeof t[0]!="number",T9=t=>Array.isArray(t)&&typeof t[0]=="number",Tte={linear:Qi,easeIn:Ete,easeInOut:P9,easeOut:Cte,circIn:Hk,circInOut:C9,circOut:E9,backIn:Vk,backInOut:S9,backOut:x9,anticipate:k9},Rte=t=>typeof t=="string",bR=t=>{if(T9(t)){V1(t.length===4);const[e,n,r,s]=t;return Nm(e,n,r,s)}else if(Rte(t))return Tte[t];return t},hg=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ate(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(c.schedule(d),t()),d(o)}const c={schedule:(d,f=!1,h=!1)=>{const v=h&&r?e:n;return f&&i.add(d),v.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(o=d,r){s=!0;return}r=!0;const f=e;e=n,n=f,e.forEach(l),e.clear(),r=!1,s&&(s=!1,c.process(d))}};return c}const Ite=40;function R9(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=hg.reduce((C,P)=>(C[P]=Ate(i),C),{}),{setup:l,read:c,resolveKeyframes:d,preUpdate:f,update:h,preRender:m,render:v,postRender:y}=o,_=()=>{const C=uc.useManualTiming,P=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(P-s.timestamp,Ite),1)),s.timestamp=P,s.isProcessing=!0,l.process(s),c.process(s),d.process(s),f.process(s),h.process(s),m.process(s),v.process(s),y.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},b=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:hg.reduce((C,P)=>{const R=o[P];return C[P]=(O,I=!1,A=!1)=>(n||b(),R.schedule(O,I,A)),C},{}),cancel:C=>{for(let P=0;P<hg.length;P++)o[hg[P]].cancel(C)},state:s,steps:o}}const{schedule:Cn,cancel:dc,state:Xr,steps:nw}=R9(typeof requestAnimationFrame<"u"?requestAnimationFrame:Qi,!0);let Kg;function Ote(){Kg=void 0}const Ms={now:()=>(Kg===void 0&&Ms.set(Xr.isProcessing||uc.useManualTiming?Xr.timestamp:performance.now()),Kg),set:t=>{Kg=t,queueMicrotask(Ote)}},A9=t=>e=>typeof e=="string"&&e.startsWith(t),I9=A9("--"),Mte=A9("var(--"),Uk=t=>Mte(t)?Nte.test(t.split("/*")[0].trim()):!1,Nte=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function xR(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Gf={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},em={...Gf,transform:t=>ua(0,1,t)},pg={...Gf,default:1},Cp=t=>Math.round(t*1e5)/1e5,Bk=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Lte(t){return t==null}const Dte=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Zk=(t,e)=>n=>!!(typeof n=="string"&&Dte.test(n)&&n.startsWith(t)||e&&!Lte(n)&&Object.prototype.hasOwnProperty.call(n,e)),O9=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(Bk);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},$te=t=>ua(0,255,t),rw={...Gf,transform:t=>Math.round($te(t))},au={test:Zk("rgb","red"),parse:O9("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+rw.transform(t)+", "+rw.transform(e)+", "+rw.transform(n)+", "+Cp(em.transform(r))+")"};function Fte(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const wx={test:Zk("#"),parse:Fte,transform:au.transform},Lm=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),La=Lm("deg"),sa=Lm("%"),Ge=Lm("px"),jte=Lm("vh"),zte=Lm("vw"),SR={...sa,parse:t=>sa.parse(t)/100,transform:t=>sa.transform(t*100)},Hd={test:Zk("hsl","hue"),parse:O9("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+sa.transform(Cp(e))+", "+sa.transform(Cp(n))+", "+Cp(em.transform(r))+")"},_r={test:t=>au.test(t)||wx.test(t)||Hd.test(t),parse:t=>au.test(t)?au.parse(t):Hd.test(t)?Hd.parse(t):wx.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?au.transform(t):Hd.transform(t),getAnimatableNone:t=>{const e=_r.parse(t);return e.alpha=0,_r.transform(e)}},Vte=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Hte(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Bk))==null?void 0:e.length)||0)+(((n=t.match(Vte))==null?void 0:n.length)||0)>0}const M9="number",N9="color",Ute="var",Bte="var(",kR="${}",Zte=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Lf(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(Zte,c=>(_r.test(c)?(r.color.push(i),s.push(N9),n.push(_r.parse(c))):c.startsWith(Bte)?(r.var.push(i),s.push(Ute),n.push(c)):(r.number.push(i),s.push(M9),n.push(parseFloat(c))),++i,kR)).split(kR);return{values:n,split:l,indexes:r,types:s}}function Wte(t){return Lf(t).values}function L9({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const o=e[i];o===M9?s+=Cp(r[i]):o===N9?s+=_r.transform(r[i]):s+=r[i]}return s}}function Kte(t){return L9(Lf(t))}const qte=t=>typeof t=="number"?0:_r.test(t)?_r.getAnimatableNone(t):t,Gte=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:qte(t);function Yte(t){const e=Lf(t);return L9(e)(e.values.map((r,s)=>Gte(r,e.split[s])))}const xo={test:Hte,parse:Wte,createTransformer:Kte,getAnimatableNone:Yte};function sw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Xte({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const l=n<.5?n*(1+e):n+e-n*e,c=2*n-l;s=sw(c,l,t+1/3),i=sw(c,l,t),o=sw(c,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Qv(t,e){return n=>n>0?e:t}const En=(t,e,n)=>t+(e-t)*n,iw=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},Qte=[wx,au,Hd],Jte=t=>Qte.find(e=>e.test(t));function ER(t){const e=Jte(t);if(!e)return!1;let n=e.parse(t);return e===Hd&&(n=Xte(n)),n}const CR=(t,e)=>{const n=ER(t),r=ER(e);if(!n||!r)return Qv(t,e);const s={...n};return i=>(s.red=iw(n.red,r.red,i),s.green=iw(n.green,r.green,i),s.blue=iw(n.blue,r.blue,i),s.alpha=En(n.alpha,r.alpha,i),au.transform(s))},bx=new Set(["none","hidden"]);function ene(t,e){return bx.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function tne(t,e){return n=>En(t,e,n)}function Wk(t){return typeof t=="number"?tne:typeof t=="string"?Uk(t)?Qv:_r.test(t)?CR:sne:Array.isArray(t)?D9:typeof t=="object"?_r.test(t)?CR:nne:Qv}function D9(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Wk(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function nne(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Wk(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function rne(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],l=t.values[o]??0;n[s]=l,r[i]++}return n}const sne=(t,e)=>{const n=xo.createTransformer(e),r=Lf(t),s=Lf(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?bx.has(t)&&!s.values.length||bx.has(e)&&!r.values.length?ene(t,e):Mm(D9(rne(r,s),s.values),n):Qv(t,e)};function $9(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?En(t,e,n):Wk(t)(t,e)}const ine=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Cn.update(e,n),stop:()=>dc(e),now:()=>Xr.isProcessing?Xr.timestamp:Ms.now()}},F9=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Jv=2e4;function Kk(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Jv;)e+=n,r=t.next(e);return e>=Jv?1/0:e}function one(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Kk(r),Jv);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Ki(s)}}const or={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function xx(t,e){return t*Math.sqrt(1-e*e)}const ane=12;function lne(t,e,n){let r=n;for(let s=1;s<ane;s++)r=r-t(r)/e(r);return r}const ow=.001;function cne({duration:t=or.duration,bounce:e=or.bounce,velocity:n=or.velocity,mass:r=or.mass}){let s,i,o=1-e;o=ua(or.minDamping,or.maxDamping,o),t=ua(or.minDuration,or.maxDuration,Ki(t)),o<1?(s=d=>{const f=d*o,h=f*t,m=f-n,v=xx(d,o),y=Math.exp(-h);return ow-m/v*y},i=d=>{const h=d*o*t,m=h*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,y=Math.exp(-h),_=xx(Math.pow(d,2),o);return(-s(d)+ow>0?-1:1)*((m-v)*y)/_}):(s=d=>{const f=Math.exp(-d*t),h=(d-n)*t+1;return-ow+f*h},i=d=>{const f=Math.exp(-d*t),h=(n-d)*(t*t);return f*h});const l=5/t,c=lne(s,i,l);if(t=Si(t),isNaN(c))return{stiffness:or.stiffness,damping:or.damping,duration:t};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const une=["duration","bounce"],dne=["stiffness","damping","mass"];function PR(t,e){return e.some(n=>t[n]!==void 0)}function fne(t){let e={velocity:or.velocity,stiffness:or.stiffness,damping:or.damping,mass:or.mass,isResolvedFromDuration:!1,...t};if(!PR(t,dne)&&PR(t,une))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ua(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:or.mass,stiffness:s,damping:i}}else{const n=cne({...t,velocity:0});e={...e,...n,mass:or.mass},e.isResolvedFromDuration=!0}return e}function e1(t=or.visualDuration,e=or.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:d,mass:f,duration:h,velocity:m,isResolvedFromDuration:v}=fne({...n,velocity:-Ki(n.velocity||0)}),y=m||0,_=d/(2*Math.sqrt(c*f)),b=o-i,x=Ki(Math.sqrt(c/f)),k=Math.abs(b)<5;r||(r=k?or.restSpeed.granular:or.restSpeed.default),s||(s=k?or.restDelta.granular:or.restDelta.default);let C,P,R,O,I,A;if(_<1)R=xx(x,_),O=(y+_*x*b)/R,C=L=>{const z=Math.exp(-_*x*L);return o-z*(O*Math.sin(R*L)+b*Math.cos(R*L))},I=_*x*O+b*R,A=_*x*b-O*R,P=L=>Math.exp(-_*x*L)*(I*Math.sin(R*L)+A*Math.cos(R*L));else if(_===1){C=z=>o-Math.exp(-x*z)*(b+(y+x*b)*z);const L=y+x*b;P=z=>Math.exp(-x*z)*(x*L*z-y)}else{const L=x*Math.sqrt(_*_-1);C=X=>{const K=Math.exp(-_*x*X),H=Math.min(L*X,300);return o-K*((y+_*x*b)*Math.sinh(H)+L*b*Math.cosh(H))/L};const z=(y+_*x*b)/L,$=_*x*z-b*L,q=_*x*b-z*L;P=X=>{const K=Math.exp(-_*x*X),H=Math.min(L*X,300);return K*($*Math.sinh(H)+q*Math.cosh(H))}}const M={calculatedDuration:v&&h||null,velocity:L=>Si(P(L)),next:L=>{if(!v&&_<1){const $=Math.exp(-_*x*L),q=Math.sin(R*L),X=Math.cos(R*L),K=o-$*(O*q+b*X),H=Si($*(I*q+A*X));return l.done=Math.abs(H)<=r&&Math.abs(o-K)<=s,l.value=l.done?o:K,l}const z=C(L);if(v)l.done=L>=h;else{const $=Si(P(L));l.done=Math.abs($)<=r&&Math.abs(o-z)<=s}return l.value=l.done?o:z,l},toString:()=>{const L=Math.min(Kk(M),Jv),z=F9($=>M.next(L*$).value,L,30);return L+"ms "+z},toTransition:()=>{}};return M}e1.applyToOptions=t=>{const e=one(t,100,e1);return t.ease=e.ease,t.duration=Si(e.duration),t.type="keyframes",t};const hne=5;function j9(t,e,n){const r=Math.max(e-hne,0);return y9(n-t(r),e-r)}function Sx({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:f}){const h=t[0],m={done:!1,value:h},v=A=>l!==void 0&&A<l||c!==void 0&&A>c,y=A=>l===void 0?c:c===void 0||Math.abs(l-A)<Math.abs(c-A)?l:c;let _=n*e;const b=h+_,x=o===void 0?b:o(b);x!==b&&(_=x-h);const k=A=>-_*Math.exp(-A/r),C=A=>x+k(A),P=A=>{const M=k(A),L=C(A);m.done=Math.abs(M)<=d,m.value=m.done?x:L};let R,O;const I=A=>{v(m.value)&&(R=A,O=e1({keyframes:[m.value,y(m.value)],velocity:j9(C,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return I(0),{calculatedDuration:null,next:A=>{let M=!1;return!O&&R===void 0&&(M=!0,P(A),I(A)),R!==void 0&&A>=R?O.next(A-R):(!M&&P(A),m)}}}function pne(t,e,n){const r=[],s=n||uc.mix||$9,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||Qi:e;l=Mm(c,l)}r.push(l)}return r}function mne(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(V1(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=pne(e,r,s),c=l.length,d=f=>{if(o&&f<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(f<t[h+1]);h++);const m=Jp(t[h],t[h+1],f);return l[h](m)};return n?f=>d(ua(t[0],t[i-1],f)):d}function gne(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Jp(0,e,r);t.push(En(n,1,s))}}function vne(t){const e=[0];return gne(e,t.length-1),e}function yne(t,e){return t.map(n=>n*e)}function _ne(t,e){return t.map(()=>e||P9).splice(0,t.length-1)}function Pp({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=Pte(r)?r.map(bR):bR(r),i={done:!1,value:e[0]},o=yne(n&&n.length===e.length?n:vne(e),t),l=mne(o,e,{ease:Array.isArray(s)?s:_ne(e,s)});return{calculatedDuration:t,next:c=>(i.value=l(c),i.done=c>=t,i)}}const wne=t=>t!==null;function H1(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(wne),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const bne={decay:Sx,inertia:Sx,tween:Pp,keyframes:Pp,spring:e1};function z9(t){typeof t.type=="string"&&(t.type=bne[t.type])}class qk{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const xne=t=>t/100;class t1 extends qk{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Ms.now()&&this.tick(Ms.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;z9(e);const{type:n=Pp,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const c=n||Pp;c!==Pp&&typeof l[0]!="number"&&(this.mixKeyframes=Mm(xne,$9(l[0],l[1])),l=[0,100]);const d=c({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Kk(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:h,repeatType:m,repeatDelay:v,type:y,onUpdate:_,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-d*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?x<0:x>s;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,P=r;if(h){const A=Math.min(this.currentTime,s)/l;let M=Math.floor(A),L=A%1;!L&&A>=1&&(L=1),L===1&&M--,M=Math.min(M,h+1),!!(M%2)&&(m==="reverse"?(L=1-L,v&&(L-=v/l)):m==="mirror"&&(P=o)),C=ua(0,1,L)*l}let R;k?(this.delayState.value=f[0],R=this.delayState):R=P.next(C),i&&!k&&(R.value=i(R.value));let{done:O}=R;!k&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return I&&y!==Sx&&(R.value=H1(f,this.options,b,this.speed)),_&&_(R.value),I&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return Ki(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ki(e)}get time(){return Ki(this.currentTime)}set time(e){e=Si(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return j9(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(Ms.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Ki(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=ine,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ms.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Sne(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const lu=t=>t*180/Math.PI,kx=t=>{const e=lu(Math.atan2(t[1],t[0]));return Ex(e)},kne={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:kx,rotateZ:kx,skewX:t=>lu(Math.atan(t[1])),skewY:t=>lu(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ex=t=>(t=t%360,t<0&&(t+=360),t),TR=kx,RR=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),AR=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ene={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:RR,scaleY:AR,scale:t=>(RR(t)+AR(t))/2,rotateX:t=>Ex(lu(Math.atan2(t[6],t[5]))),rotateY:t=>Ex(lu(Math.atan2(-t[2],t[0]))),rotateZ:TR,rotate:TR,skewX:t=>lu(Math.atan(t[4])),skewY:t=>lu(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Cx(t){return t.includes("scale")?1:0}function Px(t,e){if(!t||t==="none")return Cx(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Ene,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=kne,s=l}if(!s)return Cx(e);const i=r[e],o=s[1].split(",").map(Pne);return typeof i=="function"?i(o):o[i]}const Cne=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Px(n,e)};function Pne(t){return parseFloat(t.trim())}const Yf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xf=new Set([...Yf,"pathRotation"]),IR=t=>t===Gf||t===Ge,Tne=new Set(["x","y","z"]),Rne=Yf.filter(t=>!Tne.has(t));function Ane(t){const e=[];return Rne.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const ql={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Px(e,"x"),y:(t,{transform:e})=>Px(e,"y")};ql.translateX=ql.x;ql.translateY=ql.y;const ku=new Set;let Tx=!1,Rx=!1,Ax=!1;function V9(){if(Rx){const t=Array.from(ku).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Ane(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))==null||l.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Rx=!1,Tx=!1,ku.forEach(t=>t.complete(Ax)),ku.clear()}function H9(){ku.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Rx=!0)})}function Ine(){Ax=!0,H9(),V9(),Ax=!1}class Gk{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ku.add(this),Tx||(Tx=!0,Cn.read(H9),Cn.resolveKeyframes(V9))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}Sne(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ku.delete(this)}cancel(){this.state==="scheduled"&&(ku.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const One=t=>t.startsWith("--");function U9(t,e,n){One(e)?t.style.setProperty(e,n):t.style[e]=n}const Mne={};function B9(t,e){const n=v9(t);return()=>Mne[e]??n()}const Nne=B9(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Z9=B9(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),lp=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,OR={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lp([0,.65,.55,1]),circOut:lp([.55,0,1,.45]),backIn:lp([.31,.01,.66,-.59]),backOut:lp([.33,1.53,.69,.99])};function W9(t,e){if(t)return typeof t=="function"?Z9()?F9(t,e):"ease-out":T9(t)?lp(t):Array.isArray(t)?t.map(n=>W9(n,e)||OR.easeOut):OR[t]}function Lne(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:c}={},d=void 0){const f={[e]:n};c&&(f.offset=c);const h=W9(l,s);Array.isArray(h)&&(f.easing=h);const m={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(f,m)}function K9(t){return typeof t=="function"&&"applyToOptions"in t}function Dne({type:t,...e}){return K9(t)&&Z9()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class q9 extends qk{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,V1(typeof e.type!="string");const d=Dne(e);this.animation=Lne(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=H1(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),U9(n,r,f),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Ki(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ki(e)}get time(){return Ki(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Si(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Nne()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Qi):s(this)}}const G9={anticipate:k9,backInOut:S9,circInOut:C9};function $ne(t){return t in G9}function Fne(t){typeof t.ease=="string"&&$ne(t.ease)&&(t.ease=G9[t.ease])}const aw=10;class jne extends q9{constructor(e){Fne(e),z9(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const l=new t1({...o,autoplay:!1}),c=Math.max(aw,Ms.now()-this.startTime),d=ua(0,aw,c-aw),f=l.sample(c).value,{name:h}=this.options;i&&h&&U9(i,h,f),n.setWithVelocity(l.sample(Math.max(0,c-d)).value,f,d),l.stop()}}const MR=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(xo.test(t)||t==="0")&&!t.startsWith("url("));function zne(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Vne(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=MR(s,e),l=MR(i,e);return!o||!l?!1:zne(t)||(n==="spring"||K9(n))&&r}function Ix(t){t.duration=0,t.type="keyframes"}const Y9=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Hne=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Une(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Hne.test(t[e]))return!0;return!1}const Bne=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Zne=v9(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Wne(t){var h;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,c=(h=e==null?void 0:e.owner)==null?void 0:h.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return Zne()&&n&&(Y9.has(n)||Bne.has(n)&&Une(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const Kne=40;class qne extends qk{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:c,motionValue:d,element:f,...h}){var y;super(),this.stop=()=>{var _,b;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Ms.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:c,motionValue:d,element:f,...h},v=(f==null?void 0:f.KeyframeResolver)||Gk;this.keyframeResolver=new v(l,(_,b,x)=>this.onKeyframesResolved(_,b,m,!x),c,d,f),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,n,r,s){var x,k;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:c,isHandoff:d,onUpdate:f}=r;this.resolvedAt=Ms.now();let h=!0;Vne(e,i,o,l)||(h=!1,(uc.instantAnimations||!c)&&(f==null||f(H1(e,r,n))),e[0]=e[e.length-1],Ix(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Kne?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},y=h&&!d&&Wne(v),_=(k=(x=v.motionValue)==null?void 0:x.owner)==null?void 0:k.current;let b;if(y)try{b=new jne({...v,element:_})}catch{b=new t1(v)}else b=new t1(v);b.finished.then(()=>{this.notifyFinished()}).catch(Qi),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Ine()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function X9(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,f)=>d.sortNodePosition(f)).indexOf(e),o=t.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const NR=30,Gne=t=>!isNaN(parseFloat(t));class Yne{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Ms.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ms.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Gne(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new zk);const r=this.events[e].add(n);return e==="change"?()=>{r(),Cn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ms.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>NR)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,NR);return y9(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Df(t,e){return new Yne(t,e)}function Q9(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Yk(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Q9(n,t):n}const Xne={type:"spring",stiffness:500,damping:25,restSpeed:10},Qne=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Jne={type:"keyframes",duration:.8},ere={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tre=(t,{keyframes:e})=>e.length>2?Jne:Xf.has(t)?t.startsWith("scale")?Qne(e[1]):Xne:ere,nre=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function rre(t){for(const e in t)if(!nre.has(e))return!0;return!1}const Xk=(t,e,n,r={},s,i)=>o=>{const l=Yk(r,t)||{},c=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Si(c);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:m=>{e.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};rre(l)||Object.assign(f,tre(t,f)),f.duration&&(f.duration=Si(f.duration)),f.repeatDelay&&(f.repeatDelay=Si(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let h=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(Ix(f),f.delay===0&&(h=!0)),(uc.instantAnimations||uc.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(h=!0,Ix(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,h&&!i&&e.get()!==void 0){const m=H1(f.keyframes,l);if(m!==void 0){Cn.update(()=>{f.onUpdate(m),f.onComplete()});return}}return l.isSync?new t1(f):new qne(f)},sre=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ire(t){const e=sre.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function J9(t,e,n=1){const[r,s]=ire(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return p9(o)?parseFloat(o):o}return Uk(s)?J9(s,e,n+1):s}function LR(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Qk(t,e,n,r){if(typeof e=="function"){const[s,i]=LR(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=LR(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function Eu(t,e,n){const r=t.getProps();return Qk(r,e,n!==void 0?n:r.custom,t)}const eL=new Set(["width","height","top","left","right","bottom",...Yf]),Ox=t=>Array.isArray(t);function ore(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Df(n))}function are(t){return Ox(t)?t[t.length-1]||0:t}function lre(t,e){const n=Eu(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=are(i[o]);ore(t,o,l)}}const es=t=>!!(t&&t.getVelocity);function cre(t){return!!(es(t)&&t.add)}function Mx(t,e){const n=t.getValue("willChange");if(cre(n))return n.add(e);if(!n&&uc.WillChange){const r=new uc.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Jk(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ure="framerAppearId",tL="data-"+Jk(ure);function nL(t){return t.props[tL]}function dre({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function rL(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const c=t.getDefaultTransition();i=i?Q9(i,c):c;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],m=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,h);for(const y in l){const _=t.getValue(y,t.latestValues[y]??null),b=l[y];if(b===void 0||m&&dre(m,y))continue;const x={delay:n,...Yk(i||{},y)};f&&(x.skipAnimations=!0);const k=_.get();if(k!==void 0&&!_.isAnimating()&&!Array.isArray(b)&&b===k&&!x.velocity){Cn.update(()=>_.set(b));continue}let C=!1;if(window.MotionHandoffAnimation){const O=nL(t);if(O){const I=window.MotionHandoffAnimation(O,y,Cn);I!==null&&(x.startTime=I,C=!0)}}Mx(t,y);const P=d??t.shouldReduceMotion;_.start(Xk(y,_,b,P&&eL.has(y)?{type:!1}:x,t,C));const R=_.animation;R&&h.push(R)}if(o){const y=()=>Cn.update(()=>{o&&lre(t,o)});h.length?Promise.all(h).then(y):y()}return h}function Nx(t,e,n={}){var c;const r=Eu(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(rL(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:m}=s;return fre(t,e,d,f,h,m,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,f]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function fre(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),l.push(Nx(c,e,{...o,delay:n+(typeof r=="function"?0:r)+X9(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(l)}function hre(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Nx(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Nx(t,e,n);else{const s=typeof e=="function"?Eu(t,e,n.custom):e;r=Promise.all(rL(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const pre={test:t=>t==="auto",parse:t=>t},sL=t=>e=>e.test(t),iL=[Gf,Ge,sa,La,zte,jte,pre],DR=t=>iL.find(sL(t));function mre(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||g9(t):!0}const gre=new Set(["brightness","contrast","saturate","opacity"]);function vre(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Bk)||[];if(!r)return t;const s=n.replace(r,"");let i=gre.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const yre=/\b([a-z-]*)\(.*?\)/gu,Lx={...xo,getAnimatableNone:t=>{const e=t.match(yre);return e?e.map(vre).join(" "):t}},Dx={...xo,getAnimatableNone:t=>{const e=xo.parse(t);return xo.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},$R={...Gf,transform:Math.round},_re={rotate:La,pathRotation:La,rotateX:La,rotateY:La,rotateZ:La,scale:pg,scaleX:pg,scaleY:pg,scaleZ:pg,skew:La,skewX:La,skewY:La,distance:Ge,translateX:Ge,translateY:Ge,translateZ:Ge,x:Ge,y:Ge,z:Ge,perspective:Ge,transformPerspective:Ge,opacity:em,originX:SR,originY:SR,originZ:Ge},n1={borderWidth:Ge,borderTopWidth:Ge,borderRightWidth:Ge,borderBottomWidth:Ge,borderLeftWidth:Ge,borderRadius:Ge,borderTopLeftRadius:Ge,borderTopRightRadius:Ge,borderBottomRightRadius:Ge,borderBottomLeftRadius:Ge,width:Ge,maxWidth:Ge,height:Ge,maxHeight:Ge,top:Ge,right:Ge,bottom:Ge,left:Ge,inset:Ge,insetBlock:Ge,insetBlockStart:Ge,insetBlockEnd:Ge,insetInline:Ge,insetInlineStart:Ge,insetInlineEnd:Ge,padding:Ge,paddingTop:Ge,paddingRight:Ge,paddingBottom:Ge,paddingLeft:Ge,paddingBlock:Ge,paddingBlockStart:Ge,paddingBlockEnd:Ge,paddingInline:Ge,paddingInlineStart:Ge,paddingInlineEnd:Ge,margin:Ge,marginTop:Ge,marginRight:Ge,marginBottom:Ge,marginLeft:Ge,marginBlock:Ge,marginBlockStart:Ge,marginBlockEnd:Ge,marginInline:Ge,marginInlineStart:Ge,marginInlineEnd:Ge,fontSize:Ge,backgroundPositionX:Ge,backgroundPositionY:Ge,..._re,zIndex:$R,fillOpacity:em,strokeOpacity:em,numOctaves:$R},wre={...n1,color:_r,backgroundColor:_r,outlineColor:_r,fill:_r,stroke:_r,borderColor:_r,borderTopColor:_r,borderRightColor:_r,borderBottomColor:_r,borderLeftColor:_r,filter:Lx,WebkitFilter:Lx,mask:Dx,WebkitMask:Dx},oL=t=>wre[t],bre=new Set([Lx,Dx]);function aL(t,e){let n=oL(t);return bre.has(n)||(n=xo),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const xre=new Set(["auto","none","0"]);function Sre(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!xre.has(i)&&Lf(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=aL(n,s)}class kre extends Gk{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let h=e[f];if(typeof h=="string"&&(h=h.trim(),Uk(h))){const m=J9(h,n.current);m!==void 0&&(e[f]=m),f===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!eL.has(r)||e.length!==2)return;const[s,i]=e,o=DR(s),l=DR(i),c=xR(s),d=xR(i);if(c!==d&&ql[r]){this.needsMeasurement=!0;return}if(o!==l)if(IR(o)&&IR(l))for(let f=0;f<e.length;f++){const h=e[f];typeof h=="string"&&(e[f]=parseFloat(h))}else ql[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||mre(e[s]))&&r.push(s);r.length&&Sre(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ql[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=ql[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,d])=>{e.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const e6=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function lL(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const $x=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function qg(t){return m9(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:t6}=R9(queueMicrotask,!1),po={x:!1,y:!1};function cL(){return po.x||po.y}function Ere(t){return t==="x"||t==="y"?po[t]?null:(po[t]=!0,()=>{po[t]=!1}):po.x||po.y?null:(po.x=po.y=!0,()=>{po.x=po.y=!1})}function uL(t,e){const n=lL(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function Cre(t){return!(t.pointerType==="touch"||cL())}function Pre(t,e,n={}){const[r,s,i]=uL(t,n);return r.forEach(o=>{let l=!1,c=!1,d;const f=()=>{o.removeEventListener("pointerleave",y)},h=b=>{d&&(d(b),d=void 0),f()},m=b=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,h(b))},v=()=>{l=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},y=b=>{if(b.pointerType!=="touch"){if(l){c=!0;return}h(b)}},_=b=>{if(!Cre(b))return;c=!1;const x=e(o,b);typeof x=="function"&&(d=x,o.addEventListener("pointerleave",y,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",v,s)}),i}const dL=(t,e)=>e?t===e?!0:dL(t,e.parentElement):!1,n6=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Tre=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Rre(t){return Tre.has(t.tagName)||t.isContentEditable===!0}const Are=new Set(["INPUT","SELECT","TEXTAREA"]);function Ire(t){return Are.has(t.tagName)||t.isContentEditable===!0}const Gg=new WeakSet;function FR(t){return e=>{e.key==="Enter"&&t(e)}}function lw(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ore=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=FR(()=>{if(Gg.has(n))return;lw(n,"down");const s=FR(()=>{lw(n,"up")}),i=()=>lw(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function jR(t){return n6(t)&&!cL()}const zR=new WeakSet;function Mre(t,e,n={}){const[r,s,i]=uL(t,n),o=l=>{const c=l.currentTarget;if(!jR(l)||zR.has(l))return;Gg.add(c),n.stopPropagation&&zR.add(l);const d=e(c,l),f={...s,capture:!0},h=(y,_)=>{window.removeEventListener("pointerup",m,f),window.removeEventListener("pointercancel",v,f),Gg.has(c)&&Gg.delete(c),jR(y)&&typeof d=="function"&&d(y,{success:_})},m=y=>{h(y,c===window||c===document||n.useGlobalTarget||dL(c,y.target))},v=y=>{h(y,!1)};window.addEventListener("pointerup",m,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),qg(l)&&(l.addEventListener("focus",d=>Ore(d,s)),!Rre(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function r6(t){return m9(t)&&"ownerSVGElement"in t}const Yg=new WeakMap;let Ol;const fL=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:r6(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Nre=fL("inline","width","offsetWidth"),Lre=fL("block","height","offsetHeight");function Dre({target:t,borderBoxSize:e}){var n;(n=Yg.get(t))==null||n.forEach(r=>{r(t,{get width(){return Nre(t,e)},get height(){return Lre(t,e)}})})}function $re(t){t.forEach(Dre)}function Fre(){typeof ResizeObserver>"u"||(Ol=new ResizeObserver($re))}function jre(t,e){Ol||Fre();const n=lL(t);return n.forEach(r=>{let s=Yg.get(r);s||(s=new Set,Yg.set(r,s)),s.add(e),Ol==null||Ol.observe(r)}),()=>{n.forEach(r=>{const s=Yg.get(r);s==null||s.delete(e),s!=null&&s.size||Ol==null||Ol.unobserve(r)})}}const Xg=new Set;let Ud;function zre(){Ud=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xg.forEach(e=>e(t))},window.addEventListener("resize",Ud)}function Vre(t){return Xg.add(t),Ud||zre(),()=>{Xg.delete(t),!Xg.size&&typeof Ud=="function"&&(window.removeEventListener("resize",Ud),Ud=void 0)}}function VR(t,e){return typeof t=="function"?Vre(t):jre(t,e)}function Hre(t){return r6(t)&&t.tagName==="svg"}const Ure=[...iL,_r,xo],Bre=t=>Ure.find(sL(t)),HR=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bd=()=>({x:HR(),y:HR()}),UR=()=>({min:0,max:0}),Ar=()=>({x:UR(),y:UR()}),Zre=new WeakMap;function U1(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function tm(t){return typeof t=="string"||Array.isArray(t)}const s6=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],i6=["initial",...s6];function B1(t){return U1(t.animate)||i6.some(e=>tm(t[e]))}function hL(t){return!!(B1(t)||t.variants)}function Wre(t,e,n){for(const r in e){const s=e[r],i=n[r];if(es(s))t.addValue(r,s);else if(es(i))t.addValue(r,Df(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,Df(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const r1={current:null},o6={current:!1},Kre=typeof window<"u";function pL(){if(o6.current=!0,!!Kre)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>r1.current=t.matches;t.addEventListener("change",e),e()}else r1.current=!1}const BR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let s1={};function mL(t){s1=t}function qre(){return s1}class Gre{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Gk,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=Ms.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Cn.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=B1(n),this.isVariantNode=hL(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in m){const y=m[v];d[v]!==void 0&&es(y)&&y.set(d[v])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,Zre.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(o6.current||pL(),this.shouldReduceMotion=r1.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),dc(this.notifyUpdate),dc(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Y9.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:d,duration:f}=n.accelerate,h=new q9({element:this.current,name:e,keyframes:l,times:c,ease:d,duration:Si(f)}),m=o(h);this.valueSubscriptions.set(e,()=>{m(),h.cancel()});return}const r=Xf.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Cn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in s1){const n=s1[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ar()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<BR.length;r++){const s=BR[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Wre(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Df(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(p9(r)||g9(r))?r=parseFloat(r):!Bre(r)&&xo.test(n)&&(r=aL(e,n)),this.setBaseTarget(e,es(r)?r.get():r)),es(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Qk(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!es(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new zk),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){t6.render(this.render)}}class gL extends Gre{constructor(){super(...arguments),this.KeyframeResolver=kre}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;es(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class wc{constructor(e){this.isMounted=!1,this.node=e}update(){}}function vL({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Yre({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Xre(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function cw(t){return t===void 0||t===1}function Fx({scale:t,scaleX:e,scaleY:n}){return!cw(t)||!cw(e)||!cw(n)}function su(t){return Fx(t)||yL(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function yL(t){return ZR(t.x)||ZR(t.y)}function ZR(t){return t&&t!=="0%"}function i1(t,e,n){const r=t-n,s=e*r;return n+s}function WR(t,e,n,r,s){return s!==void 0&&(t=i1(t,s,r)),i1(t,n,r)+e}function jx(t,e=0,n=1,r,s){t.min=WR(t.min,e,n,r,s),t.max=WR(t.max,e,n,r,s)}function _L(t,{x:e,y:n}){jx(t.x,e.translate,e.scale,e.originPoint),jx(t.y,n.translate,n.scale,n.originPoint)}const KR=.999999999999,qR=1.0000000000001;function Qre(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let c=0;c<s;c++){i=n[c],o=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Yo(t.x,-i.scroll.offset.x),Yo(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,_L(t,o)),r&&su(i.latestValues)&&Qg(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<qR&&e.x>KR&&(e.x=1),e.y<qR&&e.y>KR&&(e.y=1)}function Yo(t,e){t.min+=e,t.max+=e}function GR(t,e,n,r,s=.5){const i=En(t.min,t.max,s);jx(t,e,n,i,r)}function YR(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Qg(t,e,n){const r=n??t;GR(t.x,YR(e.x,r.x),e.scaleX,e.scale,e.originX),GR(t.y,YR(e.y,r.y),e.scaleY,e.scale,e.originY)}function wL(t,e){return vL(Xre(t.getBoundingClientRect(),e))}function Jre(t,e,n){const r=wL(t,n),{scroll:s}=e;return s&&(Yo(r.x,s.offset.x),Yo(r.y,s.offset.y)),r}const ese={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tse=Yf.length;function nse(t,e,n){let r="",s=!0;for(let o=0;o<tse;o++){const l=Yf[o],c=t[l];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(l.startsWith("scale")?1:0);else{const f=parseFloat(c);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=$x(c,n1[l]);if(!d){s=!1;const h=ese[l]||l;r+=`${h}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${$x(i,n1.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function a6(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const c in e){const d=e[c];if(Xf.has(c)){o=!0;continue}else if(I9(c)){s[c]=d;continue}else{const f=$x(d,n1[c]);c.startsWith("origin")?(l=!0,i[c]=f):r[c]=f}}if(e.transform||(o||n?r.transform=nse(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${c} ${d} ${f}`}}function bL(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function XR(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Wh={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ge.test(t))t=parseFloat(t);else return t;const n=XR(t,e.target.x),r=XR(t,e.target.y);return`${n}% ${r}%`}},rse={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=xo.parse(t);if(s.length>5)return r;const i=xo.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,c=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=c;const d=En(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},zx={borderRadius:{...Wh,applyTo:[...e6]},borderTopLeftRadius:Wh,borderTopRightRadius:Wh,borderBottomLeftRadius:Wh,borderBottomRightRadius:Wh,boxShadow:rse};function xL(t,{layout:e,layoutId:n}){return Xf.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!zx[t]||t==="opacity")}function l6(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const l in r)(es(r[l])||s&&es(s[l])||xL(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function sse(t){return window.getComputedStyle(t)}class ise extends gL{constructor(){super(...arguments),this.type="html",this.renderInstance=bL}mount(e){V1(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(Xf.has(n))return(r=this.projection)!=null&&r.isProjecting?Cx(n):Cne(e,n);{const s=sse(e),i=(I9(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return wL(e,n)}build(e,n,r){a6(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return l6(e,n,r)}}const ose={offset:"stroke-dashoffset",array:"stroke-dasharray"},ase={offset:"strokeDashoffset",array:"strokeDasharray"};function lse(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?ose:ase;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const cse=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function SL(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},c,d,f){if(a6(t,l,d),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:m}=t;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete h.transformBox);for(const v of cse)h[v]!==void 0&&(m[v]=h[v],delete h[v]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&lse(h,s,i,o,!1)}const kL=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),EL=t=>typeof t=="string"&&t.toLowerCase()==="svg";function use(t,e,n,r){bL(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(kL.has(s)?s:Jk(s),e.attrs[s])}function CL(t,e,n){const r=l6(t,e,n);for(const s in t)if(es(t[s])||es(e[s])){const i=Yf.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class dse extends gL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ar}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Xf.has(n)){const r=oL(n);return r&&r.default||0}return n=kL.has(n)?n:Jk(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return CL(e,n,r)}build(e,n,r){SL(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){use(e,n,r,s)}mount(e){this.isSVGTag=EL(e.tagName),super.mount(e)}}const fse=i6.length;function PL(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?PL(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<fse;n++){const r=i6[n],s=t.props[r];(tm(s)||s===!1)&&(e[r]=s)}return e}function TL(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const hse=[...s6].reverse(),pse=s6.length;function mse(t){return e=>Promise.all(e.map(({animation:n,options:r})=>hre(t,n,r)))}function gse(t){let e=mse(t),n=QR(),r=!0,s=!1;const i=d=>(f,h)=>{var v;const m=Eu(t,h,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(m){const{transition:y,transitionEnd:_,...b}=m;f={...f,...b,..._}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,h=PL(t.parent)||{},m=[],v=new Set;let y={},_=1/0;for(let x=0;x<pse;x++){const k=hse[x],C=n[k],P=f[k]!==void 0?f[k]:h[k],R=tm(P),O=k===d?C.isActive:null;O===!1&&(_=x);let I=P===h[k]&&P!==f[k]&&R;if(I&&(r||s)&&t.manuallyAnimateOnMount&&(I=!1),C.protectedKeys={...y},!C.isActive&&O===null||!P&&!C.prevProp||U1(P)||typeof P=="boolean")continue;if(k==="exit"&&C.isActive&&O!==!0){C.prevResolvedValues&&(y={...y,...C.prevResolvedValues});continue}const A=vse(C.prevProp,P);let M=A||k===d&&C.isActive&&!I&&R||x>_&&R,L=!1;const z=Array.isArray(P)?P:[P];let $=z.reduce(i(k),{});O===!1&&($={});const{prevResolvedValues:q={}}=C,X={...q,...$},K=V=>{M=!0,v.has(V)&&(L=!0,v.delete(V)),C.needsAnimating[V]=!0;const Q=t.getValue(V);Q&&(Q.liveStyle=!1)};for(const V in X){const Q=$[V],B=q[V];if(y.hasOwnProperty(V))continue;let D=!1;Ox(Q)&&Ox(B)?D=!TL(Q,B)||A:D=Q!==B,D?Q!=null?K(V):v.add(V):Q!==void 0&&v.has(V)?K(V):C.protectedKeys[V]=!0}C.prevProp=P,C.prevResolvedValues=$,C.isActive&&(y={...y,...$}),(r||s)&&t.blockInitialAnimation&&(M=!1);const H=I&&A;M&&(!H||L)&&m.push(...z.map(V=>{const Q={type:k};if(typeof V=="string"&&(r||s)&&!H&&t.manuallyAnimateOnMount&&t.parent){const{parent:B}=t,D=Eu(B,V);if(B.enteringChildren&&D){const{delayChildren:G}=D.transition||{};Q.delay=X9(B.enteringChildren,t,G)}}return{animation:V,options:Q}}))}if(v.size){const x={};if(typeof f.initial!="boolean"){const k=Eu(t,Array.isArray(f.initial)?f.initial[0]:f.initial);k&&k.transition&&(x.transition=k.transition)}v.forEach(k=>{const C=t.getBaseTarget(k),P=t.getValue(k);P&&(P.liveStyle=!0),x[k]=C??null}),m.push({animation:x})}let b=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(b=!1),r=!1,s=!1,b?e(m):Promise.resolve()}function c(d,f){var m;if(n[d].isActive===f)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(v=>{var y;return(y=v.animationState)==null?void 0:y.setActive(d,f)}),n[d].isActive=f;const h=l(d);for(const v in n)n[v].protectedKeys={};return h}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=QR(),s=!0}}}function vse(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!TL(e,t):!1}function Kc(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function QR(){return{animate:Kc(!0),whileInView:Kc(),whileHover:Kc(),whileTap:Kc(),whileDrag:Kc(),whileFocus:Kc(),exit:Kc()}}function Vx(t,e){t.min=e.min,t.max=e.max}function fo(t,e){Vx(t.x,e.x),Vx(t.y,e.y)}function JR(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const RL=1e-4,yse=1-RL,_se=1+RL,AL=.01,wse=0-AL,bse=0+AL;function Ns(t){return t.max-t.min}function xse(t,e,n){return Math.abs(t-e)<=n}function eA(t,e,n,r=.5){t.origin=r,t.originPoint=En(e.min,e.max,t.origin),t.scale=Ns(n)/Ns(e),t.translate=En(n.min,n.max,t.origin)-t.originPoint,(t.scale>=yse&&t.scale<=_se||isNaN(t.scale))&&(t.scale=1),(t.translate>=wse&&t.translate<=bse||isNaN(t.translate))&&(t.translate=0)}function Tp(t,e,n,r){eA(t.x,e.x,n.x,r?r.originX:void 0),eA(t.y,e.y,n.y,r?r.originY:void 0)}function tA(t,e,n,r=0){const s=r?En(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Ns(e)}function Sse(t,e,n,r){tA(t.x,e.x,n.x,r==null?void 0:r.x),tA(t.y,e.y,n.y,r==null?void 0:r.y)}function nA(t,e,n,r=0){const s=r?En(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Ns(e)}function o1(t,e,n,r){nA(t.x,e.x,n.x,r==null?void 0:r.x),nA(t.y,e.y,n.y,r==null?void 0:r.y)}function rA(t,e,n,r,s){return t-=e,t=i1(t,1/n,r),s!==void 0&&(t=i1(t,1/s,r)),t}function kse(t,e=0,n=1,r=.5,s,i=t,o=t){if(sa.test(e)&&(e=parseFloat(e),e=En(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=En(i.min,i.max,r);t===i&&(l-=e),t.min=rA(t.min,e,n,l,s),t.max=rA(t.max,e,n,l,s)}function sA(t,e,[n,r,s],i,o){kse(t,e[n],e[r],e[s],e.scale,i,o)}const Ese=["x","scaleX","originX"],Cse=["y","scaleY","originY"];function iA(t,e,n,r){sA(t.x,e,Ese,n?n.x:void 0,r?r.x:void 0),sA(t.y,e,Cse,n?n.y:void 0,r?r.y:void 0)}function oA(t){return t.translate===0&&t.scale===1}function IL(t){return oA(t.x)&&oA(t.y)}function aA(t,e){return t.min===e.min&&t.max===e.max}function Pse(t,e){return aA(t.x,e.x)&&aA(t.y,e.y)}function lA(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function OL(t,e){return lA(t.x,e.x)&&lA(t.y,e.y)}function cA(t){return Ns(t.x)/Ns(t.y)}function uA(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Bo(t){return[t("x"),t("y")]}function Tse(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:h,rotateX:m,rotateY:v,skewX:y,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),v&&(r+=`rotateY(${v}deg) `),y&&(r+=`skewX(${y}deg) `),_&&(r+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,c=t.y.scale*e.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Rse=e6.length,dA=t=>typeof t=="string"?parseFloat(t):t,fA=t=>typeof t=="number"||Ge.test(t);function Ase(t,e,n,r,s,i){s?(t.opacity=En(0,n.opacity??1,Ise(r)),t.opacityExit=En(e.opacity??1,0,Ose(r))):i&&(t.opacity=En(e.opacity??1,n.opacity??1,r));for(let o=0;o<Rse;o++){const l=e6[o];let c=hA(e,l),d=hA(n,l);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||fA(c)===fA(d)?(t[l]=Math.max(En(dA(c),dA(d),r),0),(sa.test(d)||sa.test(c))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=En(e.rotate||0,n.rotate||0,r))}function hA(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Ise=ML(0,.5,E9),Ose=ML(.5,.95,Qi);function ML(t,e,n){return r=>r<t?0:r>e?1:n(Jp(t,e,r))}function Mse(t,e,n){const r=es(t)?t:Df(t);return r.start(Xk("",r,e,n)),r.animation}function nm(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const Nse=(t,e)=>t.depth-e.depth;class Lse{constructor(){this.children=[],this.isDirty=!1}add(e){jk(this.children,e),this.isDirty=!0}remove(e){Xv(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Nse),this.isDirty=!1,this.children.forEach(e)}}function Dse(t,e){const n=Ms.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(dc(r),t(i-e))};return Cn.setup(r,!0),()=>dc(r)}function Jg(t){return es(t)?t.get():t}class $se{constructor(){this.members=[]}add(e){jk(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Xv(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Xv(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const ev={hasAnimatedSinceResize:!0,hasEverUpdated:!1},uw=["","X","Y","Z"],Fse=1e3;let jse=0;function dw(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function NL(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=nL(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Cn,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&NL(r)}function LL({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=jse++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Hse),this.nodes.forEach(qse),this.nodes.forEach(Gse),this.nodes.forEach(Use)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Lse)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new zk),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=r6(o)&&!Hre(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),t){let f,h=0;const m=()=>this.root.updateBlockedByResize=!1;Cn.read(()=>{h=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==h&&(h=v,this.root.updateBlockedByResize=!0,f&&f(),f=Dse(m,250),ev.hasAnimatedSinceResize&&(ev.hasAnimatedSinceResize=!1,this.nodes.forEach(gA)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||eie,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=d.getProps(),x=!this.targetLayout||!OL(this.targetLayout,v),k=!h&&m;if(this.options.layoutRoot||this.resumeFrom||k||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Yk(y,"layout"),onPlay:_,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,k,C.path)}else h||gA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),dc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Yse),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&NL(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const h=this.path[f];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Zse),this.nodes.forEach(pA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(mA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Wse),this.nodes.forEach(Kse),this.nodes.forEach(zse),this.nodes.forEach(Vse)):this.nodes.forEach(mA),this.clearAllSnapshots();const l=Ms.now();Xr.delta=ua(0,1e3/60,l-Xr.timestamp),Xr.timestamp=l,Xr.isProcessing=!0,nw.update.process(Xr),nw.preRender.process(Xr),nw.render.process(Xr),Xr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,t6.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Bse),this.sharedNodes.forEach(Xse)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Cn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Cn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ns(this.snapshot.measuredBox.x)&&!Ns(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ar()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!IL(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||su(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),tie(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Ar();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(nie))){const{scroll:f}=this.root;f&&(Yo(l.x,f.offset.x),Yo(l.y,f.offset.y))}return l}removeElementScroll(o){var c;const l=Ar();if(fo(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:h,options:m}=f;f!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&fo(l,o),Yo(l.x,h.offset.x),Yo(l.y,h.offset.y))}return l}applyTransform(o,l=!1,c){var f,h;const d=c||Ar();fo(d,o);for(let m=0;m<this.path.length;m++){const v=this.path[m];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Yo(d.x,-v.scroll.offset.x),Yo(d.y,-v.scroll.offset.y)),su(v.latestValues)&&Qg(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return su(this.latestValues)&&Qg(d,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),d}removeTransform(o){var c;const l=Ar();fo(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!su(f.latestValues))continue;let h;f.instance&&(Fx(f.latestValues)&&f.updateSnapshot(),h=Ar(),fo(h,f.measurePageBox())),iA(l,f.latestValues,(c=f.snapshot)==null?void 0:c.layoutBox,h)}return su(this.latestValues)&&iA(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Xr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!this.layout||!(f||h))return;this.resolvedRelativeTargetAt=Xr.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ar(),this.targetWithTransforms=Ar()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Sse(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):fo(this.target,this.layout.layoutBox),_L(this.target,this.targetDelta)):fo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Fx(this.parent.latestValues)||yL(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ar(),this.relativeTargetOrigin=Ar(),o1(this.relativeTargetOrigin,l,c,this.options.layoutAnchor||void 0),fo(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Xr.timestamp&&(c=!1),c)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;fo(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;Qre(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ar());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(JR(this.prevProjectionDelta.x,this.projectionDelta.x),JR(this.prevProjectionDelta.y,this.projectionDelta.y)),Tp(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!uA(this.projectionDelta.x,this.prevProjectionDelta.x)||!uA(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Bd(),this.projectionDelta=Bd(),this.projectionDeltaWithTransform=Bd()}setAnimationOrigin(o,l=!1,c){const d=this.snapshot,f=d?d.latestValues:{},h={...this.latestValues},m=Bd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=Ar(),y=d?d.source:void 0,_=this.layout?this.layout.source:void 0,b=y!==_,x=this.getStack(),k=!x||x.members.length<=1,C=!!(b&&!k&&this.options.crossfade===!0&&!this.path.some(Jse));this.animationProgress=0;let P;const R=c==null?void 0:c.interpolateProjection(o);this.mixTargetDelta=O=>{const I=O/1e3,A=R==null?void 0:R(I);A?(m.x.translate=A.x,m.x.scale=En(o.x.scale,1,I),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=A.y,m.y.scale=En(o.y.scale,1,I),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(vA(m.x,o.x,I),vA(m.y,o.y,I)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(o1(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Qse(this.relativeTarget,this.relativeTargetOrigin,v,I),P&&Pse(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=Ar()),fo(P,this.relativeTarget)),b&&(this.animationValues=h,Ase(h,f,this.latestValues,I,C,k)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(dc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Cn.update(()=>{ev.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Df(0)),this.motionValue.jump(0,!1),this.currentAnimation=Mse(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Fse),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:f}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&DL(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Ar();const h=Ns(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const m=Ns(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+m}fo(l,c),Qg(l,f),Tp(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new $se),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const d={};c.z&&dw("z",o,d,this.animationValues);for(let f=0;f<uw.length;f++)dw(`rotate${uw[f]}`,o,d,this.animationValues),dw(`skew${uw[f]}`,o,d,this.animationValues);o.render();for(const f in d)o.setStaticValue(f,d[f]),this.animationValues&&(this.animationValues[f]=d[f]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Jg(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Jg(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!su(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let h=Tse(this.projectionDeltaWithTransform,this.treeScale,f);c&&(h=c(f,h)),o.transform=h;const{x:m,y:v}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:o.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const y in zx){if(f[y]===void 0)continue;const{correct:_,applyTo:b,isCSSVariable:x}=zx[y],k=h==="none"?f[y]:_(f[y],d);if(b){const C=b.length;for(let P=0;P<C;P++)o[b[P]]=k}else x?this.options.visualElement.renderState.vars[y]=k:o[y]=k}this.options.layoutId&&(o.pointerEvents=d===this?Jg(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(pA),this.root.sharedNodes.clear()}}}function zse(t){t.updateLayout()}function Vse(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Bo(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],v=Ns(m);m.min=r[h].min,m.max=m.min+v});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";Vx(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else DL(i,e.layoutBox,r)&&Bo(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],v=Ns(r[h]);m.max=m.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+v)});const l=Bd();Tp(l,r,e.layoutBox);const c=Bd();o?Tp(c,t.applyTransform(s,!0),e.measuredBox):Tp(c,r,e.layoutBox);const d=!IL(l);let f=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:v}=h;if(m&&v){const y=t.options.layoutAnchor||void 0,_=Ar();o1(_,e.layoutBox,m.layoutBox,y);const b=Ar();o1(b,r,v.layoutBox,y),OL(_,b)||(f=!0),h.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=_,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Hse(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Use(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Bse(t){t.clearSnapshot()}function pA(t){t.clearMeasurements()}function Zse(t){t.isLayoutDirty=!0,t.updateLayout()}function mA(t){t.isLayoutDirty=!1}function Wse(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Kse(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function gA(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function qse(t){t.resolveTargetDelta()}function Gse(t){t.calcProjection()}function Yse(t){t.resetSkewAndRotation()}function Xse(t){t.removeLeadSnapshot()}function vA(t,e,n){t.translate=En(e.translate,0,n),t.scale=En(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function yA(t,e,n,r){t.min=En(e.min,n.min,r),t.max=En(e.max,n.max,r)}function Qse(t,e,n,r){yA(t.x,e.x,n.x,r),yA(t.y,e.y,n.y,r)}function Jse(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const eie={duration:.45,ease:[.4,0,.1,1]},_A=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),wA=_A("applewebkit/")&&!_A("chrome/")?Math.round:Qi;function bA(t){t.min=wA(t.min),t.max=wA(t.max)}function tie(t){bA(t.x),bA(t.y)}function DL(t,e,n){return t==="position"||t==="preserve-aspect"&&!xse(cA(e),cA(n),.2)}function nie(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const rie=LL({attachResizeListener:(t,e)=>nm(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),fw={current:void 0},$L=LL({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!fw.current){const t=new rie({});t.mount(window),t.setOptions({layoutScroll:!0}),fw.current=t}return fw.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),c6=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function xA(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function sie(...t){return e=>{let n=!1;const r=t.map(s=>{const i=xA(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():xA(t[s],null)}}}}function iie(...t){return g.useCallback(sie(...t),t)}class oie extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(qg(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=qg(r)&&r.offsetWidth||0,i=qg(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function aie({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const o=g.useId(),l=g.useRef(null),c=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=g.useContext(c6),f=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,h=iie(l,f);return g.useInsertionEffect(()=>{const{width:v,height:y,top:_,left:b,right:x,bottom:k,direction:C}=c.current;if(e||i===!1||!l.current||!v||!y)return;const P=C==="rtl",R=n==="left"?P?`right: ${x}`:`left: ${b}`:P?`left: ${b}`:`right: ${x}`,O=r==="bottom"?`bottom: ${k}`:`top: ${_}`;l.current.dataset.motionPopId=o;const I=document.createElement("style");d&&(I.nonce=d);const A=s??document.head;return A.appendChild(I),I.sheet&&I.sheet.insertRule(`
122
- [data-motion-pop-id="${o}"] {
123
- position: absolute !important;
124
- width: ${v}px !important;
125
- height: ${y}px !important;
126
- ${R}px !important;
127
- ${O}px !important;
128
- }
129
- `),()=>{var M;(M=l.current)==null||M.removeAttribute("data-motion-pop-id"),A.contains(I)&&A.removeChild(I)}},[e]),S.jsx(oie,{isPresent:e,childRef:l,sizeRef:c,pop:i,children:i===!1?t:g.cloneElement(t,{ref:h})})}const lie=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:c,root:d})=>{const f=$k(cie),h=g.useId(),m=g.useRef(n),v=g.useRef(r);Fk(()=>{m.current=n,v.current=r});let y=!0,_=g.useMemo(()=>(y=!1,{id:h,initial:e,isPresent:n,custom:s,onExitComplete:b=>{f.set(b,!0);for(const x of f.values())if(!x)return;r&&r()},register:b=>(f.set(b,!1),()=>{var x;f.delete(b),!m.current&&!f.size&&((x=v.current)==null||x.call(v))})}),[n,f,r]);return i&&y&&(_={..._}),g.useMemo(()=>{f.forEach((b,x)=>f.set(x,!1))},[n]),g.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=S.jsx(aie,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:c,root:d,children:t}),S.jsx(z1.Provider,{value:_,children:t})};function cie(){return new Map}function FL(t=!0){const e=g.useContext(z1);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=g.useId();g.useEffect(()=>{if(t)return s(i)},[t]);const o=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const mg=t=>t.key||"";function SA(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const ki=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:d})=>{const[f,h]=FL(o),m=g.useMemo(()=>SA(t),[t]),v=o&&!f?[]:m.map(mg),y=g.useRef(!0),_=g.useRef(m),b=$k(()=>new Map),x=g.useRef(new Set),[k,C]=g.useState(m),[P,R]=g.useState(m);Fk(()=>{y.current=!1,_.current=m;for(let A=0;A<P.length;A++){const M=mg(P[A]);v.includes(M)?(b.delete(M),x.current.delete(M)):b.get(M)!==!0&&b.set(M,!1)}},[P,v.length,v.join("-")]);const O=[];if(m!==k){let A=[...m];for(let M=0;M<P.length;M++){const L=P[M],z=mg(L);v.includes(z)||(A.splice(M,0,L),O.push(L))}return i==="wait"&&O.length&&(A=O),R(SA(A)),C(m),null}const{forceRender:I}=g.useContext(Dk);return S.jsx(S.Fragment,{children:P.map(A=>{const M=mg(A),L=o&&!f?!1:m===P||v.includes(M),z=()=>{if(x.current.has(M))return;if(b.has(M))x.current.add(M),b.set(M,!0);else return;let $=!0;b.forEach(q=>{q||($=!1)}),$&&(I==null||I(),R(_.current),o&&(h==null||h()),r&&r())};return S.jsx(lie,{isPresent:L,initial:!y.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:L?void 0:z,anchorX:l,anchorY:c,children:A},M)})})},jL=g.createContext({strict:!1}),kA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let EA=!1;function uie(){if(EA)return;const t={};for(const e in kA)t[e]={isEnabled:n=>kA[e].some(r=>!!n[r])};mL(t),EA=!0}function zL(){return uie(),qre()}function die(t){const e=zL();for(const n in t)e[n]={...e[n],...t[n]};mL(e)}const fie=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function a1(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||fie.has(t)}let VL=t=>!a1(t);function hie(t){typeof t=="function"&&(VL=e=>e.startsWith("on")?!a1(e):t(e))}try{hie(require("@emotion/is-prop-valid").default)}catch{}function pie(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||es(t[s])||(VL(s)||n===!0&&a1(s)||!e&&!a1(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Z1=g.createContext({});function mie(t,e){if(B1(t)){const{initial:n,animate:r}=t;return{initial:n===!1||tm(n)?n:void 0,animate:tm(r)?r:void 0}}return t.inherit!==!1?e:{}}function gie(t){const{initial:e,animate:n}=mie(t,g.useContext(Z1));return g.useMemo(()=>({initial:e,animate:n}),[CA(e),CA(n)])}function CA(t){return Array.isArray(t)?t.join(" "):t}const u6=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HL(t,e,n){for(const r in e)!es(e[r])&&!xL(r,n)&&(t[r]=e[r])}function vie({transformTemplate:t},e){return g.useMemo(()=>{const n=u6();return a6(n,e,t),Object.assign({},n.vars,n.style)},[e])}function yie(t,e){const n=t.style||{},r={};return HL(r,n,t),Object.assign(r,vie(t,e)),r}function _ie(t,e){const n={},r=yie(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const UL=()=>({...u6(),attrs:{}});function wie(t,e,n,r){const s=g.useMemo(()=>{const i=UL();return SL(i,e,EL(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};HL(i,t.style,t),s.style={...i,...s.style}}return s}const bie=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function d6(t){return typeof t!="string"||t.includes("-")?!1:!!(bie.indexOf(t)>-1||/[A-Z]/u.test(t))}function xie(t,e,n,{latestValues:r},s,i=!1,o){const c=(o??d6(t)?wie:_ie)(e,r,s,t),d=pie(e,typeof t=="string",i),f=t!==g.Fragment?{...d,...c,ref:n}:{},{children:h}=e,m=g.useMemo(()=>es(h)?h.get():h,[h]);return g.createElement(t,{...f,children:m})}function Sie({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:kie(n,r,s,t),renderState:e()}}function kie(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Jg(i[m]);let{initial:o,animate:l}=t;const c=B1(t),d=hL(t);e&&d&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const h=f?l:o;if(h&&typeof h!="boolean"&&!U1(h)){const m=Array.isArray(h)?h:[h];for(let v=0;v<m.length;v++){const y=Qk(t,m[v]);if(y){const{transitionEnd:_,transition:b,...x}=y;for(const k in x){let C=x[k];if(Array.isArray(C)){const P=f?C.length-1:0;C=C[P]}C!==null&&(s[k]=C)}for(const k in _)s[k]=_[k]}}}return s}const BL=t=>(e,n)=>{const r=g.useContext(Z1),s=g.useContext(z1),i=()=>Sie(t,e,r,s);return n?i():$k(i)},Eie=BL({scrapeMotionValuesFromProps:l6,createRenderState:u6}),Cie=BL({scrapeMotionValuesFromProps:CL,createRenderState:UL}),Pie=Symbol.for("motionComponentSymbol");function Tie(t,e,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var l;i&&((l=t.onMount)==null||l.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const c=o(i);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const ZL=g.createContext({});function Nd(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Rie(t,e,n,r,s,i){var C,P;const{visualElement:o}=g.useContext(Z1),l=g.useContext(jL),c=g.useContext(z1),d=g.useContext(c6),f=d.reducedMotion,h=d.skipAnimations,m=g.useRef(null),v=g.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:f,skipAnimations:h,isSVG:i}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const y=m.current,_=g.useContext(ZL);y&&!y.projection&&s&&(y.type==="html"||y.type==="svg")&&Aie(m.current,n,s,_);const b=g.useRef(!1);g.useInsertionEffect(()=>{y&&b.current&&y.update(n,c)});const x=n[tL],k=g.useRef(!!x&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,x))&&((P=window.MotionHasOptimisedAnimation)==null?void 0:P.call(window,x)));return Fk(()=>{v.current=!0,y&&(b.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),k.current&&y.animationState&&y.animationState.animateChanges())}),g.useEffect(()=>{y&&(!k.current&&y.animationState&&y.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,x)}),k.current=!1),y.enteringChildren=void 0)}),y}function Aie(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d,layoutAnchor:f,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:WL(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&Nd(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:c,layoutRoot:d,layoutAnchor:f})}function WL(t){if(t)return t.options.allowProjection!==!1?t.projection:WL(t.parent)}function hw(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&die(r);const i=n?n==="svg":d6(t),o=i?Cie:Eie;function l(d,f){let h;const m={...g.useContext(c6),...d,layoutId:Iie(d)},{isStatic:v}=m,y=gie(d),_=o(d,v);if(!v&&typeof window<"u"){Oie();const b=Mie(m);h=b.MeasureLayout,y.visualElement=Rie(t,_,m,s,b.ProjectionNode,i)}return S.jsxs(Z1.Provider,{value:y,children:[h&&y.visualElement?S.jsx(h,{visualElement:y.visualElement,...m}):null,xie(t,d,Tie(_,y.visualElement,f),_,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=g.forwardRef(l);return c[Pie]=t,c}function Iie({layoutId:t}){const e=g.useContext(Dk).id;return e&&t!==void 0?e+"-"+t:t}function Oie(t,e){g.useContext(jL).strict}function Mie(t){const e=zL(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Nie(t,e){if(typeof Proxy>"u")return hw;const n=new Map,r=(i,o)=>hw(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,hw(o,void 0,t,e)),n.get(o))})}const Lie=(t,e)=>e.isSVG??d6(t)?new dse(e):new ise(e,{allowProjection:t!==g.Fragment});class Die extends wc{constructor(e){super(e),e.animationState||(e.animationState=gse(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();U1(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let $ie=0;class Fie extends wc{constructor(){super(...arguments),this.id=$ie++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const c=Eu(this.node,o,l);if(c){const{transition:d,transitionEnd:f,...h}=c;for(const m in h)(i=this.node.getValue(m))==null||i.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const jie={animation:{Feature:Die},exit:{Feature:Fie}};function Dm(t){return{point:{x:t.pageX,y:t.pageY}}}const zie=t=>e=>n6(e)&&t(e,Dm(e));function Rp(t,e,n,r){return nm(t,e,zie(n),r)}const KL=({current:t})=>t?t.ownerDocument.defaultView:null,PA=(t,e)=>Math.abs(t-e);function Vie(t,e){const n=PA(t.x,e.x),r=PA(t.y,e.y);return Math.sqrt(n**2+r**2)}const TA=new Set(["auto","scroll"]);class qL{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=gg(this.lastRawMoveEventInfo,this.transformPagePoint));const y=pw(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,b=Vie(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!b)return;const{point:x}=y,{timestamp:k}=Xr;this.history.push({...x,timestamp:k});const{onStart:C,onMove:P}=this.handlers;_||(C&&C(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,y)},this.handlePointerMove=(y,_)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=gg(_,this.transformPagePoint),Cn.update(this.updatePoint,!0)},this.handlePointerUp=(y,_)=>{this.end();const{onEnd:b,onSessionEnd:x,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=pw(y.type==="pointercancel"?this.lastMoveEventInfo:gg(_,this.transformPagePoint),this.history);this.startEvent&&b&&b(y,C),x&&x(y,C)},!n6(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=Dm(e),d=gg(c,this.transformPagePoint),{point:f}=d,{timestamp:h}=Xr;this.history=[{...f,timestamp:h}];const{onSessionStart:m}=n;m&&m(e,pw(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=Mm(Rp(this.contextWindow,"pointermove",this.handlePointerMove,v),Rp(this.contextWindow,"pointerup",this.handlePointerUp,v),Rp(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(TA.has(r.overflowX)||TA.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),Cn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),dc(this.updatePoint)}}function gg(t,e){return e?{point:e(t.point)}:t}function RA(t,e){return{x:t.x-e.x,y:t.y-e.y}}function pw({point:t},e){return{point:t,delta:RA(t,GL(e)),offset:RA(t,Hie(e)),velocity:Uie(e,.1)}}function Hie(t){return t[0]}function GL(t){return t[t.length-1]}function Uie(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=GL(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Si(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Si(e)*2&&(r=t[1]);const i=Ki(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Bie(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?En(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?En(n,t,r.max):Math.min(t,n)),t}function AA(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Zie(t,{top:e,left:n,bottom:r,right:s}){return{x:AA(t.x,n,s),y:AA(t.y,e,r)}}function IA(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function Wie(t,e){return{x:IA(t.x,e.x),y:IA(t.y,e.y)}}function Kie(t,e){let n=.5;const r=Ns(t),s=Ns(e);return s>r?n=Jp(e.min,e.max-r,t.min):r>s&&(n=Jp(t.min,t.max-s,e.min)),ua(0,1,n)}function qie(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Hx=.35;function Gie(t=Hx){return t===!1?t=0:t===!0&&(t=Hx),{x:OA(t,"left","right"),y:OA(t,"top","bottom")}}function OA(t,e,n){return{min:MA(t,e),max:MA(t,n)}}function MA(t,e){return typeof t=="number"?t:t[e]||0}const Yie=new WeakMap;class Xie{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ar(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{n&&this.snapToCursor(Dm(h).point),this.stopAnimation()},o=(h,m)=>{const{drag:v,dragPropagation:y,onDragStart:_}=this.getProps();if(v&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ere(v),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bo(x=>{let k=this.getAxisMotionValue(x).get()||0;if(sa.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[x];P&&(k=Ns(P)*(parseFloat(k)/100))}}this.originPoint[x]=k}),_&&Cn.update(()=>_(h,m),!1,!0),Mx(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:y,onDirectionLock:_,onDrag:b}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:x}=m;if(y&&this.currentDirection===null){this.currentDirection=Jie(x),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",m.point,x),this.updateAxis("y",m.point,x),this.visualElement.render(),b&&Cn.update(()=>b(h,m),!1,!0)},c=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new qL(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:KL(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Cn.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!vg(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Bie(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&Nd(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=Zie(r.layoutBox,e):this.constraints=!1,this.elastic=Gie(n),s!==this.constraints&&!Nd(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Bo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=qie(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Nd(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=Jre(r,s.root,this.visualElement.getTransformPagePoint());let o=Wie(s.layout.layoutBox,i);if(n){const l=n(Yre(o));this.hasMutatedConstraints=!!l,l&&(o=vL(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=Bo(f=>{if(!vg(f,n,this.currentDirection))return;let h=c&&c[f]||{};(o===!0||o===f)&&(h={min:0,max:0});const m=s?200:1e6,v=s?40:1e7,y={type:"inertia",velocity:r?e[f]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(f,y)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Mx(this.visualElement,e),r.start(Xk(e,r,0,n,this.visualElement,!1))}stopAnimation(){Bo(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Bo(n=>{const{drag:r}=this.getProps();if(!vg(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],c=i.get()||0;i.set(e[n]-En(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Nd(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Bo(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=Kie({min:c,max:c},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Bo(o=>{if(!vg(o,e,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(En(c,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Yie.set(this.visualElement,this);const e=this.visualElement.current,n=Rp(e,"pointerdown",d=>{const{drag:f,dragListener:h=!0}=this.getProps(),m=d.target,v=m!==e&&Ire(m);f&&h&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();Nd(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Qie(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Cn.read(s);const l=nm(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Bo(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=d[h].translate,m.set(m.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Hx,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function NA(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Qie(t,e,n){const r=VR(t,NA(n)),s=VR(e,NA(n));return()=>{r(),s()}}function vg(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Jie(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class eoe extends wc{constructor(e){super(e),this.removeGroupControls=Qi,this.removeListeners=Qi,this.controls=new Xie(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qi}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const mw=t=>(e,n)=>{t&&Cn.update(()=>t(e,n),!1,!0)};class toe extends wc{constructor(){super(...arguments),this.removePointerDownListener=Qi}onPointerDown(e){this.session=new qL(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:KL(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:mw(e),onStart:mw(n),onMove:mw(r),onEnd:(i,o)=>{delete this.session,s&&Cn.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Rp(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let gw=!1;class noe extends g.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),gw&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ev.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),gw=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Cn.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),t6.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;gw=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function YL(t){const[e,n]=FL(),r=g.useContext(Dk);return S.jsx(noe,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(ZL),isPresent:e,safeToRemove:n})}const roe={pan:{Feature:toe},drag:{Feature:eoe,ProjectionNode:$L,MeasureLayout:YL}};function LA(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Cn.postRender(()=>i(e,Dm(e)))}class soe extends wc{mount(){const{current:e}=this.node;e&&(this.unmount=Pre(e,(n,r)=>(LA(this.node,r,"Start"),s=>LA(this.node,s,"End"))))}unmount(){}}class ioe extends wc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Mm(nm(this.node.current,"focus",()=>this.onFocus()),nm(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function DA(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Cn.postRender(()=>i(e,Dm(e)))}class ooe extends wc{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Mre(e,(s,i)=>(DA(this.node,i,"Start"),(o,{success:l})=>DA(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Ux=new WeakMap,vw=new WeakMap,aoe=t=>{const e=Ux.get(t.target);e&&e(t)},loe=t=>{t.forEach(aoe)};function coe({root:t,...e}){const n=t||document;vw.has(n)||vw.set(n,{});const r=vw.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(loe,{root:t,...e})),r[s]}function uoe(t,e,n){const r=coe(e);return Ux.set(t,n),r.observe(t),()=>{Ux.delete(t),r.unobserve(t)}}const doe={some:0,all:1};class foe extends wc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:doe[s]},l=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),v=f?h:m;v&&v(d)};this.stopObserver=uoe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(hoe(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function hoe({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const poe={inView:{Feature:foe},tap:{Feature:ooe},focus:{Feature:ioe},hover:{Feature:soe}},moe={layout:{ProjectionNode:$L,MeasureLayout:YL}},goe={...jie,...poe,...roe,...moe},Ka=Nie(goe,Lie);function voe(){!o6.current&&pL();const[t]=g.useState(r1.current);return t}const So=Ka;var $m=a9();const yoe=R1($m);function _oe(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const woe=t=>{switch(t){case"success":return Soe;case"info":return Eoe;case"warning":return koe;case"error":return Coe;default:return null}},boe=Array(12).fill(0),xoe=({visible:t,className:e})=>Ee.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Ee.createElement("div",{className:"sonner-spinner"},boe.map((n,r)=>Ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Soe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),koe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Eoe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Coe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Poe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Toe=()=>{const[t,e]=Ee.useState(document.hidden);return Ee.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let Roe=1;const Aoe=100,$A=t=>{var e;return typeof(t==null?void 0:t.id)=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:Roe++};class Ioe{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Aoe;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...r}=e,s=$A(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),l=e.dismissible===void 0?!0:e.dismissible;return o&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(o?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:l,title:n}):d):this.addToast({title:n,...r,dismissible:l,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],Ee.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(Moe(d)&&!d.ok){i=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,y=typeof h=="object"&&!Ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...y})}else if(d instanceof Error){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,y=typeof h=="object"&&!Ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...y})}else if(n.success!==void 0){i=!1;const h=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,y=typeof h=="object"&&!Ee.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:m,...y})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!Ee.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=$A(n);return this.create({...n,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Bs=new Ioe,Ooe=(t,e)=>Bs.message(t,e),Moe=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Noe=Ooe,Loe=()=>Bs.toasts,Doe=()=>Bs.getActiveToasts(),on=Object.assign(Noe,{success:Bs.success,info:Bs.info,warning:Bs.warning,error:Bs.error,custom:Bs.custom,message:Bs.message,promise:Bs.promise,dismiss:Bs.dismiss,loading:Bs.loading},{getHistory:Loe,getToasts:Doe});_oe("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function yg(t){return t.label!==void 0}const $oe=3,Foe="24px",joe="16px",FA=4e3,zoe=356,Voe=14,Hoe=45,Uoe=200;function jo(...t){return t.filter(Boolean).join(" ")}function Boe(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const Zoe=t=>{var e,n,r,s,i,o,l,c,d;const{invert:f,toast:h,unstyled:m,interacting:v,setHeights:y,visibleToasts:_,heights:b,index:x,toasts:k,expanded:C,removeToast:P,defaultRichColors:R,closeButton:O,style:I,cancelButtonStyle:A,actionButtonStyle:M,className:L="",descriptionClassName:z="",duration:$,position:q,gap:X,expandByDefault:K,classNames:H,icons:ee,closeButtonAriaLabel:V="Close toast"}=t,[Q,B]=Ee.useState(null),[D,G]=Ee.useState(null),[fe,ie]=Ee.useState(!1),[ue,he]=Ee.useState(!1),[_e,le]=Ee.useState(!1),[ne,be]=Ee.useState(!1),[Ve,De]=Ee.useState(!1),[$e,Ut]=Ee.useState(0),[nn,kt]=Ee.useState(0),Dt=Ee.useRef(h.duration||$||FA),un=Ee.useRef(null),qt=Ee.useRef(null),Ne=x===0,Je=x+1<=_,Re=h.type,Ct=Re??"default",Se=h.dismissible!==!1,$t=h.className||"",ht=h.descriptionClassName||"",mt=Ee.useMemo(()=>b.findIndex(it=>it.toastId===h.id)||0,[b,h.id]),tr=Ee.useMemo(()=>{var it;return(it=h.closeButton)!=null?it:O},[h.closeButton,O]),Oi=Ee.useMemo(()=>h.duration||$||FA,[h.duration,$]),Pn=Ee.useRef(0),lr=Ee.useRef(0),to=Ee.useRef(0),bs=Ee.useRef(null),[rs,nr]=q.split("-"),vn=Ee.useMemo(()=>b.reduce((it,cn,rn)=>rn>=mt?it:it+cn.height,0),[b,mt]),ss=Toe(),pr=Ee.useMemo(()=>{var it;return(it=t.swipeDirections)!=null?it:Boe(q)},[t.swipeDirections,q]),Co=h.invert||f,Wr=Re==="loading";lr.current=Ee.useMemo(()=>mt*X+vn,[mt,vn]),Ee.useEffect(()=>{Dt.current=Oi},[Oi]),Ee.useEffect(()=>{ie(!0)},[]),Ee.useEffect(()=>{const it=qt.current;if(it){const cn=it.getBoundingClientRect().height;return kt(cn),y(rn=>[{toastId:h.id,height:cn,position:h.position},...rn]),()=>y(rn=>rn.filter(yn=>yn.toastId!==h.id))}},[y,h.id]),Ee.useLayoutEffect(()=>{if(!fe)return;const it=qt.current,cn=it.style.height;it.style.height="auto";const rn=it.getBoundingClientRect().height;it.style.height=cn,kt(rn),y(yn=>yn.find(Gt=>Gt.toastId===h.id)?yn.map(Gt=>Gt.toastId===h.id?{...Gt,height:rn}:Gt):[{toastId:h.id,height:rn,position:h.position},...yn])},[fe,h.title,h.description,y,h.id,h.jsx,h.action,h.cancel]);const rr=Ee.useCallback(()=>{he(!0),Ut(lr.current),y(it=>it.filter(cn=>cn.toastId!==h.id)),setTimeout(()=>{P(h)},Uoe)},[h,P,y,lr]);Ee.useEffect(()=>{if(h.promise&&Re==="loading"||h.duration===1/0||h.type==="loading")return;let it;return C||v||ss?(()=>{if(to.current<Pn.current){const yn=new Date().getTime()-Pn.current;Dt.current=Dt.current-yn}to.current=new Date().getTime()})():(()=>{Dt.current!==1/0&&(Pn.current=new Date().getTime(),it=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),rr()},Dt.current))})(),()=>clearTimeout(it)},[C,v,h,Re,ss,rr]),Ee.useEffect(()=>{h.delete&&(rr(),h.onDismiss==null||h.onDismiss.call(h,h))},[rr,h.delete]);function Nr(){var it;if(ee!=null&&ee.loading){var cn;return Ee.createElement("div",{className:jo(H==null?void 0:H.loader,h==null||(cn=h.classNames)==null?void 0:cn.loader,"sonner-loader"),"data-visible":Re==="loading"},ee.loading)}return Ee.createElement(xoe,{className:jo(H==null?void 0:H.loader,h==null||(it=h.classNames)==null?void 0:it.loader),visible:Re==="loading"})}const ai=h.icon||(ee==null?void 0:ee[Re])||woe(Re);var cr,xs;return Ee.createElement("li",{tabIndex:0,ref:qt,className:jo(L,$t,H==null?void 0:H.toast,h==null||(e=h.classNames)==null?void 0:e.toast,H==null?void 0:H[Ct],h==null||(n=h.classNames)==null?void 0:n[Ct]),"data-sonner-toast":"","data-rich-colors":(cr=h.richColors)!=null?cr:R,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":fe,"data-promise":!!h.promise,"data-swiped":Ve,"data-removed":ue,"data-visible":Je,"data-y-position":rs,"data-x-position":nr,"data-index":x,"data-front":Ne,"data-swiping":_e,"data-dismissible":Se,"data-type":Re,"data-invert":Co,"data-swipe-out":ne,"data-swipe-direction":D,"data-expanded":!!(C||K&&fe),"data-testid":h.testId,style:{"--index":x,"--toasts-before":x,"--z-index":k.length-x,"--offset":`${ue?$e:lr.current}px`,"--initial-height":K?"auto":`${nn}px`,...I,...h.style},onDragEnd:()=>{le(!1),B(null),bs.current=null},onPointerDown:it=>{it.button!==2&&(Wr||!Se||(un.current=new Date,Ut(lr.current),it.target.setPointerCapture(it.pointerId),it.target.tagName!=="BUTTON"&&(le(!0),bs.current={x:it.clientX,y:it.clientY})))},onPointerUp:()=>{var it,cn,rn;if(ne||!Se)return;bs.current=null;const yn=Number(((it=qt.current)==null?void 0:it.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((cn=qt.current)==null?void 0:cn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Gt=new Date().getTime()-((rn=un.current)==null?void 0:rn.getTime()),$n=Q==="x"?yn:Tn,is=Math.abs($n)/Gt;if((Q==="x"?pr.includes(yn>0?"right":"left"):pr.includes(Tn>0?"bottom":"top"))&&(Math.abs($n)>=Hoe||is>.11)){Ut(lr.current),h.onDismiss==null||h.onDismiss.call(h,h),G(Q==="x"?yn>0?"right":"left":Tn>0?"down":"up"),rr(),be(!0);return}else{var kr,Bt;(kr=qt.current)==null||kr.style.setProperty("--swipe-amount-x","0px"),(Bt=qt.current)==null||Bt.style.setProperty("--swipe-amount-y","0px")}De(!1),le(!1),B(null)},onPointerMove:it=>{var cn,rn,yn;if(!bs.current||!Se||((cn=window.getSelection())==null?void 0:cn.toString().length)>0)return;const Gt=it.clientY-bs.current.y,$n=it.clientX-bs.current.x;!Q&&(Math.abs($n)>1||Math.abs(Gt)>1)&&B(Math.abs($n)>Math.abs(Gt)?"x":"y");let is={x:0,y:0};const sr=kr=>1/(1.5+Math.abs(kr)/20);if(Q==="y"){if(pr.includes("top")||pr.includes("bottom"))if(pr.includes("top")&&Gt<0||pr.includes("bottom")&&Gt>0)is.y=Gt;else{const kr=Gt*sr(Gt);is.y=Math.abs(kr)<Math.abs(Gt)?kr:Gt}}else if(Q==="x"&&(pr.includes("left")||pr.includes("right")))if(pr.includes("left")&&$n<0||pr.includes("right")&&$n>0)is.x=$n;else{const kr=$n*sr($n);is.x=Math.abs(kr)<Math.abs($n)?kr:$n}(Math.abs(is.x)>0||Math.abs(is.y)>0)&&De(!0),(rn=qt.current)==null||rn.style.setProperty("--swipe-amount-x",`${is.x}px`),(yn=qt.current)==null||yn.style.setProperty("--swipe-amount-y",`${is.y}px`)}},tr&&!h.jsx&&Re!=="loading"?Ee.createElement("button",{"aria-label":V,"data-disabled":Wr,"data-close-button":!0,onClick:Wr||!Se?()=>{}:()=>{rr(),h.onDismiss==null||h.onDismiss.call(h,h)},className:jo(H==null?void 0:H.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(xs=ee==null?void 0:ee.close)!=null?xs:Poe):null,(Re||h.icon||h.promise)&&h.icon!==null&&((ee==null?void 0:ee[Re])!==null||h.icon)?Ee.createElement("div",{"data-icon":"",className:jo(H==null?void 0:H.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},Re==="loading"?h.icon||Nr():h.promise?Nr():null,Re!=="loading"?ai:null):null,Ee.createElement("div",{"data-content":"",className:jo(H==null?void 0:H.content,h==null||(i=h.classNames)==null?void 0:i.content)},Ee.createElement("div",{"data-title":"",className:jo(H==null?void 0:H.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ee.createElement("div",{"data-description":"",className:jo(z,ht,H==null?void 0:H.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),Ee.isValidElement(h.cancel)?h.cancel:h.cancel&&yg(h.cancel)?Ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||A,onClick:it=>{yg(h.cancel)&&Se&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,it),rr())},className:jo(H==null?void 0:H.cancelButton,h==null||(c=h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,Ee.isValidElement(h.action)?h.action:h.action&&yg(h.action)?Ee.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||M,onClick:it=>{yg(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,it),!it.defaultPrevented&&rr())},className:jo(H==null?void 0:H.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function jA(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Woe(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?joe:Foe;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const Koe=Ee.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:f,mobileOffset:h,theme:m="light",richColors:v,duration:y,style:_,visibleToasts:b=$oe,toastOptions:x,dir:k=jA(),gap:C=Voe,icons:P,customAriaLabel:R,containerAriaLabel:O="Notifications"}=e,[I,A]=Ee.useState([]),M=Ee.useMemo(()=>r?I.filter(ie=>ie.toasterId===r):I.filter(ie=>!ie.toasterId),[I,r]),L=Ee.useMemo(()=>Array.from(new Set([i].concat(M.filter(ie=>ie.position).map(ie=>ie.position)))),[M,i]),[z,$]=Ee.useState([]),[q,X]=Ee.useState(!1),[K,H]=Ee.useState(!1),[ee,V]=Ee.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=Ee.useRef(null),B=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Ee.useRef(null),G=Ee.useRef(!1),fe=Ee.useCallback(ie=>{A(ue=>{var he;return(he=ue.find(_e=>_e.id===ie.id))!=null&&he.delete||Bs.dismiss(ie.id),ue.filter(({id:_e})=>_e!==ie.id)})},[]);return Ee.useEffect(()=>Bs.subscribe(ie=>{if(ie.dismiss){requestAnimationFrame(()=>{A(ue=>ue.map(he=>he.id===ie.id?{...he,delete:!0}:he))});return}setTimeout(()=>{yoe.flushSync(()=>{A(ue=>{const he=ue.findIndex(_e=>_e.id===ie.id);return he!==-1?[...ue.slice(0,he),{...ue[he],...ie},...ue.slice(he+1)]:[ie,...ue]})})})}),[]),Ee.useEffect(()=>{if(m!=="system"){V(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const ie=window.matchMedia("(prefers-color-scheme: dark)");try{ie.addEventListener("change",({matches:ue})=>{V(ue?"dark":"light")})}catch{ie.addListener(({matches:he})=>{try{V(he?"dark":"light")}catch(_e){console.error(_e)}})}},[m]),Ee.useEffect(()=>{I.length<=1&&X(!1)},[I]),Ee.useEffect(()=>{const ie=ue=>{var he;if(o.length>0&&o.every(ne=>ue[ne]||ue.code===ne)){var le;X(!0),(le=Q.current)==null||le.focus()}ue.code==="Escape"&&(document.activeElement===Q.current||(he=Q.current)!=null&&he.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[o]),Ee.useEffect(()=>{if(Q.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,G.current=!1)}},[Q.current]),Ee.createElement("section",{ref:n,"aria-label":R??`${O} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},L.map((ie,ue)=>{var he;const[_e,le]=ie.split("-");return M.length?Ee.createElement("ol",{key:ie,dir:k==="auto"?jA():k,tabIndex:-1,ref:Q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":ee,"data-y-position":_e,"data-x-position":le,style:{"--front-toast-height":`${((he=z[0])==null?void 0:he.height)||0}px`,"--width":`${zoe}px`,"--gap":`${C}px`,..._,...Woe(f,h)},onBlur:ne=>{G.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(G.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||G.current||(G.current=!0,D.current=ne.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{K||X(!1)},onDragEnd:()=>X(!1),onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},M.filter(ne=>!ne.position&&ue===0||ne.position===ie).map((ne,be)=>{var Ve,De;return Ee.createElement(Zoe,{key:ne.id,icons:P,index:be,toast:ne,defaultRichColors:v,duration:(Ve=x==null?void 0:x.duration)!=null?Ve:y,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:s,visibleToasts:b,closeButton:(De=x==null?void 0:x.closeButton)!=null?De:c,interacting:K,position:ie,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,closeButtonAriaLabel:x==null?void 0:x.closeButtonAriaLabel,removeToast:fe,toasts:M.filter($e=>$e.position==ne.position),heights:z.filter($e=>$e.position==ne.position),setHeights:$,expandByDefault:l,gap:C,expanded:q,swipeDirections:e.swipeDirections})})):null}))}),qoe=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),g.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),Goe=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),Yoe=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),Xoe=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),g.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),Qoe=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),Joe=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),eae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]),tae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),nae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),g.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),rae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M248.23,112.31A20,20,0,0,0,232,104H220V88a20,20,0,0,0-20-20H132L105.34,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V208a12,12,0,0,0,12,12H211.1a12,12,0,0,0,11.33-8l28.49-81.47.06-.17A20,20,0,0,0,248.23,112.31ZM92,68l28.8,21.6A12,12,0,0,0,128,92h68v12H69.77a20,20,0,0,0-18.94,13.58L44,137.15V68ZM202.59,196H48.89l23.72-68H226.37Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,88v24H69.77a8,8,0,0,0-7.59,5.47L32,208V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h72A8,8,0,0,1,208,88Z",opacity:"0.2"}),g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"}))]]),sae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),g.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),iae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,84H180.2l7.61-41.85a12,12,0,0,0-23.62-4.3L155.8,84H116.2l7.61-41.85a12,12,0,1,0-23.62-4.3L91.8,84H48a12,12,0,0,0,0,24H87.44l-7.27,40H32a12,12,0,0,0,0,24H75.8l-7.61,41.85a12,12,0,0,0,9.66,14A11.43,11.43,0,0,0,80,228a12,12,0,0,0,11.8-9.86L100.2,172h39.6l-7.61,41.85a12,12,0,0,0,9.66,14,11.43,11.43,0,0,0,2.16.2,12,12,0,0,0,11.8-9.86L164.2,172H208a12,12,0,0,0,0-24H168.56l7.27-40H224a12,12,0,0,0,0-24Zm-79.83,64H104.56l7.27-40h39.61Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M165.82,96l-11.64,64h-64l11.64-64Z",opacity:"0.2"}),g.createElement("path",{d:"M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M116.25,112h31.5l-8,32h-31.5ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Zm-16,56a8,8,0,0,0-8-8H168.25l7.51-30.06a8,8,0,0,0-15.52-3.88L151.75,96h-31.5l7.51-30.06a8,8,0,0,0-15.52-3.88L103.75,96H64a8,8,0,0,0,0,16H99.75l-8,32H56a8,8,0,0,0,0,16H87.75l-7.51,30.06a8,8,0,0,0,5.82,9.7,8.13,8.13,0,0,0,2,.24,8,8,0,0,0,7.75-6.06L104.25,160h31.5l-7.51,30.06a8,8,0,0,0,5.82,9.7A8.13,8.13,0,0,0,136,200a8,8,0,0,0,7.75-6.06L152.25,160H192a8,8,0,0,0,0-16H156.25l8-32H200A8,8,0,0,0,208,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,90H173l8.89-48.93a6,6,0,1,0-11.8-2.14L160.81,90H109l8.89-48.93a6,6,0,0,0-11.8-2.14L96.81,90H48a6,6,0,0,0,0,12H94.63l-9.46,52H32a6,6,0,0,0,0,12H83L74.1,214.93a6,6,0,0,0,4.83,7A5.64,5.64,0,0,0,80,222a6,6,0,0,0,5.89-4.93L95.19,166H147l-8.89,48.93a6,6,0,0,0,4.83,7,5.64,5.64,0,0,0,1.08.1,6,6,0,0,0,5.89-4.93L159.19,166H208a6,6,0,0,0,0-12H161.37l9.46-52H224a6,6,0,0,0,0-12Zm-74.83,64H97.37l9.46-52h51.8Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,92H170.61l9.33-51.28a4,4,0,1,0-7.88-1.44L162.48,92H106.61l9.33-51.28a4,4,0,1,0-7.88-1.44L98.48,92H48a4,4,0,0,0,0,8H97L86.84,156H32a4,4,0,0,0,0,8H85.39l-9.33,51.28a4,4,0,0,0,3.22,4.65A3.65,3.65,0,0,0,80,220a4,4,0,0,0,3.94-3.29L93.52,164h55.87l-9.33,51.28a4,4,0,0,0,3.22,4.65,3.65,3.65,0,0,0,.72.07,4,4,0,0,0,3.94-3.29L157.52,164H208a4,4,0,0,0,0-8H159l10.19-56H224a4,4,0,0,0,0-8Zm-73.16,64H95l10.19-56H161Z"}))]]),oae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),g.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),aae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),lae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,98.34,172.39,155.8c11.46,22.93-1.72,45.86-10.11,57a8,8,0,0,1-12,.83L42.34,105.76A8,8,0,0,1,43,93.85c29.65-23.92,57.4-10,57.4-10l57.27-57.46a8,8,0,0,1,11.31,0L229.66,87A8,8,0,0,1,229.66,98.34Z",opacity:"0.2"}),g.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.33,104l-53.47,53.65c4.56,12.67,6.45,33.89-13.19,60A15.93,15.93,0,0,1,157,224c-.38,0-.75,0-1.13,0a16,16,0,0,1-11.32-4.69L96.29,171,53.66,213.66a8,8,0,0,1-11.32-11.32L85,159.71l-48.3-48.3A16,16,0,0,1,38,87.63c25.42-20.51,49.75-16.48,60.4-13.14L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.33,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M233.91,82.79,173.22,22.1a14,14,0,0,0-19.81,0L98.93,76.77c-9.52-3.25-34-8.34-59.71,12.41A14,14,0,0,0,38.1,110l49.71,49.71-44.05,44a6,6,0,1,0,8.48,8.48l44.05-44.05L146,217.89a14,14,0,0,0,9.9,4.11q.49,0,1,0a14,14,0,0,0,10.19-5.54c19.72-26.21,17.15-47.23,12.46-59.3l54.37-54.55A14,14,0,0,0,233.91,82.79ZM225.42,94.1h0l-57.27,57.46a6,6,0,0,0-1.11,6.92c9.94,19.88-1.71,40.32-9.54,50.72a2,2,0,0,1-3,.2L46.58,101.51a2,2,0,0,1,.18-3c12.5-10.09,24.5-12.76,33.7-12.76a42.13,42.13,0,0,1,17.25,3.41A6,6,0,0,0,104.64,88L161.9,30.59a2,2,0,0,1,2.83,0l60.69,60.68A2,2,0,0,1,225.42,94.1Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,84.2,171.8,23.51a12,12,0,0,0-17,0L99.45,79.07c-8.08-3-32.79-9.45-59,11.67a12,12,0,0,0-1,17.84l51.13,51.13L45.17,205.17a4,4,0,0,0,5.66,5.66l45.46-45.47,51.12,51.12A12,12,0,0,0,155.9,220c.28,0,.57,0,.85,0a12,12,0,0,0,8.73-4.74c19.83-26.36,16.51-47.18,11.71-58.57l55.3-55.49A12,12,0,0,0,232.49,84.2Zm-5.66,11.31h0L169.56,153a4,4,0,0,0-.75,4.61c10.43,20.85-1.62,42-9.73,52.83a4,4,0,0,1-6,.4L45.17,102.93a4,4,0,0,1,.33-6C58.44,86.53,70.86,83.74,80.44,83.74A43.9,43.9,0,0,1,98.6,87.38a4,4,0,0,0,4.62-.75l57.27-57.46a4,4,0,0,1,5.66,0l60.68,60.69A4,4,0,0,1,226.83,95.51Z"}))]]),cae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),uae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M144.49,136.49l-40,40a12,12,0,0,1-17-17L107,140H24a12,12,0,0,1,0-24h83L87.51,96.49a12,12,0,0,1,17-17l40,40A12,12,0,0,1,144.49,136.49ZM200,28H136a12,12,0,0,0,0,24h52V204H136a12,12,0,0,0,0,24h64a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,40V216H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40Z",opacity:"0.2"}),g.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M141.66,133.66l-40,40A8,8,0,0,1,88,168V136H24a8,8,0,0,1,0-16H88V88a8,8,0,0,1,13.66-5.66l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M140.24,132.24l-40,40a6,6,0,0,1-8.48-8.48L121.51,134H24a6,6,0,0,1,0-12h97.51L91.76,92.24a6,6,0,0,1,8.48-8.48l40,40A6,6,0,0,1,140.24,132.24ZM200,34H136a6,6,0,0,0,0,12h58V210H136a6,6,0,0,0,0,12h64a6,6,0,0,0,6-6V40A6,6,0,0,0,200,34Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M138.83,130.83l-40,40a4,4,0,0,1-5.66-5.66L126.34,132H24a4,4,0,0,1,0-8H126.34L93.17,90.83a4,4,0,0,1,5.66-5.66l40,40A4,4,0,0,1,138.83,130.83ZM200,36H136a4,4,0,0,0,0,8h60V212H136a4,4,0,0,0,0,8h64a4,4,0,0,0,4-4V40A4,4,0,0,0,200,36Z"}))]]),dae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"}))]]),fae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z",opacity:"0.2"}),g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z"}))]]),hae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z",opacity:"0.2"}),g.createElement("path",{d:"M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z"}))]]),pae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M242.79,149.32,223.7,97.11A20,20,0,0,0,198.12,85.2l-61.31,22.22L147.7,45.18A20,20,0,0,0,131.55,22L76.87,12.31A19.94,19.94,0,0,0,53.76,28.55l-25,143.13A48,48,0,0,0,67.4,227.26a51.19,51.19,0,0,0,8.7.74H224a20,20,0,0,0,20-20V156.19A21.74,21.74,0,0,0,242.79,149.32ZM99,184.18a23.84,23.84,0,0,1-9.86,15.56,23.28,23.28,0,0,1-17.56,3.89,24,24,0,0,1-19.23-27.82L76.71,36.66,123.37,45,99,184.18Zm23.64,4.13,9.39-53.64,70.49-25.54,16.3,44.59-96.23,34.87C122.62,188.5,122.65,188.41,122.66,188.31ZM220,204H150.52L220,178.82ZM89.22,174.07l-1.4,8A12,12,0,0,1,76,192a12.35,12.35,0,0,1-2.08-.18,12,12,0,0,1-9.75-13.89l1.4-8a12,12,0,0,1,23.64,4.14Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M135.88,43.11l-25,143.14a35.71,35.71,0,0,1-41.34,29.2h0a36,36,0,0,1-28.95-41.71l25-143.13a8,8,0,0,1,9.19-6.49l54.67,9.73A8,8,0,0,1,135.88,43.11Z",opacity:"0.2"}),g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M240,155.91a16,16,0,0,0-1-5.22L219.94,98.48A16,16,0,0,0,199.49,89l-67.81,24.57,12.08-69A16,16,0,0,0,130.84,26L76.17,16.25a15.94,15.94,0,0,0-18.47,13l-25,143.12A43.82,43.82,0,0,0,75.78,224H224a16,16,0,0,0,16-16ZM76,196a16,16,0,1,1,16-16A16,16,0,0,1,76,196Zm42.72-8.38,9.78-55.92L204.92,104,224,156.11,116.78,195A44.89,44.89,0,0,0,118.72,187.62ZM224,208H127.74L224,173.11Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M86,180a10,10,0,1,1-10-10A10,10,0,0,1,86,180Zm152-23.81V208a14,14,0,0,1-14,14H76a44.18,44.18,0,0,1-7.58-.65,42,42,0,0,1-33.81-48.64l25-143.13A13.94,13.94,0,0,1,75.82,18.22l54.67,9.72a14,14,0,0,1,11.3,16.21l-12.67,72.44,71-25.75a14,14,0,0,1,17.89,8.32l19.09,52.22A15.66,15.66,0,0,1,238,156.19Zm-133.07,29L130,42.08a2,2,0,0,0-1.58-2.32L73.72,30l-.34,0a1.84,1.84,0,0,0-1.07.35,2,2,0,0,0-.82,1.3l-25,143.13a30,30,0,0,0,24.09,34.76,29.25,29.25,0,0,0,22-4.89,29.81,29.81,0,0,0,12.33-19.44Zm8.25,13.17L224.71,158a2,2,0,0,0,1.11-1,1.86,1.86,0,0,0,.06-1.46l-19.09-52.21a2,2,0,0,0-2.53-1.17l-77.53,28.09-10,57.07A41.9,41.9,0,0,1,113.18,198.38ZM226,170.27,116.35,210H224a2,2,0,0,0,2-2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.27,152.07,216.19,99.85a12,12,0,0,0-15.34-7.13l-74.3,26.92,13.27-75.83a12,12,0,0,0-9.68-13.9L75.47,20.19a11.75,11.75,0,0,0-8.89,2,11.9,11.9,0,0,0-4.94,7.77l-25,143.13A40,40,0,0,0,68.8,219.39,42.68,42.68,0,0,0,76,220H224a12,12,0,0,0,12-12V156.19A14,14,0,0,0,235.27,152.07Zm-31.7-51.83a4,4,0,0,1,5.1,2.36l19.09,52.21a3.9,3.9,0,0,1-.13,3,3.94,3.94,0,0,1-2.24,2L108.78,202.11a40,40,0,0,0,6-15.17L125,128.73ZM93.75,206.29a31.25,31.25,0,0,1-23.55,5.22,32,32,0,0,1-25.71-37.08l25-143.13a4,4,0,0,1,1.64-2.59A3.85,3.85,0,0,1,73.38,28a4,4,0,0,1,.69.06l54.67,9.73a4,4,0,0,1,3.2,4.64l-25,143.13h0A31.79,31.79,0,0,1,93.75,206.29ZM228,208a4,4,0,0,1-4,4H105l123-44.59ZM84,180a8,8,0,1,1-8-8A8,8,0,0,1,84,180Z"}))]]),mae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),gae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),g.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),vae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),yae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M218.12,209.56l-61-95.8,59.72-65.69a12,12,0,0,0-17.76-16.14L143.81,92.77,106.12,33.56A12,12,0,0,0,96,28H48A12,12,0,0,0,37.88,46.44l61,95.8L39.12,207.93a12,12,0,1,0,17.76,16.14l55.31-60.84,37.69,59.21A12,12,0,0,0,160,228h48a12,12,0,0,0,10.12-18.44ZM166.59,204,69.86,52H89.41l96.73,152Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,216H160L48,40H96Z",opacity:"0.2"}),g.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M215,219.85a8,8,0,0,1-7,4.15H160a8,8,0,0,1-6.75-3.71l-40.49-63.63L53.92,221.38a8,8,0,0,1-11.84-10.76l61.77-68L41.25,44.3A8,8,0,0,1,48,32H96a8,8,0,0,1,6.75,3.71l40.49,63.63,58.84-64.72a8,8,0,0,1,11.84,10.76l-61.77,67.95,62.6,98.38A8,8,0,0,1,215,219.85Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.06,212.78l-63.42-99.66L212.44,44A6,6,0,1,0,203.56,36L143,102.62l-41.9-65.84A6,6,0,0,0,96,34H48a6,6,0,0,0-5.06,9.22l63.42,99.66L43.56,212A6,6,0,0,0,52.44,220L113,153.38l41.9,65.84A6,6,0,0,0,160,222h48a6,6,0,0,0,5.06-9.22ZM163.29,210,58.93,46H92.71L197.07,210Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M211.37,213.85,147.13,112.9,211,42.69A4,4,0,0,0,205,37.31L142.68,105.9,99.38,37.85A4,4,0,0,0,96,36H48a4,4,0,0,0-3.37,6.15L108.87,143.1,45,213.31A4,4,0,1,0,51,218.69l62.36-68.59,43.3,68.05A4,4,0,0,0,160,220h48a4,4,0,0,0,3.37-6.15ZM162.2,212,55.29,44H93.8L200.71,212Z"}))]]),_ae=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),In=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:c,...d}=t,{color:f="currentColor",size:h,weight:m="regular",mirrored:v=!1,...y}=g.useContext(_ae);return g.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??h,height:s??h,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,...y,...d},!!n&&g.createElement("title",null,n),l,c.get(i??m))});In.displayName="IconBase";const XL=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:qoe}));XL.displayName="ArrowLeftIcon";const wae=XL,QL=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:Goe}));QL.displayName="ArrowUpIcon";const bae=QL,JL=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:Yoe}));JL.displayName="CaretDownIcon";const xae=JL,eD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:Xoe}));eD.displayName="CaretRightIcon";const Sae=eD,tD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:Qoe}));tD.displayName="ChatCircleIcon";const kae=tD,nD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:Joe}));nD.displayName="CheckIcon";const Eae=nD,rD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:eae}));rD.displayName="CircleNotchIcon";const W1=rD,sD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:tae}));sD.displayName="CopyIcon";const rm=sD,iD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:nae}));iD.displayName="DotsThreeIcon";const Cae=iD,oD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:rae}));oD.displayName="FolderOpenIcon";const Pae=oD,aD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:sae}));aD.displayName="FolderSimpleIcon";const Tae=aD,lD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:iae}));lD.displayName="HashIcon";const Rae=lD,cD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:oae}));cD.displayName="MagnifyingGlassIcon";const Aae=cD,uD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:aae}));uD.displayName="PencilSimpleIcon";const dD=uD,fD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:lae}));fD.displayName="PushPinIcon";const Bx=fD,hD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:cae}));hD.displayName="SidebarSimpleIcon";const Iae=hD,pD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:uae}));pD.displayName="SignInIcon";const Oae=pD,mD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:dae}));mD.displayName="SignOutIcon";const Mae=mD,gD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:fae}));gD.displayName="SparkleIcon";const yw=gD,vD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:hae}));vD.displayName="SquaresFourIcon";const Nae=vD,yD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:pae}));yD.displayName="SwatchesIcon";const _D=yD,wD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:mae}));wD.displayName="TrashIcon";const bD=wD,xD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:gae}));xD.displayName="UserIcon";const Lae=xD,SD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:vae}));SD.displayName="XIcon";const f6=SD,kD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:yae}));kD.displayName="XLogoIcon";const Dae=kD,$ae="/assets/arena-Db0j1set.png",Fae="data:image/svg+xml,%3csvg%20width='38'%20height='42'%20viewBox='0%200%2038%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2543_2)'%3e%3cmask%20id='mask0_2543_2'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='38'%20height='42'%3e%3cpath%20d='M0%200H38V42H0V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2543_2)'%3e%3cpath%20d='M19.025%2011.898C22.321%2011.898%2024.995%209.237%2024.995%205.949C24.995%202.661%2022.324%200%2019.025%200C15.726%200%2013.055%202.662%2013.055%205.95C13.055%209.237%2015.726%2011.898%2019.025%2011.898ZM19.025%2041.945C22.321%2041.945%2024.995%2039.283%2024.995%2035.995C24.995%2032.708%2022.324%2030.046%2019.025%2030.046C15.726%2030.046%2013.055%2032.708%2013.055%2035.996C13.055%2039.283%2015.726%2041.945%2019.025%2041.945ZM5.97%2019.41C9.266%2019.41%2011.94%2016.748%2011.94%2013.46C11.94%2010.173%209.268%207.511%205.97%207.511C2.67%207.511%200%2010.175%200%2013.463C0%2016.752%202.67%2019.413%205.97%2019.413V19.41ZM32.08%2034.434C35.376%2034.434%2038.05%2031.772%2038.05%2028.484C38.05%2025.197%2035.379%2022.535%2032.08%2022.535C28.781%2022.535%2026.11%2025.197%2026.11%2028.485C26.11%2031.772%2028.781%2034.434%2032.08%2034.434ZM32.08%2019.41C35.376%2019.41%2038.05%2016.748%2038.05%2013.46C38.05%2010.174%2035.379%207.512%2032.08%207.512C28.781%207.512%2026.11%2010.174%2026.11%2013.461C26.11%2016.748%2028.781%2019.41%2032.08%2019.41ZM5.97%2034.433C9.266%2034.433%2011.94%2031.771%2011.94%2028.483C11.94%2025.196%209.268%2022.535%205.97%2022.535C2.67%2022.535%200%2025.202%200%2028.486C0%2031.771%202.67%2034.436%205.97%2034.436V34.433Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2543_2'%3e%3crect%20width='38'%20height='42'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function ED(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=ED(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function CD(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=ED(t))&&(r&&(r+=" "),r+=e);return r}const jae=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},zae=(t,e)=>({classGroupId:t,validator:e}),PD=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),l1="-",zA=[],Vae="arbitrary..",Hae=t=>{const e=Bae(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Uae(o);const l=o.split(l1),c=l[0]===""&&l.length>1?1:0;return TD(l,c,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],d=n[o];return c?d?jae(d,c):c:d||zA}return n[o]||zA}}},TD=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=TD(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(l1):t.slice(e).join(l1),c=o.length;for(let d=0;d<c;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},Uae=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Vae+r:void 0})(),Bae=t=>{const{theme:e,classGroups:n}=t;return Zae(n,e)},Zae=(t,e)=>{const n=PD();for(const r in t){const s=t[r];h6(s,n,r,e)}return n},h6=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];Wae(o,e,n,r)}},Wae=(t,e,n,r)=>{if(typeof t=="string"){Kae(t,e,n);return}if(typeof t=="function"){qae(t,e,n,r);return}Gae(t,e,n,r)},Kae=(t,e,n)=>{const r=t===""?e:RD(e,t);r.classGroupId=n},qae=(t,e,n,r)=>{if(Yae(t)){h6(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(zae(n,t))},Gae=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,c]=s[o];h6(c,RD(e,l),n,r)}},RD=(t,e)=>{let n=t;const r=e.split(l1),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=PD(),n.nextPart.set(o,l)),n=l}return n},Yae=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Xae=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=r[i])!==void 0)return s(i,o),o},set(i,o){i in n?n[i]=o:s(i,o)}}},Zx="!",VA=":",Qae=[],HA=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Jae=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,c=0,d;const f=s.length;for(let _=0;_<f;_++){const b=s[_];if(o===0&&l===0){if(b===VA){i.push(s.slice(c,_)),c=_+1;continue}if(b==="/"){d=_;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const h=i.length===0?s:s.slice(c);let m=h,v=!1;h.endsWith(Zx)?(m=h.slice(0,-1),v=!0):h.startsWith(Zx)&&(m=h.slice(1),v=!0);const y=d&&d>c?d-c:void 0;return HA(i,v,m,y)};if(e){const s=e+VA,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):HA(Qae,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},ele=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],l=o[0]==="[",c=e.has(o);l||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},tle=t=>({cache:Xae(t.cacheSize),parseClassName:Jae(t),sortModifiers:ele(t),postfixLookupClassGroupIds:nle(t),...Hae(t)}),nle=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},rle=/\s+/,sle=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],c=t.trim().split(rle);let d="";for(let f=c.length-1;f>=0;f-=1){const h=c[f],{isExternal:m,modifiers:v,hasImportantModifier:y,baseClassName:_,maybePostfixModifierPosition:b}=n(h);if(m){d=h+(d.length>0?" "+d:d);continue}let x=!!b,k;if(x){const I=_.substring(0,b);k=r(I);const A=k&&o[k]?r(_):void 0;A&&A!==k&&(k=A,x=!1)}else k=r(_);if(!k){if(!x){d=h+(d.length>0?" "+d:d);continue}if(k=r(_),!k){d=h+(d.length>0?" "+d:d);continue}x=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),P=y?C+Zx:C,R=P+k;if(l.indexOf(R)>-1)continue;l.push(R);const O=s(k,x);for(let I=0;I<O.length;++I){const A=O[I];l.push(P+A)}d=h+(d.length>0?" "+d:d)}return d},ile=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=AD(n))&&(s&&(s+=" "),s+=r);return s},AD=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=AD(t[r]))&&(n&&(n+=" "),n+=e);return n},ole=(t,...e)=>{let n,r,s,i;const o=c=>{const d=e.reduce((f,h)=>h(f),t());return n=tle(d),r=n.cache.get,s=n.cache.set,i=l,l(c)},l=c=>{const d=r(c);if(d)return d;const f=sle(c,n);return s(c,f),f};return i=o,(...c)=>i(ile(...c))},ale=[],Rr=t=>{const e=n=>n[t]||ale;return e.isThemeGetter=!0,e.themeKey=t,e},ID=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,OD=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lle=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,cle=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ule=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dle=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,fle=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hle=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tl=t=>lle.test(t),At=t=>!!t&&!Number.isNaN(Number(t)),zo=t=>!!t&&Number.isInteger(Number(t)),_w=t=>t.endsWith("%")&&At(t.slice(0,-1)),Ta=t=>cle.test(t),MD=()=>!0,ple=t=>ule.test(t)&&!dle.test(t),p6=()=>!1,mle=t=>fle.test(t),gle=t=>hle.test(t),vle=t=>!He(t)&&!Ze(t),yle=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),_le=t=>bc(t,DD,p6),He=t=>ID.test(t),qc=t=>bc(t,$D,ple),UA=t=>bc(t,Ple,At),wle=t=>bc(t,jD,MD),ble=t=>bc(t,FD,p6),BA=t=>bc(t,ND,p6),xle=t=>bc(t,LD,gle),_g=t=>bc(t,zD,mle),Ze=t=>OD.test(t),Kh=t=>Vu(t,$D),Sle=t=>Vu(t,FD),ZA=t=>Vu(t,ND),kle=t=>Vu(t,DD),Ele=t=>Vu(t,LD),wg=t=>Vu(t,zD,!0),Cle=t=>Vu(t,jD,!0),bc=(t,e,n)=>{const r=ID.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Vu=(t,e,n=!1)=>{const r=OD.exec(t);return r?r[1]?e(r[1]):n:!1},ND=t=>t==="position"||t==="percentage",LD=t=>t==="image"||t==="url",DD=t=>t==="length"||t==="size"||t==="bg-size",$D=t=>t==="length",Ple=t=>t==="number",FD=t=>t==="family-name",jD=t=>t==="number"||t==="weight",zD=t=>t==="shadow",Tle=()=>{const t=Rr("color"),e=Rr("font"),n=Rr("text"),r=Rr("font-weight"),s=Rr("tracking"),i=Rr("leading"),o=Rr("breakpoint"),l=Rr("container"),c=Rr("spacing"),d=Rr("radius"),f=Rr("shadow"),h=Rr("inset-shadow"),m=Rr("text-shadow"),v=Rr("drop-shadow"),y=Rr("blur"),_=Rr("perspective"),b=Rr("aspect"),x=Rr("ease"),k=Rr("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...P(),Ze,He],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],A=()=>[Ze,He,c],M=()=>[Tl,"full","auto",...A()],L=()=>[zo,"none","subgrid",Ze,He],z=()=>["auto",{span:["full",zo,Ze,He]},zo,Ze,He],$=()=>[zo,"auto",Ze,He],q=()=>["auto","min","max","fr",Ze,He],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...A()],ee=()=>[Tl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],V=()=>[l,Tl,"screen","full","dvw","lvw","svw","min","max","fit",...A()],Q=()=>[Tl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],B=()=>[t,Ze,He],D=()=>[...P(),ZA,BA,{position:[Ze,He]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],fe=()=>["auto","cover","contain",kle,_le,{size:[Ze,He]}],ie=()=>[_w,Kh,qc],ue=()=>["","none","full",d,Ze,He],he=()=>["",At,Kh,qc],_e=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[At,_w,ZA,BA],be=()=>["","none",y,Ze,He],Ve=()=>["none",At,Ze,He],De=()=>["none",At,Ze,He],$e=()=>[At,Ze,He],Ut=()=>[Tl,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ta],breakpoint:[Ta],color:[MD],container:[Ta],"drop-shadow":[Ta],ease:["in","out","in-out"],font:[vle],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ta],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ta],shadow:[Ta],spacing:["px",At],text:[Ta],"text-shadow":[Ta],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Tl,He,Ze,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Ze,He]}],"container-named":[yle],columns:[{columns:[At,"auto",He,Ze,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[zo,"auto",Ze,He]}],basis:[{basis:[Tl,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,Tl,"auto","initial","none",He]}],grow:[{grow:["",At,Ze,He]}],shrink:[{shrink:["",At,Ze,He]}],order:[{order:[zo,"first","last","none",Ze,He]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...ee()]}],"min-w":[{"min-w":[l,"screen","none",...ee()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh","none",...ee()]}],"font-size":[{text:["base",n,Kh,qc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Cle,wle]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_w,He]}],"font-family":[{font:[Sle,ble,e]}],"font-features":[{"font-features":[He]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ze,He]}],"line-clamp":[{"line-clamp":[At,"none",Ze,UA]}],leading:[{leading:["none",i,...A()]}],"list-image":[{"list-image":["none",Ze,He]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,He]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._e(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",Ze,qc]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[At,"auto",Ze,He]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[zo,Ze,He]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze,He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze,He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:fe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},zo,Ze,He],radial:["",Ze,He],conic:["",zo,Ze,He]},Ele,xle]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[..._e(),"hidden","none"]}],"divide-style":[{divide:[..._e(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[..._e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,Ze,He]}],"outline-w":[{outline:["",At,Kh,qc]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","inner","none",f,wg,_g]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",h,wg,_g]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[At,qc]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",m,wg,_g]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[At,Ze,He]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[At]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Ze,He]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:fe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,He]}],filter:[{filter:["","none",Ze,He]}],blur:[{blur:be()}],brightness:[{brightness:[At,Ze,He]}],contrast:[{contrast:[At,Ze,He]}],"drop-shadow":[{"drop-shadow":["","none",v,wg,_g]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",At,Ze,He]}],"hue-rotate":[{"hue-rotate":[At,Ze,He]}],invert:[{invert:["",At,Ze,He]}],saturate:[{saturate:[At,Ze,He]}],sepia:[{sepia:["",At,Ze,He]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,He]}],"backdrop-blur":[{"backdrop-blur":be()}],"backdrop-brightness":[{"backdrop-brightness":[At,Ze,He]}],"backdrop-contrast":[{"backdrop-contrast":[At,Ze,He]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,Ze,He]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,Ze,He]}],"backdrop-invert":[{"backdrop-invert":["",At,Ze,He]}],"backdrop-opacity":[{"backdrop-opacity":[At,Ze,He]}],"backdrop-saturate":[{"backdrop-saturate":[At,Ze,He]}],"backdrop-sepia":[{"backdrop-sepia":["",At,Ze,He]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ze,He]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",Ze,He]}],ease:[{ease:["linear","initial",x,Ze,He]}],delay:[{delay:[At,Ze,He]}],animate:[{animate:["none",k,Ze,He]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ze,He]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Ve()}],"rotate-x":[{"rotate-x":Ve()}],"rotate-y":[{"rotate-y":Ve()}],"rotate-z":[{"rotate-z":Ve()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:$e()}],"skew-x":[{"skew-x":$e()}],"skew-y":[{"skew-y":$e()}],transform:[{transform:[Ze,He,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ut()}],"translate-x":[{"translate-x":Ut()}],"translate-y":[{"translate-y":Ut()}],"translate-z":[{"translate-z":Ut()}],"translate-none":["translate-none"],zoom:[{zoom:[zo,Ze,He]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze,He]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze,He]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[At,Kh,qc,UA]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Rle=ole(Tle);function mn(...t){return Rle(CD(t))}const Ap=({provider:t,className:e})=>{if(t==="x")return S.jsx(Dae,{className:mn("h-6 w-6",e),"aria-hidden":"true"});if(t==="pinterest")return S.jsx("svg",{viewBox:"0 0 24 24",className:mn("h-6 w-6",e),"aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})});const n=t==="cosmos"?Fae:$ae;return S.jsx("span",{"aria-hidden":"true",className:mn("h-6 w-6",t==="cosmos"?"bg-current":"bg-[#b1b1b1]",e),style:{WebkitMaskImage:`url("${n}")`,maskImage:`url("${n}")`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}})},Ale=t=>{const e=new URL(t).hostname.replace(/^www\./,"");return e==="are.na"?"arena":e==="pinterest.com"||e==="pin.it"?"pinterest":e==="x.com"?"x":e==="cosmos.so"?"cosmos":null},Ile=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=g.useState(!1),i=!!e&&!r,o=t.url?Ale(t.url):null,l=t.url??(i?e:void 0),c=l?"a":"span",d=i&&t.url?new URL(t.url).hostname:t.title;return S.jsxs(c,{href:l,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,"aria-label":t.title,onPointerDown:f=>f.stopPropagation(),onKeyDown:f=>{(f.key!=="ArrowUp"&&f.key!=="ArrowDown"||f.altKey||f.ctrlKey||f.metaKey||f.shiftKey)&&f.stopPropagation()},onClick:f=>{f.stopPropagation(),l&&n()},className:mn("border-main-border bg-main-input text-content hover:border-content-muted/50 flex max-w-full min-w-0 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border pr-1.5 text-xs focus-visible:outline-2 focus-visible:-outline-offset-2",!i&&"py-1.5 pl-2"),children:[i?S.jsx("img",{src:e,alt:"",className:"h-8 w-12 shrink-0 object-contain",width:48,height:32,onError:()=>s(!0)}):null,o&&(i||o==="cosmos")?S.jsx(Ap,{provider:o,className:mn("h-3.5 w-3.5 shrink-0",o==="pinterest"&&"text-[#e60023]")}):null,!i||!o?S.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},Ole=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=Ai(),l=aJ(t);return l?S.jsx("div",{className:mn("ph-no-capture flex min-w-0 flex-nowrap gap-1.5 overflow-x-auto pr-3 pb-2",i),"aria-label":"References",children:l.map(c=>{var h;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=c.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(c.id)}/image${d}`:void 0;return S.jsx(Ile,{reference:c,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:e,reference_count:l.length})},`${c.id}:${((h=c.image)==null?void 0:h.hash)??""}:${f??""}`)})}):null},sye=t=>{const e=t.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=e[3];if(e[2]==="references")return{kind:"references"};if(e[2]!=="projects"||!n)return{kind:"library"};const r=e[4]==="variants"?e[5]:void 0,s=e[4]==="variants"?e[6]:void 0,i=new URLSearchParams(t.search);return r&&s&&i.get("edit")!=="1"?{kind:"preview",projectId:n,sessionId:r,variantId:s}:{kind:"workspace",projectId:n,sessionId:r,variantId:s}},iye=t=>{if(t.kind==="references")return"/rivet/library/references";if(t.kind==="library"||!t.projectId)return"/rivet/library";const e=`/rivet/library/projects/${encodeURIComponent(t.projectId)}`;return t.sessionId&&t.variantId?`${e}/variants/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${t.kind==="workspace"?"?edit=1":""}`:e},Mle=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},WA=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,KA=CD,Nle=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return KA(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],h=i==null?void 0:i[d];if(f===null)return null;const m=WA(f)||WA(h);return s[d][m]}),l=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:h,className:m,...v}=f;return Object.entries(v).every(y=>{let[_,b]=y;return Array.isArray(b)?b.includes({...i,...l}[_]):{...i,...l}[_]===b})?[...d,h,m]:d},[]);return KA(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},VD={pill:{item:"rounded-[20px]",bg:"rounded-[20px]",focusRing:"rounded-[22px]",mergedBg:"rounded-2xl",container:"rounded-3xl",button:"rounded-[20px]",input:"rounded-[20px]"},rounded:{item:"rounded-lg",bg:"rounded-lg",focusRing:"rounded-[10px]",mergedBg:"rounded-lg",container:"rounded-xl",button:"rounded-lg",input:"rounded-lg"}},HD=g.createContext(null);function Fm(){const t=g.useContext(HD);return t?t.classes:VD.pill}function Lle(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function Dle({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{Lle(()=>r(i))},[]);return S.jsx(HD.Provider,{value:{shape:n,setShape:s,classes:VD[n]},children:t})}const $le=Nle(["group/button relative isolate inline-flex cursor-pointer items-center justify-center outline-none","transition-colors duration-80 motion-reduce:transition-none","disabled:pointer-events-none disabled:opacity-50","focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]"],{variants:{variant:{primary:"text-background",secondary:"text-foreground",tertiary:"text-foreground",ghost:"text-muted-foreground hover:text-foreground aria-expanded:text-foreground aria-pressed:text-foreground"},size:{default:"h-9 gap-1.5 px-4 text-[13px]",compact:"h-7 gap-1 px-3 text-[12px]",icon:"h-9 w-9 p-0 [&_svg]:h-4 [&_svg]:w-4","icon-compact":"h-7 w-7 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5"},iconLeft:{true:""},iconRight:{true:""}},compoundVariants:[{size:"compact",iconLeft:!0,className:"pl-2"},{size:"default",iconLeft:!0,className:"pl-3"},{size:"compact",iconRight:!0,className:"pr-2"},{size:"default",iconRight:!0,className:"pr-3"}],defaultVariants:{variant:"secondary",size:"default"}}),qA={default:16,compact:14},Fle={primary:"[--btn-bg:var(--foreground)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",secondary:"[--btn-bg:var(--accent)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--accent)_80%,var(--background))] group-active/button:[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",tertiary:"bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover/button:bg-hover group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]",ghost:"bg-transparent shadow-[0_0_0_1px_transparent] group-hover/button:bg-hover group-hover/button:shadow-[0_0_0_1px_var(--hover)] group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--active)] group-aria-expanded/button:bg-active group-aria-expanded/button:shadow-[0_0_0_0px_var(--active)] group-aria-pressed/button:bg-active group-aria-pressed/button:shadow-[0_0_0_0px_var(--active)]"},UD=g.forwardRef(({className:t,variant:e,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:l,type:c="button",...d},f)=>{const h=e??"secondary",m=n??"default",v=m==="icon"||m==="icon-compact",y=m==="compact"||m==="icon-compact",_=y?qA.compact:qA.default,b=Fm();return S.jsxs("button",{...d,ref:f,type:c,disabled:o||r,"aria-busy":r||d["aria-busy"],className:mn($le({variant:h,size:m,iconLeft:!v&&!!s,iconRight:!v&&!!i}),b.button,t),children:[S.jsx("span",{"aria-hidden":!0,className:mn("absolute inset-px rounded-[inherit] transition-[box-shadow,background-color] [transition-duration:180ms,80ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1),ease] group-active/button:[transition-duration:80ms,80ms] motion-reduce:transition-none",Fle[h])}),S.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[S.jsxs("span",{className:mn("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?S.jsx(s,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null,S.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:l}),i&&!v?S.jsx(i,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null]}),r?S.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:S.jsx("svg",{className:y?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:S.jsx("path",{d:"M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",stroke:"currentColor",strokeWidth:"1.125",strokeLinecap:"round",pathLength:"100",className:"motion-safe:animate-[spinner-move_2s_linear_infinite,spinner-dash_4s_ease-in-out_infinite]",style:{strokeDasharray:"15 85"}})})}):null]})]})});UD.displayName="Button";var jle=Object.defineProperty,Qf=(t,e)=>jle(t,"name",{value:e,configurable:!0}),BD=!!(typeof window<"u"&&window.document&&window.document.createElement);function bn(t,e,{checkForDefaultPrevented:n=!0}={}){return Qf(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}Qf(bn,"composeEventHandlers");function zle(t){var e;if(!BD)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Qf(zle,"getOwnerWindow");function Wx(t){if(!BD)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Qf(Wx,"getOwnerDocument");function ZD(t,e=!1){const{activeElement:n}=Wx(t);if(!(n!=null&&n.nodeName))return null;if(WD(n)&&n.contentDocument)return ZD(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=Wx(n).getElementById(r);if(s)return s}}return n}Qf(ZD,"getActiveElement");function WD(t){return t.tagName==="IFRAME"}Qf(WD,"isFrame");var Vle=Object.defineProperty,m6=(t,e)=>Vle(t,"name",{value:e,configurable:!0});function Kx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}m6(Kx,"setRef");function KD(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Kx(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Kx(t[s],null)}}}}m6(KD,"composeRefs");function xn(...t){return g.useCallback(KD(...t),t)}m6(xn,"useComposedRefs");var Hle=Object.defineProperty,Wi=(t,e)=>Hle(t,"name",{value:e,configurable:!0});function Ule(t,e){const n=g.createContext(e);n.displayName=t+"Context";const r=Wi(i=>{const{children:o,...l}=i,c=g.useMemo(()=>l,Object.values(l));return S.jsx(n.Provider,{value:c,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,c=g.useContext(n);if(c)return c;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Wi(s,"useContext"),[r,s]}Wi(Ule,"createContext");function pa(t,e=[]){let n=[];function r(i,o){const l=g.createContext(o);l.displayName=i+"Context";const c=n.length;n=[...n,o];const d=Wi(h=>{var x;const{scope:m,children:v,...y}=h,_=((x=m==null?void 0:m[t])==null?void 0:x[c])||l,b=g.useMemo(()=>y,Object.values(y));return S.jsx(_.Provider,{value:b,children:v})},"Provider");d.displayName=i+"Provider";function f(h,m,v={}){var x;const{optional:y=!1}=v,_=((x=m==null?void 0:m[t])==null?void 0:x[c])||l,b=g.useContext(_);if(b)return b;if(o!==void 0)return o;if(!y)throw new Error(`\`${h}\` must be used within \`${i}\``)}return Wi(f,"useContext"),[d,f]}Wi(r,"createContext");const s=Wi(()=>{const i=n.map(o=>g.createContext(o));return Wi(function(l){const c=(l==null?void 0:l[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])},"useScope")},"createScope");return s.scopeName=t,[r,qD(s,...e)]}Wi(pa,"createContextScope");function qD(...t){const e=t[0];if(t.length===1)return e;const n=Wi(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Wi(function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const h=c(i)[`__scope${d}`];return{...l,...h}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Wi(qD,"composeContextScopes");var Ble=Object.defineProperty,Ii=(t,e)=>Ble(t,"name",{value:e,configurable:!0});function fc(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const c=[];s=t$(s),g.Children.forEach(s,m=>{var v;if(JD(m)){l=!0;const y=m;let _="child"in y.props?y.props.child:y.props.children;for(;g6(_)&&typeof c1=="function";)_=c1(_._payload);o=Zle(y,_),c.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else c.push(m)}),o?o=g.cloneElement(o,void 0,c):!l&&g.Children.count(s)===1&&g.isValidElement(s)&&(o=s);const d=o?QD(o):void 0,f=xn(r,d);if(!o){if(s||s===0)throw new Error(l?qle(t):Kle(t));return s}const h=XD(i,o.props??{});return o.type!==g.Fragment&&(h.ref=r?f:d),g.cloneElement(o,h)});return e.displayName=`${t}.Slot`,e}Ii(fc,"createSlot");var GD=Symbol.for("radix.slottable");function YD(t){const e=Ii(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=GD,e}Ii(YD,"createSlottable");var Zle=Ii((t,e)=>"child"in t.props?g.isValidElement(e)?g.cloneElement(e,void 0,t.props.children(e.props.children)):null:g.isValidElement(e)?e:null,"getSlottableElementFromSlottable");function XD(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"?n[r]=[s,i].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=n$(i,s))}return{...t,...n}}Ii(XD,"mergeProps");function QD(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Ii(QD,"getElementRef");function JD(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===GD}Ii(JD,"isSlottable");var Wle=Symbol.for("react.lazy");function g6(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Wle&&"_payload"in t&&e$(t._payload)}Ii(g6,"isLazyComponent");function e$(t){return typeof t=="object"&&t!==null&&"then"in t}Ii(e$,"isPromiseLike");function t$(t){let e=t;for(;g6(e)&&typeof c1=="function";)e=c1(e._payload);return e}Ii(t$,"useUnwrappedLazy");function n$(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Ii(n$,"concatAriaDescribedby");var Kle=Ii(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),qle=Ii(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),c1=Zf[" use ".trim().toString()],Gle=Object.defineProperty,Yle=(t,e)=>Gle(t,"name",{value:e,configurable:!0}),Xle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],er=Xle.reduce((t,e)=>{const n=fc(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function r$(t,e){t&&$m.flushSync(()=>t.dispatchEvent(e))}Yle(r$,"dispatchDiscreteCustomEvent");var _s=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Qle=Object.defineProperty,Jle=(t,e)=>Qle(t,"name",{value:e,configurable:!0}),GA=Zf[" useInsertionEffect ".trim().toString()];function $u(t){const e=g.useRef(t);return typeof GA=="function"?GA(()=>{e.current=t}):_s(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}Jle($u,"useCallbackRef");var ece=Object.defineProperty,Br=(t,e)=>ece(t,"name",{value:e,configurable:!0}),qx="dismissableLayer.update",tce="dismissableLayer.pointerDownOutside",nce="dismissableLayer.focusOutside",YA,s$=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),v6=g.forwardRef(Br(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,h=g.useContext(s$),[m,v]=g.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=g.useState({}),b=xn(n,v),x=Array.from(h.layers),[k]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=k?x.indexOf(k):-1,P=m?x.indexOf(m):-1,R=h.layersWithOutsidePointerEventsDisabled.size>0,O=P>=C,I=g.useRef(!1),A=o$($=>{o==null||o($),c==null||c($),$.defaultPrevented||d==null||d()},{ownerDocument:y,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback($=>{if(!($ instanceof Node))return!1;const q=[...h.branches].some(X=>X.contains($));return O&&!q},[h.branches,O])}),M=a$($=>{if(s&&I.current)return;const q=$.target;[...h.branches].some(K=>K.contains(q))||(l==null||l($),c==null||c($),$.defaultPrevented||d==null||d())},y),L=m?P===x.length-1:!1,z=$u($=>{$.key==="Escape"&&(i==null||i($),!$.defaultPrevented&&d&&($.preventDefault(),d()))});return g.useEffect(()=>{if(L)return y.addEventListener("keydown",z,{capture:!0}),()=>y.removeEventListener("keydown",z,{capture:!0})},[y,L,z]),g.useEffect(()=>{if(m)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(YA=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),Gx(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(m),h.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=YA))}},[m,y,r,h]),g.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),Gx())},[m,h]),g.useEffect(()=>{const $=Br(()=>_({}),"handleUpdate");return document.addEventListener(qx,$),()=>document.removeEventListener(qx,$)},[]),S.jsx(er.div,{...f,ref:b,style:{pointerEvents:R?O?"auto":"none":void 0,...e.style},onFocusCapture:bn(e.onFocusCapture,M.onFocusCapture),onBlurCapture:bn(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:bn(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function i$(){const t=g.useContext(s$),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Br(i$,"useDismissableLayerSurface");var rce=Br(()=>!0,"IS_TRUE");function o$(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=rce}=e,l=$u(t),c=g.useRef(!1),d=g.useRef(!1),f=g.useRef(new Map),h=g.useRef(()=>{});return g.useEffect(()=>{function m(){d.current=!1,s.current=!1,f.current.clear()}Br(m,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}Br(v,"isOutsideInteractionIntercepted");function y(C){if(!d.current)return;const P=C.target;P instanceof Node&&[...i].some(O=>O.contains(P))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&h.current()},0)}Br(y,"handleInteractionCapture");function _(C){d.current&&f.current.set(C.type,!1)}Br(_,"handleInteractionBubble");const b=Br(C=>{if(C.target&&!c.current){let P=function(){n.removeEventListener("click",h.current);const O=v();m(),O||y6(tce,l,R,{discrete:!0})};if(Br(P,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",h.current),m(),c.current=!1;return}const R={originalEvent:C};d.current=!0,s.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?P():(n.removeEventListener("click",h.current),h.current=P,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),m();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of x)n.addEventListener(C,y,!0),n.addEventListener(C,_);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",b),n.removeEventListener("click",h.current);for(const C of x)n.removeEventListener(C,y,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:Br(()=>c.current=!0,"onPointerDownCapture")}}Br(o$,"usePointerDownOutside");function a$(t,e=globalThis==null?void 0:globalThis.document){const n=$u(t),r=g.useRef(!1);return g.useEffect(()=>{const s=Br(i=>{i.target&&!r.current&&y6(nce,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:Br(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Br(()=>r.current=!1,"onBlurCapture")}}Br(a$,"useFocusOutside");function Gx(){const t=new CustomEvent(qx);document.dispatchEvent(t)}Br(Gx,"dispatchUpdate");function y6(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?r$(s,i):s.dispatchEvent(i)}Br(y6,"handleAndDispatchCustomEvent");var sce=Object.defineProperty,br=(t,e)=>sce(t,"name",{value:e,configurable:!0}),ww="focusScope.autoFocusOnMount",bw="focusScope.autoFocusOnUnmount",XA={bubbles:!1,cancelable:!0},l$=g.forwardRef(br(function(e,n){const{loop:r=!1,trapped:s=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:l,...c}=e,[d,f]=g.useState(null),h=$u(o),m=$u(l),v=g.useRef(null),y=xn(n,f),_=g.useRef(i);g.useEffect(()=>{_.current=i});const b=g.useCallback(C=>{var P;return C?d!=null&&d.contains(C)?!0:!!((P=_.current)!=null&&P.some(R=>R.contains(C))):!1},[d]),x=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let C=function(I){if(x.paused||!d)return;const A=I.target;b(A)?v.current=A:Da(v.current,{select:!0})},P=function(I){if(x.paused||!d)return;const A=I.relatedTarget;A!==null&&(b(A)||Da(v.current,{select:!0}))},R=function(I){if(document.activeElement===document.body)for(const M of I)M.removedNodes.length>0&&Da(d)};br(C,"handleFocusIn"),br(P,"handleFocusOut"),br(R,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",P);const O=new MutationObserver(R);return d&&O.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",P),O.disconnect()}}},[s,d,x.paused,b]),g.useEffect(()=>{if(d){QA.add(x);const C=document.activeElement;if(!d.contains(C)){const R=new CustomEvent(ww,XA);d.addEventListener(ww,h),d.dispatchEvent(R),R.defaultPrevented||(u$(m$(x6(d)),{select:!0}),document.activeElement===C&&Da(d))}return()=>{d.removeEventListener(ww,h);const R=d.ownerDocument,O=CustomEvent;setTimeout(()=>{const I=new O(bw,XA);d.addEventListener(bw,m),d.dispatchEvent(I),I.defaultPrevented||Da(C??R.body,{select:!0}),d.removeEventListener(bw,m),QA.remove(x)},0)}}},[d,h,m,x]);const k=g.useCallback(C=>{if(!r&&!s||x.paused)return;const P=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,R=document.activeElement;if(P&&R){const O=C.currentTarget,[I,A]=d$(O);I&&A?!C.shiftKey&&R===A?(C.preventDefault(),r&&Da(I,{select:!0})):C.shiftKey&&R===I&&(C.preventDefault(),r&&Da(A,{select:!0})):R===O&&C.preventDefault()}},[r,s,x.paused]);return S.jsx(er.div,{tabIndex:-1,...c,ref:y,onKeyDown:k})},"FocusScope")),c$=g.createContext(null);function _6({registry:t,children:e}){return t?S.jsx(c$.Provider,{value:t,children:e}):e}br(_6,"FocusScopeBranchProvider");function w6(){const[t,e]=g.useState([]),n=g.useMemo(()=>({add:br(r=>e(s=>s.includes(r)?s:[...s,r]),"add"),remove:br(r=>e(s=>s.filter(i=>i!==r)),"remove")}),[]);return{nodes:t,registry:n}}br(w6,"useFocusScopeBranchRegistry");function b6(t){const e=g.useContext(c$);g.useEffect(()=>{if(!(!t||!e))return e.add(t),()=>e.remove(t)},[t,e])}br(b6,"useFocusScopeBranch");function u$(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Da(r,{select:e}),document.activeElement!==n)return}br(u$,"focusFirst");function d$(t){const e=x6(t),n=Yx(e,t),r=Yx(e.reverse(),t);return[n,r]}br(d$,"getTabbableEdges");function x6(t){const e=[],r=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:br(s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)e.push(r.currentNode);return e}br(x6,"getTabbableCandidates");function Yx(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):f$(r,{upTo:e})))return r}br(Yx,"findVisible");function f$(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}br(f$,"isHidden");function h$(t){return t.tagName==="INPUT"&&typeof t.select=="function"}br(h$,"isSelectableInput");function Da(t,{select:e=!1}={}){if(t&&t.focus){const r=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==r&&h$(t)&&e&&t.select()}}br(Da,"focus");var QA=p$();function p$(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Xx(t,e),t.unshift(e)},remove(e){var n;t=Xx(t,e),(n=t[0])==null||n.resume()}}}br(p$,"createFocusScopesStack");function Xx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}br(Xx,"arrayRemove");function m$(t){return t.filter(e=>e.tagName!=="A")}br(m$,"removeLinks");var ice=Object.defineProperty,oce=(t,e)=>ice(t,"name",{value:e,configurable:!0}),ace=Zf[" useId ".trim().toString()]||(()=>{}),lce=0;function ia(t){const[e,n]=g.useState(ace());return _s(()=>{t||n(r=>r??String(lce++))},[t]),t||(e?`radix-${e}`:"")}oce(ia,"useId");const cce=["top","right","bottom","left"],hc=Math.min,qa=Math.max,u1=Math.round,bg=Math.floor,Ga=t=>({x:t,y:t}),uce={left:"right",right:"left",bottom:"top",top:"bottom"};function g$(t,e,n){return qa(t,hc(e,n))}function Ja(t,e){return typeof t=="function"?t(e):t}function pc(t){return t.split("-")[0]}function Jf(t){return t.split("-")[1]}function S6(t){return t==="x"?"y":"x"}function k6(t){return t==="y"?"height":"width"}function ea(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function E6(t){return S6(ea(t))}function dce(t,e,n){n===void 0&&(n=!1);const r=Jf(t),s=E6(t),i=k6(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=d1(o)),[o,d1(o)]}function fce(t){const e=d1(t);return[Qx(t),e,Qx(e)]}function Qx(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const JA=["left","right"],eI=["right","left"],hce=["top","bottom"],pce=["bottom","top"];function mce(t,e,n){switch(t){case"top":case"bottom":return n?e?eI:JA:e?JA:eI;case"left":case"right":return e?hce:pce;default:return[]}}function gce(t,e,n,r){const s=Jf(t);let i=mce(pc(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Qx)))),i}function d1(t){const e=pc(t);return uce[e]+t.slice(e.length)}function vce(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function v$(t){return typeof t!="number"?vce(t):{top:t,right:t,bottom:t,left:t}}function f1(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function tI(t,e,n){let{reference:r,floating:s}=t;const i=ea(e),o=E6(e),l=k6(o),c=pc(e),d=i==="y",f=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,m=r[l]/2-s[l]/2;let v;switch(c){case"top":v={x:f,y:r.y-s.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-s.width,y:h};break;default:v={x:r.x,y:r.y}}const y=Jf(e);return y&&(v[o]+=m*(y==="end"?1:-1)*(n&&d?-1:1)),v}async function yce(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:v=0}=Ja(e,t),y=v$(v),b=l[m?h==="floating"?"reference":"floating":h],x=f1(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:c})),k=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),P=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},R=f1(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:C,strategy:c}):k);return{top:(x.top-R.top+y.top)/P.y,bottom:(R.bottom-x.bottom+y.bottom)/P.y,left:(x.left-R.left+y.left)/P.x,right:(R.right-x.right+y.right)/P.x}}const _ce=50,wce=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:yce},c=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:h}=tI(d,r,c),m=r,v=0;const y={};for(let _=0;_<i.length;_++){const b=i[_];if(!b)continue;const{name:x,fn:k}=b,{x:C,y:P,data:R,reset:O}=await k({x:f,y:h,initialPlacement:r,placement:m,strategy:s,middlewareData:y,rects:d,platform:l,elements:{reference:t,floating:e}});f=C??f,h=P??h,y[x]={...y[x],...R},O&&v<_ce&&(v++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(d=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:f,y:h}=tI(d,m,c)),_=-1)}return{x:f,y:h,placement:m,strategy:s,middlewareData:y}},bce=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:c}=e,{element:d,padding:f=0}=Ja(t,e)||{};if(d==null)return{};const h=v$(f),m={x:n,y:r},v=E6(s),y=k6(v),_=await o.getDimensions(d),b=v==="y",x=b?"top":"left",k=b?"bottom":"right",C=b?"clientHeight":"clientWidth",P=i.reference[y]+i.reference[v]-m[v]-i.floating[y],R=m[v]-i.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let I=O?O[C]:0;(!I||!await(o.isElement==null?void 0:o.isElement(O)))&&(I=l.floating[C]||i.floating[y]);const A=P/2-R/2,M=I/2-_[y]/2-1,L=hc(h[x],M),z=hc(h[k],M),$=I-_[y]-z,q=I/2-_[y]/2+A,X=g$(L,q,$),K=!c.arrow&&Jf(s)!=null&&q!==X&&i.reference[y]/2-(q<L?L:z)-_[y]/2<0,H=K?q<L?q-L:q-$:0;return{[v]:m[v]+H,data:{[v]:X,centerOffset:q-X-H,...K&&{alignmentOffset:H}},reset:K}}}),xce=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:_=!0,...b}=Ja(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=pc(s),k=ea(l),C=pc(l)===l,P=await(c.isRTL==null?void 0:c.isRTL(d.floating)),R=m||(C||!_?[d1(l)]:fce(l)),O=y!=="none";!m&&O&&R.push(...gce(l,_,y,P));const I=[l,...R],A=await c.detectOverflow(e,b),M=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&M.push(A[x]),h){const X=dce(s,o,P);M.push(A[X[0]],A[X[1]])}if(L=[...L,{placement:s,overflows:M}],!M.every(X=>X<=0)){var z,$;const X=(((z=i.flip)==null?void 0:z.index)||0)+1,K=I[X];if(K&&(!(h==="alignment"?k!==ea(K):!1)||L.every(V=>ea(V.placement)===k?V.overflows[0]>0:!0)))return{data:{index:X,overflows:L},reset:{placement:K}};let H=($=L.filter(ee=>ee.overflows[0]<=0).sort((ee,V)=>ee.overflows[1]-V.overflows[1])[0])==null?void 0:$.placement;if(!H)switch(v){case"bestFit":{var q;const ee=(q=L.filter(V=>{if(O){const Q=ea(V.placement);return Q===k||Q==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(Q=>Q>0).reduce((Q,B)=>Q+B,0)]).sort((V,Q)=>V[1]-Q[1])[0])==null?void 0:q[0];ee&&(H=ee);break}case"initialPlacement":H=l;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function nI(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function rI(t){return cce.some(e=>t[e]>=0)}const Sce=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Ja(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=nI(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:rI(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=nI(o,n.floating);return{data:{escapedOffsets:l,escaped:rI(l)}}}default:return{}}}}},y$=new Set(["left","top"]);async function kce(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=pc(n),l=Jf(n),c=ea(n)==="y",d=y$.has(o)?-1:1,f=i&&c?-1:1,h=Ja(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof y=="number"&&(v=l==="end"?y*-1:y),c?{x:v*f,y:m*d}:{x:m*d,y:v*f}}const Ece=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=e,c=await kce(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},Cce=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:k=>{let{x:C,y:P}=k;return{x:C,y:P}}},...d}=Ja(t,e),f={x:n,y:r},h=await i.detectOverflow(e,d),m=ea(s),v=S6(m);let y=f[v],_=f[m];const b=(k,C)=>g$(C+h[k==="y"?"top":"left"],C,C-h[k==="y"?"bottom":"right"]);o&&(y=b(v,y)),l&&(_=b(m,_));const x=c.fn({...e,[v]:y,[m]:_});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:o,[m]:l}}}}}},Pce=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:c}=e,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=Ja(t,e),m={x:s,y:i},v=ea(o),y=S6(v);let _=m[y],b=m[v];const x=Ja(d,e),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(r=x.crossAxis)!=null?r:0};if(f){const R=y==="y"?"height":"width",O=l.reference[y]-l.floating[R]+k.mainAxis,I=l.reference[y]+l.reference[R]-k.mainAxis;_<O?_=O:_>I&&(_=I)}if(h){var C,P;const R=y==="y"?"width":"height",O=y$.has(pc(o)),I=l.reference[v]-l.floating[R]+(O&&((C=c.offset)==null?void 0:C[v])||0)+(O?0:k.crossAxis),A=l.reference[v]+l.reference[R]+(O?0:((P=c.offset)==null?void 0:P[v])||0)-(O?k.crossAxis:0);b<I?b=I:b>A&&(b=A)}return{[y]:_,[v]:b}}}},Tce=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=Ja(t,e),c=await s.detectOverflow(e,l),d=pc(n),f=Jf(n),h=ea(n)==="y",{width:m,height:v}=r.floating;let y,_;d==="top"||d==="bottom"?(y=d,_=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,y=f==="end"?"top":"bottom");const b=v-c.top-c.bottom,x=m-c.left-c.right,k=hc(v-c[y],b),C=hc(m-c[_],x),P=e.middlewareData.shift,R=!P;let O=k,I=C;P!=null&&P.enabled.x&&(I=x),P!=null&&P.enabled.y&&(O=b),R&&!f&&(h?I=m-2*qa(c.left,c.right):O=v-2*qa(c.top,c.bottom)),await o({...e,availableWidth:I,availableHeight:O});const A=await s.getDimensions(i.floating);return m!==A.width||v!==A.height?{reset:{rects:!0}}:{}}}};function K1(){return typeof window<"u"}function eh(t){return _$(t)?(t.nodeName||"").toLowerCase():"#document"}function Xs(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function sl(t){var e;return(e=(_$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function _$(t){return K1()?t instanceof Node||t instanceof Xs(t).Node:!1}function da(t){return K1()?t instanceof Element||t instanceof Xs(t).Element:!1}function xc(t){return K1()?t instanceof HTMLElement||t instanceof Xs(t).HTMLElement:!1}function sI(t){return!K1()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xs(t).ShadowRoot}function q1(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=fa(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function Rce(t){return/^(table|td|th)$/.test(eh(t))}function G1(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Ace=/transform|translate|scale|rotate|perspective|filter/,Ice=/paint|layout|strict|content/,Gc=t=>!!t&&t!=="none";let xw;function C6(t){const e=da(t)?fa(t):t;return Gc(e.transform)||Gc(e.translate)||Gc(e.scale)||Gc(e.rotate)||Gc(e.perspective)||!P6()&&(Gc(e.backdropFilter)||Gc(e.filter))||Ace.test(e.willChange||"")||Ice.test(e.contain||"")}function Oce(t){let e=Fu(t);for(;xc(e)&&!sm(e);){if(C6(e))return e;if(G1(e))return null;e=Fu(e)}return null}function P6(){return xw==null&&(xw=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xw}function sm(t){return/^(html|body|#document)$/.test(eh(t))}function fa(t){return Xs(t).getComputedStyle(t)}function Y1(t){return da(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fu(t){if(eh(t)==="html")return t;const e=t.assignedSlot||t.parentNode||sI(t)&&t.host||sl(t);return sI(e)?e.host:e}function w$(t){const e=Fu(t);return sm(e)?(t.ownerDocument||t).body:xc(e)&&q1(e)?e:w$(e)}function im(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=w$(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Xs(s);if(i){const l=Jx(o);return e.concat(o,o.visualViewport||[],q1(s)?s:[],l&&n?im(l):[])}else return e.concat(s,im(s,[],n))}function Jx(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function b$(t){const e=fa(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=xc(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=u1(n)!==i||u1(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function T6(t){return da(t)?t:t.contextElement}function Xd(t){const e=T6(t);if(!xc(e))return Ga(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=b$(e);let o=(i?u1(n.width):n.width)/r,l=(i?u1(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Mce=Ga(0);function x$(t){const e=Xs(t);return!P6()||!e.visualViewport?Mce:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Nce(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Xs(t)}function ju(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=T6(t);let o=Ga(1);e&&(r?da(r)&&(o=Xd(r)):o=Xd(t));const l=Nce(i,n,r)?x$(i):Ga(0);let c=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,h=s.height/o.y;if(i&&r){const m=Xs(i),v=da(r)?Xs(r):r;let y=m,_=Jx(y);for(;_&&v!==y;){const b=Xd(_),x=_.getBoundingClientRect(),k=fa(_),C=x.left+(_.clientLeft+parseFloat(k.paddingLeft))*b.x,P=x.top+(_.clientTop+parseFloat(k.paddingTop))*b.y;c*=b.x,d*=b.y,f*=b.x,h*=b.y,c+=C,d+=P,y=Xs(_),_=Jx(y)}}return f1({width:f,height:h,x:c,y:d})}function X1(t,e){const n=Y1(t).scrollLeft;return e?e.left+n:ju(sl(t)).left+n}function S$(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-X1(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function Lce(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=sl(r),l=e?G1(e.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=Ga(1);const f=Ga(0),h=xc(r);if((h||!i)&&((eh(r)!=="body"||q1(o))&&(c=Y1(r)),h)){const v=ju(r);d=Xd(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=o&&!h&&!i?S$(o,c):Ga(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-c.scrollTop*d.y+f.y+m.y}}function Dce(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function $ce(t){const e=Y1(t),n=t.ownerDocument.body,r=qa(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=qa(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+X1(t);const o=-e.scrollTop;return fa(n).direction==="rtl"&&(i+=qa(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const Fce=25;function jce(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Xs(t),i=sl(t),o=s.visualViewport;let l=i.clientWidth,c=i.clientHeight,d=0,f=0;if(o){const m=!P6()||e==="fixed";r?m||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,c=o.height,m&&(d=o.offsetLeft,f=o.offsetTop))}if(X1(i)<=0){const m=i.ownerDocument,v=m.body,y=getComputedStyle(v),_=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,b=Math.abs(i.clientWidth-v.clientWidth-_),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;x<=Fce&&(l-=x)}return{width:l,height:c,x:d,y:f}}function zce(t,e){const n=ju(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Xd(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:o,height:l,x:c,y:d}}function iI(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=jce(t,n,e);else if(e==="document")r=$ce(sl(t));else if(da(e))r=zce(e,n);else{const s=x$(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return f1(r)}function Vce(t,e){const n=e.get(t);if(n)return n;let r=im(t,[],!1).filter(l=>da(l)&&eh(l)!=="body"),s=null;const i=fa(t).position==="fixed";let o=i?Fu(t):t;for(;da(o)&&!sm(o);){const l=fa(o),c=C6(o),d=s?s.position:i?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(h=>h!==o):s=l,o=Fu(o)}return e.set(t,r),r}function Hce(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?G1(e)?[]:Vce(e,this._c):[].concat(n),r],l=iI(e,o[0],s);let c=l.top,d=l.right,f=l.bottom,h=l.left;for(let m=1;m<o.length;m++){const v=iI(e,o[m],s);c=qa(v.top,c),d=hc(v.right,d),f=hc(v.bottom,f),h=qa(v.left,h)}return{width:d-h,height:f-c,x:h,y:c}}function Uce(t){const{width:e,height:n}=b$(t);return{width:e,height:n}}function Bce(t,e,n){const r=xc(e),s=sl(e),i=n==="fixed",o=ju(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=Ga(0);if((r||!i)&&((eh(e)!=="body"||q1(s))&&(l=Y1(e)),r)){const m=ju(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&s&&(c.x=X1(s));const d=s&&!r&&!i?S$(s,l):Ga(0),f=o.left+l.scrollLeft-c.x-d.x,h=o.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function Sw(t){return fa(t).position==="static"}function oI(t,e){if(!xc(t)||fa(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return sl(t)===n&&(n=n.ownerDocument.body),n}function k$(t,e){const n=Xs(t);if(G1(t))return n;if(!xc(t)){let s=Fu(t);for(;s&&!sm(s);){if(da(s)&&!Sw(s))return s;s=Fu(s)}return n}let r=oI(t,e);for(;r&&Rce(r)&&Sw(r);)r=oI(r,e);return r&&sm(r)&&Sw(r)&&!C6(r)?n:r||Oce(t)||n}const Zce=async function(t){const e=this.getOffsetParent||k$,n=this.getDimensions,r=await n(t.floating);return{reference:Bce(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wce(t){return fa(t).direction==="rtl"}const Kce={convertOffsetParentRelativeRectToViewportRelativeRect:Lce,getDocumentElement:sl,getClippingRect:Hce,getOffsetParent:k$,getElementRects:Zce,getClientRects:Dce,getDimensions:Uce,getScale:Xd,isElement:da,isRTL:Wce};function E$(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qce(t,e,n){let r=null,s;const i=sl(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),o();const m=t.getBoundingClientRect(),{left:v,top:y,width:_,height:b}=m;if(f||e(),!_||!b)return;const x=bg(y),k=bg(i.clientWidth-(v+_)),C=bg(i.clientHeight-(y+b)),P=bg(v),O={rootMargin:-x+"px "+-k+"px "+-C+"px "+-P+"px",threshold:qa(0,hc(1,h))||1};let I=!0;function A(M){const L=M[0].intersectionRatio;if(!E$(m,t.getBoundingClientRect()))return l();if(L!==h){if(!I)return l();L?l(!1,L):s=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(A,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,O)}r.observe(t)}const c=Xs(t),d=()=>l(n);return c.addEventListener("resize",d),l(!0),()=>{c.removeEventListener("resize",d),o()}}function Gce(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=T6(t),f=s||i?[...d?im(d):[],...e?im(e):[]]:[];f.forEach(x=>{s&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const h=d&&l?qce(d,n,i):null;let m=-1,v=null;o&&(v=new ResizeObserver(x=>{let[k]=x;k&&k.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(e)})),n()}),d&&!c&&v.observe(d),e&&v.observe(e));let y,_=c?ju(t):null;c&&b();function b(){const x=ju(t);_&&!E$(_,x)&&n(),_=x,y=requestAnimationFrame(b)}return n(),()=>{var x;f.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),h==null||h(),(x=v)==null||x.disconnect(),v=null,c&&cancelAnimationFrame(y)}}const Yce=Ece,Xce=Cce,Qce=xce,Jce=Tce,eue=Sce,aI=bce,tue=Pce,nue=(t,e,n)=>{const r=new Map,s=n??{},i={...Kce,...s.platform,_c:r};return wce(t,e,{...s,platform:i})};var rue=typeof document<"u",sue=function(){},tv=rue?g.useLayoutEffect:sue;function h1(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!h1(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!h1(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function C$(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function lI(t,e){const n=C$(t);return Math.round(e*n)/n}function kw(t){const e=g.useRef(t);return tv(()=>{e.current=t}),e}function iue(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=t,[f,h]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=g.useState(r);h1(m,r)||v(r);const[y,_]=g.useState(null),[b,x]=g.useState(null),k=g.useCallback(V=>{V!==O.current&&(O.current=V,_(V))},[]),C=g.useCallback(V=>{V!==I.current&&(I.current=V,x(V))},[]),P=i||y,R=o||b,O=g.useRef(null),I=g.useRef(null),A=g.useRef(f),M=c!=null,L=kw(c),z=kw(s),$=kw(d),q=g.useCallback(()=>{if(!O.current||!I.current)return;const V={placement:e,strategy:n,middleware:m};z.current&&(V.platform=z.current),nue(O.current,I.current,V).then(Q=>{const B={...Q,isPositioned:$.current!==!1};X.current&&!h1(A.current,B)&&(A.current=B,$m.flushSync(()=>{h(B)}))})},[m,e,n,z,$]);tv(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,h(V=>({...V,isPositioned:!1})))},[d]);const X=g.useRef(!1);tv(()=>(X.current=!0,()=>{X.current=!1}),[]),tv(()=>{if(P&&(O.current=P),R&&(I.current=R),P&&R){if(L.current)return L.current(P,R,q);q()}},[P,R,q,L,M]);const K=g.useMemo(()=>({reference:O,floating:I,setReference:k,setFloating:C}),[k,C]),H=g.useMemo(()=>({reference:P,floating:R}),[P,R]),ee=g.useMemo(()=>{const V={position:n,left:0,top:0};if(!H.floating)return V;const Q=lI(H.floating,f.x),B=lI(H.floating,f.y);return l?{...V,transform:"translate("+Q+"px, "+B+"px)",...C$(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:B}},[n,l,H.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:q,refs:K,elements:H,floatingStyles:ee}),[f,q,K,H,ee])}const oue=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?aI({element:r.current,padding:s}).fn(n):{}:r?aI({element:r,padding:s}).fn(n):{}}}},aue=(t,e)=>{const n=Yce(t);return{name:n.name,fn:n.fn,options:[t,e]}},lue=(t,e)=>{const n=Xce(t);return{name:n.name,fn:n.fn,options:[t,e]}},cue=(t,e)=>({fn:tue(t).fn,options:[t,e]}),uue=(t,e)=>{const n=Qce(t);return{name:n.name,fn:n.fn,options:[t,e]}},due=(t,e)=>{const n=Jce(t);return{name:n.name,fn:n.fn,options:[t,e]}},fue=(t,e)=>{const n=eue(t);return{name:n.name,fn:n.fn,options:[t,e]}},hue=(t,e)=>{const n=oue(t);return{name:n.name,fn:n.fn,options:[t,e]}};var pue=Object.defineProperty,mue=(t,e)=>pue(t,"name",{value:e,configurable:!0});function R6(t){const[e,n]=g.useState(void 0);return _s(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});let r=0;const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let l,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,c=f.blockSize}else l=t.offsetWidth,c=t.offsetHeight;n({width:l,height:c})})});return s.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}else n(void 0)},[t]),e}mue(R6,"useSize");var gue=Object.defineProperty,nc=(t,e)=>gue(t,"name",{value:e,configurable:!0}),cI={Partial:"partial"},uI={Optimized:"optimized",Always:"always"},P$="Popper",[T$,Q1]=pa(P$),[vue,R$]=T$(P$),A$=nc(t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,o]=g.useState(void 0);return S.jsx(vue,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),yue="PopperAnchor",I$=g.forwardRef(nc(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=R$(yue,r),l=g.useRef(null),c=o.onAnchorChange,d=g.useCallback(_=>{l.current=_,_&&c(_)},[c]),f=xn(n,d),h=g.useRef(null);g.useEffect(()=>{if(!s)return;const _=h.current;h.current=s.current,_!==h.current&&c(h.current)});const m=o.placementState&&J1(o.placementState),v=m==null?void 0:m[0],y=m==null?void 0:m[1];return s?null:S.jsx(er.div,{"data-radix-popper-side":v,"data-radix-popper-align":y,...i,ref:f})},"PopperAnchor")),O$="PopperContent",[_ue,oye]=T$(O$),M$=g.forwardRef(nc(function(e,n){var ne,be,Ve,De,$e,Ut,nn;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:m=cI.Partial,hideWhenDetached:v=!1,updatePositionStrategy:y=uI.Optimized,onPlaced:_,...b}=e,x=R$(O$,r),[k,C]=g.useState(null),P=xn(n,C),[R,O]=g.useState(null),I=R6(R),A=(I==null?void 0:I.width)??0,M=(I==null?void 0:I.height)??0,L=s+(o!=="center"?"-"+o:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},$=Array.isArray(f)?f:[f],q=$.length>0,X={padding:z,boundary:$.filter(N$),altBoundary:q},{refs:K,floatingStyles:H,placement:ee,isPositioned:V,middlewareData:Q}=iue({strategy:"fixed",placement:L,whileElementsMounted:nc((...kt)=>Gce(...kt,{animationFrame:y===uI.Always}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[aue({mainAxis:i+M,alignmentAxis:l}),d&&lue({mainAxis:!0,crossAxis:!1,...m===cI.Partial?{limiter:cue()}:{},...X}),d&&uue({...X}),due({...X,apply:nc(({elements:kt,rects:Dt,availableWidth:un,availableHeight:qt})=>{const{width:Ne,height:Je}=Dt.reference,Re=kt.floating.style;Re.setProperty("--radix-popper-available-width",`${un}px`),Re.setProperty("--radix-popper-available-height",`${qt}px`),Re.setProperty("--radix-popper-anchor-width",`${Ne}px`),Re.setProperty("--radix-popper-anchor-height",`${Je}px`)},"apply")}),R&&hue({element:R,padding:c}),wue({arrowWidth:A,arrowHeight:M}),v&&fue(q?{strategy:"referenceHidden",...X}:{strategy:"referenceHidden",padding:X.padding,altBoundary:X.altBoundary})]}),B=x.setPlacementState;_s(()=>(B(ee),()=>{B(void 0)}),[ee,B]);const[D,G]=J1(ee),fe=$u(_);_s(()=>{V&&(fe==null||fe())},[V,fe]);const ie=(ne=Q.arrow)==null?void 0:ne.x,ue=(be=Q.arrow)==null?void 0:be.y,he=((Ve=Q.arrow)==null?void 0:Ve.centerOffset)!==0,[_e,le]=g.useState();return _s(()=>{k&&le(window.getComputedStyle(k).zIndex)},[k]),S.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:V?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(De=Q.transformOrigin)==null?void 0:De.x,($e=Q.transformOrigin)==null?void 0:$e.y].join(" "),...((Ut=Q.hide)==null?void 0:Ut.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(_ue,{scope:r,placedSide:D,placedAlign:G,onArrowChange:O,arrowX:ie,arrowY:ue,shouldHideArrow:he,children:S.jsx(er.div,{"data-side":D,"data-align":G,...b,ref:P,style:{...b.style,animation:V?(nn=b.style)==null?void 0:nn.animation:"none"}})})})},"PopperContent"));function N$(t){return t!==null}nc(N$,"isNotNull");var wue=nc(t=>({name:"transformOrigin",options:t,fn(e){var b,x,k;const{placement:n,rects:r,middlewareData:s}=e,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[d,f]=J1(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((x=s.arrow)==null?void 0:x.x)??0)+l/2,v=(((k=s.arrow)==null?void 0:k.y)??0)+c/2;let y="",_="";return d==="bottom"?(y=o?h:`${m}px`,_=`${-c}px`):d==="top"?(y=o?h:`${m}px`,_=`${r.floating.height+c}px`):d==="right"?(y=`${-c}px`,_=o?h:`${v}px`):d==="left"&&(y=`${r.floating.width+c}px`,_=o?h:`${v}px`),{data:{x:y,y:_}}}}),"transformOrigin");function J1(t){const[e,n="center"]=t.split("-");return[e,n]}nc(J1,"getSideAndAlignFromPlacement");var bue=Object.defineProperty,xue=(t,e)=>bue(t,"name",{value:e,configurable:!0}),A6=g.forwardRef(xue(function(e,n){var c;const{container:r,...s}=e,[i,o]=g.useState(!1);_s(()=>o(!0),[]);const l=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?$m.createPortal(S.jsx(er.div,{...s,ref:n}),l):null},"Portal")),Sue=Object.defineProperty,el=(t,e)=>Sue(t,"name",{value:e,configurable:!0});function L$(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}el(L$,"useStateMachine");var Sc=el(t=>{const{present:e,children:n}=t,r=D$(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=$$(r.ref,F$(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null},"Presence");function D$(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),o=g.useRef(void 0),l=t?"mounted":"unmounted",[c,d]=L$(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{c==="mounted"?(i.current=o.current??Ld(r.current),o.current=void 0):i.current="none"},[c]),_s(()=>{const f=r.current,h=s.current;if(h!==t){const v=i.current,y=Ld(f);t?(o.current=y,d("MOUNT")):y==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&v!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),_s(()=>{if(e){let f;const h=e.ownerDocument.defaultView??window,m=el(y=>{const b=Ld(r.current).includes(CSS.escape(y.animationName));if(y.target===e&&b&&(d("ANIMATION_END"),!s.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",f=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),v=el(y=>{y.target===e&&(i.current=Ld(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(f=>{if(f){const h=getComputedStyle(f);r.current=h,o.current=Ld(h)}else r.current=null;n(f)},[])}}el(D$,"usePresence");function eS(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}el(eS,"setRef");function $$(...t){const e=g.useRef(t);return e.current=t,g.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=eS(o,n);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():eS(r[o],null)}}},[])}el($$,"useStableComposedRefs");function Ld(t){return(t==null?void 0:t.animationName)||"none"}el(Ld,"getAnimationName");function F$(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}el(F$,"getElementRef");var kue=Object.defineProperty,Eue=(t,e)=>kue(t,"name",{value:e,configurable:!0}),dI=Zf[" useEffectEvent ".trim().toString()],fI=Zf[" useInsertionEffect ".trim().toString()];function j$(t){if(typeof dI=="function")return dI(t);const e=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof fI=="function"?fI(()=>{e.current=t}):_s(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}Eue(j$,"useEffectEvent");var Cue=Object.defineProperty,jm=(t,e)=>Cue(t,"name",{value:e,configurable:!0}),Pue=Zf[" useInsertionEffect ".trim().toString()]||_s;function kc({prop:t,defaultProp:e,onChange:n=jm(()=>{},"onChange"),caller:r}){const[s,i,o]=z$({defaultProp:e,onChange:n}),l=t!==void 0,c=l?t:s,d=g.useCallback(f=>{var h;if(l){const m=V$(f)?f(t):f;m!==t&&((h=o.current)==null||h.call(o,m))}else i(f)},[l,t,i,o]);return[c,d]}jm(kc,"useControllableState");function z$({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return Pue(()=>{i.current=e},[e]),g.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}jm(z$,"useUncontrolledState");function V$(t){return typeof t=="function"}jm(V$,"isFunction");var hI=Symbol("RADIX:SYNC_STATE");function Tue(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,c=s!==void 0,d=j$(o),f=[{...n,state:i}];r&&f.push(r);const[h,m]=g.useReducer((b,x)=>{if(x.type===hI)return{...b,state:x.state};const k=t(b,x);return c&&!Object.is(k.state,b.state)&&d(k.state),k},...f),v=h.state,y=g.useRef(v);g.useEffect(()=>{y.current!==v&&(y.current=v,c||d(v))},[v,y,c]);const _=g.useMemo(()=>s!==void 0?{...h,state:s}:h,[h,s]);return g.useEffect(()=>{c&&!Object.is(s,h.state)&&m({type:hI,state:s})},[s,h.state,c]),[_,m]}jm(Tue,"useControllableStateReducer");var Rue=Object.defineProperty,Aue=(t,e)=>Rue(t,"name",{value:e,configurable:!0}),Iue=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Oue=g.forwardRef(Aue(function(e,n){return S.jsx(er.span,{...e,ref:n,style:{...Iue,...e.style}})},"VisuallyHidden")),Mue=Object.defineProperty,Mr=(t,e)=>Mue(t,"name",{value:e,configurable:!0}),[I6,aye]=pa("Tooltip",[Q1]),O6=Q1(),Nue="TooltipProvider",Lue=700,tS="tooltip.open",[Due,M6]=I6(Nue),$ue=Mr(t=>{const{__scopeTooltip:e,delayDuration:n=Lue,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),S.jsx(Due,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),nS="Tooltip",[Fue,zm]=I6(nS),jue=Mr(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,c=M6(nS,t.__scopeTooltip),d=O6(e),[f,h]=g.useState(null),[m,v]=g.useState(void 0),y=ia(),_=g.useRef(0),b=o??c.disableHoverableContent,x=l??c.delayDuration,k=g.useRef(!1),[C,P]=kc({prop:r,defaultProp:s??!1,onChange:Mr(L=>{L?(c.onOpen(),document.dispatchEvent(new CustomEvent(tS))):c.onClose(),i==null||i(L)},"onChange"),caller:nS}),R=g.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),O=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k.current=!1,P(!0)},[P]),I=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,P(!1)},[P]),A=g.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{k.current=!0,P(!0),_.current=0},x)},[x,P]);g.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const M=m??y;return S.jsx(A$,{...d,children:S.jsx(Fue,{scope:e,contentId:M,setContentId:v,open:C,stateAttribute:R,trigger:f,onTriggerChange:h,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?A():O()},[c.isOpenDelayedRef,A,O]),onTriggerLeave:g.useCallback(()=>{b?I():(window.clearTimeout(_.current),_.current=0)},[I,b]),onOpen:O,onClose:I,disableHoverableContent:b,children:n})})},"Tooltip"),pI="TooltipTrigger",zue=g.forwardRef(Mr(function(e,n){const{__scopeTooltip:r,"aria-describedby":s,...i}=e,o=zm(pI,r),l=M6(pI,r),c=O6(r),d=g.useRef(null),f=xn(n,d,o.onTriggerChange),h=g.useRef(!1),m=g.useRef(!1),v=g.useCallback(()=>h.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),S.jsx(I$,{asChild:!0,...c,children:S.jsx(er.button,{"aria-describedby":o.open?Y$(s,o.contentId):s,"data-state":o.stateAttribute,...i,ref:f,onPointerMove:bn(e.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:bn(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:bn(e.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:bn(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:bn(e.onBlur,o.onClose),onClick:bn(e.onClick,o.onClose)})})},"TooltipTrigger")),H$="TooltipPortal",[Vue,Hue]=I6(H$,{forceMount:void 0}),Uue=Mr(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=zm(H$,e);return S.jsx(Vue,{scope:e,forceMount:n,children:S.jsx(Sc,{present:n||i.open,children:S.jsx(A6,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),om="TooltipContent",Bue=g.forwardRef(Mr(function(e,n){const r=Hue(om,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=zm(om,e.__scopeTooltip);return S.jsx(Sc,{present:s||l.open,children:l.disableHoverableContent?S.jsx(U$,{side:i,...o,ref:n}):S.jsx(Zue,{side:i,...o,ref:n})})},"TooltipContent")),Zue=g.forwardRef(Mr(function(e,n){const r=zm(om,e.__scopeTooltip),s=M6(om,e.__scopeTooltip),i=g.useRef(null),o=xn(n,i),[l,c]=g.useState(null),{trigger:d,onClose:f}=r,h=i.current,{onPointerInTransitChange:m}=s,v=g.useCallback(()=>{c(null),m(!1)},[m]),y=g.useCallback((_,b)=>{const x=_.currentTarget,k={x:_.clientX,y:_.clientY},C=B$(k,x.getBoundingClientRect()),P=Z$(k,C),R=W$(b.getBoundingClientRect()),O=q$([...P,...R]);c(O),m(!0)},[m]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(d&&h){const _=Mr(x=>y(x,h),"handleTriggerLeave"),b=Mr(x=>y(x,d),"handleContentLeave");return d.addEventListener("pointerleave",_),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",_),h.removeEventListener("pointerleave",b)}}},[d,h,y,v]),g.useEffect(()=>{if(l){const _=Mr(b=>{const x=b.target,k={x:b.clientX,y:b.clientY},C=(d==null?void 0:d.contains(x))||(h==null?void 0:h.contains(x)),P=!K$(k,l);C?v():P&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,h,l,f,v]),S.jsx(U$,{...e,ref:o})},"TooltipContentHoverable")),Wue=YD("TooltipContent"),U$=g.forwardRef(Mr(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=zm(om,r),h=O6(r),{onClose:m}=f,[v,y]=g.useState(null),_=xn(n,y);b6(v),g.useEffect(()=>(document.addEventListener(tS,m),()=>document.removeEventListener(tS,m)),[m]),g.useEffect(()=>{if(f.trigger){const x=Mr(k=>{k.target instanceof Node&&k.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[f.trigger,m]);const{setContentId:b}=f;return _s(()=>(b(o),()=>{b(void 0)}),[o,b]),S.jsx(v6,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:S.jsxs(M$,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...h,...d,ref:_,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(Wue,{children:s}),i?S.jsx(Oue,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function B$(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Mr(B$,"getExitSideFromRect");function Z$(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Mr(Z$,"getPaddedExitPoints");function W$(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}Mr(W$,"getPointsFromRect");function K$(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],c=e[o],d=l.x,f=l.y,h=c.x,m=c.y;f>r!=m>r&&n<(h-d)*(r-f)/(m-f)+d&&(s=!s)}return s}Mr(K$,"isPointInPolygon");function q$(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),G$(e)}Mr(q$,"getHull");function G$(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Mr(G$,"getHullPresorted");function Y$(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Mr(Y$,"concatAriaDescribedby");const Ip={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},X$=g.createContext(null);function Q$({value:t,children:e}){return S.jsx(X$.Provider,{value:t,children:e})}function Kue(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function N6({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[c,d]=g.useState(!1),f=o!==void 0?o:c,[h,m]=g.useState(!1),v=Fm(),y=g.useContext(X$);g.useEffect(()=>{f&&m(!0)},[f]);const _=()=>{f||m(!1)},b=Kue(n);return S.jsx($ue,{delayDuration:s,children:S.jsxs(jue,{open:f,onOpenChange:x=>{d(x),l==null||l(x)},children:[S.jsx(zue,{asChild:!0,children:e}),h&&S.jsx(Uue,{forceMount:!0,container:y??void 0,children:S.jsx(Bue,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(Ka.div,{className:mn("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",v.bg,i),style:{fontVariationSettings:Ip.medium},initial:{opacity:0,scale:.8,...b},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const oa=g.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=S.jsx(UD,{ref:r,...n});return t?S.jsx(N6,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:t}),e?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:e}):null]}),children:s}):s});oa.displayName="Button";var que=Object.defineProperty,L6=(t,e)=>que(t,"name",{value:e,configurable:!0}),xg=0,Vo=null;function Gue(t){return ey(),t.children}L6(Gue,"FocusGuards");function ey(){g.useEffect(()=>{Vo||(Vo={start:rS(),end:rS()});const{start:t,end:e}=Vo;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),xg++,()=>{xg===1&&(Vo==null||Vo.start.remove(),Vo==null||Vo.end.remove(),Vo=null),xg=Math.max(0,xg-1)}},[])}L6(ey,"useFocusGuards");function rS(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}L6(rS,"createFocusGuard");var Xo=function(){return Xo=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Xo.apply(this,arguments)};function J$(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function Yue(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var nv="right-scroll-bar-position",rv="width-before-scroll-bar",Xue="with-scroll-bars-hidden",Que="--removed-body-scroll-bar-size";function Ew(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Jue(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var ede=typeof window<"u"?g.useLayoutEffect:g.useEffect,mI=new WeakMap;function tde(t,e){var n=Jue(null,function(r){return t.forEach(function(s){return Ew(s,r)})});return ede(function(){var r=mI.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||Ew(l,null)}),i.forEach(function(l){s.has(l)||Ew(l,o)})}mI.set(n,t)},[t]),n}function nde(t){return t}function rde(t,e){e===void 0&&(e=nde);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function sde(t){t===void 0&&(t={});var e=rde(null);return e.options=Xo({async:!0,ssr:!1},t),e}var eF=function(t){var e=t.sideCar,n=J$(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Xo({},n))};eF.isSideCarExport=!0;function ide(t,e){return t.useMedium(e),eF}var tF=sde(),Cw=function(){},ty=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:Cw,onWheelCapture:Cw,onTouchMoveCapture:Cw}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,c=t.className,d=t.removeScrollBar,f=t.enabled,h=t.shards,m=t.sideCar,v=t.noRelative,y=t.noIsolation,_=t.inert,b=t.allowPinchZoom,x=t.as,k=x===void 0?"div":x,C=t.gapMode,P=J$(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,O=tde([n,e]),I=Xo(Xo({},P),s);return g.createElement(g.Fragment,null,f&&g.createElement(R,{sideCar:tF,removeScrollBar:d,shards:h,noRelative:v,noIsolation:y,inert:_,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:C}),o?g.cloneElement(g.Children.only(l),Xo(Xo({},I),{ref:O})):g.createElement(k,Xo({},I,{className:c,ref:O}),l))});ty.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ty.classNames={fullWidth:rv,zeroRight:nv};var ode=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ade(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=ode();return e&&t.setAttribute("nonce",e),t}function lde(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function cde(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var ude=function(){var t=0,e=null;return{add:function(n){t==0&&(e=ade())&&(lde(e,n),cde(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},dde=function(){var t=ude();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},nF=function(){var t=dde(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},fde={left:0,top:0,right:0,gap:0},Pw=function(t){return parseInt(t||"",10)||0},hde=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[Pw(n),Pw(r),Pw(s)]},pde=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return fde;var e=hde(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},mde=nF(),Qd="data-scroll-locked",gde=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
130
- .`.concat(Xue,` {
131
- overflow: hidden `).concat(r,`;
132
- padding-right: `).concat(l,"px ").concat(r,`;
133
- }
134
- body[`).concat(Qd,`] {
135
- overflow: hidden `).concat(r,`;
136
- overscroll-behavior: contain;
137
- `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
138
- padding-left: `.concat(s,`px;
139
- padding-top: `).concat(i,`px;
140
- padding-right: `).concat(o,`px;
141
- margin-left:0;
142
- margin-top:0;
143
- margin-right: `).concat(l,"px ").concat(r,`;
144
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
145
- }
146
-
147
- .`).concat(nv,` {
148
- right: `).concat(l,"px ").concat(r,`;
149
- }
150
-
151
- .`).concat(rv,` {
152
- margin-right: `).concat(l,"px ").concat(r,`;
153
- }
154
-
155
- .`).concat(nv," .").concat(nv,` {
156
- right: 0 `).concat(r,`;
157
- }
158
-
159
- .`).concat(rv," .").concat(rv,` {
160
- margin-right: 0 `).concat(r,`;
161
- }
162
-
163
- body[`).concat(Qd,`] {
164
- `).concat(Que,": ").concat(l,`px;
165
- }
166
- `)},gI=function(){var t=parseInt(document.body.getAttribute(Qd)||"0",10);return isFinite(t)?t:0},vde=function(){g.useEffect(function(){return document.body.setAttribute(Qd,(gI()+1).toString()),function(){var t=gI()-1;t<=0?document.body.removeAttribute(Qd):document.body.setAttribute(Qd,t.toString())}},[])},yde=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;vde();var i=g.useMemo(function(){return pde(s)},[s]);return g.createElement(mde,{styles:gde(i,!e,s,n?"":"!important")})},sS=!1;if(typeof window<"u")try{var Sg=Object.defineProperty({},"passive",{get:function(){return sS=!0,!0}});window.addEventListener("test",Sg,Sg),window.removeEventListener("test",Sg,Sg)}catch{sS=!1}var Pd=sS?{passive:!1}:!1,_de=function(t){return t.tagName==="TEXTAREA"},rF=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!_de(t)&&n[e]==="visible")},wde=function(t){return rF(t,"overflowY")},bde=function(t){return rF(t,"overflowX")},vI=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=sF(t,r);if(s){var i=iF(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xde=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Sde=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},sF=function(t,e){return t==="v"?wde(e):bde(e)},iF=function(t,e){return t==="v"?xde(e):Sde(e)},kde=function(t,e){return t==="h"&&e==="rtl"?-1:1},Ede=function(t,e,n,r,s){var i=kde(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,c=e.contains(l),d=!1,f=o>0,h=0,m=0;do{if(!l)break;var v=iF(t,l),y=v[0],_=v[1],b=v[2],x=_-b-i*y;(y||x)&&sF(t,l)&&(h+=x,m+=y);var k=l.parentNode;l=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!c&&l!==document.body||c&&(e.contains(l)||e===l));return(f&&Math.abs(h)<1||!f&&Math.abs(m)<1)&&(d=!0),d},kg=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},yI=function(t){return[t.deltaX,t.deltaY]},_I=function(t){return t&&"current"in t?t.current:t},Cde=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Pde=function(t){return`
167
- .block-interactivity-`.concat(t,` {pointer-events: none;}
168
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
169
- `)},Tde=0,Td=[];function Rde(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(Tde++)[0],i=g.useState(nF)[0],o=g.useRef(t);g.useEffect(function(){o.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=Yue([t.lockRef.current],(t.shards||[]).map(_I),!0).filter(Boolean);return _.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=g.useCallback(function(_,b){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var x=kg(_),k=n.current,C="deltaX"in _?_.deltaX:k[0]-x[0],P="deltaY"in _?_.deltaY:k[1]-x[1],R,O=_.target,I=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in _&&I==="h"&&O.type==="range")return!1;var A=window.getSelection(),M=A&&A.anchorNode,L=M?M===O||M.contains(O):!1;if(L)return!1;var z=vI(I,O);if(!z)return!0;if(z?R=I:(R=I==="v"?"h":"v",z=vI(I,O)),!z)return!1;if(!r.current&&"changedTouches"in _&&(C||P)&&(r.current=R),!R)return!0;var $=r.current||R;return Ede($,b,_,$==="h"?C:P)},[]),c=g.useCallback(function(_){var b=_;if(!(!Td.length||Td[Td.length-1]!==i)){var x="deltaY"in b?yI(b):kg(b),k=e.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&Cde(R.delta,x)})[0];if(k&&k.should){b.cancelable&&b.preventDefault();return}if(!k){var C=(o.current.shards||[]).map(_I).filter(Boolean).filter(function(R){return R.contains(b.target)}),P=C.length>0?l(b,C[0]):!o.current.noIsolation;P&&b.cancelable&&b.preventDefault()}}},[]),d=g.useCallback(function(_,b,x,k){var C={name:_,delta:b,target:x,should:k,shadowParent:Ade(x)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(P){return P!==C})},1)},[]),f=g.useCallback(function(_){n.current=kg(_),r.current=void 0},[]),h=g.useCallback(function(_){d(_.type,yI(_),_.target,l(_,t.lockRef.current))},[]),m=g.useCallback(function(_){d(_.type,kg(_),_.target,l(_,t.lockRef.current))},[]);g.useEffect(function(){return Td.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Pd),document.addEventListener("touchmove",c,Pd),document.addEventListener("touchstart",f,Pd),function(){Td=Td.filter(function(_){return _!==i}),document.removeEventListener("wheel",c,Pd),document.removeEventListener("touchmove",c,Pd),document.removeEventListener("touchstart",f,Pd)}},[]);var v=t.removeScrollBar,y=t.inert;return g.createElement(g.Fragment,null,y?g.createElement(i,{styles:Pde(s)}):null,v?g.createElement(yde,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Ade(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Ide=ide(tF,Rde);var D6=g.forwardRef(function(t,e){return g.createElement(ty,Xo({},t,{ref:e,sideCar:Ide}))});D6.classNames=ty.classNames;var Ode=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Rd=new WeakMap,Eg=new WeakMap,Cg={},Tw=0,oF=function(t){return t&&(t.host||oF(t.parentNode))},Mde=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=oF(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Nde=function(t,e,n,r){var s=Mde(e,Array.isArray(t)?t:[t]);Cg[n]||(Cg[n]=new WeakMap);var i=Cg[n],o=[],l=new Set,c=new Set(s),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};s.forEach(d);var f=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(l.has(m))f(m);else try{var v=m.getAttribute(r),y=v!==null&&v!=="false",_=(Rd.get(m)||0)+1,b=(i.get(m)||0)+1;Rd.set(m,_),i.set(m,b),o.push(m),_===1&&y&&Eg.set(m,!0),b===1&&m.setAttribute(n,"true"),y||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(e),l.clear(),Tw++,function(){o.forEach(function(h){var m=Rd.get(h)-1,v=i.get(h)-1;Rd.set(h,m),i.set(h,v),m||(Eg.has(h)||h.removeAttribute(r),Eg.delete(h)),v||h.removeAttribute(n)}),Tw--,Tw||(Rd=new WeakMap,Rd=new WeakMap,Eg=new WeakMap,Cg={})}},aF=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=Ode(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Nde(r,s,n,"aria-hidden")):function(){return null}},Lde=Object.defineProperty,ii=(t,e)=>Lde(t,"name",{value:e,configurable:!0}),$6="Dialog",[lF,lye]=pa($6),[Dde,Eo]=lF($6),ny=ii(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=g.useRef(null),c=g.useRef(null),{nodes:d,registry:f}=w6(),[h,m]=kc({prop:r,defaultProp:s??!1,onChange:i,caller:$6}),[v,y]=g.useState(0),[_,b]=g.useState(0);return S.jsx(Dde,{scope:e,triggerRef:l,contentRef:c,contentId:ia(),titleId:ia(),descriptionId:ia(),titlePresent:v>0,descriptionPresent:_>0,setTitleCount:y,setDescriptionCount:b,open:h,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(x=>!x),[m]),modal:o,branchNodes:d,branchRegistry:f,children:n})},"Dialog"),$de="DialogTrigger",cye=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Eo($de,r),o=xn(n,i.triggerRef);return S.jsx(er.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":ly(i.open),...s,ref:o,onClick:bn(e.onClick,i.onOpenToggle)})},"DialogTrigger")),cF="DialogPortal",[Fde,uF]=lF(cF,{forceMount:void 0}),ry=ii(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Eo(cF,e);return S.jsx(Fde,{scope:e,forceMount:n,children:g.Children.map(r,o=>S.jsx(Sc,{present:n||i.open,children:S.jsx(A6,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),iS="DialogOverlay",sy=g.forwardRef(ii(function(e,n){const r=uF(iS,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Eo(iS,e.__scopeDialog);return o.modal?S.jsx(Sc,{present:s||o.open,children:S.jsx(zde,{...i,ref:n})}):null},"DialogOverlay")),jde=fc("DialogOverlay.RemoveScroll"),zde=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Eo(iS,r),o=i$(),l=xn(n,o);return S.jsx(D6,{as:jde,allowPinchZoom:!0,shards:g.useMemo(()=>[i.contentRef,...i.branchNodes.map(c=>({current:c}))],[i.contentRef,i.branchNodes]),children:S.jsx(er.div,{"data-state":ly(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),am="DialogContent",iy=g.forwardRef(ii(function(e,n){const r=uF(am,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Eo(am,e.__scopeDialog);return S.jsx(Sc,{present:s||o.open,children:o.modal?S.jsx(Vde,{...i,ref:n}):S.jsx(Hde,{...i,ref:n})})},"DialogContent")),Vde=g.forwardRef(ii(function(e,n){const r=Eo(am,e.__scopeDialog),s=g.useRef(null),i=xn(n,r.contentRef,s);return g.useEffect(()=>{const o=s.current;if(o)return aF(o)},[]),S.jsx(dF,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:bn(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:bn(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&o.preventDefault()}),onFocusOutside:bn(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),Hde=g.forwardRef(ii(function(e,n){const r=Eo(am,e.__scopeDialog),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(dF,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),dF=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,"aria-describedby":l,children:c,...d}=e,f=Eo(am,r);return ey(),S.jsx(_6,{registry:f.branchRegistry,children:S.jsx(l$,{asChild:!0,loop:!0,trapped:s,branches:f.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(v6,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?fF(l,f.descriptionId):l,"data-state":ly(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:c})})})},"DialogContentImpl")),oy=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Eo("DialogTitle",r),{setTitleCount:o}=i;return _s(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(er.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),ay=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Eo("DialogDescription",r),{setDescriptionCount:o}=i;return _s(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(er.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),Ude="DialogClose",uye=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Eo(Ude,r);return S.jsx(er.button,{type:"button",...s,ref:n,onClick:bn(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function fF(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}ii(fF,"concatAriaDescribedby");function ly(t){return t?"open":"closed"}ii(ly,"getState");var Bde=Object.defineProperty,il=(t,e)=>Bde(t,"name",{value:e,configurable:!0}),F6="Popover",[hF,dye]=pa(F6,[Q1]),j6=Q1(),[Zde,th]=hF(F6),z6=il(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=j6(e),c=g.useRef(null),[d,f]=g.useState(!1),[h,m]=g.useState(0),[v,y]=g.useState(0),[_,b]=kc({prop:r,defaultProp:s??!1,onChange:i,caller:F6});return S.jsx(A$,{...l,children:S.jsx(Zde,{scope:e,contentId:ia(),titleId:ia(),descriptionId:ia(),titlePresent:h>0,descriptionPresent:v>0,setTitleCount:m,setDescriptionCount:y,triggerRef:c,open:_,onOpenChange:b,onOpenToggle:g.useCallback(()=>b(x=>!x),[b]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>f(!0),[]),onCustomAnchorRemove:g.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),Wde="PopoverTrigger",V6=g.forwardRef(il(function(e,n){const{__scopePopover:r,...s}=e,i=th(Wde,r),o=j6(r),l=xn(n,i.triggerRef),c=S.jsx(er.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":B6(i.open),...s,ref:l,onClick:bn(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:S.jsx(I$,{asChild:!0,...o,children:c})},"PopoverTrigger")),pF="PopoverPortal",[Kde,qde]=hF(pF,{forceMount:void 0}),H6=il(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=th(pF,e);return S.jsx(Kde,{scope:e,forceMount:n,children:S.jsx(Sc,{present:n||i.open,children:S.jsx(A6,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),lm="PopoverContent",U6=g.forwardRef(il(function(e,n){const r=qde(lm,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=th(lm,e.__scopePopover);return S.jsx(Sc,{present:s||o.open,children:o.modal?S.jsx(Yde,{...i,ref:n}):S.jsx(Xde,{...i,ref:n})})},"PopoverContent")),Gde=fc("PopoverContent.RemoveScroll"),Yde=g.forwardRef(il(function(e,n){const r=th(lm,e.__scopePopover),s=g.useRef(null),i=xn(n,s),o=g.useRef(!1),{nodes:l,registry:c}=w6();return g.useEffect(()=>{const d=s.current;if(d)return aF(d)},[]),S.jsx(D6,{as:Gde,allowPinchZoom:!0,shards:g.useMemo(()=>[s,...l.map(d=>({current:d}))],[s,l]),children:S.jsx(mF,{...e,ref:i,branchNodes:l,branchRegistry:c,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bn(e.onCloseAutoFocus,d=>{var f;d.preventDefault(),o.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:bn(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,m=f.button===2||h;o.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:bn(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Xde=g.forwardRef(il(function(e,n){const r=th(lm,e.__scopePopover),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(mF,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),mF=g.forwardRef(il(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,"aria-describedby":m,branchNodes:v,branchRegistry:y,..._}=e,b=th(lm,r),x=j6(r),[k,C]=g.useState(null),P=xn(n,C);return b6(k),ey(),S.jsx(_6,{registry:y,children:S.jsx(l$,{asChild:!0,loop:!0,trapped:s,branches:v,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(v6,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(M$,{"data-state":B6(b.open),role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?gF(m,b.descriptionId):m,...x,..._,ref:P,style:{..._.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function B6(t){return t?"open":"closed"}il(B6,"getState");function gF(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}il(gF,"concatAriaDescribedby");const cm={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},Qde="data-hover-dead-zone";function vF(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=g.useRef(new Map),[i,o]=g.useState(null),[l,c]=g.useState([]),d=g.useRef([]),f=g.useRef(0),h=g.useRef(null),m=g.useRef(null),v=g.useCallback(()=>{const C=[];return s.current.forEach((P,R)=>{C[R]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),C},[]),y=g.useCallback(()=>{if(!t.current)return;const P=v();d.current=P,c(P)},[t,v]),_=g.useCallback((C,P)=>{P?s.current.set(C,P):s.current.delete(C),m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{m.current=null,y()})},[y]),b=g.useCallback(C=>{const P=C.clientX,R=C.clientY,O=C.target instanceof Element&&C.target.closest(`[${Qde}]`)!==null;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const I=t.current;if(!I)return;if(O){o(null);return}const A=v(),M=d.current;(A.length!==M.length||A.some((fe,ie)=>{const ue=M[ie];return!ue||!fe||fe.top!==ue.top||fe.height!==ue.height||fe.left!==ue.left||fe.width!==ue.width}))&&(d.current=A,c(A));const z=I.getBoundingClientRect(),$=n==="x"?P:R;let q=null,X=1/0,K=null;const H=d.current,ee=n==="x"?I.scrollLeft:I.scrollTop,V=n==="x"?I.clientLeft:I.clientTop,Q=n==="x"?z.left:z.top,B=n==="x"?I.offsetWidth:I.offsetHeight,D=n==="x"?z.width:z.height,G=B>0?D/B:1;for(let fe=0;fe<H.length;fe++){const ie=H[fe];if(!ie)continue;const ue=n==="x"?ie.left:ie.top,he=Q+(V+ue-ee)*G,_e=(n==="x"?ie.width:ie.height)*G,le=he+_e;$>=he&&$<=le&&(K=fe);let ne=0;$<he?ne=he-$:$>le&&(ne=$-le),ne<X&&(X=ne,q=fe)}o(K??(X<=r?q:null))})},[n,t,r,v]),x=g.useCallback(()=>{f.current+=1,y()},[y]),k=g.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),o(null)},[]);return g.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),m.current!==null&&cancelAnimationFrame(m.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:b,onMouseEnter:x,onMouseLeave:k},registerItem:_,measureItems:y}}function Jde(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const um=t=>{const e=g.useRef(t);return g.useLayoutEffect(()=>{e.current=t}),e};let sv=0;const efe=()=>{sv+=1;let t=!1;return()=>{t||(t=!0,sv=Math.max(0,sv-1))}},tfe=()=>sv>0,nfe='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',yF=({itemSelector:t=nfe,loop:e=!1,onDismiss:n}={})=>{const r=g.useRef(null),s=g.useRef(null),i=um(n),o=g.useRef(!1),l=g.useCallback(f=>{var h;if(r.current=f,f){o.current=!1;const m=efe(),v=f.ownerDocument.defaultView;let y;const _=()=>{v==null||v.clearTimeout(y),y=v==null?void 0:v.setTimeout(()=>{const b=f.ownerDocument.activeElement;(b==null?void 0:b.tagName)==="IFRAME"&&!f.contains(b)&&i.current&&(o.current=!0,i.current())})};v==null||v.addEventListener("blur",_),s.current=()=>{v==null||v.removeEventListener("blur",_),v==null||v.clearTimeout(y),m()}}else(h=s.current)==null||h.call(s),s.current=null},[i]),c=f=>{o.current&&f.preventDefault()},d=g.useCallback(f=>{var k;const{key:h}=f;if(h!=="ArrowDown"&&h!=="ArrowUp"&&h!=="Home"&&h!=="End")return;const m=r.current;if(!m)return;const v=Array.from(m.querySelectorAll(t));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const y=v.indexOf(document.activeElement),_=v.length-1,b=C=>{if(y===-1)return C===1?0:_;const P=y+C;return e?(P+v.length)%v.length:Math.min(Math.max(P,0),_)};let x;h==="Home"?x=0:h==="End"?x=_:h==="ArrowDown"?x=b(1):x=b(-1),(k=v[x])==null||k.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:c}},_F=({queryKey:t,data:e})=>{const n=Om(),[r,s]=g.useState(null),i=r!==null&&r.base===e?r.value:e,o=um({queryKey:t,data:e,visible:i}),l=g.useCallback(c=>{const d=o.current,f=c(n.getQueryData(d.queryKey)??d.visible);return n.setQueryData(d.queryKey,f),o.current={...d,visible:f},s({base:d.data,value:f}),f},[n,o]);return{data:i,updateData:l}},oS=["project-library"],wI=[...oS,"history"],bI=["library-project-preview"],xI=["variants-history"],Qs={rivetConfig:["rivet-config"],featureFlags:["rivet-feature-flags"],account:["rivet-account"],serverConfig:["server-config"],integrations:["integrations"],cosmosProfile:["cosmos-profile"],previewUpstreamHealth:t=>["preview-upstream-health",t],variantsUiState:t=>["variants-ui-state",t],variantsHistory:{all:xI,list:t=>[...xI,t]},designLibrary:(t,e)=>["design-library",t,e],designReferenceSearch:({profileId:t,revision:e,references:n,search:r,sourceId:s})=>["design-reference-search",t,e,n,r,s],designLibraryImage:({profileId:t,referenceId:e,hash:n})=>["design-library-image",t,e,n],projectLibrary:{all:oS,projects:[...oS,"projects"],histories:wI,history:t=>[...wI,t]},libraryProjectPreview:{project:t=>[...bI,t],thumbnail:(t,e)=>[...bI,t,e]},libraryWorkspace:t=>["library-workspace",t],libraryPreview:({projectId:t,sessionId:e,variantId:n})=>["library-preview",t,e,n]};var iv={exports:{}},rfe=iv.exports,SI;function sfe(){return SI||(SI=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(rfe,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},o=null;function l(_,b){var x=_[b];if(typeof x.bind=="function")return x.bind(_);try{return Function.prototype.bind.call(x,_)}catch{return function(){return Function.prototype.apply.apply(x,[_,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?c:console[_]!==void 0?l(console,_):console.log!==void 0?l(console,"log"):e}function f(){for(var _=this.getLevel(),b=0;b<s.length;b++){var x=s[b];this[x]=b<_?e:this.methodFactory(x,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function h(_){return function(){typeof console!==n&&(f.call(this),this[_].apply(this,arguments))}}function m(_,b,x){return d(_)||h.apply(this,arguments)}function v(_,b){var x=this,k,C,P,R="loglevel";typeof _=="string"?R+=":"+_:typeof _=="symbol"&&(R=void 0);function O(z){var $=(s[z]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=$;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+$+";"}catch{}}}function I(){var z;if(!(typeof window===n||!R)){try{z=window.localStorage[R]}catch{}if(typeof z===n)try{var $=window.document.cookie,q=encodeURIComponent(R),X=$.indexOf(q+"=");X!==-1&&(z=/^([^;]+)/.exec($.slice(X+q.length+1))[1])}catch{}return x.levels[z]===void 0&&(z=void 0),z}}function A(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function M(z){var $=z;if(typeof $=="string"&&x.levels[$.toUpperCase()]!==void 0&&($=x.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=x.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+z)}x.name=_,x.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},x.methodFactory=b||m,x.getLevel=function(){return P??C??k},x.setLevel=function(z,$){return P=M(z),$!==!1&&O(P),f.call(x)},x.setDefaultLevel=function(z){C=M(z),I()||x.setLevel(z,!1)},x.resetLevel=function(){P=null,A(),f.call(x)},x.enableAll=function(z){x.setLevel(x.levels.TRACE,z)},x.disableAll=function(z){x.setLevel(x.levels.SILENT,z)},x.rebuild=function(){if(o!==x&&(k=M(o.getLevel())),f.call(x),o===x)for(var z in i)i[z].rebuild()},k=M(o?o.getLevel():"WARN");var L=I();L!=null&&(P=M(L)),f.call(x)}o=new v,o.getLogger=function(b){if(typeof b!="symbol"&&typeof b!="string"||b==="")throw new TypeError("You must supply a name when creating a logger.");var x=i[b];return x||(x=i[b]=new v(b,o.methodFactory)),x};var y=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=y),o},o.getLoggers=function(){return i},o.default=o,o})})(iv)),iv.exports}var ife=sfe();const mo=R1(ife),ofe="INFO",afe=ofe.toUpperCase();mo.setLevel(mo.levels[afe]||mo.levels.INFO);const oi=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>mo.trace(`${e}${n}`,...r),debug:(n,...r)=>mo.debug(`${e}${n}`,...r),info:(n,...r)=>mo.info(`${e}${n}`,...r),warn:(n,...r)=>mo.warn(`${e}${n}`,...r),error:(n,...r)=>{mo.error(`${e}${n}`,...r);try{const i=r.map(l=>Gs(l)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Qe.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>mo.info(`${e}API: ${n}`,...r),hook:(n,...r)=>mo.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>mo.debug(`${e}Mount: ${n}`,...r)}},lfe=oi("useVariantsHistory"),kI=[],cfe=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,o;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.requestId===s.requestId&&n.label===s.label&&n.brief===s.brief&&JSON.stringify(n.references)===JSON.stringify(s.references)&&n.runLabel===s.runLabel&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((o=s.serve)==null?void 0:o.kind)&&n.hasTree===s.hasTree}),ufe=({historyQuery:t,snapshotKey:e,isEnabled:n,isListed:r,onLoaded:s})=>{const i=Qs.variantsHistory.list({historyQuery:t,snapshotKey:e}),o=um(s),l=ca({queryKey:i,queryFn:async({signal:v})=>{let y;try{const b=await Ft(`/api/variants/history${t}`,{credentials:"same-origin",signal:v});if(!b.ok)return h.current;y=((await b.json()).variants??[]).filter(r)}catch(b){return v.aborted||lfe.warn("Failed to load past variants",b),h.current}if(v.aborted)return h.current;o.current(y);const _=h.current;return cfe(_,y)?_:y},enabled:n,placeholderData:VJ,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:c,updateData:d}=_F({queryKey:i,data:l.data}),f=c??kI,h=um(f),m=g.useCallback(v=>{d(y=>v(y??kI))},[d]);return{pastVariants:f,setPastVariants:m}},EI=oi("useVariantsUiState"),dfe={groups:[],rows:{}},ov={pinned:[],order:dfe},cp="pinned",ffe="top",Rw=t=>`rows:${t}`,Aw=t=>({projectPath:t,mutations:[],preview:ov}),hfe=(t,e)=>e.reduce((n,r)=>r(n),t),wF=t=>t?`/api/variants/ui-state?projectPath=${encodeURIComponent(t)}`:"/api/variants/ui-state",pfe=async t=>{const e=await Ft(wF(t));if(!e.ok)throw new Error(`Failed to load variants UI state (${e.status})`);return xJ.parse(await e.json()).uiState},mfe=async({projectPath:t,uiState:e})=>{await Ft(wF(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:e})})},CI=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},gfe=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),vfe=(t,e)=>n=>{if(t===cp){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===ffe?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},yfe=t=>{const e=Om(),n=Qs.variantsUiState(t),[r,s]=g.useState(()=>Aw(t)),i=g.useRef(r),o=g.useCallback(P=>{i.current=P,s(P)},[]),l=g.useCallback(P=>i.current.projectPath===P?i.current:Aw(P),[]),{mutate:c}=s9({mutationFn:mfe,onError:P=>{EI.warn("persist failed — arrangement kept for this session only",P)}}),d=ca({queryKey:n,queryFn:async()=>{let P;try{P=await pfe(t)}catch(I){throw EI.warn("load failed — arrangement is session-local until reload",I),I}const{mutations:R}=l(t);if(R.length===0)return P;o(Aw(t));const O=hfe(P,R);return t&&c({projectPath:t,uiState:O}),O},enabled:t!==null,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:f,updateData:h}=_F({queryKey:n,data:d.isSuccess?d.data:void 0}),m=g.useCallback(()=>{var P;return t!==null&&((P=e.getQueryState(Qs.variantsUiState(t)))==null?void 0:P.status)==="success"},[t,e]),v=g.useCallback(()=>m()?e.getQueryData(Qs.variantsUiState(t))??ov:l(t).preview,[m,t,e,l]),y=g.useCallback(P=>{if(t!==null&&m()){const O=h(I=>P(I??ov));c({projectPath:t,uiState:O});return}const R=l(t);o({projectPath:t,mutations:[...R.mutations,P],preview:P(R.preview)})},[m,c,t,l,o,h]),_=g.useCallback(P=>{const R=!v().pinned.includes(P);y(R?CI(P):gfe(P))},[y,v]),b=g.useCallback(P=>{v().pinned.includes(P)||y(CI(P))},[y,v]),x=g.useCallback((P,R)=>{y(vfe(P,R))},[y]);let k=ov;f?k=f:r.projectPath===t&&(k=r.preview);const C=g.useMemo(()=>new Set(k.pinned),[k.pinned]);return{pinnedKeys:k.pinned,pinnedKeySet:C,listOrder:k.order,togglePin:_,pinItem:b,reorder:x}},_fe=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=g.useState(null),c=g.useCallback(h=>{const m=e.current;return m?Array.from(m.querySelectorAll(`[data-reorder-container="${CSS.escape(h)}"]`)):[]},[e]),d=g.useCallback(h=>{if(!n){o&&l(null);return}const m=e.current;if(!m)return;if(r){const x=m.querySelector(r);if(x){const k=x.getBoundingClientRect();if(h.clientY>=k.top&&h.clientY<=k.bottom){o&&l(null);return}}}if(s){const x=m.querySelector(s),k=x==null?void 0:x.getBoundingClientRect();if(!k||h.clientY<k.top||h.clientY>k.bottom){o&&l(null);return}}const v=c(n.container);if(v.length===0){o&&l(null);return}const y=m.getBoundingClientRect().top;let _=v.length;for(let x=0;x<v.length;x++){const k=v[x].getBoundingClientRect();if(h.clientY<k.top+k.height/2){_=x;break}}let b;_===0?b=v[0].getBoundingClientRect().top-y-1:_===v.length?b=v[v.length-1].getBoundingClientRect().bottom-y:b=(v[_-1].getBoundingClientRect().bottom+v[_].getBoundingClientRect().top)/2-y,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:b})},[e,n,o,c,r,s]),f=g.useCallback(()=>{if(!n||!o)return;l(null);const h=c(o.container).map(y=>y.dataset.reorderKey).filter(y=>!!y),m=h.indexOf(n.key);if(m===-1)return;h.splice(m,1);const v=o.index>m?o.index-1:o.index;h.splice(v,0,n.key),i(o.container,h)},[n,o,c,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},wfe={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},share:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},inspectorUndoRedo:{default:!1}},bF=Object.fromEntries(Object.entries(wfe).map(([t,e])=>[t,{isEnabled:e.default}])),xF=gn(!0),SF=gn(null),kF=gn(0),bfe=gn({name:null,email:null}),aS=gn(0),p1=gn(null),lS=gn(!1),cS=gn(null),EF=gn(!1),CF=gn(!1),av=gn(null),lv=gn(null),$f=gn(null),Z6=gn(null),mc=gn(null),PF=gn(!1),Vm=gn({active:!1}),TF=gn([]),uS=gn(bF),xfe=gn(!1),cy=gn(null),RF=gn(null),uy=gn(!0),Sfe=gn(!1),AF=gn(!1),IF=gn(null),kfe=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},dy=gn(kfe()),Efe=gn(null);function Cfe(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const Pfe=t=>{var s,i;const e=[t.label.trim(),(s=t.description)==null?void 0:s.trim()].filter(o=>!!o).join(`
170
- `);if(!t.reference)return e;const n=((i=t.projectPath)==null?void 0:i.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"";return t.directionRef&&n?`rivet variants get ${t.directionRef}${r}`:t.projectId?`rivet variants get ${t.projectId}/${t.reference}`:`rivet variants get ${t.reference}${r}`},Tfe=async({text:t,copyKind:e})=>{const n=t.trim();if(n)try{await navigator.clipboard.writeText(n),Qe.capture("variants_panel.copy_completed",{outcome:"success",copyKind:e}),on.success("Copied")}catch(r){Qe.capture("variants_panel.copy_failed",{outcome:"failure",copyKind:e,errorName:r instanceof Error?r.name:"UnknownError"}),on.error("Couldn't copy")}},Rfe=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],W6=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:Rfe.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),Afe=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(rm,{size:12,weight:"bold"}):null,o]})]})},OF=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:c})=>{const[d,f]=g.useState(!1),h=i?o??t:t,m=c.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,h]}),m?S.jsxs(z6,{open:d,onOpenChange:f,children:[S.jsx(V6,{asChild:!0,children:S.jsx("button",{"aria-label":l,disabled:s||i,title:l,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(xae,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(H6,{children:S.jsx(U6,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(v=>{const y=v.icon;return S.jsxs("button",{onClick:()=>{v.isDisabled||(v.onClick(),f(!1))},disabled:v.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[y?S.jsx(y,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})},zu=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(N6,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),Ife=32,Ofe=2048,MF=Vd().max(Ofe).refine(t=>{let e;try{e=decodeURIComponent(t.split(/[?#]/)[0])}catch{return!1}return t.startsWith("/")&&!t.startsWith("//")&&!t.includes("\\")&&!/^\/%(?:2f|5c)/i.test(t)&&!e.includes("\\")&&!e.split("/").some(n=>n==="."||n==="..")&&![...t].some(n=>n<=" "||n==="")},"Expected an app-relative preview route");sJ(MF).min(1).max(Ife).transform(t=>[...new Set(t)]);const fy="/__rivet/preview",PI=`${fy}/variant/`,TI=`${fy}/history/`,NF=t=>t?t.startsWith("/")?t:`/${t}`:"/",LF=(t,e)=>{if(!e)return t;const n=MF.parse(e);if(t.includes("?")||t.includes("#"))throw new Error("Preview target must not contain an application query or hash");return t.replace(/\/$/,"")+n},RI=(t,e)=>{const n=new URLSearchParams(e);return n.set("targetAddressed","1"),`/api/variants/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}/run?${n}`},Mfe=t=>{const e="/api/variants/history/"+encodeURIComponent(t.sessionId)+"/"+encodeURIComponent(t.variantId);return t.routePath?LF(e+"/site/"+encodeURIComponent(t.projectPath??"current"),t.routePath):e+"/preview"+(t.projectPath?"?projectPath="+encodeURIComponent(t.projectPath):"")},Nfe=t=>`${fy}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${NF(t.routePath)}`,AI=t=>`${fy}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${NF(t.routePath)}`,II=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(PI)||e.pathname.startsWith(TI)}catch{return t.startsWith(PI)||t.startsWith(TI)}},Cu=t=>{var s,i,o,l,c,d;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?LF(n.preview.url,(i=n.previewRoutes)==null?void 0:i[0]):e&&(((o=n.preview)==null?void 0:o.kind)==="dev_server"||typeof n.port=="number")?Nfe({sessionId:e,variantId:n.workItemId,routePath:((l=n.previewRoutes)==null?void 0:l[0])??((r==null?void 0:r.kind)==="fresh"?"/":t.routePath)}):e&&(r==null?void 0:r.kind)==="fresh"&&((c=r.executionPlan)==null?void 0:c.mode)!=="vite_app"&&((d=n.preview)==null?void 0:d.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},OI="/rivet/",DF=t=>{if(!t.startsWith(OI))return null;const e=t.slice(OI.length);return!e||e==="/"?null:`/${e}`},Jd=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},Lfe=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static"||((n=t.serve)==null?void 0:n.kind)==="static"||Jd(t)},Dfe=t=>[...t].sort((e,n)=>new Date(n.createdAt).getTime()-new Date(e.createdAt).getTime()).find(e=>!Jd(e)),dm=t=>{var e,n;return t.status!=="succeeded"?!1:((n=(e=t.actions)==null?void 0:e.view)==null?void 0:n.enabled)??(!!t.preview||typeof t.port=="number")},MI=t=>{var e,n;return dm(t)&&(((e=t.preview)==null?void 0:e.kind)==="static_artifact"||((n=t.preview)==null?void 0:n.kind)==="dev_server")},$F=({entry:t,projectPath:e})=>{var n;return Mfe({sessionId:t.sessionId,variantId:t.variantId,projectPath:e,routePath:(n=t.previewRoutes)==null?void 0:n[0]})},$fe=({entry:t,projectPath:e})=>({selectedPastVariant:{sessionId:t.sessionId,variantId:t.variantId,previewKind:"static",references:t.references,projectPath:e??void 0},previewUrl:$F({entry:t,projectPath:e})}),Ffe=({incomingSessionId:t,previousSessionId:e,isIncomingSessionPreviewable:n,selectedPastVariant:r,displayedLiveVariantId:s,pastVariants:i})=>{if(n)return{kind:"clear"};if(r)return r.sessionId===t?{kind:"clear"}:{kind:"keep_selected"};const o=i.find(l=>l.sessionId===e&&l.variantId===s&&!Jd(l));return o?{kind:"show_saved",entry:o}:{kind:"clear"}},Ff=(t,e=Ft)=>{if((t==null?void 0:t.source)!=="history-dev-server")return;const n=new URLSearchParams({sessionId:t.sessionId,variantId:t.variantId});e(`/api/variants/history/replay/stop?${n.toString()}`,{method:"POST"}).catch(()=>{})},jfe=(t,e=Ft)=>{const n=new Set;for(const r of[t==null?void 0:t.left,t==null?void 0:t.right]){if((r==null?void 0:r.source)!=="history-dev-server")continue;const s=`${r.sessionId}:${r.variantId}`;n.has(s)||(n.add(s),Ff(r,e))}},m1=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},NI=6,FF="original",K6="Original",jF="The original state of your app before any variants were generated.",LI=200,zF="h-6 w-6 rounded",dS=[.33,1,.68,1],fS=.22,Yr=oi("AgentVariantsPanel"),Iw=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},zfe=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Ow(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const Vfe=(t,e)=>{if(t.kind==="original")return null;const n=t.kind==="active"?t.variant.runLabel:t.entry.runLabel,r=n==null?void 0:n.trim();return r?t.kind==="active"?e?{label:r,run:t.variant.requestId?{sessionId:e,requestId:t.variant.requestId}:{sessionId:e,runLabel:r}}:null:{label:r,run:t.entry.requestId?{sessionId:t.entry.sessionId,requestId:t.entry.requestId}:{sessionId:t.entry.sessionId,runLabel:r}}:null},VF=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},Hfe="original",hS="pinned-section";function HF(t){return`rivet:collapsedRuns:${t}`}function Pg(t){try{const e=window.localStorage.getItem(HF(t)),n=e?JSON.parse(e):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function Mw(t,e){try{window.localStorage.setItem(HF(t),JSON.stringify([...e]))}catch{}}const DI=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=Vfe(s,e);let o="";s.kind==="original"?o=Hfe:i&&(o=VF(i.run));let l=r.get(o);l||(l={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,l),n.push(l)),l.rows.push(s)}return n};async function Ra(t){try{const e=await t.json();return{message:typeof e.message=="string"?e.message:null,errorCode:typeof e.errorCode=="string"?e.errorCode:null}}catch{return{message:null,errorCode:null}}}const UF=t=>t.status==="succeeded",BF=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},Ufe=t=>t.status==="succeeded"&&!dm(t)&&(!t.previewUnavailable||BF(t)),Nw=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static_artifact"?"static_artifact":((n=t.preview)==null?void 0:n.kind)==="dev_server"||typeof t.port=="number"?"dev_server":"none"},$I=(t,e,n)=>{const r=new URL(t,window.location.origin);return r.searchParams.set(e,n),`${r.pathname}${r.search}${r.hash}`},Bfe=t=>{var e;return UF(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},FI=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),Zfe=()=>{var Wu,Ku,Rc;const t=Lk(),e=bt(Vm),n=bt(PF),r=g.useRef(!1),s=bt(TF),i=bt(cy),o=bt(uy),l=bt(uS),c=((Wu=l.share)==null?void 0:Wu.isEnabled)??!1,d=((Ku=l.deployPrototype)==null?void 0:Ku.isEnabled)??!1,f=((Rc=l.canvasShare)==null?void 0:Rc.isEnabled)??!1,h=bt(AF),m=bt(IF),v=Nt(aS),y=Nt(p1),_=Nt(lS),b=Nt(cS),x=Nt(EF),k=Nt(CF),C=Nt($f),P=bt($f),R=Nt(Z6),O=Nt(SF);g.useEffect(()=>(O("Directions"),()=>O(null)),[O]);const I=bt(mc),A=Nt(mc),M=g.useCallback((U=!1)=>{if(jfe(I),A(null),U&&I){const ae=m1("ended",I);Qe.capture(ae.event,ae.properties)}},[A,I]),L=bt(av),z=Nt(av),$=bt(lv),q=Nt(lv),X=$?`${$.sessionId}:${$.variantId}`:null,[K,H]=g.useState(""),[ee,V]=g.useReducer(U=>U+1,0),Q=g.useMemo(()=>i!==null?Pg(i):new Set,[i,ee]),B=g.useCallback(U=>{if(i===null)return;const ae=new Set(Pg(i));ae.delete(U)||ae.add(U),Mw(i,ae),V()},[i]),[D,G]=g.useState(null),[fe,ie]=g.useState(null),[ue,he]=g.useState(!1),[_e,le]=g.useState({}),[ne,be]=g.useState(null),[Ve,De]=g.useState({}),[$e,Ut]=g.useState(null),[nn,kt]=g.useState(!1),[Dt]=g.useState(()=>Mle(window.location.search)),un=g.useRef(!1),qt=Dt!==null||$!==null||L!==null||nn,Ne=g.useMemo(()=>e.active?e.variants:[],[e]),Je=g.useMemo(()=>Ne.filter(Bfe),[Ne]),Re=g.useMemo(()=>FI(Je,_e),[Je,_e]),Ct=(ne==null?void 0:ne.key)===Re?ne.shareUrl:null,Se=e.active?e.sessionId:null,$t=g.useMemo(()=>{const U=new Set;for(const ae of Ne)ae.adoptedSource&&U.add(`${ae.adoptedSource.sessionId}:${ae.adoptedSource.variantId}`);return U},[Ne]),ht=e.active?e.projectContext:null,mt=(ht==null?void 0:ht.kind)==="fresh"?ht.workspacePath:i,tr=g.useMemo(()=>mt?`?projectPath=${encodeURIComponent(mt)}`:"",[mt]),Oi=e.active?`${e.sessionId}:${e.stage}`:"inactive",Pn=g.useMemo(()=>{var ae;if(nn||X)return null;const U=L?Ne.find(Ie=>Ie.workItemId===L):null;return L&&!U?null:U?dm(U)?U.workItemId:null:e.active?((ae=Ne.find(MI))==null?void 0:ae.workItemId)??null:null},[L,X,nn,e,Ne]),lr=g.useCallback(U=>{const ae=$fe({entry:U,projectPath:mt});q(ae.selectedPastVariant),kt(!1),y(ae.previewUrl)},[mt,y,q]),to=g.useRef(!1),bs=U=>{if(!to.current&&!qt&&Pn===null&&U.length>0&&U.every(ae=>ae.projectKind==="fresh")){const ae=Dfe(U);ae&&(to.current=!0,lr(ae))}q(ae=>{if(!ae)return ae;const Ie=U.find(Ce=>Ce.sessionId===ae.sessionId&&Ce.variantId===ae.variantId);return!Ie||JSON.stringify(ae.references)===JSON.stringify(Ie.references)?ae:{...ae,references:Ie.references}})},{pastVariants:rs,setPastVariants:nr}=ufe({historyQuery:tr,snapshotKey:Oi,isEnabled:!o,isListed:Lfe,onLoaded:bs}),vn=g.useMemo(()=>[...rs.filter(ae=>ae.sessionId!==Se&&!$t.has(`${ae.sessionId}:${ae.variantId}`))].sort((ae,Ie)=>{const Ce=new Date(ae.createdAt).getTime(),Ae=new Date(Ie.createdAt).getTime();return(Number.isNaN(Ae)?0:Ae)-(Number.isNaN(Ce)?0:Ce)}),[$t,rs,Se]),ss=g.useMemo(()=>$?Ne.find(U=>{var ae,Ie;return((ae=U.adoptedSource)==null?void 0:ae.sessionId)===$.sessionId&&((Ie=U.adoptedSource)==null?void 0:Ie.variantId)===$.variantId})??null:null,[$,Ne]),pr=g.useMemo(()=>$?vn.find(U=>U.sessionId===$.sessionId&&U.variantId===$.variantId)??null:null,[$,vn]),Co=!e.active&&vn.length>0&&vn.every(U=>U.projectKind==="fresh"),Wr=e.active?zfe(ht):!!i&&!Co,{pinnedKeys:rr,pinnedKeySet:Nr,listOrder:ai,togglePin:cr,pinItem:xs,reorder:it}=yfe(mt),cn=g.useRef(null),rn=g.useRef(null),yn=typeof window>"u"?"/":DF(window.location.pathname)??"/",Tn=g.useRef(null),Gt=g.useRef(!1),$n=g.useCallback((U,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),Iw(),Tn.current={kind:"live",variantId:U,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]),is=g.useCallback((U,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),Iw(),Tn.current={kind:"past",entry:U,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]);g.useEffect(()=>{const U=Ce=>{var dt;const Ae=Tn.current;if(!Ae)return;const Le=Ce.clientX-Ae.startX,Pt=Ce.clientY-Ae.startY;if(!Ae.committed){if(Le*Le+Pt*Pt<NI*NI)return;if(Iw(),Ae.kind==="live"){const vt=Ne.find(as=>as.workItemId===Ae.variantId);if(!vt||vt.status!=="succeeded"){Tn.current=null;return}const Cr=Cu({sessionId:Se,variant:vt,projectContext:ht,routePath:yn});C({sessionId:Se??"",variantId:vt.workItemId,label:vt.label||"Direction",url:Cr,source:"live",runLabel:vt.runLabel,description:vt.description})}else{const{entry:vt}=Ae,Cr=Jd(vt),as=Cr?AI({sessionId:vt.sessionId,variantId:vt.variantId,routePath:((dt=vt.previewRoutes)==null?void 0:dt[0])??yn}):$F({entry:vt,projectPath:mt});if(C({sessionId:vt.sessionId,variantId:vt.variantId,label:vt.label||"Direction",url:as,source:Cr?"history-dev-server":"history-static",runLabel:vt.runLabel,description:vt.brief}),Cr){const ks=RI(vt,tr);(async()=>{try{if(!(await Ft(ks,{method:"POST"})).ok)return;const sn=$I(as,"replay",String(Date.now()));C(Tt=>!Tt||Tt.sessionId!==vt.sessionId||Tt.variantId!==vt.variantId||Tt.source!=="history-dev-server"?Tt:{...Tt,url:sn}),A(Tt=>{if(!Tt)return Tt;const Mo=Li=>!Li||Li.sessionId!==vt.sessionId||Li.variantId!==vt.variantId?Li:{...Li,url:sn};return{...Tt,left:Mo(Tt.left),right:Mo(Tt.right)}})}catch($s){Yr.warn("history replay drag boot failed",$s)}})()}}Ae.committed=!0}R({x:Ce.clientX,y:Ce.clientY})},ae=()=>{const Ce=Tn.current;Ce!=null&&Ce.committed&&(Gt.current=!0,window.setTimeout(()=>{Gt.current=!1},0)),Tn.current=null,R(null)},Ie=Ce=>{if(Ce.key!=="Escape")return;const Ae=Tn.current;Ae!=null&&Ae.committed&&(Ae.kind==="past"&&Jd(Ae.entry)&&Ff({sessionId:Ae.entry.sessionId,variantId:Ae.entry.variantId,source:"history-dev-server"}),Tn.current=null,C(null),R(null))};return window.addEventListener("pointermove",U),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",ae),window.addEventListener("keydown",Ie),()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",ae),window.removeEventListener("keydown",Ie)}},[Ne,Se,ht,yn,tr,mt,C,R,A]);const sr=g.useCallback(()=>{var U;(U=Tn.current)!=null&&U.committed&&(Gt.current=!0,window.setTimeout(()=>{Gt.current=!1},0)),Tn.current=null,R(null),P&&(P.source==="history-dev-server"&&Ff({sessionId:P.sessionId,variantId:P.variantId,source:"history-dev-server"}),C(null))},[P,C,R]),kr=g.useCallback((U,ae)=>{const Ie=!Nr.has(U);Qe.capture(Ie?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:ae}),cr(U)},[Nr,cr]),Bt=g.useCallback(()=>{P&&(Qe.capture("variants_panel.direction_pinned",{method:"drag"}),xs(`row:past:${P.sessionId}:${P.variantId}`),sr())},[P,sr,xs]),Mi=g.useCallback(U=>{Qe.capture("variants_panel.direction_unpinned",{method:"drag"}),cr(U),sr()},[cr,sr]),rh=g.useCallback((U,ae)=>{it(U,ae),sr()},[it,sr]),ol=nn||Wr&&L===null&&X===null&&Pn===null,Po=g.useCallback(async U=>{var Ie,Ce,Ae,Le,Pt;if(!Se)return;const ae=(U==null?void 0:U.workItemId)??null;G({kind:"switch",variantId:ae??void 0});try{if(((Ie=U==null?void 0:U.preview)==null?void 0:Ie.kind)==="static_artifact"){const vt=Cu({sessionId:Se,variant:U,projectContext:e.active?e.projectContext:null})??U.preview.url;_(!1),b(null),((Ce=U.refinement)==null?void 0:Ce.status)==="succeeded"&&!((Ae=U.previewRoutes)!=null&&Ae.length)?y($I(vt,"refinement",U.refinement.workItemId)):y(vt);return}if(ae&&Se&&e.active&&e.projectContext.kind==="fresh"&&((Le=e.projectContext.executionPlan)==null?void 0:Le.mode)!=="vite_app"&&((Pt=U==null?void 0:U.preview)==null?void 0:Pt.kind)!=="dev_server"){_(!1),b(null),y(`/api/variants/${Se}/static/${ae}`);return}const dt=U&&ae?Cu({sessionId:Se,variant:U,projectContext:e.active?e.projectContext:null,routePath:yn}):null;if(dt){_(!1),b(null),y(dt);return}Qe.capture("variants_panel.preview_display_failed",{sessionId:Se,variantId:ae,previewKind:U?Nw(U):"none",hasPreview:!!(U!=null&&U.preview),hasPort:typeof(U==null?void 0:U.port)=="number",errorMessage:"No addressable dev-server preview URL"}),_(!1),b(null)}catch(dt){Yr.warn("preview display failed",dt),Qe.capture("variants_panel.preview_display_failed",{sessionId:Se,variantId:ae,previewKind:U?Nw(U):"none",hasPreview:!!(U!=null&&U.preview),hasPort:typeof(U==null?void 0:U.port)=="number",errorMessage:dt instanceof Error?dt.message:String(dt)}),_(!1),b(null)}finally{G(null)}},[Se,e,yn,y,_,b]),Lr=g.useRef(0),Ni=g.useCallback(()=>{Lr.current++,G(U=>(U==null?void 0:U.kind)==="switch"?null:U),x(!1),k(!1)},[x,k]),Ls=g.useCallback(async U=>{if(Se){G({kind:"switch",variantId:U.workItemId});try{const ae=await Ft(`/api/variants/${Se}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:U.workItemId})});if(!ae.ok){const Ie=await Ra(ae);throw new Error(Ie.message??`Preview restoration failed (${ae.status})`)}}catch(ae){Yr.warn("preview restoration failed",ae),Qe.capture("variants_panel.preview_display_failed",{sessionId:Se,variantId:U.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ae instanceof Error?ae.message:String(ae)})}finally{G(null)}}},[Se]),no=g.useCallback(U=>{var Le,Pt,dt,vt,Cr;if(Gt.current){Gt.current=!1;return}const ae=dm(U),Ie=U.status==="pending"||U.status==="running"||Ufe(U);Ni();const Ce=Nw(U),Ae=Ne.find(as=>as.workItemId===L);Qe.capture("variants_panel.preview_requested",{sessionId:Se,fromVariantId:Ae==null?void 0:Ae.workItemId,toVariantId:U.workItemId,variantStatus:U.status,isPreviewReady:ae,isArmed:Ie,previewKind:Ce,hasPreview:!!U.preview,hasPort:typeof U.port=="number",viewEnabled:((Pt=(Le=U.actions)==null?void 0:Le.view)==null?void 0:Pt.enabled)??null,previewUnavailableReason:((dt=U.previewUnavailable)==null?void 0:dt.reason)??null}),z(U.workItemId),q(null),ae?(rn.current=U.workItemId,kt(!1),M(!0),Po(U)):(rn.current=null,kt(!1),y(null),_(!1),Ie&&Qe.capture("variants_panel.preview_armed",{sessionId:Se,fromVariantId:Ae==null?void 0:Ae.workItemId,toVariantId:U.workItemId,variantStatus:U.status,previewKind:Ce,hasPreview:!!U.preview,hasPort:typeof U.port=="number",viewEnabled:((Cr=(vt=U.actions)==null?void 0:vt.view)==null?void 0:Cr.enabled)??null}),BF(U)&&Ls(U)),Qe.capture("variants_panel.preview_switched",{sessionId:Se,fromVariantId:Ae==null?void 0:Ae.workItemId,toVariantId:U.workItemId,armed:Ie})},[L,Se,M,z,q,Ni,Ls,Po,Ne,y,_]),Ds=g.useCallback(U=>{if(Gt.current){Gt.current=!1;return}if(M(!0),z(null),Jd(U)){q({sessionId:U.sessionId,variantId:U.variantId,previewKind:"dev_server",references:U.references,projectPath:mt??void 0}),kt(!1);const ae=++Lr.current;x(!0),k(!0),(async()=>{var Ce;G({kind:"switch"}),Qe.capture("variants_panel.history_replay_started",{sessionId:U.sessionId,variantId:U.variantId});const Ie=(Ae,Le)=>{Qe.capture("variants_panel.history_replay_failed",{sessionId:U.sessionId,variantId:U.variantId,...Le}),x(!1),k(!1),q(Pt=>Pt?{...Pt,previewError:Ae}:null),y(null)};try{const Ae=await Ft(RI(U,tr),{method:"POST"});if(ae!==Lr.current)return;if(!Ae.ok){const{message:Pt,errorCode:dt}=await Ra(Ae);if(ae!==Lr.current)return;Yr.warn(`history replay failed: HTTP ${Ae.status} ${dt??""}`),Ie(Pt??`Preview startup failed (${Ae.status})`,{httpStatus:Ae.status,errorCode:dt});return}const Le=await Ae.json();if(ae!==Lr.current)return;k(!1),_(!1),b(null),y(AI({sessionId:U.sessionId,variantId:U.variantId,routePath:((Ce=U.previewRoutes)==null?void 0:Ce[0])??yn})),Le.alreadyRunning||v(Pt=>Pt+1),Qe.capture("variants_panel.history_replay_ready",{sessionId:U.sessionId,variantId:U.variantId})}catch(Ae){if(ae!==Lr.current)return;Yr.warn("history replay failed",Ae);const Le=Gs(Ae,"Preview startup failed");Ie(Le,{errorMessage:Le})}finally{ae===Lr.current&&G(null)}})();return}Ni(),_(!1),b(null),lr(U)},[mt,yn,lr,G,x,k,v,q,z,y,b,M,_,Ni,tr]);g.useEffect(()=>{if(!Dt||un.current)return;const U=rs.find(ae=>ae.sessionId===Dt.sessionId&&ae.variantId===Dt.variantId);U&&(un.current=!0,Ds(U))},[Dt,rs,Ds]);const al=g.useCallback(async()=>{Ni();const U=()=>{M(!0),z(null),q(null),kt(!0),rn.current=null,_(!1),b(null),y(null)};if(!Se){U();return}G({kind:"switch"});try{const ae=await Ft(`/api/variants/${Se}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ae.ok){Yr.warn(`switch to original failed: HTTP ${ae.status}`);return}U(),_(!0),Qe.capture("variants_panel.preview_switched",{sessionId:Se,fromVariantId:L,toVariantId:null,target:"original",armed:!1})}catch(ae){Yr.warn("preview-port original switch failed",ae)}finally{G(null)}},[L,Se,z,q,y,b,M,_,Ni]),li=g.useCallback(async(U,ae,Ie)=>{Qe.capture("variants_panel.deploy_clicked",{sessionId:U,variantId:ae,variantLabel:Ie});try{const Ce=await Ft(`/api/variants/${U}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ae,...i?{projectPath:i}:{}})});if(!Ce.ok){const{message:Pt,errorCode:dt}=await Ra(Ce);return Yr.warn(`deploy failed: HTTP ${Ce.status} ${dt??""} ${Pt??""}`),Qe.capture("variants_panel.deploy_failed",{sessionId:U,variantId:ae,httpStatus:Ce.status,errorCode:dt??null,errorMessage:Pt??null}),on.error("Couldn't deploy this direction",{description:Pt??`The server rejected the request (HTTP ${Ce.status}). Try again.`}),null}const Ae=await Ce.json().catch(()=>null),Le=Ae==null?void 0:Ae.shareUrl;return Le?(await navigator.clipboard.writeText(Le).catch(()=>{}),Qe.capture("variants_panel.deploy_succeeded",{sessionId:U,variantId:ae}),on.success(`"${Ie}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Le,"_blank","noopener")}}),Le):(on.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(Ce){return Yr.warn("deploy failed",Ce),Qe.capture("variants_panel.deploy_failed",{sessionId:U,variantId:ae,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:Ce instanceof Error?Ce.message:String(Ce)}),on.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),Cc=g.useCallback(async U=>{if(!Se)return;const ae=_e[U.workItemId];if(ae){await navigator.clipboard.writeText(ae).catch(()=>{}),on.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ae,"_blank","noopener")}});return}G({kind:"deploy",variantId:U.workItemId});try{const Ie=await li(Se,U.workItemId,U.label);Ie&&le(Ce=>({...Ce,[U.workItemId]:Ie}))}finally{G(null)}},[Se,_e,li]),Uu=g.useCallback(async()=>{if(!(!Se||Je.length===0)){if(Ct){await navigator.clipboard.writeText(Ct).catch(()=>{}),on.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Ct,"_blank","noopener")}});return}Qe.capture("variants_panel.deploy_clicked",{sessionId:Se,variantId:"canvas",variantLabel:"Canvas",variantCount:Je.length}),G({kind:"deploy-canvas"});try{const U=await Ft(`/api/variants/${Se}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Je.map(Le=>Le.workItemId),...i?{projectPath:i}:{}})});if(!U.ok){const{message:Le,errorCode:Pt}=await Ra(U);Yr.warn(`canvas deploy failed: HTTP ${U.status} ${Pt??""} ${Le??""}`),Qe.capture("variants_panel.deploy_failed",{sessionId:Se,variantId:"canvas",httpStatus:U.status,errorCode:Pt??null,errorMessage:Le??null,variantCount:Je.length}),on.error("Couldn't share this canvas",{description:Le??`The server rejected the request (HTTP ${U.status}). Try again.`});return}const ae=await U.json().catch(()=>null),Ie=ae==null?void 0:ae.shareUrl;if(!Ie){on.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const Ce=Object.fromEntries(((ae==null?void 0:ae.variants)??[]).filter(Le=>typeof Le.variantId=="string"&&typeof Le.shareUrl=="string").map(Le=>[Le.variantId,Le.shareUrl])),Ae=Object.keys(Ce).length>0?{..._e,...Ce}:_e;Ae!==_e&&le(Ae),await navigator.clipboard.writeText(Ie).catch(()=>{}),be({key:FI(Je,Ae),shareUrl:Ie}),Qe.capture("variants_panel.deploy_succeeded",{sessionId:Se,variantId:"canvas",variantCount:Je.length}),on.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Ie,"_blank","noopener")}})}catch(U){Yr.warn("canvas deploy failed",U),Qe.capture("variants_panel.deploy_failed",{sessionId:Se,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:U instanceof Error?U.message:String(U),variantCount:Je.length}),on.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{G(null)}}},[Ct,Je,_e,i,Se]),ll=g.useCallback(async U=>{const ae=`${U.sessionId}:${U.variantId}`,Ie=Ve[ae];if(Ie){await navigator.clipboard.writeText(Ie).catch(()=>{}),on.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Ie,"_blank","noopener")}});return}Ut(ae);try{const Ce=await li(U.sessionId,U.variantId,U.label);Ce&&De(Ae=>({...Ae,[ae]:Ce}))}finally{Ut(null)}},[Ve,li]),dn=g.useCallback(async U=>{if(Se){Qe.capture("variants_panel.remove_clicked",{sessionId:Se,variantId:U.workItemId,variantLabelLength:U.label.length}),G({kind:"remove",variantId:U.workItemId});try{const ae=await Ft(`/api/variants/${Se}/${U.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ae.ok){const{message:Ie}=await Ra(ae);Yr.warn(`remove failed: HTTP ${ae.status} ${Ie??""}`),on.error("Couldn't remove direction",{description:Ie??`The server rejected the request (HTTP ${ae.status}). Try again.`});return}(U.workItemId===Pn||U.workItemId===L)&&(z(null),y(null),_(!1),v(Ie=>Ie+1))}catch(ae){Yr.warn("remove failed",ae),on.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{G(null)}}},[Se,L,Pn,z,y,_,v]),To=g.useCallback(async U=>{if(!mt){on.error("Couldn't remove direction",{description:"No project path available."});return}Qe.capture("variants_panel.remove_past_clicked",{sessionId:U.sessionId,variantId:U.variantId});const ae=`${U.sessionId}:${U.variantId}`,Ie=Ce=>Ce.sessionId===U.sessionId&&Ce.variantId===U.variantId;G({kind:"remove",variantId:ae}),nr(Ce=>Ce.filter(Ae=>!Ie(Ae))),X===ae&&(q(null),y(null),_(!1),v(Ce=>Ce+1));try{const Ce=await Ft(`/api/variants/history/${encodeURIComponent(U.sessionId)}/${encodeURIComponent(U.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:mt})});if(!Ce.ok){const{message:Ae}=await Ra(Ce);nr(Le=>Le.some(Ie)?Le:[...Le,U]),on.error("Couldn't remove direction",{description:Ae??`The server rejected the request (HTTP ${Ce.status}). Try again.`})}}catch(Ce){Yr.warn("remove past failed",Ce),nr(Ae=>Ae.some(Ie)?Ae:[...Ae,U]),on.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{G(null)}},[mt,X,q,y,_,v,nr]),ci=g.useCallback(U=>{ie(U)},[]),Ro=g.useCallback(U=>{if(!U.label||!U.run)return;const ae=U.rows.flatMap(Ce=>Ce.kind==="active"?[Ce.variant]:[]),Ie=U.rows.flatMap(Ce=>Ce.kind==="past"?[Ce.entry]:[]);ae.length===0&&Ie.length===0||ie({kind:"run",label:U.label,variants:ae,entries:Ie})},[]),Kr=g.useCallback(async()=>{if(!(!fe||ue)){he(!0);try{if(fe.kind==="active")await dn(fe.variant);else if(fe.kind==="past")await To(fe.entry);else{for(const U of fe.variants)await dn(U);for(const U of fe.entries)await To(U)}}finally{he(!1),ie(null)}}},[fe,ue,dn,To]),[Pc,Tc]=g.useState(null),[ga,os]=g.useState(null),Bu=g.useCallback(U=>{os(U)},[]),Ss=g.useCallback(()=>{os(null)},[]),sh=g.useCallback(async(U,ae)=>{os(null);const Ie=ae.trim();if(!Ie||U.kind==="original")return;if(U.kind==="active"){if(!Se||Ie===U.variant.label)return;Qe.capture("variants_panel.rename",{sessionId:Se,variantId:U.variant.workItemId,labelLength:Ie.length,past:!1});try{const Le=await Ft(`/api/variants/${Se}/${U.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ie})});if(!Le.ok){const{message:Pt}=await Ra(Le);on.error("Couldn't rename direction",{description:Pt??`The server rejected the request (HTTP ${Le.status}). Try again.`})}}catch(Le){Yr.warn("rename failed",Le),on.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:Ce}=U;if(Ie===Ce.label.trim())return;if(!mt){on.error("Couldn't rename direction",{description:"No project path available."});return}Qe.capture("variants_panel.rename",{sessionId:Ce.sessionId,variantId:Ce.variantId,labelLength:Ie.length,past:!0});const Ae=Le=>Le.sessionId===Ce.sessionId&&Le.variantId===Ce.variantId;nr(Le=>Le.map(Pt=>Ae(Pt)?{...Pt,label:Ie}:Pt));try{const Le=await Ft(`/api/variants/history/${encodeURIComponent(Ce.sessionId)}/${encodeURIComponent(Ce.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ie,projectPath:mt})});if(!Le.ok){const{message:Pt}=await Ra(Le);nr(dt=>dt.map(vt=>Ae(vt)?{...vt,label:Ce.label}:vt)),on.error("Couldn't rename direction",{description:Pt??`The server rejected the request (HTTP ${Le.status}). Try again.`})}}catch(Le){Yr.warn("rename failed",Le),nr(Pt=>Pt.map(dt=>Ae(dt)?{...dt,label:Ce.label}:dt)),on.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Se,mt,nr]),[Zu,Ao]=g.useState(null),Io=g.useCallback(U=>{Ao(U)},[]),F=g.useCallback(()=>{Ao(null)},[]),pe=g.useCallback(async(U,ae)=>{if(Ao(null),!U.label||!U.run)return;const Ie=U.label,Ce=ae.trim();if(!Ce||Ce===Ie)return;Qe.capture("variants_panel.rename_run",{runLabelLength:Ce.length});const Ae="requestId"in U.run?U.run.requestId:void 0,Le=Ae?U.key:VF({sessionId:U.run.sessionId,runLabel:Ce}),Pt=Le!==U.key;let dt=!1,vt=!1;if(i!==null&&Pt){const sn=Pg(i);dt=sn.has(U.key),vt=sn.has(Le),dt&&(sn.add(Le),Mw(i,sn),V())}const Cr=sn=>{if(i===null||!Pt)return;const Tt=Pg(i);sn?Tt.delete(U.key):(dt?Tt.add(U.key):Tt.delete(U.key),vt?Tt.add(Le):Tt.delete(Le)),Mw(i,Tt),V()},as=new Set(U.rows.flatMap(sn=>sn.kind==="past"?[`${sn.entry.sessionId}:${sn.entry.variantId}`]:[])),ks=sn=>as.has(`${sn.sessionId}:${sn.variantId}`);nr(sn=>sn.map(Tt=>ks(Tt)?{...Tt,runLabel:Ce}:Tt));const $s=()=>nr(sn=>sn.map(Tt=>ks(Tt)?{...Tt,runLabel:Ie}:Tt));try{const sn=await Ft("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:U.run.sessionId,...Ae?{requestId:Ae}:{},runLabel:Ie,label:Ce,...mt?{projectPath:mt}:{}})});if(sn.ok)Cr(!0);else{const{message:Tt}=await Ra(sn);$s(),Cr(!1),on.error("Couldn't rename run",{description:Tt??`The server rejected the request (HTTP ${sn.status}). Try again.`})}}catch(sn){Yr.warn("run rename failed",sn),$s(),Cr(!1),on.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[mt,i,nr]);g.useEffect(()=>{const U=n&&!r.current;if(r.current=n,cn.current!==Se){const Ie=cn.current===null,Ce=cn.current;cn.current=Se;const Ae=t.get(lv);if(U&&Dt&&(Ae==null?void 0:Ae.sessionId)===Dt.sessionId&&(Ae==null?void 0:Ae.variantId)===Dt.variantId)return;const Le=Ffe({incomingSessionId:Se,previousSessionId:Ce,isIncomingSessionPreviewable:e.active&&Ne.some(MI),selectedPastVariant:Ae,displayedLiveVariantId:t.get(av)??rn.current,pastVariants:rs});switch(rn.current=null,be(null),_(!1),b(null),M(),z(null),kt(!1),to.current=!1,Le.kind){case"keep_selected":break;case"show_saved":lr(Le.entry);break;case"clear":y(null),q(null);break;default:{const Pt=Le;throw new Error(`Unhandled session preview: ${String(Pt)}`)}}if(!Ie)return}if(X||nn||!Pn||e.active!==!0||rn.current===Pn)return;const ae=Ne.find(Ie=>Ie.workItemId===Pn);ae&&(rn.current=Pn,M(),Po(ae))},[Se,n,Dt,t,X,nn,Pn,e,Ne,Po,M,rs,z,q,y,lr,b,_]),g.useEffect(()=>{!$||!ss||(rn.current=null,q(null),z(ss.workItemId))},[ss,$,Se,z,q]),g.useEffect(()=>{!$||ss||pr||q(null)},[ss,$,pr,Se,q,vn]),g.useEffect(()=>{const U=K.trim().toLowerCase(),ae=[...Ne.map(dt=>({kind:"active",variant:dt})),...vn.map(dt=>({kind:"past",entry:dt})),...Wr?[{kind:"original"}]:[]],Ie=U?ae.filter(dt=>jI(dt,U)):ae,{pinned:Ce,unpinned:Ae}=zI(HI(DI(Ie,Se),ai),rr,Se),Le=[...Q.has(hS)?[]:Ce,...Ae.flatMap(dt=>dt.key!==""&&Q.has(dt.key)?[]:dt.rows)];return Le.length===0?void 0:Nee(dt=>{if(tfe())return;if(dt.key==="Enter"){const Tt=Ne.find(Mo=>Mo.workItemId===Pc);Tt&&(dt.preventDefault(),no(Tt));return}if(dt.key!=="ArrowUp"&&dt.key!=="ArrowDown")return;dt.preventDefault();const vt=L??Pn;let Cr=vt?`live:${vt}`:null;X?Cr=`past:${X}`:ol&&(Cr=FF);const as=Cr?Le.findIndex(Tt=>jf(Tt)===Cr):-1;let ks;if(as===-1?ks=dt.key==="ArrowDown"?0:Le.length-1:dt.key==="ArrowDown"?ks=Math.min(as+1,Le.length-1):ks=Math.max(as-1,0),ks===as)return;const $s=Le[ks];$s.kind==="active"?no($s.variant):$s.kind==="past"?Ds($s.entry):al();const sn=document.querySelector(`[data-variant-key="${jf($s)}"]`);sn instanceof HTMLElement&&sn.focus({preventScroll:!0})})},[Ne,vn,K,Wr,Q,rr,ai,Se,L,X,ol,Pn,Pc,no,Ds,al]);const ge=Ne.find(U=>U.workItemId===Pn)??null,ke=X?vn.find(U=>`${U.sessionId}:${U.variantId}`===X)??null:null,We=!!ke,gt=[...(e.active?Ne:[]).map(U=>({kind:"active",variant:U})),...vn.map(U=>({kind:"past",entry:U})),...Wr?[{kind:"original"}]:[]],jt=K.trim().toLowerCase(),Jt=jt?gt.filter(U=>jI(U,jt)):gt,wt=HI(DI(Jt,Se),ai),{pinned:Fn,unpinned:ot}=zI(wt,rr,Se);let Dr=null;P&&(Dr=P.source==="live"?`live:${P.variantId}`:`past:${P.sessionId}:${P.variantId}`);const cl=new Set(Ne.map(U=>U.requestId).filter(Boolean)),Oo=s.filter(U=>!cl.has(U.requestId)),Er=Oo.length>0,va=o&&!Er&&gt.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[gt.length>0?S.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:S.jsxs("div",{className:"relative",children:[S.jsx(Aae,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:K,onChange:U=>H(U.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[Er?S.jsx(the,{groups:Oo}):null,va?S.jsx(nhe,{}):null,e.active&&gt.length===0&&!Er&&!va?S.jsx(rhe,{}):null,!e.active&&!Er&&!va&&vn.length===0&&!Wr?S.jsx(she,{isMCPSession:h,mcpEditor:m}):null,gt.length>0&&Jt.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",K.trim(),"”."]}):null,Jt.length>0?S.jsx(Xfe,{groups:ot,pinned:Fn,pinnedKeys:Nr,draggedRowKey:Dr,onDropPin:Bt,onDropUnpin:Mi,onTogglePin:kr,onReorder:rh,collapsedRuns:Q,onToggleRun:B,activeVariantId:L??Pn,activePastKey:X,isOriginalSelected:ol,busy:D,editingKey:ga,onSelectActive:no,onSelectPast:Ds,onSelectOriginal:al,onActivePointerDown:$n,onPastPointerDown:is,onHover:Tc,onRemove:U=>ci({kind:"active",variant:U}),onRemovePast:U=>ci({kind:"past",entry:U}),onStartRename:Bu,onCommitRename:sh,onCancelRename:Ss,editingRunKey:Zu,onStartRunRename:Io,onCommitRunRename:pe,onCancelRunRename:F,onRemoveRun:Ro,onCopyVariantContext:Tfe,activeSessionId:e.active?e.sessionId:null,projectPath:mt}):null]}),c&&We&&ke?S.jsx(Afe,{entry:ke,deploying:$e===X,deployedUrl:X?Ve[X]??null:null,onDeploy:ll,isDeployDisabled:!d}):null,!We&&e.active?S.jsx(ehe,{selectedVariant:ge,busy:D,onDeploy:Cc,onDeployCanvas:Uu,canShare:c,canDeploy:d&&(ht==null?void 0:ht.kind)==="fresh",canDeployCanvas:d&&f&&(ht==null?void 0:ht.kind)==="fresh",canvasVariantCount:Je.length,canvasDeployedUrl:Ct,deployedUrl:ge?_e[ge.workItemId]??null:null}):null,S.jsx(Kfe,{target:fe,isConfirming:ue,onCancel:()=>ie(null),onConfirm:Kr})]})},Wfe=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",Kfe=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=Wfe(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return S.jsx(ny,{open:!0,onOpenChange:c=>{!c&&!e&&n()},children:S.jsxs(ry,{children:[S.jsx(sy,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(iy,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(oy,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),S.jsx(ay,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":l})]})]})})]})})},jf=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:FF,jI=(t,e)=>t.kind==="active"?Ow(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Ow(e,t.entry.label,t.entry.runLabel,t.entry.brief):Ow(e,K6,jF),ZF=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,WF=(t,e)=>ZF(jf(t),e),zI=(t,e,n)=>{if(e.length===0)return{pinned:[],unpinned:t};const r=new Set(e),s=new Map,i=[];for(const l of t){const c=[];for(const d of l.rows){const f=WF(d,n);r.has(f)?s.set(f,d):c.push(d)}c.length>0&&i.push(c.length===l.rows.length?l:{...l,rows:c})}return{pinned:e.flatMap(l=>{const c=s.get(l);return c?[c]:[]}),unpinned:i}},VI=(t,e,n)=>{if(!e||e.length===0)return t;const r=new Map(e.map((o,l)=>[o,l])),s=t.filter(o=>!r.has(n(o)));if(s.length===t.length)return t;const i=t.flatMap(o=>{const l=r.get(n(o));return l===void 0?[]:[{item:o,index:l}]}).sort((o,l)=>o.index-l.index).map(({item:o})=>o);return[...s,...i]},HI=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:VI(r.rows,s,jf)}});return VI(n,e.groups,r=>r.key)},qfe=t=>t.length<=LI?t:`${t.slice(0,LI-1)}…`,Gfe=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,Yfe=t=>t.kind==="active"?t.variant.directionRef??null:t.kind==="past"?t.entry.directionRef??null:null,Xfe=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:c,onToggleRun:d,activeVariantId:f,activePastKey:h,isOriginalSelected:m,busy:v,editingKey:y,onSelectActive:_,onSelectPast:b,onSelectOriginal:x,onActivePointerDown:k,onPastPointerDown:C,onHover:P,onRemove:R,onRemovePast:O,onStartRename:I,onCommitRename:A,onCancelRename:M,editingRunKey:L,onStartRunRename:z,onCommitRunRename:$,onCancelRunRename:q,onRemoveRun:X,onCopyVariantContext:K,activeSessionId:H,projectPath:ee})=>{const V=g.useRef(null),{activeIndex:Q,itemRects:B,handlers:D,registerItem:G}=vF(V,{snapTolerancePx:5}),[fe,ie]=g.useState(0),[ue,he]=g.useState(!1),[_e,le]=g.useState(!1),ne=c.has(hS),be=r!==null,Ve=g.useMemo(()=>{if(!r)return null;const Re=ZF(r,H);if(n.has(Re))return{container:cp,key:Re};const Ct=t.find(Se=>Se.rows.some($t=>jf($t)===r));return Ct?{container:Rw(Ct.key),key:r}:null},[r,n,t,H]),De=(Ve==null?void 0:Ve.container)===cp,{dropTarget:$e,onPointerMove:Ut,onPointerUp:nn}=_fe({containerRef:V,dragged:Ve,yieldToSelector:De?void 0:"[data-pinned-drop-zone]",restrictToSelector:De?"[data-pinned-drop-zone]":void 0,onReorder:l}),kt=Q!==null?B[Q]:null,Dt=Re=>Re.kind==="active"?Re.variant.workItemId===f:Re.kind==="past"?`${Re.entry.sessionId}:${Re.entry.variantId}`===h:m,un=(Re,Ct,Se,$t)=>{const ht=jf(Re),mt=WF(Re,H);return S.jsx(Jfe,{rowKey:ht,row:Re,index:Ct,isSelected:Dt(Re),isEditing:y===ht,isPinned:n.has(mt),onTogglePin:tr=>o(mt,tr),reorderContainer:Se,reorderKey:Se===cp?mt:ht,isNested:$t,busy:v,registerItem:G,onSelectActive:_,onSelectPast:b,onSelectOriginal:x,onActivePointerDown:k,onPastPointerDown:C,onHover:P,onRemove:R,onRemovePast:O,onStartRename:I,onCommitRename:A,onCancelRename:M,onCopyVariantContext:K,activeSessionId:H,projectPath:ee},ht)};let qt=0;const Ne=Re=>{if(Re.key==="")return Re.rows.map(ht=>un(ht,qt++,Rw(Re.key),!1));const Ct=c.has(Re.key),Se=Ct?null:Re.rows.map(ht=>un(ht,qt++,Rw(Re.key),!0)),$t=Re.label;return S.jsx(Qfe,{label:$t??K6,collapsed:Ct,onToggle:()=>d(Re.key),directionCount:Re.rows.length,isEditing:$t!==null&&L===Re.key,onStartRename:$t!==null?()=>z(Re.key):void 0,onCommitRename:$t!==null?ht=>$(Re,ht):void 0,onCancelRename:q,onRemove:$t!==null?()=>X(Re):void 0,children:Se},Re.key)},Je=e.length>0||be;return S.jsxs("div",{ref:V,className:"relative",onMouseEnter:()=>{ie(Re=>Re+1),D.onMouseEnter()},onMouseMove:D.onMouseMove,onMouseLeave:D.onMouseLeave,onPointerMove:Ut,onPointerUp:Re=>{var Ct;if(De&&Ve){const Se=(Ct=V.current)==null?void 0:Ct.querySelector("[data-pinned-drop-zone]"),$t=Se==null?void 0:Se.getBoundingClientRect();if(!($t!==void 0&&Re.clientY>=$t.top&&Re.clientY<=$t.bottom)){i(Ve.key);return}}nn()},children:[Ve&&$e?S.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:$e.top}}):null,S.jsx(ki,{children:kt&&S.jsx(So.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:kt.top,left:kt.left,width:kt.width,height:kt.height},animate:{opacity:1,top:kt.top,left:kt.left,width:kt.width,height:kt.height},exit:{opacity:0,transition:{duration:.06}},transition:{...cm.fast,opacity:{duration:.08}}},fe)}),S.jsxs("ul",{className:"relative flex flex-col gap-2",children:[S.jsx(ki,{initial:!1,children:Je?S.jsxs(So.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:fS,ease:dS},"data-pinned-drop-zone":"",className:mn("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",be&&"ring-content-muted/30 ring-1",be&&ue&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:be?()=>he(!0):void 0,onPointerLeave:be?()=>he(!1):void 0,onPointerUp:be?()=>{he(!1),s()}:void 0,children:[S.jsx("div",{"data-hover-dead-zone":"",children:S.jsxs("button",{type:"button",onClick:()=>d(hS),"aria-expanded":!ne,"aria-label":`${ne?"Expand":"Collapse"} pinned items`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[S.jsx(Bx,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),S.jsx(ki,{initial:!1,children:!ne&&S.jsx(So.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:fS,ease:dS},className:"overflow-hidden",children:e.length>0?S.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Re=>un(Re,qt++,cp,!1))}):null},"body")})]},"pinned-section"):null}),Je&&t.length>0?S.jsxs("li",{className:mn("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",De&&"ring-content-muted/30 ring-1",De&&_e&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:De?()=>le(!0):void 0,onPointerLeave:De?()=>le(!1):void 0,onPointerUp:De?()=>le(!1):void 0,children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[S.jsx(Nae,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),S.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Re=>Ne(Re))})]}):t.map(Re=>Ne(Re))]})]})},KF=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=yF({onDismiss:()=>e(!1)});return S.jsxs(z6,{open:t,onOpenChange:e,children:[S.jsx(zu,{label:n,children:S.jsx(V6,{asChild:!0,children:S.jsx(oa,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:zF,children:S.jsx(Cae,{size:15,weight:"bold"})})})}),S.jsx(H6,{children:S.jsx(U6,{ref:s,onKeyDown:i,role:"menu",side:"bottom",align:"end",sideOffset:4,onCloseAutoFocus:o=>o.preventDefault(),className:"bg-popover shadow-surface-4 z-[60] min-w-[160px] rounded-lg p-1",children:r.map(o=>S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,disabled:o.disabled,onClick:l=>{l.stopPropagation(),e(!1),o.onSelect()},onPointerDown:l=>l.stopPropagation(),className:"text-content hover:bg-hover focus:bg-hover flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[o.icon,o.label,o.detail?S.jsx("span",{className:"text-content-muted ml-auto pl-3 font-mono",children:o.detail}):null]},o.key))})})]})},Qfe=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:c,children:d})=>{const f=Ai(),[h,m]=g.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:S.jsx(dD,{size:13,weight:"bold"}),onSelect:i}]:[],...c?[{key:"remove",label:"Remove",icon:S.jsx(bD,{size:13,weight:"bold"}),onSelect:c}]:[]],y=e?S.jsx(Tae,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):S.jsx(Pae,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[y,S.jsx("span",{className:"min-w-0 flex-1",children:S.jsx(qF,{initial:t,onCommit:o,onCancel:l})})]}),S.jsx(ki,{initial:!1,children:!e&&S.jsx(So.ul,{className:"overflow-hidden",children:d},"body")})]}):S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[S.jsxs("button",{type:"button",onClick:_=>{if((_.metaKey||_.ctrlKey)&&v.length>0){m(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[y,S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),v.length>0&&S.jsx("div",{className:mn("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",h&&"pointer-events-auto opacity-100"),children:S.jsx(KF,{open:h,onOpenChange:m,triggerLabel:`${t} run actions`,actions:v})})]}),S.jsx(ki,{initial:!1,children:!e&&S.jsx(So.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:fS,ease:dS},className:"overflow-hidden",children:d},"body")})]})},Jfe=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:c,isNested:d,busy:f,registerItem:h,onSelectActive:m,onSelectPast:v,onSelectOriginal:y,onActivePointerDown:_,onPastPointerDown:b,onHover:x,onRemove:k,onRemovePast:C,onStartRename:P,onCommitRename:R,onCancelRename:O,onCopyVariantContext:I,activeSessionId:A,projectPath:M})=>{var Ve,De;const L=bt(RF),z=g.useRef(null);Jde(h,n,z);const[$,q]=g.useState(!1),X=e.kind==="active",K=e.kind==="original",H=e.kind==="active"?e.variant:null,ee=e.kind==="past"?e.entry:null,V=H?H.status==="succeeded":!0,Q=H?dm(H):!0,B=H!==null&&(H.status==="pending"||H.status==="running"),D=(H==null?void 0:H.status)==="failed",G=(H==null?void 0:H.status)==="cancelled",fe=H!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===H.workItemId,ie=H!==null&&(((Ve=H.refinement)==null?void 0:Ve.status)==="pending"||((De=H.refinement)==null?void 0:De.status)==="running");let ue=K6;H?ue=H.label||`Direction ${n+1}`:ee&&(ue=ee.label.trim()||"Untitled direction");let he=jF;H?he=H.description:ee&&(he=ee.brief);const _e=he?qfe(he):null,le=Gfe(e,A),ne=Yfe(e),be=le?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:z,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":c,className:"group relative z-10",children:S.jsx("div",{className:mn("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(qF,{initial:ue,onCommit:$e=>R(e,$e),onCancel:O}),_e&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:_e})]})})}):S.jsxs("li",{ref:z,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":c,className:mn("group relative z-10 rounded-md",r&&"bg-main-input"),onMouseEnter:H?()=>x(H.workItemId):void 0,onMouseLeave:X?()=>x(null):void 0,children:[S.jsx("div",{role:"button",tabIndex:0,"data-variant-id":H==null?void 0:H.workItemId,"data-variant-key":t,onClick:$e=>{if($e.metaKey||$e.ctrlKey){q(!0);return}const Ut=window.getSelection();Ut&&!Ut.isCollapsed||(e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):y())},onKeyDown:$e=>{($e.key==="Enter"||$e.key===" ")&&($e.preventDefault(),$e.stopPropagation(),e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):y())},onPointerDown:$e=>{$e.metaKey||$e.ctrlKey||(e.kind==="active"?Q&&_(e.variant.workItemId,$e):e.kind==="past"&&b(e.entry,$e))},"aria-pressed":r,"aria-disabled":X?!1:void 0,"aria-busy":B||ie,className:mn("flex w-full items-start gap-2 rounded-md py-2 pr-3 text-left transition-colors focus:outline-none",d?"pl-[33px]":"pl-3",Q&&"cursor-grab active:cursor-grabbing",!Q&&"cursor-pointer"),style:Q?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(B||ie)&&S.jsx(W6,{className:"text-content-muted shrink-0 text-sm","data-testid":ie&&!B?"variant-refining":void 0}),S.jsx(zu,{label:"Double-click to rename",disabled:K,children:S.jsx("span",{onDoubleClick:$e=>{$e.stopPropagation(),K||P(t)},className:mn("min-w-0 flex-1 truncate text-sm font-medium select-text",K?"cursor-default":"cursor-text",V||r?"text-content":"text-content-muted"),children:ue})}),D&&S.jsx(zu,{label:(H==null?void 0:H.errorMessage)??(H==null?void 0:H.errorCode)??"Failed",disabled:!(H!=null&&H.errorMessage)&&!(H!=null&&H.errorCode),children:S.jsx("span",{className:"shrink-0",children:S.jsx(UI,{label:"Failed"})})}),G&&S.jsx(UI,{label:"Cancelled"})]}),_e&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:_e})]})}),K?null:S.jsx(Ole,{references:(H==null?void 0:H.references)??(ee==null?void 0:ee.references),source:X?"active":"history",sessionId:(ee==null?void 0:ee.sessionId)??A,variantId:(ee==null?void 0:ee.variantId)??(H==null?void 0:H.workItemId),projectPath:M,className:d?"pl-[33px]":"pl-3"}),S.jsxs("div",{className:mn("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150 motion-reduce:transition-none","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",$&&"pointer-events-auto opacity-100"),children:[S.jsx(oa,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:$e=>$e.stopPropagation(),onKeyDown:$e=>{($e.key!=="ArrowUp"&&$e.key!=="ArrowDown"||$e.altKey||$e.ctrlKey||$e.metaKey||$e.shiftKey)&&$e.stopPropagation()},onClick:$e=>{$e.stopPropagation(),o("button")},className:zF,children:S.jsx(Bx,{weight:i?"fill":"bold"})}),S.jsx(KF,{open:$,onOpenChange:q,triggerLabel:"Direction actions",actions:[...ne?[{key:"copy-ref",label:"Copy ref",detail:ne,icon:S.jsx(Rae,{size:13,weight:"bold"}),onSelect:()=>I({text:ne,copyKind:"direction_ref"})}]:[],...he||le?[{key:"copy",label:be,icon:S.jsx(rm,{size:13,weight:"bold"}),onSelect:()=>I({text:Pfe({label:ue,description:he,reference:le,directionRef:ne,projectId:L,projectPath:M}),copyKind:le?"reference":"description"})}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:S.jsx(Bx,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...K?[]:[{key:"rename",label:"Rename",icon:S.jsx(dD,{size:13,weight:"bold"}),onSelect:()=>P(t)},{key:"remove",label:"Remove",icon:S.jsx(bD,{size:13,weight:"bold"}),disabled:fe,onSelect:()=>{e.kind==="active"?k(e.variant):e.kind==="past"&&C(e.entry)}}]]})]})]})},qF=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=g.useState(t),i=g.useRef(!1),o=g.useCallback(c=>{c&&(c.focus(),c.select())},[]),l=c=>{i.current||(i.current=!0,c?e(r):n())};return S.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:c=>s(c.target.value),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"?(c.preventDefault(),l(!0)):c.key==="Escape"&&(c.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},UI=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),ehe=({selectedVariant:t,busy:e,onDeploy:n,onDeployCanvas:r,canShare:s,canDeploy:i,canDeployCanvas:o,canvasVariantCount:l,canvasDeployedUrl:c,deployedUrl:d})=>{const f=t?UF(t):!1,h=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),m=(e==null?void 0:e.kind)==="deploy-canvas",v=!i||!f||e!==null,y=o&&l>0,b=h?"Deploying…":d?"Copy link":"Share",k=m?"Sharing…":c?"Copy canvas link":"Share canvas";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),d?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsx("div",{className:"flex shrink-0 items-center gap-2",children:s?S.jsx(OF,{primaryLabel:b,primaryIcon:d&&!h?rm:void 0,primaryAction:()=>{t&&n(t)},isDisabled:v,isDropdownDisabled:e!==null,isLoading:h,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:y?[{label:k,icon:c&&!m?rm:void 0,onClick:r,isDisabled:e!==null}]:[]}):null})]})},GF=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(W6,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),the=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(GF,{},`${e.requestId}-${r}`)))}),nhe=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(GF,{},e))}),rhe=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),BI="Try different ways to create a dropdown that feels fluid and dynamic",she=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=Cfe(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(BI).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",BI,"”"]}),S.jsx("button",{type:"button",onClick:o,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(Eae,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(rm,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},ihe="Open Rivet",pS="Close Rivet",ohe=".",ahe=229,lhe=/Mac|iPhone|iPad|iPod/,che={ariaKeyShortcuts:"Meta+.",modifier:"metaKey"},uhe={ariaKeyShortcuts:"Control+.",modifier:"ctrlKey"},q6=()=>typeof navigator<"u"&&lhe.test(navigator.platform)?che:uhe,dhe=t=>{const{modifier:e}=q6();return t.key===ohe&&!t.isComposing&&t.keyCode!==ahe&&t.metaKey===(e==="metaKey")&&t.ctrlKey===(e==="ctrlKey")&&!t.altKey&&!t.shiftKey},fhe="rivet:show-projects",hhe=t=>{const e=new URLSearchParams(t),n=e.get("libraryOrigin");if(e.get("library")!=="1"||!n)return null;try{const r=new URL(n);return r.protocol!=="http:"&&r.protocol!=="https:"?null:r.origin}catch{return null}},phe=({onClose:t,libraryOrigin:e})=>{const n=Ai(),r=bt(SF),s=bt(cy),i=hhe(window.location.search),o=window.parent!==window&&i!==null,l=(s==null?void 0:s.split(/[\\/]/).filter(Boolean).pop())??"Project";if(!t)return null;let c=r?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:r,children:r}):S.jsx("span",{});if(o||e){const f=S.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[S.jsx("li",{className:"shrink-0",children:S.jsx("button",{type:"button",onClick:async()=>{if(o&&i)window.parent.postMessage(fhe,i);else{try{const h=await Ft("/api/library/browser-launches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({view:"projects"})});if(!h.ok)throw new Error("The project library could not be opened.");const{url:m}=_J.parse(await h.json());window.location.assign(m)}catch{on.error("Could not open the project library. Please try again.");return}n==null||n.capture("library_view_changed",{view:"projects"})}},className:"text-content-subtle hover:bg-main-input hover:text-content focus-visible:outline-content rounded px-1 py-1 focus-visible:outline focus-visible:outline-2",children:"Projects"})}),S.jsx("li",{"aria-hidden":!0,className:"text-content-subtle shrink-0",children:S.jsx(Sae,{className:"h-3 w-3"})}),S.jsx("li",{className:"min-w-0",children:S.jsx("span",{"aria-current":"page",title:l,className:"text-content block truncate font-medium",children:l})})]});c=S.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:f})}const d=q6();return S.jsxs("div",{className:"border-main-border bg-main-light z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b px-2.5 py-2.5",children:[c,S.jsx(zu,{label:pS,side:"bottom",children:S.jsx("button",{onClick:t,"aria-label":pS,"aria-keyshortcuts":d.ariaKeyShortcuts,className:"text-content-subtle hover:bg-main-input hover:text-content flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 transition-colors",children:S.jsx(Iae,{className:"h-4 w-4",weight:"bold"})})})]})},mhe=ze({agentModeAvailable:Ys(),email:se().optional(),userId:se().optional(),name:se().optional(),isMCPSession:Ys(),mcpEditor:se().nullable(),agentApplyMode:Vt(["embedded","external"]).nullable().optional(),queueAccessToken:se().nullable().optional(),projectPath:se(),projectId:se().uuid().nullable().optional(),libraryOrigin:se().url().nullable()}),YF=async({signal:t})=>{const e=await Ft("/api/config",{signal:t});if(!e.ok)throw new Error(`Failed to fetch config: ${e.statusText}`);return mhe.parse(await e.json())},XF=5e3,ghe=async({signal:t})=>{const e=await Ft("/api/account",{signal:t});if(!e.ok)throw new Error("Could not load your account.");return bJ.parse(await e.json())},vhe=t=>({isAuthenticated:t.agentModeAvailable,name:t.name,email:t.email,userId:t.userId}),yhe=t=>ca({queryKey:Qs.account,queryFn:ghe,enabled:t,refetchInterval:XF,retry:!1}),_he=t=>ca({queryKey:Qs.rivetConfig,queryFn:YF,select:vhe,enabled:t,refetchInterval:XF,retry:!1}),whe=()=>{const t=window.location.pathname.startsWith("/rivet/library"),e=yhe(t),n=_he(!t);return t?e:n},g1="rivet_just_signed_in",mS="https://rivet-proxy.onrender.com",bhe=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},Lw=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s,entryPoint:i="editor_gate"})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:i,method:"google_oauth",...s?{failure_reason:s}:{}}}),ZI=oi("useLogin"),xhe=2e3,She=60,WI="Connecting to Google...",khe=`<!doctype html>
171
- <html lang="en">
172
- <head>
173
- <meta charset="utf-8" />
174
- <meta name="viewport" content="width=device-width, initial-scale=1" />
175
- <title>${WI}</title>
176
- <style>
177
- :root { color-scheme: light dark; }
178
- body {
179
- margin: 0;
180
- min-height: 100vh;
181
- display: grid;
182
- place-items: center;
183
- font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
184
- background: #111215;
185
- color: #f3f4f6;
186
- }
187
- .panel {
188
- border: 1px solid rgba(255, 255, 255, 0.16);
189
- border-radius: 12px;
190
- padding: 18px 22px;
191
- background: rgba(255, 255, 255, 0.06);
192
- font-size: 14px;
193
- }
194
- </style>
195
- </head>
196
- <body>
197
- <div class="panel">${WI}</div>
198
- </body>
199
- </html>`,Ehe=ze({success:Ys(),authUrl:se().optional(),sessionId:se().optional(),pollSecret:se().optional(),error:se().optional(),message:se().optional()}),Che=ze({success:Ys(),token:se().optional(),refreshToken:se().optional(),user:ze({id:se().optional(),email:se().optional()}).optional(),error:se().optional(),message:se().optional()}),Phe="/api/auth/install-ref",The=ze({installRef:se().nullable()}),Rhe=async()=>{try{const t=await fetch(Phe);if(!t.ok)return;const e=The.safeParse(await t.json());return e.success?e.data.installRef??void 0:void 0}catch{return}},QF=(t="editor_gate",e)=>{const n=Ai(),[r,s]=g.useState(!1),[i,o]=g.useState(null);return{startLogin:g.useCallback(async()=>{var m;const c=globalThis.crypto.randomUUID(),d=Date.now();s(!0),o(null);const f=Lw({outcome:"started",authAttemptId:c,entryPoint:t,startedAt:d,now:d});n==null||n.capture(f.event,f.properties);let h=null;try{if(h=window.open("","_blank"),!h)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{h.document.open(),h.document.write(khe),h.document.close()}catch(x){ZI.warn("Failed to render loading state in auth popup:",x)}const v=await Rhe(),y=await fetch(`${mS}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core",...v?{ref:v}:{}})}),_=Ehe.safeParse(await y.json());if(!_.success)throw new Error("Invalid Google login response");const b=_.data;if(!y.ok||!b.success||!b.authUrl||!b.sessionId||!b.pollSecret)throw new Error(b.error||b.message||"Failed to start Google login");if(h.closed)throw new Error("Sign-in window was closed before Google login started.");h.location.href=b.authUrl;for(let x=0;x<She;x+=1){if(h.closed)throw new Error("Sign-in window was closed before authentication completed.");const k=await fetch(`${mS}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:b.sessionId,pollSecret:b.pollSecret})}),C=Che.safeParse(await k.json());if(!C.success)throw new Error("Invalid Google token response");const P=C.data;if(P.success&&P.token&&((m=P.user)!=null&&m.email)){const R={email:P.user.email,token:P.token,refreshToken:P.refreshToken,userId:P.user.id,...v?{installRef:v}:{}};if(e)await e(R);else if(!(await Ft("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})).ok)throw new Error("Signed in, but failed to store session locally.");h.close(),window.sessionStorage.setItem(g1,"1");const O=Lw({outcome:"completed",authAttemptId:c,entryPoint:t,startedAt:d,now:Date.now()});n==null||n.capture(O.event,O.properties),window.location.reload();return}if(P.error&&P.error!=="Pending")throw new Error(P.error||"Google login failed");await new Promise(R=>setTimeout(R,xhe))}throw new Error("Authentication timed out. Please try again.")}catch(v){h&&!h.closed&&h.close();const y=Gs(v,"Failed to start login flow");ZI.warn("Login failed:",y);const _=Lw({outcome:"failed",authAttemptId:c,entryPoint:t,startedAt:d,now:Date.now(),failureReason:bhe(y)});n==null||n.capture(_.event,_.properties),o(y),s(!1)}},[n,t,e]),isStartingLogin:r,loginError:i}},Ahe=oi("useIntegrations"),Ihe=ze({provider:se(),status:se(),externalUsername:se().nullable(),connectedAt:se()}),Ohe=ze({integrations:Rt(Ihe).optional()}),Mhe=ze({authUrl:se().min(1).optional(),error:se().optional()}),Nhe="rivet:connect-result",Lhe=t=>typeof t=="object"&&t!==null&&t.type===Nhe,Dhe=gn(null),KI=async()=>{const t=await Ft("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return Ohe.parse(await t.json()).integrations??[]},$he=async t=>{const e=await Ft(`/api/integrations/${t}`,{method:"DELETE"});if(!e.ok){const n=$N.safeParse(await e.json().catch(()=>({})));throw new Error(n.success&&n.data.error||`Could not disconnect ${t}`)}},Fhe=()=>{const t=Om(),[e,n]=h9(Dhe),r=ca({queryKey:Qs.integrations,queryFn:KI,staleTime:1e4}),s=g.useCallback(async()=>(await t.invalidateQueries({queryKey:Qs.integrations,refetchType:"none"}),t.fetchQuery({queryKey:Qs.integrations,queryFn:KI})),[t]),i=g.useCallback(async c=>{const d=window.open("","_blank","width=560,height=720");if(!d)throw new Error("Popup blocked. Allow popups to connect.");n(c);try{const f=await Ft(`/api/integrations/${c}/connect`,{method:"POST"}),h=Mhe.safeParse(await f.json().catch(()=>({}))),m=h.success?h.data:{};if(!f.ok||!m.authUrl)throw d.close(),new Error(m.error||`Could not connect ${c}`);return d.location.href=m.authUrl,await new Promise(v=>{let y=!1,_=null;const b=async(k,C=!1)=>{if(!y){y=!0,window.removeEventListener("message",x),_&&clearInterval(_);try{const R=(await s()).some(O=>O.provider===c&&O.status==="connected");v(C&&R?"connected":k)}catch{v(k)}}},x=k=>{if(Lhe(k.data)&&k.data.provider===c){if(k.data.status==="error"){Ahe.warn(`Connect failed for ${c}:`,k.data.message),b("failed");return}b("connected")}};window.addEventListener("message",x),_=setInterval(()=>{d.closed&&b("closed",!0)},500)})}finally{n(null)}},[s,n]),{mutateAsync:o}=s9({mutationFn:$he,onSuccess:s}),l=g.useCallback(async c=>{n(c);try{await o(c)}finally{n(null)}},[o,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:l,refetch:s}},Yc=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),Pu=se().regex(/^[1-9]\d{0,15}$/).refine(t=>Number.isSafeInteger(Number(t))),JF=se().min(1).max(4096),G6=t=>{const e=()=>new Error("Use an HTTPS Cosmos profile URL such as https://www.cosmos.so/username");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length!==1)throw e();let s;try{s=decodeURIComponent(r[0])}catch{throw e()}if(!/^[a-zA-Z0-9_.-]{1,100}$/.test(s)||["e","login","signup","explore","search","collections","settings","api","profile"].includes(s.toLowerCase()))throw e();return{username:s,url:`https://www.cosmos.so/${encodeURIComponent(s)}`}},ej=se().max(2048).transform((t,e)=>{try{return G6(t).url}catch(n){return e.addIssue({code:EN.custom,message:Gs(n,"Invalid Cosmos profile URL")}),FM}}),tj=t=>{const e=()=>new Error("Use an HTTPS Cosmos collection URL such as https://www.cosmos.so/owner/collection");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length<2||r.length>3||r[0]==="e")throw e();let s;try{s=r.map(i=>decodeURIComponent(i))}catch{throw e()}if(s.some(i=>!i.length||i.length>300||/[/\\\p{Cc}]/u.test(i)))throw e();return{ownerUsername:s[0],slug:s[1],subcollectionSlug:s[2],url:`https://www.cosmos.so/${s.map(encodeURIComponent).join("/")}`}},jhe=se().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&e.hostname==="cdn.cosmos.so"&&!e.username&&!e.password&&!e.port}),zhe=ze({id:Pu,title:se().min(1).max(500),url:se().url().transform(t=>tj(t).url),children:Rt(Pu)}),Vhe=ze({id:Pu,url:se().url(),title:se().max(1e3),text:se().max(1e5),author:se().nullable(),owner:se().nullable(),sourceUrl:se().url().nullable(),images:Rt(ze({url:jhe,representation:Vt(["image","video-cover"])})).max(100),unsupportedReason:se().optional()}),Hhe=ze({collection:zhe,elements:Rt(Vhe),total:Dn().int().nonnegative(),nextCursor:JF.nullable()});oQ("status",[Hhe.extend({status:Tf("ok")}),ze({status:Tf("error"),message:se(),reason:Vt(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:Dn().nonnegative().optional()})]);const nj=ze({id:Pu,username:se().min(1).max(100),title:se().max(500),url:se().transform(t=>G6(t).url)}),Uhe=ze({id:Pu,title:se().min(1).max(500),description:se().max(1e4).nullable(),url:se().transform(t=>tj(t).url),total:Dn().int().nonnegative(),parentId:Pu.nullable(),children:Rt(Pu).max(1e4)});ze({profile:nj,collections:Rt(Uhe),total:Dn().int().nonnegative(),nextCursor:JF.nullable()});const rj=Vt(["pinterest","arena","x"]),Bhe=Vt(["cosmos","pinterest","arena","x"]),ef=se().min(1).max(200).regex(/^[a-zA-Z0-9:_-]+$/),sj={"www.cosmos.so":"cosmos","www.pinterest.com":"pinterest","www.are.na":"arena","x.com":"x"},Zhe=se().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&!e.username&&!e.password&&!e.port&&!e.search&&!e.hash&&rj.safeParse(sj[e.hostname]).success&&/^\/[a-zA-Z0-9_-]+\/?$/.test(e.pathname)},"Use a canonical reference provider profile URL"),Y6=ze({id:ef,username:se().min(1).max(100),title:se().max(500),url:Am([ej,Zhe])}).transform(t=>sj[new URL(t.url).hostname]==="cosmos"?nj.parse(t):t),X6=ze({id:ef,title:se().min(1).max(500),description:se().max(1e4).nullable(),url:se().url().nullable(),total:Dn().int().nonnegative().nullable(),parentId:ef.nullable(),children:Rt(ef).max(1e4)});Am([ze({url:ej}).strict(),ze({provider:rj}).strict()]);const Whe=ze({collections:Rt(X6),total:Dn().int().nonnegative().nullable(),nextCursor:se().min(1).max(4096).nullable()});Whe.extend({profile:Y6});const fm=1e3,Khe=1e4,qhe=ze({profile:Y6,collections:Rt(X6).max(fm),total:Dn().int().nonnegative().max(fm)}),Ghe=qhe.extend({id:se().uuid(),createdAt:se().datetime()}),Yhe=ze({collection:X6,collectionIds:Rt(ef).min(1).max(fm),references:Rt(LN.extend({provider:Bhe})).max(Khe)}),Xhe=ze({discoveryId:se().uuid(),runtime:Im,sources:Rt(Yhe).min(1).max(fm),reusableCount:Dn().int().nonnegative()});Xhe.extend({id:se().uuid(),profile:Y6,revision:se().regex(/^[a-f0-9]{64}$/),createdAt:se().datetime(),expiresAt:se().datetime(),approvedAt:se().datetime().nullable(),jobIds:Rt(se().uuid())});ze({discoveryId:se().uuid(),collectionIds:Rt(ef).min(1).max(fm),runtime:Im}).strict();ze({id:se().uuid(),revision:se().regex(/^[a-f0-9]{64}$/),isApproved:Tf(!0)}).strict();Vt(["later","dismiss","reset"]);const Hm=async(t,e,n="GET",r)=>{if(window.location.pathname.startsWith("/rivet/library"))return CJ(t,{schema:e,method:n,body:r});const s=await Ft(t.replace(/^\/profile/,"/api/reference-profiles"),{method:n,headers:{"Content-Type":"application/json"},...r!==void 0?{body:JSON.stringify(r)}:{}}),i=await s.text();let o;try{o=JSON.parse(i)}catch{throw new Error(`Reference profile request failed (${s.status})`)}if(!s.ok)throw new Error(o.error??`Request failed (${s.status})`);return o},ij=()=>Hm("/profile",FN),Qhe=t=>ca({queryKey:Qs.cosmosProfile,queryFn:ij,enabled:t}),Jhe=t=>Hm("/profile/discoveries",Ghe,"POST",{url:t}),epe=({discoveryId:t,collectionIds:e,runtime:n})=>Hm("/profile/import-plans",jN,"POST",{discoveryId:t,collectionIds:e,runtime:n}),tpe=t=>Hm("/profile",FN,"PATCH",{isEnabled:!0,runtime:t}),npe=t=>Hm(`/profile/import-plans/${t.id}/imports`,jN,"POST",{revision:t.revision,isApproved:!0}),rpe=({isOpen:t,onClose:e,onImported:n})=>{const[r,s]=g.useState(""),[i,o]=g.useState(null),[l,c]=g.useState([]),[d,f]=g.useState(""),[h,m]=g.useState(null),[v,y]=g.useState(null),[_,b]=g.useState(!1),x=g.useRef(0),k=Ai(),C=()=>{x.current+=1,s(""),o(null),c([]),f(""),m(null),y(null),b(!1)},P=()=>{k==null||k.capture("visual_editor_cosmos_modal_closed"),C(),e()},R=async M=>{M.preventDefault(),y(null);let L;try{L=G6(r.trim()).url}catch($){y(Gs($,"Invalid Cosmos profile URL"));return}k==null||k.capture("visual_editor_cosmos_discovery_started");const z=++x.current;b(!0);try{const $=await Jhe(L);if(z!==x.current)return;o($),c([]),k==null||k.capture("visual_editor_cosmos_discovery_completed",{collection_count:$.collections.length})}catch($){if(z!==x.current)return;y(Gs($,"Could not find Cosmos profile")),k==null||k.capture("visual_editor_cosmos_discovery_failed")}finally{z===x.current&&b(!1)}},O=async()=>{if(!i||l.length===0||!d)return;y(null),k==null||k.capture("visual_editor_cosmos_plan_started",{collection_count:l.length,runtime:d});const M=++x.current;b(!0);try{const L=await epe({discoveryId:i.id,collectionIds:l,runtime:d});if(M!==x.current)return;m(L),k==null||k.capture("visual_editor_cosmos_plan_completed",{collection_count:L.collectionCount,reference_count:L.referenceCount})}catch(L){if(M!==x.current)return;y(Gs(L,"Could not prepare import plan")),k==null||k.capture("visual_editor_cosmos_plan_failed")}finally{M===x.current&&b(!1)}},I=async()=>{if(!h||!d)return;y(null),k==null||k.capture("visual_editor_cosmos_import_started",{collection_count:h.collectionCount,reference_count:h.referenceCount});const M=++x.current;b(!0);try{if((await ij()).profile.isEnabled||await tpe(d),await npe(h),k==null||k.capture("visual_editor_cosmos_import_completed",{reference_count:h.referenceCount}),n(),M!==x.current)return;C(),e()}catch(L){if(k==null||k.capture("visual_editor_cosmos_import_failed"),M!==x.current)return;y(Gs(L,"Could not start Cosmos import"))}finally{M===x.current&&b(!1)}},A=M=>{c(L=>L.includes(M)?L.filter(z=>z!==M):[...L,M]),k==null||k.capture("visual_editor_cosmos_collection_toggled")};return S.jsx(ny,{open:t,onOpenChange:M=>!M&&P(),children:S.jsxs(ry,{children:[S.jsx(sy,{className:"z-max fixed inset-0 bg-black/60"}),S.jsxs(iy,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 max-h-[min(680px,calc(100vh-32px))] w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-lg border shadow-2xl outline-none",children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(oy,{className:"text-content text-base font-medium",children:"Connect Cosmos"}),S.jsx(oa,{onClick:P,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(f6,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"space-y-4 p-4",children:[S.jsx(ay,{className:"text-content-subtle text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:S.jsxs("form",{onSubmit:M=>void R(M),className:"space-y-4",children:[S.jsx("label",{className:"text-content block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),S.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:r,onChange:M=>s(M.target.value),placeholder:"https://www.cosmos.so/username",className:"border-main-border bg-main-input text-content placeholder:text-content-muted focus:border-secondary w-full rounded-md border px-3 py-2 text-sm outline-none"}),S.jsx("button",{type:"submit",disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Finding collections…":"Continue"})]}),i&&!h?S.jsxs("div",{className:"space-y-4",children:[S.jsxs("p",{className:"text-content text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),S.jsx("div",{className:"border-main-border max-h-60 divide-y overflow-y-auto rounded-md border",children:i.collections.map(M=>S.jsxs("label",{className:"text-content hover:bg-main-light flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[S.jsx("input",{type:"checkbox",checked:l.includes(M.id),disabled:_,onChange:()=>A(M.id)}),S.jsx("span",{className:"min-w-0 flex-1 truncate",children:M.title}),S.jsx("span",{className:"text-content-muted text-xs",children:M.total??"—"})]},M.id))}),i.collections.length===0?S.jsx("p",{className:"text-content-muted text-sm",children:"No public collections found for this profile."}):null,S.jsxs("label",{className:"text-content flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",S.jsxs("select",{value:d,disabled:_,onChange:M=>{const L=M.target.value;f(L),k==null||k.capture("visual_editor_cosmos_runtime_selected",{runtime:L})},className:"border-main-border bg-main-input rounded-md border px-2 py-1.5",children:[S.jsx("option",{value:"",disabled:!0,children:"Select a runtime"}),S.jsx("option",{value:"codex",children:"Codex"}),S.jsx("option",{value:"claude",children:"Claude"}),S.jsx("option",{value:"cursor",children:"Cursor"})]})]}),S.jsx("button",{type:"button",onClick:()=>void O(),disabled:_||l.length===0||!d,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Preparing plan…":"Review import plan"}),S.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_profile_changed"),C()},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Use another profile"})]}):null,h?S.jsxs("div",{className:"space-y-4 text-sm",children:[S.jsxs("p",{className:"text-content",children:[h.collectionCount," ",h.collectionCount===1?"collection":"collections"," ·"," ",h.referenceCount," ",h.referenceCount===1?"reference":"references"," ·"," ",h.imageCount," ",h.imageCount===1?"image":"images"]}),S.jsx("p",{className:"text-content-subtle",children:h.scopeDisclosure}),S.jsx("p",{className:"text-content-subtle",children:h.usageDisclosure}),S.jsxs("p",{className:"text-content-muted text-xs",children:[h.reusableCount," reusable · ",h.unsupportedCount," ","unsupported · runtime: ",d]}),S.jsx("button",{type:"button",onClick:()=>void I(),disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Starting import…":"Approve and import"}),S.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_plan_revised"),m(null)},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Change selection"})]}):null,v?S.jsx("p",{role:"alert",className:"text-sm text-red-300",children:v}):null]})]})]})})},qI=oi("ConnectorsModal"),spe=[{provider:"x",name:"X",iconClassName:"text-content",icon:S.jsx(Ap,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:S.jsx(Ap,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-content",icon:S.jsx(Ap,{provider:"arena"})}],ipe={name:"Cosmos",iconClassName:"text-content",icon:S.jsx(Ap,{provider:"cosmos"})},GI=({meta:t,status:e,actionLabel:n,buttonLabel:r,isDisabled:s,isHighlighted:i,onAction:o})=>S.jsxs("li",{className:`flex min-h-[64px] items-center gap-3 py-3 ${i?"ring-secondary -mx-2 rounded-md px-2 ring-2":""}`,children:[S.jsx("span",{className:`grid h-7 w-7 flex-none place-items-center ${t.iconClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("span",{className:"text-content block text-sm font-medium",children:t.name}),S.jsx("span",{className:"text-content-muted block truncate text-xs",children:e})]}),S.jsx("button",{type:"button","aria-label":n,onClick:o,disabled:s,className:"active-push bg-main-input text-content hover:bg-main-input/80 inline-flex min-h-8 w-24 flex-none items-center justify-center rounded-md px-3 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:r})]}),gS=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{var O;const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:c,disconnect:d}=Fhe(),f=Ai(),[h,m]=g.useState(null),[v,y]=g.useState(!1),_=Qhe(t),b=I=>s.find(A=>A.provider===I),x=g.useCallback(I=>{const A=Date.now(),M=Yc({action:"connect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(M.event,M.properties),c(I).then(L=>{const z=Date.now()-A;if(L==="connected"){const q=Yc({action:"connect",outcome:"completed",provider:I,entryPoint:n,durationMs:z});f==null||f.capture(q.event,q.properties);return}const $=Yc({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:z,failureReason:L==="closed"?"popup_closed":"provider_failed"});f==null||f.capture($.event,$.properties)}).catch(L=>{const z=Gs(L,"Could not connect."),$=Yc({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-A,failureReason:z.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture($.event,$.properties),qI.warn(`Connect error for ${I}:`,z),on.error(z)})},[c,n,f]),k=g.useCallback(I=>{const A=Date.now(),M=Yc({action:"disconnect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(M.event,M.properties),d(I).then(()=>{const L=Yc({action:"disconnect",outcome:"completed",provider:I,entryPoint:n,durationMs:Date.now()-A});f==null||f.capture(L.event,L.properties)}).catch(L=>{const z=Gs(L,"Could not disconnect."),$=Yc({action:"disconnect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-A,failureReason:"request_failed"});f==null||f.capture($.event,$.properties),qI.warn(`Disconnect error for ${I}:`,z),on.error(z)})},[n,d,f]),C=n==="onboarding",P=(O=_.data)==null?void 0:O.sources.some(I=>I.provider==="cosmos");let R=P?"Connected":"Not connected";return _.isError&&(R="Status unavailable"),_.isPending&&(R="Checking status…"),S.jsxs(S.Fragment,{children:[S.jsx(ny,{open:t,onOpenChange:I=>!I&&e(),children:S.jsxs(ry,{children:[S.jsx(sy,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(iy,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(Q$,{value:h,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(oy,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(oa,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(f6,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(ay,{className:"text-content-subtle text-sm",children:"Connect your references to add them to your Rivet library. Rivet can use them to inspire new design directions."}),o?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,S.jsxs("ul",{className:"divide-main-border divide-y","aria-label":"Design reference services",children:[spe.map(I=>{const A=b(I.provider),M=(A==null?void 0:A.status)==="connected",L=A==null?void 0:A.externalUsername;let z=M?`Connected${L?` as @${L}`:""}`:"Not connected";i&&(z="Checking status…");const $=l===I.provider,q=M?"Disconnect":"Connect";return S.jsx(GI,{meta:I,status:z,actionLabel:`${q} ${I.name}`,buttonLabel:$?`${q}ing…`:q,isDisabled:i||$,isHighlighted:r===I.provider,onAction:()=>M?k(I.provider):x(I.provider)},I.provider)}),S.jsx(GI,{meta:ipe,status:R,actionLabel:P?"Add Cosmos profile":"Connect Cosmos",buttonLabel:P?"Add profile":"Connect",isDisabled:!1,isHighlighted:!1,onAction:()=>{f==null||f.capture("visual_editor_cosmos_modal_opened"),y(!0)}})]}),C?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})}),S.jsx(rpe,{isOpen:v,onClose:()=>y(!1),onImported:()=>{_.refetch()}})]})},YI=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),ope=oi("SupportTicketModal"),XI=5e3,Dw="feedback",ape=t=>{var r;if(!t)return null;const e=(r=t.formErrors)==null?void 0:r[0];if(e)return e;const n=t.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},lpe=async t=>{let e;try{const n=vJ.safeParse(await t.json());e=n.success?n.data:void 0}catch{e=void 0}if(t.status===400){if(typeof(e==null?void 0:e.details)=="string"&&e.details.trim())return e.details;if(typeof(e==null?void 0:e.details)=="object"&&e.details!==null){const n=ape(e.details);if(n)return n}return"Please check your feedback and try again."}return t.status>=500?typeof(e==null?void 0:e.details)=="string"&&e.details.trim()?e.details:"Could not send feedback right now. Please try again later.":typeof(e==null?void 0:e.error)=="string"&&e.error.trim()?e.error:`HTTP ${t.status}`},cpe=({isOpen:t,onClose:e,contactEmail:n})=>{const r=Ai(),[s,i]=g.useState(""),[o,l]=g.useState(!1),[c,d]=g.useState(null),f=g.useCallback(()=>{i("")},[]),h=g.useCallback(()=>{o||(f(),e())},[o,e,f]),m=g.useCallback(async()=>{const b=s.trim();if(!(!b||o)){l(!0);try{const x=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,k=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,C=n==null?void 0:n.trim(),P=await Ft("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:Dw,message:b,contactEmail:C||void 0,metadata:{posthogSessionId:x??void 0,posthogDistinctId:k??void 0,appVersion:"0.27.1",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!P.ok){const R=await lpe(P);throw new Error(R)}r==null||r.capture("support_ticket_submitted",{ticket_type:Dw,has_posthog_session_id:!!x}),on.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(x){const k=Gs(x,"Failed to send message");r==null||r.capture("support_ticket_submit_failed",{ticket_type:Dw,error:k}),ope.error("Failed to submit support ticket:",k),on.error("Could not send feedback",{description:k})}finally{l(!1)}}},[n,o,s,e,r,f]),v=g.useCallback(b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),m())},[m]),y=XI-s.length,_=o||s.trim().length===0;return S.jsx(ny,{open:t,onOpenChange:b=>!b&&h(),children:S.jsxs(ry,{children:[S.jsx(sy,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(iy,{ref:d,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(Q$,{value:c,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(oy,{className:"text-content text-base font-medium",children:"Send feedback"}),S.jsx(oa,{onClick:h,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(f6,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(ay,{className:"text-content-subtle text-sm",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"bg-main-input rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:b=>i(b.target.value),onKeyDown:v,maxLength:XI,rows:6,disabled:o,placeholder:"What happened?",className:"text-content placeholder-content-subtle max-h-64 w-full resize-none overflow-y-auto bg-transparent pt-3 pr-3 pb-1 pl-3 text-sm focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[S.jsx("span",{className:"text-content-subtle text-xs",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[y<=500&&S.jsx("span",{className:"text-content-subtle text-xs",children:y}),S.jsx(oa,{onClick:m,disabled:_,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",size:"icon-compact",children:o?S.jsx(W1,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(bae,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},upe=oi("ProfileAvatar"),oj=(t,e)=>{const n=(t??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((e??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},dpe=(t,e)=>oj(t,e).charAt(0).toUpperCase(),fpe=({className:t="",side:e="bottom",align:n="end"})=>{var q,X,K;const r=whe(),s=((q=r.data)==null?void 0:q.name)??null,i=((X=r.data)==null?void 0:X.email)??null,o=((K=r.data)==null?void 0:K.isAuthenticated)===!0,l=Ai(),{startLogin:c,isStartingLogin:d,loginError:f}=QF("account_menu"),[h,m]=g.useState(!1),[v,y]=g.useState(!1),[_,b]=g.useState(!1),[x,k]=g.useState(!1),{containerRef:C,onKeyDown:P,onCloseAutoFocus:R}=yF({onDismiss:()=>$(!1)}),O=dpe(s,i);if(r.isPending)return S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(YI,{className:"h-8 w-8 rounded-full"}),S.jsx(YI,{className:"h-3.5 w-16"})]});const I=oj(s,i),A=(s==null?void 0:s.trim())||null,M=(i==null?void 0:i.trim())||null,L=async()=>{k(!0);try{const H=await Ft("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!H.ok)throw new Error(`Logout failed: ${H.status}`);window.location.pathname.startsWith("/rivet/library")&&HN()}catch(H){upe.warn("Logout request failed",H),on.error("Could not log out. Please try again."),k(!1);return}window.location.reload()};let z="Log in";o&&(z=I||"Account"),r.error&&!r.data&&(z="Account unavailable");const $=H=>{m(H),l==null||l.capture(`visual_editor_account_menu_${H?"opened":"closed"}`,{is_authenticated:o})};return S.jsxs(S.Fragment,{children:[S.jsxs(z6,{open:h,onOpenChange:$,children:[S.jsx(V6,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account","data-rivet-private":!0,className:`ph-no-capture text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[S.jsx("span",{className:"border-main-border bg-main-input flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:O||S.jsx(Lae,{className:"h-4 w-4",weight:"bold"})}),S.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:z})]})}),S.jsx(H6,{children:S.jsxs(U6,{"data-rivet-private":!0,ref:C,onKeyDown:P,onCloseAutoFocus:R,role:"menu",className:"ph-no-capture bg-popover shadow-surface-4 z-[60] min-w-[180px] rounded-lg p-1",side:e,sideOffset:6,align:n,children:[A||M?S.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[A?S.jsx("div",{className:"text-content truncate text-sm font-medium",children:A}):null,M?S.jsx("div",{className:"text-content-muted truncate text-xs",children:M}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),y(!0)},disabled:!o,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(_D,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),b(!0)},className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none",children:[S.jsx(kae,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:L,disabled:x,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(Mae,{className:"h-4 w-4",weight:"bold"}),x?"Logging out…":"Log out"]}):null,!o&&!r.error?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c()},disabled:d,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm focus:outline-none disabled:opacity-50",children:[S.jsx(Oae,{className:"h-4 w-4",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?S.jsx("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{r.refetch()},className:"text-content mt-1 px-3 py-1.5 text-sm",children:"Retry account"}):null,f?S.jsx("p",{role:"alert",className:"max-w-64 px-3 py-2 text-sm text-red-300",children:f}):null]})})]}),v?S.jsx(gS,{isOpen:!0,onClose:()=>y(!1)}):null,S.jsx(cpe,{isOpen:_,onClose:()=>b(!1),contactEmail:i??void 0})]})},hpe=({onClose:t,libraryOrigin:e})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(phe,{onClose:t,libraryOrigin:e}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(Zfe,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:S.jsx(fpe,{side:"top",align:"start"})})]}),QI=oi("useServerConfig"),hm=[250,500,1e3,2e3,4e3],ppe=hm.length+1,mpe=async()=>{var n;const t=await Ft("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},gpe=(t,e)=>t<hm.length?(QI.warn(`Server config fetch failed (attempt ${t+1}); retrying in ${hm[t]}ms`,e),!0):(QI.warn("Error fetching server config:",e),Qe==null||Qe.capture("preview_config_load_failed",{message:Gs(e,"unknown_error"),attempts:ppe}),!1),vpe=t=>hm[Math.min(t,hm.length-1)],ype=()=>{const t=ca({queryKey:Qs.serverConfig,queryFn:mpe,retry:gpe,retryDelay:vpe,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),e=t.isFetching&&!t.data,{refetch:n}=t;return{config:t.data??null,isLoading:e,error:t.error&&!e?t.error.message:null,retry:()=>{n()}}},_pe="#1C1C20",Aa=[118,118,124],JI=.85,wpe=3,bpe=.15,Tg=36,xpe=4.4,Spe=.7,kpe=3.5,Epe=.8,e4=9,Cpe=11,Ppe=[1.35,1.12,.95,.85],Tpe=[0,1.1,2.3,3.1],Rpe=[0,.35,.16,.13],Ape=[.9,.5,.4,.35],Xc=3,$w=[[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.23,level:1},{x1:.14,y1:.28,x2:.3,y2:.87,level:1},{x1:.34,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.155,x2:.225,y2:.205,level:2},{x1:.7,y1:.155,x2:.755,y2:.205,level:2},{x1:.775,y1:.155,x2:.83,y2:.205,level:2},{x1:.165,y1:.32,x2:.275,y2:.375,level:2},{x1:.165,y1:.415,x2:.275,y2:.47,level:2},{x1:.165,y1:.51,x2:.275,y2:.565,level:2},{x1:.37,y1:.32,x2:.585,y2:.56,level:2},{x1:.615,y1:.32,x2:.83,y2:.56,level:2},{x1:.37,y1:.61,x2:.83,y2:.83,level:2},{hline:!0,x1:.39,x2:.81,y:.685,level:3},{hline:!0,x1:.39,x2:.75,y:.755,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.16,y1:.17,x2:.52,y2:.45,level:1},{x1:.58,y1:.17,x2:.685,y2:.29,level:1},{x1:.715,y1:.17,x2:.84,y2:.29,level:1},{x1:.58,y1:.33,x2:.685,y2:.45,level:1},{x1:.715,y1:.33,x2:.84,y2:.45,level:1},{x1:.16,y1:.55,x2:.84,y2:.85,level:1},{x1:.19,y1:.21,x2:.36,y2:.33,level:2},{hline:!0,x1:.19,x2:.48,y:.37,level:3},{hline:!0,x1:.19,x2:.42,y:.42,level:3},{x1:.19,y1:.6,x2:.49,y2:.8,level:2},{hline:!0,x1:.53,x2:.8,y:.63,level:3},{hline:!0,x1:.53,x2:.76,y:.7,level:3},{hline:!0,x1:.53,x2:.79,y:.77,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.22,level:1},{x1:.14,y1:.28,x2:.36,y2:.87,level:1},{x1:.39,y1:.28,x2:.61,y2:.87,level:1},{x1:.64,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.15,x2:.225,y2:.2,level:2},{x1:.165,y1:.32,x2:.335,y2:.52,level:2},{x1:.415,y1:.32,x2:.585,y2:.52,level:2},{x1:.665,y1:.32,x2:.835,y2:.52,level:2},{hline:!0,x1:.165,x2:.335,y:.6,level:3},{hline:!0,x1:.165,x2:.3,y:.67,level:3},{hline:!0,x1:.415,x2:.585,y:.6,level:3},{hline:!0,x1:.415,x2:.55,y:.67,level:3},{hline:!0,x1:.665,x2:.835,y:.6,level:3},{hline:!0,x1:.665,x2:.8,y:.67,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.3,y1:.22,x2:.7,y2:.74,level:1},{x1:.34,y1:.27,x2:.55,y2:.34,level:2},{hline:!0,x1:.36,x2:.64,y:.42,level:3},{hline:!0,x1:.36,x2:.6,y:.49,level:3},{hline:!0,x1:.36,x2:.62,y:.56,level:3},{x1:.5,y1:.63,x2:.575,y2:.69,level:2},{x1:.595,y1:.63,x2:.66,y2:.69,level:2}]],Rg=t=>{let e=t|0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),e^=e>>>16,(e>>>0)/4294967296},cv=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Qc=(t,e)=>(Math.round(t/e-.5)+.5)*e,Ipe=Math.sin(Math.PI/3),t4=(t,e,n,r,s)=>{if(t.beginPath(),e===0)t.arc(n,r,s,0,Math.PI*2);else if(e===1){const i=s*Ipe;t.moveTo(n,r-s),t.lineTo(n+i,r+s/2),t.lineTo(n-i,r+s/2),t.closePath()}else{const i=s*.85;t.rect(n-i,r-i,i*2,i*2)}t.fill()},Ope=(t,e,n)=>{let r;if(n.hline){const s=Math.max(n.x1-t,t-n.x2,0),i=Math.abs(e-n.y1);r=Math.hypot(s,i)-e4}else{const s=Math.max(n.x1-t,t-n.x2,0),i=Math.max(n.y1-e,e-n.y2,0);s===0&&i===0?r=-Math.min(t-n.x1,n.x2-t,e-n.y1,n.y2-e):r=Math.hypot(s,i),r=Math.abs(r)-e4}return cv(.5-r/(2*Cpe))},aj=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=Nt(kF),r=g.useRef(null),s=g.useCallback(i=>{var L;if((L=r.current)==null||L.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(z=>z+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let c=[],d=0,f=0,h=Tg,m=Tg,v=null,y=null,_=0,b=-1;const x=new Array(33),k=z=>{const $=Math.round(z*32);let q=x[$];if(!q){const X=$/32,K=Math.round(Aa[0]+(255-Aa[0])*X),H=Math.round(Aa[1]+(255-Aa[1])*X),ee=Math.round(Aa[2]+(255-Aa[2])*X);q=`rgba(${K}, ${H}, ${ee}, ${JI})`,x[$]=q}return q},C=z=>{const $=1-.35*z,q=Math.round(Aa[0]*$),X=Math.round(Aa[1]*$),K=Math.round(Aa[2]*$);return`rgba(${q}, ${X}, ${K}, ${JI})`},P=z=>{let $=Math.floor(Math.random()*$w.length);$===b&&($=($+1)%$w.length),b=$;const q=[0,0,0,0],X=$w[$].map((D,G)=>{const fe=D.level,ie=q[fe]++,ue=Tpe[fe]+ie*Rpe[fe],he=Ape[fe]+Rg($*131+G*17+5)*.2;if(D.hline){const ne=Qc((D.y??0)*f,m);return{hline:!0,x1:Qc(D.x1*d,h),x2:Qc(D.x2*d,h),y1:ne,y2:ne,level:fe,start:ue,dur:he}}const _e=Qc(D.x1*d,h),le=Qc((D.y1??0)*f,m);return{hline:!1,x1:_e,y1:le,x2:Math.max(Qc(D.x2*d,h),_e+h),y2:Math.max(Qc((D.y2??0)*f,m),le+m),level:fe,start:ue,dur:he}}),K=X.reduce((D,G)=>Math.max(D,G.start+G.dur),0),H=c.length,ee=new Float32Array(H*Xc),V=new Int16Array(H*Xc).fill(-1),Q=new Uint8Array(H),B=X[0];for(let D=0;D<H;D++){const G=c[D];G.x>B.x1&&G.x<B.x2&&G.y>B.y1&&G.y<B.y2&&(Q[D]=1);const fe=D*Xc;for(let ie=0;ie<X.length;ie++){const ue=Ope(G.x,G.y,X[ie]);if(ue<=.02)continue;let he=fe;for(let _e=fe;_e<fe+Xc;_e++){if(V[_e]===-1){he=_e;break}ee[_e]<ee[he]&&(he=_e)}(V[he]===-1||ue>ee[he])&&(ee[he]=ue,V[he]=ie)}}return{startT:z,buildEnd:K,els:X,frame:B,cellQ:ee,cellEl:V,inFrame:Q}},R=()=>{const z=i.getBoundingClientRect();d=Math.max(1,z.width),f=Math.max(1,z.height);const $=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*$),i.height=Math.round(f*$),o.setTransform($,0,0,$,0,0);const q=Math.max(8,Math.round(d/Tg)),X=Math.max(6,Math.round(f/Tg));h=d/q,m=f/X,c=[];for(let K=0;K<X;K++){const H=X>1?K/(X-1):.5,ee=xpe*(1+Spe*.4*(H*2-1));for(let V=0;V<q;V++){const Q=K*8191+V*131+1,B={x:(V+.5)*h,y:(K+.5)*m,size:ee,seed:Q,phase:Rg(Q),kind:0};B.kind=Math.floor(Rg(Q*97)*3),c.push(B)}}y=null,v=null},O=new Float32Array(32),I=z=>{o.fillStyle=_pe,o.fillRect(0,0,d,f),v||(v=P(z+.2)),z>=v.startT+v.buildEnd+kpe&&(y=v,_=z,v=P(z+.2));let $=0;y&&($=1-cv((z-_)/Epe),$<=0&&(y=null));const q=v;for(let B=0;B<q.els.length;B++){const D=q.els[B];O[B]=cv(Math.min(1,Math.max(0,(z-q.startT-D.start)/D.dur)))}const X=O[0],K=C(0),H=C(X),ee=$>0?C($):K,V=$>0?C(Math.max(X,$)):H,Q=c.length;for(let B=0;B<Q;B++){const D=c[B];let G=0,fe=0;const ie=B*Xc;for(let Ve=ie;Ve<ie+Xc;Ve++){const De=q.cellEl[Ve];if(De<0)break;const $e=q.cellQ[Ve]*O[De];$e>G&&(G=$e,fe=q.els[De].level)}if(y)for(let Ve=ie;Ve<ie+Xc;Ve++){const De=y.cellEl[Ve];if(De<0)break;const $e=y.cellQ[Ve]*$;$e>G&&(G=$e,fe=y.els[De].level)}const ue=z/wpe+D.phase,he=Math.floor(ue),_e=ue-he,le=cv(Math.min(_e,1-_e)/bpe),ne=Math.floor(Rg(D.seed*97+he*7919)*3);ne!==D.kind&&G<.02&&le<.05&&(D.kind=ne);const be=Math.max(le*(1-G),G);if(!(be<.01))if(G<.02){const Ve=q.inFrame[B]===1,De=y?y.inFrame[B]===1:!1;Ve?o.fillStyle=De?V:H:o.fillStyle=De?ee:K;const $e=Math.max(Ve?X:0,De?$:0);t4(o,D.kind,D.x,D.y,D.size*be*(1-.2*$e))}else{o.fillStyle=k(G);const Ve=1+(Ppe[fe]-1)*G;t4(o,D.kind,D.x,D.y,D.size*be*Ve)}}};R();let A=0;if(l)v=P(-100),I(0);else{const z=performance.now(),$=q=>{I((q-z)/1e3),A=requestAnimationFrame($)};A=requestAnimationFrame($)}const M=new ResizeObserver(()=>{R(),l&&(v=P(-100),I(0))});M.observe(i),r.current=()=>{cancelAnimationFrame(A),M.disconnect(),e&&n(z=>z-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},n4={kind:"base"};function r4(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}const Mpe=async(t=null)=>{if(t)return Npe(t);let e;try{e=await Ft("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return Ag();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return Ag()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:Ag()},lj=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},Npe=t=>lj(t),Ag=()=>lj("/"),Fw=oi("usePreviewUpstreamHealth"),Lpe=500,Dpe=4e3,$pe=15e3,Fpe=3,jpe={completedProbeCount:0,isUpstreamReady:!1,unavailableReason:"upstream_unreachable",isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!1,hasCapturedUnreachable:!1,downSince:null,everReady:!1,consecutiveServerErrors:0,hasFiredPersistentErrorHook:!1,lastUpstreamStatus:null},zpe=({history:t,outcome:e,now:n,startedAt:r,firstUnreachableCaptureAfterMs:s})=>{const i=[],{upstreamStatus:o}=e,l=e.isOk&&o!==null&&o>=500;let c=t.consecutiveServerErrors;l&&t.everReady?c+=1:e.isOk&&!l&&(c=0);const d=c>=Fpe;let f=t.hasFiredPersistentErrorHook;d&&!f&&o!==null&&(f=!0,i.push({kind:"persistent_server_errors",upstreamStatus:o,consecutiveCount:c}));const h={...t,completedProbeCount:t.completedProbeCount+1,lastUpstreamStatus:o,consecutiveServerErrors:c,hasFiredPersistentErrorHook:f};if(e.isOk&&!d)return t.hasCapturedFirstReady?t.isUpstreamReady||i.push({kind:"restored"}):i.push({kind:"first_ready",readyAfterMs:n-r}),{history:{...h,everReady:h.everReady||!l,hasFiredPersistentErrorHook:h.hasFiredPersistentErrorHook&&l,isUpstreamReady:!0,unavailableReason:null,downSince:null,hasCapturedUnreachable:!1,isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!0},events:i};const m=t.downSince===null,v=t.downSince??n;let y=m?!1:t.hasCapturedUnreachable,_=m?!1:t.isFirstUnreachableWindowExceeded;t.isUpstreamReady&&i.push({kind:"lost",upstreamStatus:o});const b=n-v;return b>=s&&!y&&(y=!0,_=!0,i.push({kind:"first_unreachable",elapsedMs:b,upstreamStatus:o})),{history:{...h,isUpstreamReady:!1,unavailableReason:e.unavailableReason,downSince:v,hasCapturedUnreachable:y,isFirstUnreachableWindowExceeded:_},events:i}},s4=(t,e)=>({id:e,identity:t,startedAt:Date.now()}),Vpe=(t,e={})=>{const n=g.useId(),r=e.probeMsWhileDown??Lpe,s=e.probeMsWhileUp??Dpe,i=e.firstUnreachableCaptureAfterMs??$pe,o=e.probePath??null,l=e.skip??!1,c=t!=="static"&&!l,d=um(e.onPersistentUpstreamServerErrors),f=c?JSON.stringify([t,o,r,s,i]):null,[h,m]=g.useState(()=>s4(f,0)),v=h.identity===f?h:s4(f,h.id+1);v!==h&&m(v);const[y,_]=g.useState(0),b=g.useRef(null),x=P=>{var R;switch(P.kind){case"persistent_server_errors":Qe==null||Qe.capture("preview_upstream_error_responses",{framework:t,upstream_status:P.upstreamStatus,consecutive_count:P.consecutiveCount}),Fw.warn(`Preview upstream is listening but has served ${P.consecutiveCount} consecutive ${P.upstreamStatus} responses`),(R=d.current)==null||R.call(d,{upstreamStatus:P.upstreamStatus,consecutiveCount:P.consecutiveCount});return;case"first_ready":Qe==null||Qe.capture("preview_dev_server_ready",{framework:t,ready_after_ms:P.readyAfterMs});return;case"restored":Qe==null||Qe.capture("preview_upstream_restored",{framework:t});return;case"lost":Qe==null||Qe.capture("preview_upstream_lost",{framework:t,upstream_status:P.upstreamStatus}),_(O=>O+1),Fw.warn("Preview upstream became unavailable after it was ready");return;case"first_unreachable":Qe==null||Qe.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:P.elapsedMs,upstream_status:P.upstreamStatus}),Fw.warn("Dev server did not become ready within timeout window");return;default:{const O=P;throw new Error(`Unhandled probe event: ${String(O)}`)}}},k=ca({queryKey:Qs.previewUpstreamHealth({instanceId:n,sessionId:v.id,rerunVersion:e.rerunProbeImmediatelyOnVersion??null}),queryFn:async({signal:P})=>{var M;const R=await Mpe(o),O=((M=b.current)==null?void 0:M.sessionId)===v.id?b.current.history:jpe;if(P.aborted)return O;const{history:I,events:A}=zpe({history:O,outcome:R,now:Date.now(),startedAt:v.startedAt,firstUnreachableCaptureAfterMs:i});return b.current={sessionId:v.id,history:I},A.forEach(x),I},enabled:c,placeholderData:(P,R)=>(R==null?void 0:R.queryKey[1].sessionId)===v.id?P:void 0,refetchInterval:P=>{var R;return(R=P.state.data)!=null&&R.isUpstreamReady?s:r},refetchIntervalInBackground:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,gcTime:0,networkMode:"always"});if(t==="static")return{isUpstreamReady:!0,iframeRemountKey:y,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:null};if(l)return{isUpstreamReady:!1,iframeRemountKey:y,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:"upstream_unreachable"};const C=k.data;return{isUpstreamReady:(C==null?void 0:C.isUpstreamReady)??!1,iframeRemountKey:y,probeStartedAt:v.startedAt,probeAttemptCount:((C==null?void 0:C.completedProbeCount)??0)+(k.isFetching?1:0),isFirstUnreachableWindowExceeded:(C==null?void 0:C.isFirstUnreachableWindowExceeded)??!1,initialProbeComplete:C!==void 0,unavailableReason:C?C.unavailableReason:"upstream_unreachable"}};function Hpe(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const cj=t=>{var r;if(typeof window>"u")return"";const e=(r=window.__RIVET_BOOTSTRAP__)==null?void 0:r.previewOrigin;if(e)return e;const n=new URL(window.location.origin);return n.hostname="localhost",n.origin},vS=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${cj()}${e}`:e,Upe="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",Bpe=t=>Upe,Zpe=oi("PreviewSurface"),qh=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",yS=({target:t,src:e,framework:n,remountKey:r,isActive:s=!0})=>{bt(dy);const i=Ai(),o=g.useRef(!1),l=g.useRef(s),c=g.useCallback(f=>{t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:qh(e,t),framework:n,isReused:f}))},[n,i,e,t]),d=g.useCallback(f=>{f&&(s&&!l.current&&o.current&&c(!0),l.current=s)},[c,s]);return S.jsx("div",{ref:d,className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:s?"Project Preview":"Retained Project Preview",tabIndex:s?void 0:-1,sandbox:Bpe(),onLoad:()=>{o.current=!0,i==null||i.capture("preview_iframe_loaded",{framework:n,src_kind:qh(e,t)}),s&&c(!1)},onError:()=>{i==null||i.capture("preview_iframe_load_failed",{framework:n,src_kind:qh(e,t)}),s&&t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:qh(e,t),framework:n})),Zpe.warn("Preview iframe failed to load",{framework:n,src_kind:qh(e,t)})}},r)})},Wpe=7,Kpe=t=>{const e=r4(t.target),n=`${e}:${t.src}`,r=t.src==="about:blank",[s,i]=g.useState(()=>({selectedKey:n,remountKey:t.remountKey,selection:0,frames:r?[]:[{key:n,props:t,lastSelected:0}]}));if(s.selectedKey!==n||s.remountKey!==t.remountKey){const o=s.selection+1,l=s.remountKey!==t.remountKey;let c=s.frames.filter(d=>!l||r4(d.props.target)!==e);if(!r){const d=c.find(f=>f.key===n);if(d?c=c.map(f=>f===d?{...f,lastSelected:o}:f):c=[...c,{key:n,props:t,lastSelected:o}],c.length>Wpe){const f=c.reduce((h,m)=>m.lastSelected<h.lastSelected?m:h);c=c.filter(h=>h!==f)}}i({selectedKey:n,remountKey:t.remountKey,selection:o,frames:c})}return S.jsxs("div",{className:"relative h-full w-full",children:[s.frames.map(o=>{const l=!r&&o.key===n;return S.jsx("div",{className:"absolute inset-0",style:{visibility:l?"visible":"hidden",pointerEvents:l?"auto":"none"},"aria-hidden":!l,children:S.jsx(yS,{...o.props,isActive:l})},`${o.key}:${o.props.remountKey??""}`)}),r?S.jsx(yS,{...t}):null]})},qpe=g.lazy(()=>J4(()=>Promise.resolve().then(()=>R0e),void 0)),Gpe={surface:"relative flex h-full w-full items-center justify-center bg-main px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-main/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-main px-6"},Ype={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},Xpe={neutral:"rounded-md border border-divider bg-transparent px-5 py-2 text-sm font-medium text-content transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-content-muted transition-colors hover:text-content"},Tu=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:c,state:d,role:f="status",busy:h=!1,className:m=""})=>{const v=g.useCallback(_=>{_&&d&&(Qe==null||Qe.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),y=!!(e||n||r||c||s!=null&&s.length);return S.jsxs("div",{ref:v,className:`${Gpe[o]} ${m}`.trim(),role:f,"aria-live":"polite","aria-busy":h||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,y?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:Ype[l],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:Xpe[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},_S=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Tu,{...r,size:n,busy:!0,backdrop:S.jsx(aj,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Tu,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(qpe,{className:"absolute inset-0"})})}):S.jsx(Tu,{...r,size:n,busy:!0,media:S.jsx(W1,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),uj=({icon:t,...e})=>S.jsx(Tu,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Q6=t=>S.jsx(Tu,{...t,tone:"error",role:"alert"}),i4="/static/",Qpe=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(i4)}catch{return t.endsWith(i4)}},Jpe=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="dependency_install_failed"?"The direction is saved, but its dependencies couldn’t be prepared. Fix the installation error, then retry the preview.":t==="compile_error"?"The direction is saved, but its app couldn’t compile. Fix the app error, then retry the preview.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",eme=t=>{if(t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE")return{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED")return{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed")return{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="cancelled")return{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1};if(t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"){const e=t.previewUnavailable.portInUse?"The preview port was already in use.":void 0;return{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:Jpe(t.previewUnavailable.reason),detail:t.previewUnavailable.detail??e,isError:!0}}return null},tme=({issue:t,retryTarget:e})=>{const n=Ai(),r=g.useRef(!1),[s,i]=g.useState(!1),[o,l]=g.useState(null),c=async()=>{if(!(!e||r.current)){r.current=!0,i(!0),l(null),n==null||n.capture("preview_retry_clicked",{session_id:e.sessionId,variant_id:e.variantId});try{const d=await Ft(`/api/variants/${encodeURIComponent(e.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:e.variantId,retry:!0})});if(!d.ok){const f=gJ.safeParse(await d.json().catch(()=>({})));throw new Error(f.success?f.data.message:"The preview could not restart. Try again.")}}catch(d){l(Gs(d,"The preview could not restart. Try again."))}finally{r.current=!1,i(!1)}}};return S.jsxs(Tu,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,busy:s,actions:e&&!s?[{label:"Retry preview",onClick:()=>void c()}]:void 0,children:[s?S.jsx("p",{className:"text-content-subtle text-xs",children:"Starting preview…"}):null,o?S.jsx("p",{className:"text-content-subtle text-xs",children:o}):null,t.detail?S.jsx("p",{"data-rivet-private":!0,className:"ph-no-capture text-content-subtle max-h-40 overflow-auto text-xs leading-relaxed break-words whitespace-pre-wrap",children:t.detail}):null]})},nme=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var qt;const r=bt(cy),s=bt(aS),i=Nt(aS),o=bt(p1),l=Nt(p1),c=bt(Vm),d=bt(dy),f=bt(lS),h=bt(cS),m=bt(EF),v=bt(CF),y=Nt(cS),_=bt(mc),b=bt(lv),x=Nt(lS),k=c.active&&c.projectContext.kind==="fresh",C=bt(av),P=c.active?c.variants.find(Ne=>Ne.workItemId===C&&(Ne.status==="pending"||Ne.status==="running"||Ne.status==="succeeded"&&!Ne.preview&&typeof Ne.port!="number"&&(!Ne.previewUnavailable||Ne.previewUnavailable.reason==="idle_timeout")))??null:null,R=c.active&&c.variants.some(Ne=>Ne.status==="pending"||Ne.status==="running"),O=k||R,I=c.active?c.variants.find(Ne=>Ne.workItemId===C)??null:null,A=I?eme(I):null,M=e==="static"&&o!==null&&Qpe(o);g.useEffect(()=>{c.active||x(!1)},[c.active,x]);const L=g.useRef(!1);g.useEffect(()=>{const Ne=!!(_!=null&&_.left||_!=null&&_.right),Je=Ne&&!L.current;L.current=Ne;const Re=c.active?c.sessionId:null;!Re||!Hpe({enteringSplit:Je,isExistingSession:c.active&&c.projectContext.kind==="existing",hasActiveVariantProxy:f&&h!==null})||(x(!1),y(null),i(Ct=>Ct+1),Ft(`/api/variants/${encodeURIComponent(Re)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[_,c,f,h,x,y,i]);const $=g.useMemo(()=>{var $t;if(f||o&&!M||!c.active)return null;const{stage:Ne,variants:Je}=c,Re=Ne==="ready"||Ne==="degraded",Ct=Je.some(ht=>{var mt,tr;return((mt=ht.refinement)==null?void 0:mt.status)==="pending"||((tr=ht.refinement)==null?void 0:tr.status)==="running"});if(!Re&&!Ct)return null;const Se=Je.find(ht=>{var mt;return ht.status==="succeeded"&&((mt=ht.preview)==null?void 0:mt.kind)==="static_artifact"});return(($t=Se==null?void 0:Se.preview)==null?void 0:$t.kind)==="static_artifact"?Cu({sessionId:c.sessionId,variant:Se,projectContext:c.projectContext}):null},[M,o,f,c])??o,q=g.useMemo(()=>!c.active||!$?null:c.variants.find(Ne=>{var Je;return((Je=Ne.preview)==null?void 0:Je.kind)==="static_artifact"&&$.startsWith(Ne.preview.url)})??null,[$,c]),X=g.useMemo(()=>{if((b==null?void 0:b.previewKind)==="static"||(b==null?void 0:b.previewKind)==="dev_server"&&b.previewError||(b==null?void 0:b.previewKind)==="dev_server"&&$&&II($))return{kind:"variant",sessionId:b.sessionId,variantId:b.variantId};if(!c.active)return n4;if(q)return{kind:"variant",sessionId:c.sessionId,variantId:q.workItemId};if($){const Je=$.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Re=Je!=null&&Je[1]?decodeURIComponent(Je[1]):null,Ct=Je!=null&&Je[2]?decodeURIComponent(Je[2]):null;if(Re===c.sessionId&&Ct&&c.variants.some(ht=>ht.workItemId===Ct))return{kind:"variant",sessionId:c.sessionId,variantId:Ct};const Se=$.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),$t=Se!=null&&Se[1]?decodeURIComponent(Se[1]):null;if($t&&c.variants.some(ht=>ht.workItemId===$t))return{kind:"variant",sessionId:c.sessionId,variantId:$t}}const Ne=!!(_!=null&&_.left||_!=null&&_.right);return(!Ne||k)&&!$&&f&&h&&c.variants.some(Je=>Je.workItemId===h)?{kind:"variant",sessionId:c.sessionId,variantId:h}:(!Ne||k)&&!$&&C&&c.variants.some(Je=>Je.workItemId===C)?{kind:"variant",sessionId:c.sessionId,variantId:C}:n4},[b,q,c,f,h,$,_,k,C]),K=g.useRef(null);g.useEffect(()=>{var Ct,Se,$t;if(!q||((Ct=q.preview)==null?void 0:Ct.kind)!=="static_artifact"||((Se=q.refinement)==null?void 0:Se.status)!=="succeeded")return;const Ne=`${q.workItemId}:${q.refinement.workItemId}`;if(K.current===Ne)return;if(K.current=Ne,($t=q.previewRoutes)!=null&&$t.length){i(ht=>ht+1);return}const Je=q.preview.url.includes("?")?"&":"?",Re=`${q.preview.url}${Je}refinement=${encodeURIComponent(q.refinement.workItemId)}`;$!==Re&&(l(Re),i(ht=>ht+1))},[$,q,i,l,c]);const H=$!==null&&II($),ee=$!==null&&!H||k&&!f&&!H,{isUpstreamReady:V,iframeRemountKey:Q,probeAttemptCount:B,initialProbeComplete:D}=Vpe(e,{rerunProbeImmediatelyOnVersion:s,probePath:H?$:null,skip:ee}),[G,fe]=g.useState(()=>m&&V?s:null),[ie,ue]=g.useState(null);m?G!==s&&((ie==null?void 0:ie.remountKey)!==s?ue({remountKey:s,probeAttemptCount:B}):V&&B>ie.probeAttemptCount&&fe(s)):(ie!==null&&ue(null),G!==null&&fe(null));const _e=$!==null&&!H||V,ne=v||m&&!H&&G!==s||m&&!_e,be=`${Q}:${s}`,Ve=DF(window.location.pathname),De=e==="static"?`/static${Ve??"/"}`:Ve??"/",$e=cj();let Ut=null;$&&(Ut=vS({agentApplyMode:d,url:$}));const nn=H&&!_e?"about:blank":Ut,kt=P||A||b!=null&&b.previewError||ne?"about:blank":nn??(_e?`${$e}${De}`:"about:blank"),Dt=!!P||!!A||!_e&&D;let un=null;if(b!=null&&b.previewError)un=S.jsx(Tu,{fill:"overlay",size:"sm",state:"preview_replay_failed",role:"alert",tone:"error",title:"Rivet couldn’t preview this direction",description:"Select the direction again to retry.",children:S.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:b.previewError})});else if(ne)un=S.jsx(_S,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(P)un=S.jsx(_S,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(A){const Ne=c.active&&I&&A.state==="preview_unavailable"&&((qt=I.previewUnavailable)==null?void 0:qt.reason)!=="missing_static_entry"?{sessionId:c.sessionId,variantId:I.workItemId}:void 0;un=S.jsx(tme,{issue:A,retryTarget:Ne},I==null?void 0:I.workItemId)}else Dt&&(un=O?S.jsx(uj,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Q6,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}));return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:S.jsxs("div",{className:"relative min-h-0 flex-1",children:[un,S.jsx(Kpe,{target:X,src:kt,framework:e,remountKey:be},r)]})})};function o4({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=bt(mc),c=Nt(mc),d=Ai(),f=bt(Vm),h=bt(dy),m=g.useRef(!1),v=g.useCallback(()=>{m.current||(m.current=!0,Ff({source:i,sessionId:e,variantId:n}))},[i,e,n]),y=g.useCallback(()=>{if(o){c(null);const I=m1("ended",l);d==null||d.capture(I.event,I.properties);return}v();const P={...l};delete P[t];const R=P.left||P.right?P:null;c(R);const O=m1(R?"updated":"ended",R??l);d==null||d.capture(O.event,O.properties)},[o,d,c,t,l,v]),_=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),b=g.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(P=>P.workItemId===n)??null,[e,n,f]),x=g.useMemo(()=>{var R,O,I;let P=r;if(((R=b==null?void 0:b.preview)==null?void 0:R.kind)==="static_artifact"&&((O=b.refinement)==null?void 0:O.status)==="succeeded"){if((I=b.previewRoutes)!=null&&I.length)return vS({agentApplyMode:h,url:Cu({sessionId:e,variant:b,projectContext:null})??r});const A=b.preview.url.includes("?")?"&":"?";P=`${b.preview.url}${A}refinement=${encodeURIComponent(b.refinement.workItemId)}`}return vS({agentApplyMode:h,url:P})},[h,b,e,r]),k=((C=b==null?void 0:b.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${b.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(zu,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:y,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(yS,{target:_,src:x,framework:"static",remountKey:k})})]})}function rme(){const t=bt($f),e=bt(Z6);return!t||!e?null:$m.createPortal(S.jsx("div",{"aria-hidden":"true",className:"border-main-border bg-main pointer-events-none fixed top-0 left-0 z-[70] flex max-w-60 items-center gap-2 rounded-md border px-3 py-1.5 shadow-lg",style:{transform:`translate3d(${e.x+12}px, ${e.y+12}px, 0)`},children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}const a4=(t,e)=>{if(!t)return null;const n=t.getBoundingClientRect(),{x:r,y:s}=e;return r<n.left||r>n.right||s<n.top||s>n.bottom?null:r<(n.left+n.right)/2?"left":"right"};function sme(){const t=bt($f),e=bt(Z6),n=bt(mc),r=Nt($f),s=Nt(mc),i=Ai(),o=g.useRef(null),[l,c]=g.useState(null),[d,f]=g.useState("hidden");if(!t&&(d!=="hidden"||l!==null)&&(f("hidden"),c(null)),g.useEffect(()=>{if(!t||!e)return;const m=a4(o.current,e);c(v=>v===m?v:m),f(v=>{if(v==="exiting")return v;const y=m!==null?"visible":"hidden";return v===y?v:y})},[t,e]),g.useEffect(()=>{if(!t)return;const m=v=>{const y=a4(o.current,{x:v.clientX,y:v.clientY});if(y&&t.url){const _={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[y];b&&(b.sessionId!==_.sessionId||b.variantId!==_.variantId)&&Ff(b);const x={...n??{},[y]:_};s(x);const k=m1(n?"updated":"started",x);i==null||i.capture(k.event,k.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else Ff(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",m),window.addEventListener("pointercancel",m),()=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)}},[t,i,r,s,n]),!t)return null;const h=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:o,className:h,"aria-hidden":"true",children:[S.jsx(l4,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),S.jsx(l4,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function l4({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const dj=(t,e,n)=>{var i,o,l;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(c=>c.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if((o=r.previewRoutes)!=null&&o.length)return Cu({sessionId:e,variant:r,projectContext:t.projectContext});if(((l=r.refinement)==null?void 0:l.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},c4=(t,e)=>{if(!t)return;const n=dj(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},ime=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(aj,{trackGlobalLoaderCount:!1})})}),ome=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,retry:r,isLoading:s,error:i}=ype();return s?S.jsx(ime,{}):i||!n?S.jsx(Q6,{fill:"surface",size:"sm",state:"preview_config_error",title:"Couldn't load preview",description:"We couldn't load the preview configuration.",actions:[{label:"Retry",onClick:()=>{Qe==null||Qe.capture("preview_config_retry_clicked"),r()}}]}):S.jsx(ame,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function ame(t){const e=bt(mc),n=bt($f),r=bt(Vm),s=bt(p1),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=g.useMemo(()=>{var R,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(R=i??o)==null?void 0:R.variantId,b=r.variants.filter(I=>{var A;return I.status==="succeeded"&&((A=I.preview)==null?void 0:A.kind)==="static_artifact"&&I.workItemId!==_}),x=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=b.find(I=>{var A;return((A=I.preview)==null?void 0:A.kind)==="static_artifact"&&(I.preview.url===x||Cu({sessionId:r.sessionId,variant:I,projectContext:r.projectContext})===s)})??b[0];if(((O=C==null?void 0:C.preview)==null?void 0:O.kind)!=="static_artifact")return;const P=dj(r,r.sessionId,C.workItemId);if(P)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:P,source:"live"}},[r,i,o,s]),c=c4(i,r)??(o?l:void 0),d=c4(o,r)??(i?l:void 0),f=!i&&!!c,h=!o&&!!d,m=!!(c||d),v=S.jsx(nme,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&S.jsx(o4,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:f},`left-${c.sessionId}:${c.variantId}:${c.url}`),S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",style:{display:c&&d?"none":void 0},"aria-hidden":!!(c&&d),children:v}),d&&S.jsx(o4,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:h},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(sme,{}),S.jsx(rme,{})]})})}function $a(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fj(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
200
- * GSAP 3.15.1
201
- * https://gsap.com
202
- *
203
- * @license Copyright 2008-2026, GreenSock. All rights reserved.
204
- * Subject to the terms at https://gsap.com/standard-license
205
- * @author: Jack Doyle, jack@greensock.com
206
- */var Ei={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},pm={duration:.5,overwrite:!1,delay:0},J6,ts,Hn,qi=1e8,wn=1/qi,wS=Math.PI*2,lme=wS/4,cme=0,hj=Math.sqrt,ume=Math.cos,dme=Math.sin,Zr=function(e){return typeof e=="string"},ar=function(e){return typeof e=="function"},tl=function(e){return typeof e=="number"},eE=function(e){return typeof e>"u"},ha=function(e){return typeof e=="object"},Js=function(e){return e!==!1},tE=function(){return typeof window<"u"},Ig=function(e){return ar(e)||Zr(e)},pj=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ws=Array.isArray,fme=/random\([^)]+\)/g,hme=/,\s*/g,u4=/(?:-?\.?\d|\.)+/gi,mj=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Zd=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,jw=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,gj=/[+-]=-?[.\d]+/,pme=/[^,'"\[\]\s]+/gi,mme=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,qn,Zo,bS,nE,Ti={},v1={},vj,yj=function(e){return(v1=zf(e,Ti))&&ri},rE=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},mm=function(e,n){return!n&&console.warn(e)},_j=function(e,n){return e&&(Ti[e]=n)&&v1&&(v1[e]=n)||Ti},gm=function(){return 0},gme={suppressEvents:!0,isStart:!0,kill:!1},uv={suppressEvents:!0,kill:!1},vme={suppressEvents:!0},sE={},rc=[],xS={},wj,gi={},zw={},d4=30,dv=[],iE="",oE=function(e){var n=e[0],r,s;if(ha(n)||ar(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=dv.length;s--&&!dv[s].targetTest(n););r=dv[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new Hj(e[s],r)))||e.splice(s,1);return e},Ru=function(e){return e._gsap||oE(Gi(e))[0]._gsap},bj=function(e,n,r){return(r=e[n])&&ar(r)?e[n]():eE(r)&&e.getAttribute&&e.getAttribute(n)||r},ei=function(e,n){return(e=e.split(",")).forEach(n)||e},fr=function(e){return Math.round(e*1e5)/1e5||0},Kn=function(e){return Math.round(e*1e7)/1e7||0},tf=function(e,n){var r=n.charAt(0),s=parseFloat(n.substr(2));return e=parseFloat(e),r==="+"?e+s:r==="-"?e-s:r==="*"?e*s:e/s},yme=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},y1=function(){var e=rc.length,n=rc.slice(0),r,s;for(xS={},rc.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},aE=function(e){return!!(e._initted||e._startAt||e.add)},xj=function(e,n,r,s){rc.length&&!ts&&y1(),e.render(n,r,!!(ts&&n<0&&aE(e))),rc.length&&!ts&&y1()},Sj=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(pme).length<2?n:Zr(e)?e.trim():e},kj=function(e){return e},Ri=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},_me=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},zf=function(e,n){for(var r in n)e[r]=n[r];return e},f4=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=ha(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},_1=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Op=function(e){var n=e.parent||qn,r=e.keyframes?_me(ws(e.keyframes)):Ri;if(Js(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},wme=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},Ej=function(e,n,r,s,i){var o=e[s],l;if(i)for(l=n[i];o&&o[i]>l;)o=o._prev;return o?(n._next=o._next,o._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=o,n.parent=n._dp=e,n},hy=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,o=n._next;i?i._next=o:e[r]===n&&(e[r]=o),o?o._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},gc=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Au=function(e,n){if(e&&(!n||n._end>e._dur||n._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},bme=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},SS=function(e,n,r,s){return e._startAt&&(ts?e._startAt.revert(uv):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},xme=function t(e){return!e||e._ts&&t(e.parent)},h4=function(e){return e._repeat?Vf(e._tTime,e=e.duration()+e._rDelay)*e:0},Vf=function(e,n){var r=Math.floor(e=Kn(e/n));return e&&r===e?r-1:r},w1=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},py=function(e){return e._end=Kn(e._start+(e._tDur/Math.abs(e._ts||e._rts||wn)||0))},my=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Kn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),py(e),r._dirty||Au(r,e)),e},Cj=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=w1(e.rawTime(),n),(!n._dur||Um(0,n.totalDuration(),r)-n._tTime>wn)&&n.render(r,!0)),Au(e,n)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-wn}},Qo=function(e,n,r,s){return n.parent&&gc(n),n._start=Kn((tl(r)?r:!r&&b1(n)&&(!e._last||e._last._start>=e._time)?e._last?e._last._start:e._time:r||e!==qn?Bi(e,r,n):e._time)+n._delay),n._end=Kn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),Ej(e,n,"_first","_last",e._sort?"_start":0),b1(n)||(e._recent=n),s||Cj(e,n),e._ts<0&&my(e,e._tTime),e},Pj=function(e,n){return(Ti.ScrollTrigger||rE("scrollTrigger",n))&&Ti.ScrollTrigger.create(n,e)},Tj=function(e,n,r,s,i){if(cE(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!ts&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&wj!==wi.frame)return rc.push(e),e._lazy=[i,s],1},Sme=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},b1=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},kme=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&Sme(e)&&!(!e._initted&&b1(e))||(e._ts<0||e._dp._ts<0)&&!b1(e))?0:1,l=e._rDelay,c=0,d,f,h;if(l&&e._repeat&&(c=Um(0,e._tDur,n),f=Vf(c,l),e._yoyo&&f&1&&(o=1-o),f!==Vf(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||ts||s||e._zTime===wn||!n&&e._zTime){if(!e._initted&&Tj(e,n,s,r,c))return;for(h=e._zTime,e._zTime=n||(r?wn:0),r||(r=n&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=c,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&SS(e,n,r,!0),e._onUpdate&&!r&&bi(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&bi(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&gc(e,1),!r&&!ts&&(bi(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},Eme=function(e,n,r){var s;if(r>n)for(s=e._first;s&&s._start<=r;){if(s.data==="isPause"&&s._start>n)return s;s=s._next}else for(s=e._last;s&&s._start>=r;){if(s.data==="isPause"&&s._start<n)return s;s=s._prev}},Hf=function(e,n,r,s){var i=e._repeat,o=Kn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:Kn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&my(e,e._tTime=e._tDur*l),e.parent&&py(e),r||Au(e.parent,e),e},p4=function(e){return e instanceof Ks?Au(e):Hf(e,e._dur)},Cme={_start:0,endTime:gm,totalDuration:gm},Bi=function t(e,n,r){var s=e.labels,i=e._recent||Cme,o=e.duration()>=qi?i.endTime(!1):e._dur,l,c,d;return Zr(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),c==="<"||c===">"?(l>=0&&(n=n.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(l<0?i:r).totalDuration()/100:1)):l<0?(n in s||(s[n]=o),s[n]):(c=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(c=c/100*(ws(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+c:o+c)):n==null?o:+n},Mp=function(e,n,r){var s=tl(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,c;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,c=r;c&&!("immediateRender"in l);)l=c.vars.defaults||{},c=Js(c.vars.inherit)&&c.parent;o.immediateRender=Js(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new wr(n[0],o,n[i+1])},Ec=function(e,n){return e||e===0?n(e):n},Um=function(e,n,r){return r<e?e:r>n?n:r},vs=function(e,n){return!Zr(e)||!(n=mme.exec(e))?"":n[1]},Pme=function(e,n,r){return Ec(r,function(s){return Um(e,n,s)})},kS=[].slice,Rj=function(e,n){return e&&ha(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&ha(e[0]))&&!e.nodeType&&e!==Zo},Tme=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Zr(s)&&!n||Rj(s,1)?(i=r).push.apply(i,Gi(s)):r.push(s)})||r},Gi=function(e,n,r){return Hn&&!n&&Hn.selector?Hn.selector(e):Zr(e)&&!r&&(bS||!Uf())?kS.call((n||nE).querySelectorAll(e),0):ws(e)?Tme(e,r):Rj(e)?kS.call(e,0):e?[e]:[]},ES=function(e){return e=Gi(e)[0]||mm("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Gi(n,r.querySelectorAll?r:r===e?mm("Invalid scope")||nE.createElement("div"):e)}},Aj=function(e){return e.sort(function(){return .5-Math.random()})},Ij=function(e){if(ar(e))return e;var n=ha(e)?e:{each:e},r=Iu(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,c=isNaN(s)||l,d=n.axis,f=s,h=s;return Zr(s)?f=h={center:.5,edges:.5,end:1}[s]||0:!l&&c&&(f=s[0],h=s[1]),function(m,v,y){var _=(y||n).length,b=o[_],x,k,C,P,R,O,I,A,M;if(!b){if(M=n.grid==="auto"?0:(n.grid||[1,qi])[1],!M){for(I=-qi;I<(I=y[M++].getBoundingClientRect().left)&&M<_;);M<_&&M--}for(b=o[_]=[],x=c?Math.min(M,_)*f-.5:s%M,k=M===qi?0:c?_*h/M-.5:s/M|0,I=0,A=qi,O=0;O<_;O++)C=O%M-x,P=k-(O/M|0),b[O]=R=d?Math.abs(d==="y"?P:C):hj(C*C+P*P),R>I&&(I=R),R<A&&(A=R);s==="random"&&Aj(b),b.max=I-A,b.min=A,b.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(M>_?_-1:d?d==="y"?_/M:M:Math.max(M,_/M))||0)*(s==="edges"?-1:1),b.b=_<0?i-_:i,b.u=vs(n.amount||n.each)||0,r=r&&_<0?Vme(r):r}return _=(b[m]-b.min)/b.max||0,Kn(b.b+(r?r(_):_)*b.v)+b.u}},CS=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Kn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(tl(r)?0:vs(r))}},Oj=function(e,n){var r=ws(e),s,i;return!r&&ha(e)&&(s=r=e.radius||qi,e.values?(e=Gi(e.values),(i=!tl(e[0]))&&(s*=s)):e=CS(e.increment)),Ec(n,r?ar(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),c=parseFloat(i?o.y:0),d=qi,f=0,h=e.length,m,v;h--;)i?(m=e[h].x-l,v=e[h].y-c,m=m*m+v*v):m=Math.abs(e[h]-l),m<d&&(d=m,f=h);return f=!s||d<=s?e[f]:o,i||f===o||tl(o)?f:f+vs(o)}:CS(e))},Mj=function(e,n,r,s){return Ec(ws(e)?!n:r===!0?!!(r=0):!s,function(){return ws(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(s=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(n-e+r*.99))/r)*r*s)/s})},Rme=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,o){return o(i)},s)}},Ame=function(e,n){return function(r){return e(parseFloat(r))+(n||vs(r))}},Ime=function(e,n,r){return Lj(e,n,0,1,r)},Nj=function(e,n,r){return Ec(r,function(s){return e[~~n(s)]})},Ome=function t(e,n,r){var s=n-e;return ws(e)?Nj(e,t(0,e.length),n):Ec(r,function(i){return(s+(i-e)%s)%s+e})},Mme=function t(e,n,r){var s=n-e,i=s*2;return ws(e)?Nj(e,t(0,e.length-1),n):Ec(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},vm=function(e){return e.replace(fme,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(hme);return Mj(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},Lj=function(e,n,r,s,i){var o=n-e,l=s-r;return Ec(i,function(c){return r+((c-e)/o*l||0)})},Nme=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=Zr(e),l={},c,d,f,h,m;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(ws(e)&&!ws(n)){for(f=[],h=e.length,m=h-2,d=1;d<h;d++)f.push(t(e[d-1],e[d]));h--,i=function(y){y*=h;var _=Math.min(m,~~y);return f[_](y-_)},r=n}else s||(e=zf(ws(e)?[]:{},e));if(!f){for(c in n)lE.call(l,e,c,"get",n[c]);i=function(y){return fE(y,l)||(o?e.p:e)}}}return Ec(r,i)},m4=function(e,n,r){var s=e.labels,i=qi,o,l,c;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(c=o,i=l);return c},bi=function(e,n,r){var s=e.vars,i=s[n],o=Hn,l=e._ctx,c,d,f;if(i)return c=s[n+"Params"],d=s.callbackScope||e,r&&rc.length&&y1(),l&&(Hn=l),f=c?i.apply(d,c):i.call(d),Hn=o,f},up=function(e){return gc(e),e.scrollTrigger&&e.scrollTrigger.kill(!!ts),e.progress()<1&&bi(e,"onInterrupt"),e},Wd,Dj=[],$j=function(e){if(e)if(e=!e.name&&e.default||e,tE()||e.headless){var n=e.name,r=ar(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:gm,render:fE,add:lE,kill:Xme,modifier:Yme,rawVars:0},o={targetTest:0,get:0,getSetter:dE,aliases:{},register:0};if(Uf(),e!==s){if(gi[n])return;Ri(s,Ri(_1(e,i),o)),zf(s.prototype,zf(i,_1(e,o))),gi[s.prop=n]=s,e.targetTest&&(dv.push(s),sE[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}_j(n,s),e.register&&e.register(ri,s,ti)}else Dj.push(e)},kn=255,dp={aqua:[0,kn,kn],lime:[0,kn,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,kn],navy:[0,0,128],white:[kn,kn,kn],olive:[128,128,0],yellow:[kn,kn,0],orange:[kn,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[kn,0,0],pink:[kn,192,203],cyan:[0,kn,kn],transparent:[kn,kn,kn,0]},Vw=function(e,n,r){return e+=e<0?1:e>1?-1:0,(e*6<1?n+(r-n)*e*6:e<.5?r:e*3<2?n+(r-n)*(2/3-e)*6:n)*kn+.5|0},Fj=function(e,n,r){var s=e?tl(e)?[e>>16,e>>8&kn,e&kn]:0:dp.black,i,o,l,c,d,f,h,m,v,y;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),dp[e])s=dp[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),l=e.charAt(3),e="#"+i+i+o+o+l+l+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&kn,s&kn,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&kn,e&kn]}else if(e.substr(0,3)==="hsl"){if(s=y=e.match(u4),!n)c=+s[0]%360/360,d=+s[1]/100,f=+s[2]/100,o=f<=.5?f*(d+1):f+d-f*d,i=f*2-o,s.length>3&&(s[3]*=1),s[0]=Vw(c+1/3,i,o),s[1]=Vw(c,i,o),s[2]=Vw(c-1/3,i,o);else if(~e.indexOf("="))return s=e.match(mj),r&&s.length<4&&(s[3]=1),s}else s=e.match(u4)||dp.transparent;s=s.map(Number)}return n&&!y&&(i=s[0]/kn,o=s[1]/kn,l=s[2]/kn,h=Math.max(i,o,l),m=Math.min(i,o,l),f=(h+m)/2,h===m?c=d=0:(v=h-m,d=f>.5?v/(2-h-m):v/(h+m),c=h===i?(o-l)/v+(o<l?6:0):h===o?(l-i)/v+2:(i-o)/v+4,c*=60),s[0]=~~(c+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},jj=function(e){var n=[],r=[],s=-1;return e.split(sc).forEach(function(i){var o=i.match(Zd)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},g4=function(e,n,r){var s="",i=(e+s).match(sc),o=n?"hsla(":"rgba(",l=0,c,d,f,h;if(!i)return e;if(i=i.map(function(m){return(m=Fj(m,n,1))&&o+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(f=jj(e),c=r.c,c.join(s)!==f.c.join(s)))for(d=e.replace(sc,"1").split(Zd),h=d.length-1;l<h;l++)s+=d[l]+(~c.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(sc),h=d.length-1;l<h;l++)s+=d[l]+i[l];return s+d[h]},sc=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in dp)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),Lme=/hsl[a]?\(/,zj=function(e){var n=e.join(" "),r;if(sc.lastIndex=0,sc.test(n))return r=Lme.test(n),e[1]=g4(e[1],r),e[0]=g4(e[0],r,jj(e[1])),!0},ym,wi=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],c,d,f,h,m,v,y=function _(b){var x=t()-s,k=b===!0,C,P,R,O;if((x>e||x<0)&&(r+=x-n),s+=x,R=s-r,C=R-o,(C>0||k)&&(O=++h.frame,m=R-h.time*1e3,h.time=R=R/1e3,o+=C+(C>=i?0:i-C),P=1),k||(c=d(_)),P)for(v=0;v<l.length;v++)l[v](R,m,O,b)};return h={time:0,frame:0,tick:function(){y(!0)},deltaRatio:function(b){return m/(1e3/(b||60))},wake:function(){vj&&(!bS&&tE()&&(Zo=bS=window,nE=Zo.document||{},Ti.gsap=ri,(Zo.gsapVersions||(Zo.gsapVersions=[])).push(ri.version),yj(v1||Zo.GreenSockGlobals||!Zo.gsap&&Zo||{}),Dj.forEach($j)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&h.sleep(),d=f||function(b){return setTimeout(b,o-h.time*1e3+1|0)},ym=1,y(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(c),ym=0,d=gm},lagSmoothing:function(b,x){e=b||1/0,n=Math.min(x||33,e)},fps:function(b){i=1e3/(b||240),o=h.time*1e3+i},add:function(b,x,k){var C=x?function(P,R,O,I){b(P,R,O,I),h.remove(C)}:b;return h.remove(b),l[k?"unshift":"push"](C),Uf(),C},remove:function(b,x){~(x=l.indexOf(b))&&l.splice(x,1)&&v>=x&&v--},_listeners:l},h})(),Uf=function(){return!ym&&wi.wake()},Ht={},Dme=/^[\d.\-M][\d.\-,\s]/,$me=/["']/g,Fme=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,c,d;i<o;i++)c=r[i],l=i!==o-1?c.lastIndexOf(","):c.length,d=c.substr(0,l),n[s]=isNaN(d)?d.replace($me,"").trim():+d,s=c.substr(l+1).trim();return n},jme=function(e){var n=e.indexOf("(")+1,r=e.indexOf(")"),s=e.indexOf("(",n);return e.substring(n,~s&&s<r?e.indexOf(")",r+1):r)},zme=function(e){var n=(e+"").split("("),r=Ht[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[Fme(n[1])]:jme(e).split(",").map(Sj)):Ht._CE&&Dme.test(e)?Ht._CE("",e):r},Vme=function(e){return function(n){return 1-e(1-n)}},Iu=function(e,n){return e&&(ar(e)?e:Ht[e]||zme(e))||n},Hu=function(e,n,r,s){r===void 0&&(r=function(c){return 1-n(1-c)}),s===void 0&&(s=function(c){return c<.5?n(c*2)/2:1-n((1-c)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return ei(e,function(l){Ht[l]=Ti[l]=i,Ht[o=l.toLowerCase()]=r;for(var c in i)Ht[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=Ht[l+"."+c]=i[c]}),i},Vj=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},Hw=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/wS*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*dme((f-o)*i)+1},c=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:Vj(l);return i=wS/i,c.config=function(d,f){return t(e,d,f)},c},Uw=function t(e,n){n===void 0&&(n=1.70158);var r=function(o){return o?--o*o*((n+1)*o+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:Vj(r);return s.config=function(i){return t(e,i)},s};ei("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Hu(t+",Power"+(n-1),e?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});Ht.Linear.easeNone=Ht.none=Ht.Linear.easeIn;Hu("Elastic",Hw("in"),Hw("out"),Hw());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(l){return l<n?t*l*l:l<r?t*Math.pow(l-1.5/e,2)+.75:l<s?t*(l-=2.25/e)*l+.9375:t*Math.pow(l-2.625/e,2)+.984375};Hu("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Hu("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Hu("Circ",function(t){return-(hj(1-t*t)-1)});Hu("Sine",function(t){return t===1?1:-ume(t*lme)+1});Hu("Back",Uw("in"),Uw("out"),Uw());Ht.SteppedEase=Ht.steps=Ti.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-wn;return function(l){return((s*Um(0,o,l)|0)+i)*r}}};pm.ease=Ht["quad.out"];ei("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return iE+=t+","+t+"Params,"});var Hj=function(e,n){this.id=cme++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:bj,this.set=n?n.getSetter:dE},_m=(function(){function t(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,Hf(this,+n.duration,1,1),this.data=n.data,Hn&&(this._ctx=Hn,Hn.data.push(this)),ym||wi.wake()}var e=t.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,Hf(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(Uf(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(my(this,r),!i._dp||i.parent||Cj(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Qo(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===wn||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),xj(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+h4(this))%(this._dur+this._rDelay)||(r?this._dur:0),s):this._time},e.totalProgress=function(r,s){return arguments.length?this.totalTime(this.totalDuration()*r,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+h4(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,s){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,s):this._repeat?Vf(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-wn?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?w1(this.parent._time,this):this._tTime,o=this._rts<0;this._rts=+r||0,this._ts=this._ps||r===-wn?0:this._rts;var l=this.totalDuration();return(o!==this._rts<0||i>0&&i<l)&&this.totalTime(Um(-Math.abs(this._delay),l,i),s!==!1),py(this),bme(this)},e.paused=function(r){if(!arguments.length)return this._ps;if(this._ps!==r)if(this._ps=r,r)this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0;else{Uf(),this._ts=this._rts;var s=this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,i=this.progress()===1&&Math.abs(this._zTime)!==wn,o;if(i)for(this._tTime-=wn,o=this._first;o;){if(!o._dur&&o._zTime<0&&o._ts&&o._start<=s+wn){i=!1;break}o=o._next}this.totalTime(s,i)}return this},e.startTime=function(r){if(arguments.length){this._start=Kn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Qo(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Js(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var s=this.parent||this._dp;return s?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?w1(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=vme);var s=ts;return ts=r,aE(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),ts=s,this},e.globalTime=function(r){for(var s=this,i=arguments.length?r:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,p4(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,p4(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,s){return this.totalTime(Bi(this,r),Js(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Js(s)),this._dur||(this._zTime=-wn),this},e.play=function(r,s){return r!=null&&this.seek(r,s),this.reversed(!1).paused(!1)},e.reverse=function(r,s){return r!=null&&this.seek(r||this.totalDuration(),s),this.reversed(!0).paused(!1)},e.pause=function(r,s){return r!=null&&this.seek(r,s),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-wn:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-wn,this},e.isActive=function(){var r=this.parent||this._dp,s=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=s&&i<this.endTime(!0)-wn)},e.eventCallback=function(r,s,i){var o=this.vars;return arguments.length>1?(s?(o[r]=s,i&&(o[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete o[r],this):o[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(o){var l=ar(r)?r:kj,c=function(){var f=s.then;s.then=null,i&&i(),ar(l)&&(l=l(s))&&(l.then||l===s)&&(s.then=f),o(l),s.then=f};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){up(this)},t})();Ri(_m.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-wn,_prom:0,_ps:!1,_rts:1});var Ks=(function(t){fj(e,t);function e(r,s){var i;return r===void 0&&(r={}),i=t.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=Js(r.sortChildren),qn&&Qo(r.parent||qn,$a(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&Pj($a(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return Mp(0,arguments,this),this},n.from=function(s,i,o){return Mp(1,arguments,this),this},n.fromTo=function(s,i,o,l){return Mp(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,Op(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new wr(s,i,Bi(this,o),1),this},n.call=function(s,i,o){return Qo(this,wr.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,c,d,f){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=f,o.parent=this,new wr(s,o,Bi(this,c)),this},n.staggerFrom=function(s,i,o,l,c,d,f){return o.runBackwards=1,Op(o).immediateRender=Js(o.immediateRender),this.staggerTo(s,i,o,l,c,d,f)},n.staggerFromTo=function(s,i,o,l,c,d,f,h){return l.startAt=o,Op(l).immediateRender=Js(l.immediateRender),this.staggerTo(s,i,l,c,d,f,h)},n.render=function(s,i,o){var l=this._time,c=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:Kn(s),h=this._zTime<0!=s<0&&(this._initted||!d),m,v,y,_,b,x,k,C,P,R,O,I;if(this!==qn&&f>c&&s>=0&&(f=c),f!==this._tTime||o||h){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),m=f,P=this._start,C=this._ts,x=!C,h&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(O=this._yoyo,b=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(b*100+s,i,o);if(m=Kn(f%b),f===c?(_=this._repeat,m=d):(R=Kn(f/b),_=~~R,_&&_===R&&(m=d,_--),m>d&&(m=d)),R=Vf(this._tTime,b),!l&&this._tTime&&R!==_&&this._tTime-R*b-this._dur<=0&&(R=_),O&&_&1&&(m=d-m,I=1),_!==R&&!this._lock){var A=O&&R&1,M=A===(O&&_&1);if(_<R&&(A=!A),l=A?0:f%d?d:f,this._lock=1,this.render(l||(I?0:Kn(_*b)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&bi(this,"onRepeat"),this.vars.repeatRefresh&&!I&&(this.invalidate()._lock=1,R=_),l&&l!==this._time||x!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,c=this._tDur,M&&(this._lock=2,l=A?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!I&&this.invalidate()),this._lock=0,!this._ts&&!x)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=Eme(this,Kn(l),Kn(m)),k&&(f-=m-(m=k._start))),this._tTime=f,this._time=m,this._act=!!C,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!R&&(bi(this,"onStart"),this._tTime!==f))return this;if(m>=l&&s>=0)for(v=this._first;v;){if(y=v._next,(v._act||m>=v._start)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(m-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(m-v._start)*v._ts,i,o),m!==this._time||!this._ts&&!x){k=0,y&&(f+=this._zTime=-wn);break}}v=y}else{v=this._last;for(var L=s<0?s:m;v;){if(y=v._prev,(v._act||L<=v._end)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(L-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(L-v._start)*v._ts,i,o||ts&&aE(v)),m!==this._time||!this._ts&&!x){k=0,y&&(f+=this._zTime=L?-wn:wn);break}}v=y}}if(k&&!i&&(this.pause(),k.render(m>=l?0:-wn)._zTime=m>=l?1:-1,this._ts))return this._start=P,py(this),this.render(s,i,o);this._onUpdate&&!i&&bi(this,"onUpdate",!0),(f===c&&this._tTime>=this.totalDuration()||!f&&l)&&(P===this._start||Math.abs(C)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===c&&this._ts>0||!f&&this._ts<0)&&gc(this,1),!i&&!(s<0&&!l)&&(f||l||!c)&&(bi(this,f===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(tl(i)||(i=Bi(this,i,s)),!(s instanceof _m)){if(ws(s))return s.forEach(function(l){return o.add(l,i)}),this;if(Zr(s))return this.addLabel(s,i);if(ar(s))s=wr.delayedCall(0,s);else return this}return this!==s?Qo(this,s,i):this},n.getChildren=function(s,i,o,l){s===void 0&&(s=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),l===void 0&&(l=-qi);for(var c=[],d=this._first;d;)d._start>=l&&(d instanceof wr?i&&c.push(d):(o&&c.push(d),s&&c.push.apply(c,d.getChildren(!0,i,o)))),d=d._next;return c},n.getById=function(s){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===s)return i[o]},n.remove=function(s){return Zr(s)?this.removeLabel(s):ar(s)?this.killTweensOf(s):(s.parent===this&&hy(this,s),s===this._recent&&(this._recent=this._last),Au(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Kn(wi.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),t.prototype.totalTime.call(this,s,i),this._forcing=0,this):this._tTime},n.addLabel=function(s,i){return this.labels[s]=Bi(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=wr.delayedCall(0,i||gm,o);return l.data="isPause",this._hasPause=1,Qo(this,l,Bi(this,s))},n.removePause=function(s){var i=this._first;for(s=Bi(this,s);i;)i._start===s&&i.data==="isPause"&&gc(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),c=l.length;c--;)Gl!==l[c]&&l[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Gi(s),c=this._first,d=tl(i),f;c;)c instanceof wr?yme(c._targets,l)&&(d?(!Gl||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&o.push(c):(f=c.getTweensOf(l,i)).length&&o.push.apply(o,f),c=c._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=Bi(o,s),c=i,d=c.startAt,f=c.onStart,h=c.onStartParams,m=c.immediateRender,v,y=wr.to(o,Ri({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||wn,onStart:function(){if(o.pause(),!v){var b=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());y._dur!==b&&Hf(y,b,0,1).render(y._time,!0,!0),v=1}f&&f.apply(y,h||[])}},i));return m?y.render(0):y},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Ri({startAt:{time:Bi(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),m4(this,Bi(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),m4(this,Bi(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+wn)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,c=this.labels,d;for(s=Kn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in c)c[d]>=o&&(c[d]+=s);return Au(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),Au(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,c=qi,d,f,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(h=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),f=l._start,f>c&&o._sort&&l._ts&&!o._lock?(o._lock=1,Qo(o,l,f-l._delay,1)._lock=0):c=f,f<0&&l._ts&&(i-=f,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=Kn(f/o._ts),o._time-=f,o._tTime-=f),o.shiftChildren(-f,!1,-1/0),c=0),l._end>i&&l._ts&&(i=l._end),l=d;Hf(o,o===qn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(qn._ts&&(xj(qn,w1(s,qn)),wj=wi.frame),wi.frame>=d4){d4+=Ei.autoSleep||120;var i=qn._first;if((!i||!i._ts)&&Ei.autoSleep&&wi._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||wi.sleep()}}},e})(_m);Ri(Ks.prototype,{_lock:0,_hasPause:0,_forcing:0});var Hme=function(e,n,r,s,i,o,l){var c=new ti(this._pt,e,n,0,1,Kj,null,i),d=0,f=0,h,m,v,y,_,b,x,k;for(c.b=r,c.e=s,r+="",s+="",(x=~s.indexOf("random("))&&(s=vm(s)),o&&(k=[r,s],o(k,e,n),r=k[0],s=k[1]),m=r.match(jw)||[];h=jw.exec(s);)y=h[0],_=s.substring(d,h.index),v?v=(v+1)%5:_.substr(-5)==="rgba("&&(v=1),y!==m[f++]&&(b=parseFloat(m[f-1])||0,c._pt={_next:c._pt,p:_||f===1?_:",",s:b,c:y.charAt(1)==="="?tf(b,y)-b:parseFloat(y)-b,m:v&&v<4?Math.round:0},d=jw.lastIndex);return c.c=d<s.length?s.substring(d,s.length):"",c.fp=l,(gj.test(s)||x)&&(c.e=0),this._pt=c,c},lE=function(e,n,r,s,i,o,l,c,d,f){ar(s)&&(s=s(i||0,e,o));var h=e[n],m=r!=="get"?r:ar(h)?d?e[n.indexOf("set")||!ar(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():h,v=ar(h)?d?Kme:Zj:uE,y;if(Zr(s)&&(~s.indexOf("random(")&&(s=vm(s)),s.charAt(1)==="="&&(y=tf(m,s)+(vs(m)||0),(y||y===0)&&(s=y))),!f||m!==s||PS)return!isNaN(m*s)&&s!==""?(y=new ti(this._pt,e,n,+m||0,s-(m||0),typeof h=="boolean"?Gme:Wj,0,v),d&&(y.fp=d),l&&y.modifier(l,this,e),this._pt=y):(!h&&!(n in e)&&rE(n,s),Hme.call(this,e,n,m,s,v,c||Ei.stringFilter,d))},Ume=function(e,n,r,s,i){if(ar(e)&&(e=Np(e,i,n,r,s)),!ha(e)||e.style&&e.nodeType||ws(e)||pj(e))return Zr(e)?Np(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=Np(e[l],i,n,r,s);return o},Uj=function(e,n,r,s,i,o){var l,c,d,f;if(gi[e]&&(l=new gi[e]).init(i,l.rawVars?n[e]:Ume(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=c=new ti(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Wd))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=c;return l},Gl,PS,cE=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,c=s.lazy,d=s.onUpdate,f=s.runBackwards,h=s.yoyoEase,m=s.keyframes,v=s.autoRevert,y=e._dur,_=e._startAt,b=e._targets,x=e.parent,k=x&&x.data==="nested"?x.vars.targets:b,C=e._overwrite==="auto"&&!J6,P=e.timeline,R=s.easeReverse||h,O,I,A,M,L,z,$,q,X,K,H,ee,V;if(P&&(!m||!i)&&(i="none"),e._ease=Iu(i,pm.ease),e._rEase=R&&(Iu(R)||e._ease),e._from=!P&&!!s.runBackwards,e._from&&(e.ratio=1),!P||m&&!s.stagger){if(q=b[0]?Ru(b[0]).harness:0,ee=q&&s[q.prop],O=_1(s,sE),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!v?_.render(-1,!0):_.revert(f&&y?uv:gme),_._lazy=0),o){if(gc(e._startAt=wr.set(b,Ri({data:"isStart",overwrite:!1,parent:x,immediateRender:!0,lazy:!_&&Js(c),startAt:null,delay:0,onUpdate:d&&function(){return bi(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(ts||!l&&!v)&&e._startAt.revert(uv),l&&y&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&y&&!_){if(n&&(l=!1),A=Ri({overwrite:!1,data:"isFromStart",lazy:l&&!_&&Js(c),immediateRender:l,stagger:0,parent:x},O),ee&&(A[q.prop]=ee),gc(e._startAt=wr.set(b,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(ts?e._startAt.revert(uv):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,wn,wn);else if(!n)return}for(e._pt=e._ptCache=0,c=y&&Js(c)||c&&!y,I=0;I<b.length;I++){if(L=b[I],$=L._gsap||oE(b)[I]._gsap,e._ptLookup[I]=K={},xS[$.id]&&rc.length&&y1(),H=k===b?I:k.indexOf(L),q&&(X=new q).init(L,ee||O,e,H,k)!==!1&&(e._pt=M=new ti(e._pt,L,X.name,0,1,X.render,X,0,X.priority),X._props.forEach(function(Q){K[Q]=M}),X.priority&&(z=1)),!q||ee)for(A in O)gi[A]&&(X=Uj(A,O,e,H,L,k))?X.priority&&(z=1):K[A]=M=lE.call(e,L,A,"get",O[A],H,k,0,s.stringFilter);e._op&&e._op[I]&&e.kill(L,e._op[I]),C&&e._pt&&(Gl=e,qn.killTweensOf(L,K,e.globalTime(n)),V=!e.parent,Gl=0),e._pt&&c&&(xS[$.id]=1)}z&&qj(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!V,m&&n<=0&&P.render(qi,!0,!0)},Bme=function(e,n,r,s,i,o,l,c){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,h,m,v;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,v=e._targets.length;v--;){if(f=m[v][n],f&&f.d&&f.d._pt)for(f=f.d._pt;f&&f.p!==n&&f.fp!==n;)f=f._next;if(!f)return PS=1,e.vars[n]="+=0",cE(e,l),PS=0,c?mm(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(v=d.length;v--;)h=d[v],f=h._pt||h,f.s=(s||s===0)&&!i?s:f.s+(s||0)+o*f.c,f.c=r-f.s,h.e&&(h.e=fr(r)+vs(h.e)),h.b&&(h.b=f.s+vs(h.b))},Zme=function(e,n){var r=e[0]?Ru(e[0]).harness:0,s=r&&r.aliases,i,o,l,c;if(!s)return n;i=zf({},n);for(o in s)if(o in i)for(c=s[o].split(","),l=c.length;l--;)i[c[l]]=i[o];return i},Wme=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(ws(n))l=r[e]||(r[e]=[]),n.forEach(function(c,d){return l.push({t:d/(n.length-1)*100,v:c,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},Np=function(e,n,r,s,i){return ar(e)?e.call(n,r,s,i):Zr(e)&&~e.indexOf("random(")?vm(e):e},x1=iE+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Bj={};ei(x1+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return Bj[t]=1});x1=x1.split(",");var wr=(function(t){fj(e,t);function e(r,s,i,o){var l;typeof s=="number"&&(i.duration=s,s=i,i=null),l=t.call(this,o?s:Op(s))||this;var c=l.vars,d=c.duration,f=c.delay,h=c.immediateRender,m=c.stagger,v=c.overwrite,y=c.keyframes,_=c.defaults,b=c.scrollTrigger,x=s.parent||qn,k=(ws(r)||pj(r)?tl(r[0]):"length"in s)?[r]:Gi(r),C,P,R,O,I,A,M,L;if(l._targets=k.length?oE(k):mm("GSAP target "+r+" not found. https://gsap.com",!Ei.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,y||m||Ig(d)||Ig(f)){s=l.vars;var z=s.easeReverse||s.yoyoEase;if(C=l.timeline=new Ks({data:"nested",defaults:_||{},targets:x&&x.data==="nested"?x.vars.targets:k}),C.kill(),C.parent=C._dp=$a(l),C._start=0,m||Ig(d)||Ig(f)){if(O=k.length,M=m&&Ij(m),ha(m))for(I in m)~x1.indexOf(I)&&(L||(L={}),L[I]=m[I]);for(P=0;P<O;P++)R=_1(s,Bj),R.stagger=0,z&&(R.easeReverse=z),L&&zf(R,L),A=k[P],R.duration=+Np(d,$a(l),P,A,k),R.delay=(+Np(f,$a(l),P,A,k)||0)-l._delay,!m&&O===1&&R.delay&&(l._delay=f=R.delay,l._start+=f,R.delay=0),C.to(A,R,M?M(P,A,k):0),C._ease=Ht.none;C.duration()?d=f=0:l.timeline=0}else if(y){Op(Ri(C.vars.defaults,{ease:"none"})),C._ease=Iu(y.ease||s.ease||"none");var $=0,q,X,K;if(ws(y))y.forEach(function(H){return C.to(k,H,">")}),C.duration();else{R={};for(I in y)I==="ease"||I==="easeEach"||Wme(I,y[I],R,y.easeEach);for(I in R)for(q=R[I].sort(function(H,ee){return H.t-ee.t}),$=0,P=0;P<q.length;P++)X=q[P],K={ease:X.e,duration:(X.t-(P?q[P-1].t:0))/100*d},K[I]=X.v,C.to(k,K,$),$+=K.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return v===!0&&!J6&&(Gl=$a(l),qn.killTweensOf(k),Gl=0),Qo(x,$a(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(h||!d&&!y&&l._start===Kn(x._time)&&Js(h)&&xme($a(l))&&x.data!=="nested")&&(l._tTime=-wn,l.render(Math.max(0,-f)||0)),b&&Pj($a(l),b),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,c=this._tDur,d=this._dur,f=s<0,h=s>c-wn&&!f?c:s<wn?0:s,m,v,y,_,b,x,k,C;if(!d)kme(this,s,i,o);else if(h!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(m=h,C=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(_*100+s,i,o);if(m=Kn(h%_),h===c?(y=this._repeat,m=d):(b=Kn(h/_),y=~~b,y&&y===b?(m=d,y--):m>d&&(m=d)),x=this._yoyo&&y&1,x&&(m=d-m),b=Vf(this._tTime,_),m===l&&!o&&this._initted&&y===b)return this._tTime=h,this;y!==b&&this.vars.repeatRefresh&&!x&&!this._lock&&m!==_&&this._initted&&(this._lock=o=1,this.render(Kn(_*y),!0).invalidate()._lock=0)}if(!this._initted){if(Tj(this,f?s:m,o,i,h))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&y!==b))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var P=m<l;if(P!==this._inv){var R=P?l:d-l;this._inv=P,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=R?(P?-1:1)/R:0,this._invScale=P?-this.ratio:1-this.ratio,this._invEase=P?this._rEase:this._ease}this.ratio=k=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(m/d);if(this._from&&(this.ratio=k=1-k),this._tTime=h,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&h&&!i&&!b&&(bi(this,"onStart"),this._tTime!==h))return this;for(v=this._pt;v;)v.r(k,v.d),v=v._next;C&&C.render(s<0?s:C._dur*C._ease(m/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&SS(this,s,i,o),bi(this,"onUpdate")),this._repeat&&y!==b&&this.vars.onRepeat&&!i&&this.parent&&bi(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(f&&!this._onUpdate&&SS(this,s,!0,!0),(s||!d)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&gc(this,1),!i&&!(f&&!l)&&(h||l||x)&&(bi(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,o,l,c){ym||wi.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||cE(this,d),f=this._ease(d/this._dur),Bme(this,s,i,o,l,f,d,c)?this.resetTo(s,i,o,l,1):(my(this,0),this.parent||Ej(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(s,i){if(i===void 0&&(i="all"),!s&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?up(this):this.scrollTrigger&&this.scrollTrigger.kill(!!ts),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Gl&&Gl.vars.overwrite!==!0)._first||up(this),this.parent&&o!==this.timeline.totalDuration()&&Hf(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,c=s?Gi(s):l,d=this._ptLookup,f=this._pt,h,m,v,y,_,b,x;if((!i||i==="all")&&wme(l,c))return i==="all"&&(this._pt=0),up(this);for(h=this._op=this._op||[],i!=="all"&&(Zr(i)&&(_={},ei(i,function(k){return _[k]=1}),i=_),i=Zme(l,i)),x=l.length;x--;)if(~c.indexOf(l[x])){m=d[x],i==="all"?(h[x]=i,y=m,v={}):(v=h[x]=h[x]||{},y=i);for(_ in y)b=m&&m[_],b&&((!("kill"in b.d)||b.d.kill(_)===!0)&&hy(this,b,"_pt"),delete m[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&f&&up(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Mp(1,arguments)},e.delayedCall=function(s,i,o,l){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:l})},e.fromTo=function(s,i,o){return Mp(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,o){return qn.killTweensOf(s,i,o)},e})(_m);Ri(wr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ei("staggerTo,staggerFrom,staggerFromTo",function(t){wr[t]=function(){var e=new Ks,n=kS.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var uE=function(e,n,r){return e[n]=r},Zj=function(e,n,r){return e[n](r)},Kme=function(e,n,r,s){return e[n](s.fp,r)},qme=function(e,n,r){return e.setAttribute(n,r)},dE=function(e,n){return ar(e[n])?Zj:eE(e[n])&&e.setAttribute?qme:uE},Wj=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},Gme=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},Kj=function(e,n){var r=n._pt,s="";if(!e&&n.b)s=n.b;else if(e===1&&n.e)s=n.e;else{for(;r;)s=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+s,r=r._next;s+=n.c}n.set(n.t,n.p,s,n)},fE=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},Yme=function(e,n,r,s){for(var i=this._pt,o;i;)o=i._next,i.p===s&&i.modifier(e,n,r),i=o},Xme=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?hy(this,n,"_pt"):n.dep||(r=1),n=s;return!r},Qme=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},qj=function(e){for(var n=e._pt,r,s,i,o;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:o)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:o=n,n=r}e._pt=i},ti=(function(){function t(n,r,s,i,o,l,c,d,f){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||Wj,this.d=c||this,this.set=d||uE,this.pr=f||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=Qme,this.m=r,this.mt=i,this.tween=s},t})();ei(iE+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(t){return sE[t]=1});Ti.TweenMax=Ti.TweenLite=wr;Ti.TimelineLite=Ti.TimelineMax=Ks;qn=new Ks({sortChildren:!1,defaults:pm,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ei.stringFilter=zj;var Ou=[],fv={},Jme=[],v4=0,e0e=0,Bw=function(e){return(fv[e]||Jme).map(function(n){return n()})},wm=function(){var e=Date.now(),n=[];e-v4>2&&(Bw("matchMediaInit"),Ou.forEach(function(r){var s=r.queries,i=r.conditions,o,l,c,d;for(l in s)o=Zo.matchMedia(s[l]).matches,o&&(c=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),c&&n.push(r))}),Bw("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),v4=e,Bw("matchMedia"))},Gj=(function(){function t(n,r){this.selector=r&&ES(r),this.data=[],this._r=[],this.isReverted=!1,this.id=e0e++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){ar(r)&&(i=s,s=r,r=ar);var o=this,l=function(){var d=Hn,f=o.selector,h;return d&&d!==o&&d.data.push(o),i&&(o.selector=ES(i)),Hn=o,h=s.apply(o,arguments),ar(h)&&o._r.push(h),Hn=d,o.selector=f,o.isReverted=!1,h};return o.last=l,r===ar?l(o,function(c){return o.add(null,c)}):r?o[r]=l:l},e.ignore=function(r){var s=Hn;Hn=null,r(this),Hn=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof wr&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var l=i.getTweens(),c=i.data.length,d;c--;)d=i.data[c],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(f){return l.splice(l.indexOf(f),1)}));for(l.map(function(f){return{g:f._dur||f._delay||f._sat&&!f._sat.vars.immediateRender?f.globalTime(0):-1/0,t:f}}).sort(function(f,h){return h.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),c=i.data.length;c--;)d=i.data[c],d instanceof Ks?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof wr)&&d.revert&&d.revert(r);i._r.forEach(function(f){return f(r,i)}),i.isReverted=!0})():this.data.forEach(function(l){return l.kill&&l.kill()}),this.clear(),s){for(var o=Ou.length;o--;)Ou[o].id===this.id&&Ou.splice(o,1);this._mqs&&this._mqs.forEach(function(l){return l.removeListener?l.removeListener(wm):l.removeEventListener("change",wm)}),this._mqs=null}},e.revert=function(r){this.kill(r||{})},t})(),t0e=(function(){function t(n){this.contexts=[],this.scope=n,Hn&&Hn.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){ha(r)||(r={matches:r});var o=new Gj(0,i||this.scope),l=o.conditions={},c,d,f;Hn&&!o.selector&&(o.selector=Hn.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(c=Zo.matchMedia(r[d]),c&&(Ou.indexOf(o)<0&&Ou.push(o),(l[d]=c.matches)&&(f=1),c.addListener?c.addListener(wm):c.addEventListener("change",wm),(o._mqs||(o._mqs=[])).push(c)));return f&&s(o,function(h){return o.add(null,h)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),S1={registerPlugin:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(s){return $j(s)})},timeline:function(e){return new Ks(e)},getTweensOf:function(e,n){return qn.getTweensOf(e,n)},getProperty:function(e,n,r,s){Zr(e)&&(e=Gi(e)[0]);var i=Ru(e||{}).get,o=r?kj:Sj;return r==="native"&&(r=""),e&&(n?o((gi[n]&&gi[n].get||i)(e,n,r,s)):function(l,c,d){return o((gi[l]&&gi[l].get||i)(e,l,c,d))})},quickSetter:function(e,n,r){if(e=Gi(e),e.length>1){var s=e.map(function(f){return ri.quickSetter(f,n,r)}),i=s.length;return function(f){for(var h=i;h--;)s[h](f)}}e=e[0]||{};var o=gi[n],l=Ru(e),c=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var h=new o;Wd._pt=0,h.init(e,r?f+r:f,Wd,0,[e]),h.render(1,h),Wd._pt&&fE(1,Wd)}:l.set(e,c);return o?d:function(f){return d(e,c,r?f+r:f,l,1)}},quickTo:function(e,n,r){var s,i=ri.to(e,Ri((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(c,d,f){return i.resetTo(n,c,d,f)};return o.tween=i,o},isTweening:function(e){return qn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Iu(e.ease,pm.ease)),f4(pm,e||{})},config:function(e){return f4(Ei,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,o=e.extendTimeline;(s||"").split(",").forEach(function(l){return l&&!gi[l]&&!Ti[l]&&mm(n+" effect requires "+l+" plugin.")}),zw[n]=function(l,c,d){return r(Gi(l),Ri(c||{},i),d)},o&&(Ks.prototype[n]=function(l,c,d){return this.add(zw[n](l,ha(c)?c:(d=c)&&{},this),d)})},registerEase:function(e,n){Ht[e]=Iu(n)},parseEase:function(e,n){return arguments.length?Iu(e,n):Ht},getById:function(e){return qn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Ks(e),s,i;for(r.smoothChildTiming=Js(e.smoothChildTiming),qn.remove(r),r._dp=0,r._time=r._tTime=qn._time,s=qn._first;s;)i=s._next,(n||!(!s._dur&&s instanceof wr&&s.vars.onComplete===s._targets[0]))&&Qo(r,s,s._start-s._delay),s=i;return Qo(qn,r,0),r},context:function(e,n){return e?new Gj(e,n):Hn},matchMedia:function(e){return new t0e(e)},matchMediaRefresh:function(){return Ou.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||wm()},addEventListener:function(e,n){var r=fv[e]||(fv[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=fv[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:Ome,wrapYoyo:Mme,distribute:Ij,random:Mj,snap:Oj,normalize:Ime,getUnit:vs,clamp:Pme,splitColor:Fj,toArray:Gi,selector:ES,mapRange:Lj,pipe:Rme,unitize:Ame,interpolate:Nme,shuffle:Aj},install:yj,effects:zw,ticker:wi,updateRoot:Ks.updateRoot,plugins:gi,globalTimeline:qn,core:{PropTween:ti,globals:_j,Tween:wr,Timeline:Ks,Animation:_m,getCache:Ru,_removeLinkedListItem:hy,reverting:function(){return ts},context:function(e){return e&&Hn&&(Hn.data.push(e),e._ctx=Hn),Hn},suppressOverwrites:function(e){return J6=e}}};ei("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return S1[t]=wr[t]});wi.add(Ks.updateRoot);Wd=S1.to({},{duration:0});var n0e=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},r0e=function(e,n){var r=e._targets,s,i,o;for(s in n)for(i=r.length;i--;)o=e._ptLookup[i][s],o&&(o=o.d)&&(o._pt&&(o=n0e(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},Zw=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var c,d;if(Zr(i)&&(c={},ei(i,function(f){return c[f]=1}),i=c),n){c={};for(d in i)c[d]=n(i[d]);i=c}r0e(l,i)}}}},ri=S1.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,c;this.tween=r;for(o in n)c=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(c||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=c,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)ts?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,n){for(var r=n.length;r--;)this.add(e,r,e[r]||0,n[r],0,0,0,0,0,1)}},Zw("roundProps",CS),Zw("modifiers"),Zw("snap",Oj))||S1;wr.version=Ks.version=ri.version="3.15.1";vj=1;tE()&&Uf();Ht.Power0;Ht.Power1;Ht.Power2;Ht.Power3;Ht.Power4;Ht.Linear;Ht.Quad;Ht.Cubic;Ht.Quart;Ht.Quint;Ht.Strong;Ht.Elastic;Ht.Back;Ht.SteppedEase;Ht.Bounce;Ht.Sine;Ht.Expo;Ht.Circ;/*!
207
- * CSSPlugin 3.15.1
208
- * https://gsap.com
209
- *
210
- * Copyright 2008-2026, GreenSock. All rights reserved.
211
- * Subject to the terms at https://gsap.com/standard-license
212
- * @author: Jack Doyle, jack@greensock.com
213
- */var y4,Yl,nf,hE,cu,_4,pE,s0e=function(){return typeof window<"u"},nl={},iu=180/Math.PI,rf=Math.PI/180,Ad=Math.atan2,w4=1e8,mE=/([A-Z])/g,i0e=/(left|right|width|margin|padding|x)/i,o0e=/[\s,\(]\S/,ta={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},TS=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},a0e=function(e,n){return n.set(n.t,n.p,e===1?n.e:Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},l0e=function(e,n){return n.set(n.t,n.p,e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},c0e=function(e,n){return n.set(n.t,n.p,e===1?n.e:e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},u0e=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},Yj=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},Xj=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},d0e=function(e,n,r){return e.style[n]=r},f0e=function(e,n,r){return e.style.setProperty(n,r)},h0e=function(e,n,r){return e._gsap[n]=r},p0e=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},m0e=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},g0e=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},Gn="transform",ni=Gn+"Origin",v0e=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in nl&&i){if(this.tfm=this.tfm||{},e!=="transform")e=ta[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=Fa(s,l)}):this.tfm[e]=o.x?o[e]:Fa(s,e),e===ni&&(this.tfm.zOrigin=o.zOrigin);else return ta.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(Gn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(ni,n,"")),e=Gn}(i||n)&&this.props.push(e,n,i[e])},Qj=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},y0e=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(mE,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=pE(),(!i||!i.isStart)&&!r[Gn]&&(Qj(r),s.zOrigin&&r[ni]&&(r[ni]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},Jj=function(e,n){var r={target:e,props:[],revert:y0e,save:v0e};return e._gsap||ri.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},e7,RS=function(e,n){var r=Yl.createElementNS?Yl.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Yl.createElement(e);return r&&r.style?r:Yl.createElement(e)},xi=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(mE,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Bf(n)||n,1)||""},b4="O,Moz,ms,Ms,Webkit".split(","),Bf=function(e,n,r){var s=n||cu,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(b4[o]+e in i););return o<0?null:(o===3?"ms":o>=0?b4[o]:"")+e},AS=function(){s0e()&&window.document&&(y4=window,Yl=y4.document,nf=Yl.documentElement,cu=RS("div")||{style:{}},RS("div"),Gn=Bf(Gn),ni=Gn+"Origin",cu.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",e7=!!Bf("perspective"),pE=ri.core.reverting,hE=1)},x4=function(e){var n=e.ownerSVGElement,r=RS("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),nf.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),nf.removeChild(r),i},S4=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},t7=function(e){var n,r;try{n=e.getBBox()}catch{n=x4(e),r=1}return n&&(n.width||n.height)||r||(n=x4(e)),n&&!n.width&&!n.x&&!n.y?{x:+S4(e,["x","cx","x1"])||0,y:+S4(e,["y","cy","y1"])||0,width:0,height:0}:n},n7=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&t7(e))},vc=function(e,n){if(n){var r=e.style,s;n in nl&&n!==ni&&(n=Gn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(mE,"-$1").toLowerCase())):r.removeAttribute(n)}},Xl=function(e,n,r,s,i,o){var l=new ti(e._pt,n,r,0,1,o?Xj:Yj);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},k4={deg:1,rad:1,turn:1},_0e={grid:1,flex:1},yc=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=cu.style,c=i0e.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(c?"Width":"Height"),h=100,m=s==="px",v=s==="%",y,_,b,x;if(s===o||!i||k4[s]||k4[o])return i;if(o!=="px"&&!m&&(i=t(e,n,r,"px")),x=e.getCTM&&n7(e),(v||o==="%")&&(nl[n]||~n.indexOf("adius")))return y=x?e.getBBox()[c?"width":"height"]:e[f],fr(v?i/y*h:i/100*y);if(l[c?"width":"height"]=h+(m?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,x&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Yl||!_.appendChild)&&(_=Yl.body),b=_._gsap,b&&v&&b.width&&c&&b.time===wi.time&&!b.uncache)return fr(i/b.width*h);if(v&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=h+s,y=e[f],k?e.style[n]=k:vc(e,n)}else(v||o==="%")&&!_0e[xi(_,"display")]&&(l.position=xi(e,"position")),_===e&&(l.position="static"),_.appendChild(cu),y=cu[f],_.removeChild(cu),l.position="absolute";return c&&v&&(b=Ru(_),b.time=wi.time,b.width=_[f]),fr(m?y*i/h:y&&i?h/y*i:0)},Fa=function(e,n,r,s){var i;return hE||AS(),n in ta&&n!=="transform"&&(n=ta[n],~n.indexOf(",")&&(n=n.split(",")[0])),nl[n]&&n!=="transform"?(i=xm(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:E1(xi(e,ni))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=k1[n]&&k1[n](e,n,r)||xi(e,n)||bj(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?yc(e,n,i,r)+r:i},w0e=function(e,n,r,s){if(!r||r==="none"){var i=Bf(n,e,1),o=i&&xi(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=xi(e,"borderTopColor"))}var l=new ti(this._pt,e.style,n,0,1,Kj),c=0,d=0,f,h,m,v,y,_,b,x,k,C,P,R;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=xi(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=xi(e,n)||s,_?e.style[n]=_:vc(e,n)),f=[r,s],zj(f),r=f[0],s=f[1],m=r.match(Zd)||[],R=s.match(Zd)||[],R.length){for(;h=Zd.exec(s);)b=h[0],k=s.substring(c,h.index),y?y=(y+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(y=1),b!==(_=m[d++]||"")&&(v=parseFloat(_)||0,P=_.substr((v+"").length),b.charAt(1)==="="&&(b=tf(v,b)+P),x=parseFloat(b),C=b.substr((x+"").length),c=Zd.lastIndex-C.length,C||(C=C||Ei.units[n]||P,c===s.length&&(s+=C,l.e+=C)),P!==C&&(v=yc(e,n,_,C)||0),l._pt={_next:l._pt,p:k||d===1?k:",",s:v,c:x-v,m:y&&y<4||n==="zIndex"?Math.round:0});l.c=c<s.length?s.substring(c,s.length):""}else l.r=n==="display"&&s==="none"?Xj:Yj;return gj.test(s)&&(l.e=0),this._pt=l,l},E4={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},b0e=function(e){var n=e.split(" "),r=n[0],s=n[1]||"50%";return(r==="top"||r==="bottom"||s==="left"||s==="right")&&(e=r,r=s,s=e),n[0]=E4[r]||r,n[1]=E4[s]||s,n.join(" ")},x0e=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,o=r._gsap,l,c,d;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],nl[l]&&(c=1,l=l==="transformOrigin"?ni:Gn),vc(r,l);c&&(vc(r,Gn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",xm(r,1),o.uncache=1,Qj(s)))}},k1={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new ti(e._pt,n,r,0,0,x0e);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},bm=[1,0,0,1,0,0],r7={},s7=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},C4=function(e){var n=xi(e,Gn);return s7(n)?bm:n.substr(7).match(mj).map(fr)},gE=function(e,n){var r=e._gsap||Ru(e),s=e.style,i=C4(e),o,l,c,d;return r.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?bm:i):(i===bm&&!e.offsetParent&&e!==nf&&!r.svg&&(c=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,nf.appendChild(e)),i=C4(e),c?s.display=c:vc(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):nf.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},IS=function(e,n,r,s,i,o){var l=e._gsap,c=i||gE(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,h=l.xOffset||0,m=l.yOffset||0,v=c[0],y=c[1],_=c[2],b=c[3],x=c[4],k=c[5],C=n.split(" "),P=parseFloat(C[0])||0,R=parseFloat(C[1])||0,O,I,A,M;r?c!==bm&&(I=v*b-y*_)&&(A=P*(b/I)+R*(-_/I)+(_*k-b*x)/I,M=P*(-y/I)+R*(v/I)-(v*k-y*x)/I,P=A,R=M):(O=t7(e),P=O.x+(~C[0].indexOf("%")?P/100*O.width:P),R=O.y+(~(C[1]||C[0]).indexOf("%")?R/100*O.height:R)),s||s!==!1&&l.smooth?(x=P-d,k=R-f,l.xOffset=h+(x*v+k*_)-x,l.yOffset=m+(x*y+k*b)-k):l.xOffset=l.yOffset=0,l.xOrigin=P,l.yOrigin=R,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[ni]="0px 0px",o&&(Xl(o,l,"xOrigin",d,P),Xl(o,l,"yOrigin",f,R),Xl(o,l,"xOffset",h,l.xOffset),Xl(o,l,"yOffset",m,l.yOffset)),e.setAttribute("data-svg-origin",P+" "+R)},xm=function(e,n){var r=e._gsap||new Hj(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",c=getComputedStyle(e),d=xi(e,ni)||"0",f,h,m,v,y,_,b,x,k,C,P,R,O,I,A,M,L,z,$,q,X,K,H,ee,V,Q,B,D,G,fe,ie,ue;return f=h=m=_=b=x=k=C=P=0,v=y=1,r.svg=!!(e.getCTM&&n7(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[Gn]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[Gn]!=="none"?c[Gn]:"")),s.scale=s.rotate=s.translate="none"),I=gE(e,r.svg),r.svg&&(r.uncache?(V=e.getBBox(),d=r.xOrigin-V.x+"px "+(r.yOrigin-V.y)+"px",ee=""):ee=!n&&e.getAttribute("data-svg-origin"),IS(e,ee||d,!!ee||r.originIsAbsolute,r.smooth!==!1,I)),R=r.xOrigin||0,O=r.yOrigin||0,I!==bm&&(z=I[0],$=I[1],q=I[2],X=I[3],f=K=I[4],h=H=I[5],I.length===6?(v=Math.sqrt(z*z+$*$),y=Math.sqrt(X*X+q*q),_=z||$?Ad($,z)*iu:0,k=q||X?Ad(q,X)*iu+_:0,k&&(y*=Math.abs(Math.cos(k*rf))),r.svg&&(f-=R-(R*z+O*q),h-=O-(R*$+O*X))):(ue=I[6],fe=I[7],B=I[8],D=I[9],G=I[10],ie=I[11],f=I[12],h=I[13],m=I[14],A=Ad(ue,G),b=A*iu,A&&(M=Math.cos(-A),L=Math.sin(-A),ee=K*M+B*L,V=H*M+D*L,Q=ue*M+G*L,B=K*-L+B*M,D=H*-L+D*M,G=ue*-L+G*M,ie=fe*-L+ie*M,K=ee,H=V,ue=Q),A=Ad(-q,G),x=A*iu,A&&(M=Math.cos(-A),L=Math.sin(-A),ee=z*M-B*L,V=$*M-D*L,Q=q*M-G*L,ie=X*L+ie*M,z=ee,$=V,q=Q),A=Ad($,z),_=A*iu,A&&(M=Math.cos(A),L=Math.sin(A),ee=z*M+$*L,V=K*M+H*L,$=$*M-z*L,H=H*M-K*L,z=ee,K=V),b&&Math.abs(b)+Math.abs(_)>359.9&&(b=_=0,x=180-x),v=fr(Math.sqrt(z*z+$*$+q*q)),y=fr(Math.sqrt(H*H+ue*ue)),A=Ad(K,H),k=Math.abs(A)>2e-4?A*iu:0,P=ie?1/(ie<0?-ie:ie):0),r.svg&&(ee=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!s7(xi(e,Gn)),ee&&e.setAttribute("transform",ee))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(v*=-1,k+=_<=0?180:-180,_+=_<=0?180:-180):(y*=-1,k+=k<=0?180:-180)),n=n||r.uncache,r.x=f-((r.xPercent=f&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-f)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+o,r.y=h-((r.yPercent=h&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=m+o,r.scaleX=fr(v),r.scaleY=fr(y),r.rotation=fr(_)+l,r.rotationX=fr(b)+l,r.rotationY=fr(x)+l,r.skewX=k+l,r.skewY=C+l,r.transformPerspective=P+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[ni]=E1(d)),r.xOffset=r.yOffset=0,r.force3D=Ei.force3D,r.renderTransform=r.svg?k0e:e7?i7:S0e,r.uncache=0,r},E1=function(e){return(e=e.split(" "))[0]+" "+e[1]},Ww=function(e,n,r){var s=vs(n);return fr(parseFloat(n)+parseFloat(yc(e,"x",r+"px",s)))+s},S0e=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,i7(e,n)},Jc="0deg",Gh="0px",eu=") ",i7=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,c=r.z,d=r.rotation,f=r.rotationY,h=r.rotationX,m=r.skewX,v=r.skewY,y=r.scaleX,_=r.scaleY,b=r.transformPerspective,x=r.force3D,k=r.target,C=r.zOrigin,P="",R=x==="auto"&&e&&e!==1||x===!0;if(C&&(h!==Jc||f!==Jc)){var O=parseFloat(f)*rf,I=Math.sin(O),A=Math.cos(O),M;O=parseFloat(h)*rf,M=Math.cos(O),o=Ww(k,o,I*M*-C),l=Ww(k,l,-Math.sin(O)*-C),c=Ww(k,c,A*M*-C+C)}b!==Gh&&(P+="perspective("+b+eu),(s||i)&&(P+="translate("+s+"%, "+i+"%) "),(R||o!==Gh||l!==Gh||c!==Gh)&&(P+=c!==Gh||R?"translate3d("+o+", "+l+", "+c+") ":"translate("+o+", "+l+eu),d!==Jc&&(P+="rotate("+d+eu),f!==Jc&&(P+="rotateY("+f+eu),h!==Jc&&(P+="rotateX("+h+eu),(m!==Jc||v!==Jc)&&(P+="skew("+m+", "+v+eu),(y!==1||_!==1)&&(P+="scale("+y+", "+_+eu),k.style[Gn]=P||"translate(0, 0)"},k0e=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,c=r.rotation,d=r.skewX,f=r.skewY,h=r.scaleX,m=r.scaleY,v=r.target,y=r.xOrigin,_=r.yOrigin,b=r.xOffset,x=r.yOffset,k=r.forceCSS,C=parseFloat(o),P=parseFloat(l),R,O,I,A,M;c=parseFloat(c),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,c+=f),c||d?(c*=rf,d*=rf,R=Math.cos(c)*h,O=Math.sin(c)*h,I=Math.sin(c-d)*-m,A=Math.cos(c-d)*m,d&&(f*=rf,M=Math.tan(d-f),M=Math.sqrt(1+M*M),I*=M,A*=M,f&&(M=Math.tan(f),M=Math.sqrt(1+M*M),R*=M,O*=M)),R=fr(R),O=fr(O),I=fr(I),A=fr(A)):(R=h,A=m,O=I=0),(C&&!~(o+"").indexOf("px")||P&&!~(l+"").indexOf("px"))&&(C=yc(v,"x",o,"px"),P=yc(v,"y",l,"px")),(y||_||b||x)&&(C=fr(C+y-(y*R+_*I)+b),P=fr(P+_-(y*O+_*A)+x)),(s||i)&&(M=v.getBBox(),C=fr(C+s/100*M.width),P=fr(P+i/100*M.height)),M="matrix("+R+","+O+","+I+","+A+","+C+","+P+")",v.setAttribute("transform",M),k&&(v.style[Gn]=M)},E0e=function(e,n,r,s,i){var o=360,l=Zr(i),c=parseFloat(i)*(l&&~i.indexOf("rad")?iu:1),d=c-s,f=s+d+"deg",h,m;return l&&(h=i.split("_")[1],h==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),h==="cw"&&d<0?d=(d+o*w4)%o-~~(d/o)*o:h==="ccw"&&d>0&&(d=(d-o*w4)%o-~~(d/o)*o)),e._pt=m=new ti(e._pt,n,r,s,d,a0e),m.e=f,m.u="deg",e._props.push(r),m},P4=function(e,n){for(var r in n)e[r]=n[r];return e},C0e=function(e,n,r){var s=P4({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,c,d,f,h,m,v,y;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[Gn]=n,l=xm(r,1),vc(r,Gn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Gn],o[Gn]=n,l=xm(r,1),o[Gn]=d);for(c in nl)d=s[c],f=l[c],d!==f&&i.indexOf(c)<0&&(v=vs(d),y=vs(f),h=v!==y?yc(r,c,d,y):parseFloat(d),m=parseFloat(f),e._pt=new ti(e._pt,l,c,h,m-h,TS),e._pt.u=y||0,e._props.push(c));P4(l,s)};ei("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",o=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(l){return e<2?t+l:"border"+l+t});k1[e>1?"border"+t:t]=function(l,c,d,f,h){var m,v;if(arguments.length<4)return m=o.map(function(y){return Fa(l,y,d)}),v=m.join(" "),v.split(m[0]).length===5?m[0]:v;m=(f+"").split(" "),v={},o.forEach(function(y,_){return v[y]=m[_]=m[_]||m[(_-1)/2|0]}),l.init(c,v,h)}});var o7={name:"css",register:AS,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,c=r.vars.startAt,d,f,h,m,v,y,_,b,x,k,C,P,R,O,I,A,M;hE||AS(),this.styles=this.styles||Jj(e),A=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(gi[_]&&Uj(_,n,r,s,e,i)))){if(v=typeof f,y=k1[_],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=vm(f)),y)y(this,e,_,f,r)&&(I=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",sc.lastIndex=0,sc.test(d)||(b=vs(d),x=vs(f),x?b!==x&&(d=yc(e,_,d,x)+x):b&&(f+=b)),this.add(l,"setProperty",d,f,s,i,0,0,_),o.push(_),A.push(_,0,l[_]);else if(v!=="undefined"){if(c&&_ in c?(d=typeof c[_]=="function"?c[_].call(r,s,e,i):c[_],Zr(d)&&~d.indexOf("random(")&&(d=vm(d)),vs(d+"")||d==="auto"||(d+=Ei.units[_]||vs(Fa(e,_))||""),(d+"").charAt(1)==="="&&(d=Fa(e,_))):d=Fa(e,_),m=parseFloat(d),k=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),k&&(f=f.substr(2)),h=parseFloat(f),_ in ta&&(_==="autoAlpha"&&(m===1&&Fa(e,"visibility")==="hidden"&&h&&(m=0),A.push("visibility",0,l.visibility),Xl(this,l,"visibility",m?"inherit":"hidden",h?"inherit":"hidden",!h)),_!=="scale"&&_!=="transform"&&(_=ta[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in nl,C){if(this.styles.save(_),M=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=xi(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var L=e.style.perspective;e.style.perspective=f,f=xi(e,"perspective"),L?e.style.perspective=L:vc(e,"perspective")}h=parseFloat(f)}if(P||(R=e._gsap,R.renderTransform&&!n.parseTransform||xm(e,n.parseTransform),O=n.smoothOrigin!==!1&&R.smooth,P=this._pt=new ti(this._pt,l,Gn,0,1,R.renderTransform,R,0,-1),P.dep=1),_==="scale")this._pt=new ti(this._pt,R,"scaleY",R.scaleY,(k?tf(R.scaleY,k+h):h)-R.scaleY||0,TS),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){A.push(ni,0,l[ni]),f=b0e(f),R.svg?IS(e,f,0,O,0,this):(x=parseFloat(f.split(" ")[2])||0,x!==R.zOrigin&&Xl(this,R,"zOrigin",R.zOrigin,x),Xl(this,l,_,E1(d),E1(f)));continue}else if(_==="svgOrigin"){IS(e,f,1,O,0,this);continue}else if(_ in r7){E0e(this,R,_,m,k?tf(m,k+f):f);continue}else if(_==="smoothOrigin"){Xl(this,R,"smooth",R.smooth,f);continue}else if(_==="force3D"){R[_]=f;continue}else if(_==="transform"){C0e(this,f,e);continue}}else _ in l||(_=Bf(_)||_);if(C||(h||h===0)&&(m||m===0)&&!o0e.test(f)&&_ in l)b=(d+"").substr((m+"").length),h||(h=0),x=vs(f)||(_ in Ei.units?Ei.units[_]:b),b!==x&&(m=yc(e,_,d,x)),this._pt=new ti(this._pt,C?R:l,_,m,(k?tf(m,k+h):h)-m,!C&&(x==="px"||_==="zIndex")&&n.autoRound!==!1?u0e:TS),this._pt.u=x||0,C&&M!==f?(this._pt.b=d,this._pt.e=M,this._pt.r=c0e):b!==x&&x!=="%"&&(this._pt.b=d,this._pt.r=l0e);else if(_ in l)w0e.call(this,e,_,d,k?k+f:f);else if(_ in e)this.add(e,_,d||e[_],k?k+f:f,s,i);else if(_!=="parseTransform"){rE(_,f);continue}C||(_ in l?A.push(_,0,l[_]):typeof e[_]=="function"?A.push(_,2,e[_]()):A.push(_,1,d||e[_])),o.push(_)}}I&&qj(this)},render:function(e,n){if(n.tween._time||!pE())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Fa,aliases:ta,getSetter:function(e,n,r){var s=ta[n];return s&&s.indexOf(",")<0&&(n=s),n in nl&&n!==ni&&(e._gsap.x||Fa(e,"x"))?r&&_4===r?n==="scale"?p0e:h0e:(_4=r||{})&&(n==="scale"?m0e:g0e):e.style&&!eE(e.style[n])?d0e:~n.indexOf("-")?f0e:dE(e,n)},core:{_removeProperty:vc,_getMatrix:gE}};ri.utils.checkPrefix=Bf;ri.core.getStyleSaver=Jj;(function(t,e,n,r){var s=ei(t+","+e+","+n,function(i){nl[i]=1});ei(e,function(i){Ei.units[i]="deg",r7[i]=1}),ta[s[13]]=t+","+e,ei(r,function(i){var o=i.split(":");ta[o[1]]=s[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");ei("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Ei.units[t]="px"});ri.registerPlugin(o7);var ho=ri.registerPlugin(o7)||ri;ho.core.Tween;const hv="/assets/logo-animation",Kw=1280,P0e=[{id:"eraser",src:`${hv}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${hv}/clasp.png`,cssW:170,cssH:170,rot:-248,fit:205,flip:!0,localX:188,localY:97,seaX:.8,seaY:.24,seaRot:-18},{id:"ball",src:`${hv}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],T0e=[{k:"pot",x:.075,y:.2,r:-12,w:152},{k:"chair",x:.1,y:.52,r:8,w:150},{k:"mug",x:.11,y:.84,r:-6,w:140},{k:"cart",x:.3,y:.13,r:10,w:178},{k:"terracotta-1",x:.345,y:.45,r:-18,w:122},{k:"pitcher",x:.285,y:.71,r:14,w:128},{k:"desk",x:.46,y:.25,r:-8,w:198},{k:"startac",x:.475,y:.55,r:16,w:140},{k:"vhsplant",x:.4,y:.9,r:-6,w:188},{k:"bubblephone",x:.63,y:.12,r:12,w:150},{k:"terracotta-2",x:.61,y:.43,r:20,w:122},{k:"pot",x:.675,y:.68,r:14,w:140},{k:"chair",x:.71,y:.91,r:-12,w:140},{k:"mug",x:.91,y:.15,r:8,w:136},{k:"cart",x:.905,y:.47,r:-10,w:166},{k:"startac",x:.88,y:.76,r:18,w:136}],OS=({className:t})=>{const e=g.useRef(null),n=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{const s=e.current,i=n.current,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(x,k)=>x+Math.random()*(k-x);let d=null,f,h=1;const m=P0e.map(x=>({...x})),v=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const x=s.getBoundingClientRect(),k=x.width||Kw,C=x.height||Kw*.64;h=k/Kw,i.style.width=`${242*h}px`,i.style.height=`${250*h}px`;const R=250*h/337,O=[],I=(A,M,L)=>{const z=document.createElement("div");return z.className="la-obj",z.style.width=`${M}px`,z.innerHTML=`<img src="${A}" alt="" style="${L?"transform:scaleX(-1)":""}">`,s.appendChild(z),z};return T0e.forEach((A,M)=>{const L=A.w*h,z=I(`${hv}/sea/${A.k}.png`,L,M%2===0);ho.set(z,{x:A.x*k-L/2,y:A.y*C-L/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:z,hero:!1,rest:1})}),m.forEach(A=>{const M=A.cssW*h;A.el=I(A.src,M,!!A.flip),A.finalScale=A.fit*R/(A.cssW*h),ho.set(A.el,{x:A.seaX*k-M/2,y:A.seaY*C-A.cssH*h/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:A.el,hero:!0,rest:150/A.cssW})}),O},y=(x,k)=>{const C=s.getBoundingClientRect(),P=o.getBoundingClientRect();return{x:P.left-C.left+x/326*P.width,y:P.top-C.top+k/337*P.height}},_=()=>{d&&d.revert();const x=v();if(l){d=ho.context(()=>{x.filter(P=>!P.hero).forEach(P=>ho.set(P.el,{scale:0})),m.forEach(P=>{if(!P.el)return;const R=y(P.localX,P.localY);ho.set(P.el,{x:R.x-P.cssW*h/2,y:R.y-P.cssH*h/2,rotation:P.rot,scale:P.finalScale})})},s);return}const k=[],C=[];d=ho.context(()=>{const P=ho.timeline();P.to(x.map(R=>R.el),{scale:R=>x[R].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),P.add(()=>{x.forEach(({el:R,hero:O},I)=>{const A=O?k:C,M=I%2?1:-1;A.push(ho.to(R,{rotation:"+="+c(2.5,6)*M,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),ho.to(R,{y:"+="+c(5,11)*M,x:"+="+c(4,9)*-M,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),P.to({},{duration:1.1}),P.add("pick"),m.forEach((R,O)=>{R.el&&P.to(R.el,{scale:150/R.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+O*.08)}),P.add("clear","pick+=0.7"),P.add(()=>C.forEach(R=>R.kill()),"clear"),P.to(x.filter(R=>!R.hero).map(R=>R.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),P.add("assemble","clear+=0.25"),P.add(()=>k.forEach(R=>R.kill()),"assemble"),m.forEach((R,O)=>{if(!R.el||R.finalScale===void 0)return;const I=y(R.localX,R.localY);P.to(R.el,{x:I.x-R.cssW*h/2,y:I.y-R.cssH*h/2,rotation:R.rot,scale:R.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.12)}),m.forEach(R=>{!R.el||R.finalScale===void 0||P.to(R.el,{scale:R.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};ho.ticker.fps(12),_();const b=()=>{clearTimeout(f),f=setTimeout(_,250)};return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(x=>x.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},R0e=Object.freeze(Object.defineProperty({__proto__:null,default:OS},Symbol.toStringTag,{value:"Module"})),T4=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),A0e=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(OS,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(T4,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[S.jsx(OS,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(T4,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),I0e="data:image/svg+xml,%3csvg%20width='94'%20height='24'%20viewBox='0%200%2094%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M-0.000156164%2023.832V7.704H5.11184L6.47984%208.424C7.58384%207.704%209.04784%207.344%2010.8718%207.344C12.0718%207.344%2013.1278%207.476%2014.0398%207.74C14.9518%207.98%2015.6838%208.244%2016.2358%208.532C16.8118%208.82%2017.1718%209.024%2017.3158%209.144L15.5158%2013.824C15.2758%2013.656%2014.8198%2013.428%2014.1478%2013.14C13.4998%2012.852%2012.7318%2012.588%2011.8438%2012.348C10.9558%2012.084%2010.0198%2011.952%209.03584%2011.952H8.63984C7.96784%2011.952%207.45184%2012.072%207.09184%2012.312C6.73184%2012.528%206.55184%2013.02%206.55184%2013.788V23.832H-0.000156164ZM23.464%206.156C21.04%206.156%2019.828%205.124%2019.828%203.06C19.828%201.908%2020.128%201.116%2020.728%200.684C21.352%200.227999%2022.264%20-1.43051e-06%2023.464%20-1.43051e-06C24.736%20-1.43051e-06%2025.66%200.227999%2026.236%200.684C26.836%201.116%2027.136%201.908%2027.136%203.06C27.136%205.124%2025.912%206.156%2023.464%206.156ZM20.152%2023.832V7.704H26.704V23.832H20.152ZM37.4767%2023.832L29.6647%207.704H36.9007L40.3207%2016.524L41.2567%2019.116H41.6167L42.5527%2016.524L46.0087%207.704H53.1727L52.5967%209.9L45.4327%2023.832H37.4767ZM61.1953%2023.832C59.6113%2023.832%2058.3873%2023.604%2057.5233%2023.148C56.6833%2022.692%2056.1073%2022.068%2055.7953%2021.276C55.4833%2020.46%2055.3273%2019.524%2055.3273%2018.468V13.032C55.3273%2012.072%2055.4833%2011.196%2055.7953%2010.404C56.1313%209.588%2056.7193%208.94%2057.5593%208.46C58.3993%207.956%2059.6113%207.704%2061.1953%207.704H68.6473C70.5193%207.704%2071.9473%207.932%2072.9313%208.388C73.9393%208.82%2074.6233%209.444%2074.9833%2010.26C75.3673%2011.052%2075.5593%2011.976%2075.5593%2013.032V17.64H69.2593C67.0993%2017.64%2065.4553%2017.592%2064.3273%2017.496C63.2233%2017.4%2062.4433%2017.34%2061.9873%2017.316V17.856C61.9633%2018.816%2062.5393%2019.296%2063.7153%2019.296H64.8313C66.7513%2019.296%2068.5273%2019.26%2070.1593%2019.188C71.7913%2019.092%2073.0033%2019.008%2073.7953%2018.936L75.9553%2022.356C75.9553%2022.596%2075.7513%2022.824%2075.3433%2023.04C74.9353%2023.256%2074.2153%2023.448%2073.1833%2023.616C72.1753%2023.76%2070.7353%2023.832%2068.8633%2023.832H61.1953ZM61.9873%2014.184H68.8993V13.68C68.8993%2013.2%2068.8513%2012.864%2068.7553%2012.672C68.6833%2012.48%2068.4313%2012.36%2067.9993%2012.312C67.5673%2012.264%2066.8353%2012.24%2065.8033%2012.24H63.7153C62.5633%2012.24%2061.9873%2012.72%2061.9873%2013.68V14.184ZM85.8224%2023.832C83.9984%2023.832%2082.7504%2023.448%2082.0784%2022.68C81.4064%2021.912%2081.0704%2020.76%2081.0704%2019.224V12.24H78.1184V7.704H79.6304C80.0384%207.704%2080.3624%207.632%2080.6024%207.488C80.8664%207.32%2081.0344%207.032%2081.1064%206.624L81.7904%202.772H87.6944V7.704H93.7064V12.24H87.6944V17.82C87.6944%2018.42%2087.8384%2018.816%2088.1264%2019.008C88.4144%2019.2%2088.8464%2019.296%2089.4224%2019.296H93.0224L93.7424%2023.472C93.2384%2023.544%2092.4704%2023.628%2091.4384%2023.724C90.4064%2023.796%2089.2784%2023.832%2088.0544%2023.832H85.8224Z'%20fill='%23FF3300'/%3e%3c/svg%3e",O0e=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:I0e,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(W1,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),M0e="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M70.5245%206.60961C66.8741%202.95923%2060.9556%202.95922%2057.3053%206.60961L8.61753%2055.2973C4.96715%2058.9477%204.96714%2064.8662%208.61752%2068.5166L26.3518%2086.2508C30.0022%2089.9012%2035.9206%2089.9012%2039.571%2086.2508L92.033%2033.7889C93.5989%2032.2229%2093.5989%2029.684%2092.033%2028.1181L70.5245%206.60961Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M119.208%2068.5159C122.858%2064.8655%20122.858%2058.947%20119.208%2055.2966L70.5199%206.60891C66.8695%202.95853%2060.951%202.95851%2057.3007%206.6089L32.8391%2031.0705L88.1364%2086.3678C91.7868%2090.0182%2097.7053%2090.0182%20101.356%2086.3678L119.208%2068.5159Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M64.0164%2077.3398L44.0436%2097.3127C41.1057%20100.251%2041.1057%20105.014%2044.0436%20107.952L58.5067%20122.415C61.4446%20125.353%2066.2079%20125.353%2069.1458%20122.415L83.7991%20107.762C86.737%20104.824%2086.737%20100.06%2083.7991%2097.1225L64.0164%2077.3398Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3c/svg%3e",C1=44,Yh=8,Og=16,N0e=4,R4=-18,L0e=.18,D0e=[.22,1,.36,1],A4=.92,$0e=1,F0e=.95,j0e=.4,z0e=[.19,1,.22,1],qw=0,V0e=1,H0e=0,U0e=0,B0e=0,a7=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Yh,s=Math.max(r,e.width-C1-Yh),i=Math.max(Yh,e.height-C1-Yh);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Yh,t.y))}},vE=()=>({width:window.innerWidth,height:window.innerHeight}),Z0e=({position:t,boundsLeftPx:e=0})=>a7({position:t,viewport:vE(),boundsLeft:e}),W0e=()=>{if(typeof window>"u")return{x:Og,y:Og};const t=vE();return{x:t.width-C1-Og,y:t.height-C1-Og}},K0e=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=N0e,q0e=t=>t.button===void 0||t.button<=B0e,I4=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},G0e=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=g.useRef(null),c=g.useRef(!1),[d,f]=g.useState(!1),[h,m]=g.useState(!1),[v,y]=g.useState(!1),_=n?!1:{opacity:qw,scale:A4,x:R4},b=n?{opacity:qw}:{opacity:qw,scale:A4,x:R4},x=n?{duration:U0e}:{duration:L0e,ease:D0e,scale:{duration:j0e,ease:z0e}},k=g.useCallback(()=>{const M=l.current;M&&(c.current=M.hasMoved),l.current=null,f(!1)},[]),C=g.useCallback(M=>{const L=l.current;if(!L)return;const z=I4(M),$=z.x-L.startPointer.x,q=z.y-L.startPointer.y,X=L.hasMoved||K0e({deltaX:$,deltaY:q});l.current={...L,hasMoved:X},X&&o(a7({position:{x:L.startPosition.x+$,y:L.startPosition.y+q},viewport:vE(),boundsLeft:s}))},[o,s]),P=g.useCallback(M=>{if(l.current||!q0e(M))return;const L=I4(M);l.current={startPointer:L,startPosition:r,hasMoved:!1},f(!0)},[r]),R=g.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),O=e?pS:ihe,I=q6(),A=!d&&(h||v);return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:C,onPointerUp:k,onPointerCancel:k,onMouseMove:C,onMouseUp:k}):null,S.jsx(ki,{children:t?S.jsx(zu,{label:O,side:"top",forceOpen:A?void 0:!1,children:S.jsx(So.button,{type:"button","aria-label":O,"aria-keyshortcuts":I.ariaKeyShortcuts,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onFocus:M=>y(M.currentTarget.matches(":focus-visible")),onBlur:()=>y(!1),initial:_,animate:{opacity:V0e,scale:$0e,x:H0e},whileTap:{scale:F0e},exit:b,transition:x,onPointerDown:P,onMouseDown:P,onPointerMove:C,onPointerUp:k,onPointerCancel:k,onMouseMove:C,onMouseUp:k,onClick:R,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:M0e,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},Gw=oi("useConfig"),Y0e=300*1e3,X0e=1800*1e3,Q0e=60*1e3,J0e=300*1e3,ege=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},tge=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},nge=ze({featureFlags:Sk(se(),ze({isEnabled:Ys()})).optional()}),rge=async()=>{const t=await Ft("/api/feature-flags");if(!t.ok)throw new Error(`Failed to fetch feature flags: ${t.statusText}`);return nge.parse(await t.json())},sge=t=>({...bF,...t??{}}),ige=()=>{const t=bt(uS),e=Nt(uS),n=Nt(AF),r=Nt(IF),s=Nt(dy),i=Nt(Efe),o=Nt(Sfe),l=Nt(xfe),c=Nt(uy),d=Nt(bfe),f=Nt(RF),h=g.useCallback(x=>{o(x.agentModeAvailable),f(x.projectId??null),d({name:x.name??null,email:x.email??null}),x.isMCPSession&&n(!0),x.mcpEditor&&r(x.mcpEditor),s(x.agentApplyMode??tge()??null),i(x.queueAccessToken??ege())},[s,o,n,r,i,f,d]),m=ca({queryKey:Qs.rivetConfig,queryFn:YF,staleTime:Y0e,gcTime:X0e}),v=ca({queryKey:Qs.featureFlags,queryFn:rge,staleTime:Q0e,gcTime:J0e}),{refetch:y}=m,{refetch:_}=v;g.useLayoutEffect(()=>{m.data&&(h(m.data),c(!1),Gw.info("Config loaded:",m.data)),v.data&&(e(sge(v.data.featureFlags)),l(!0)),m.error&&(l(!0),c(!1),Gw.warn("Failed to load config:",m.error.message)),v.error&&(l(!0),Gw.warn("Failed to load feature flags:",v.error.message))},[m.data,m.error,v.data,v.error,h,c,e,l]);const b=g.useCallback(async()=>{const[x]=await Promise.all([y(),_()]);return x.data?x.data:null},[y,_]);return{config:m.data??null,featureFlags:t,loading:m.isPending||!m.error&&v.isPending,error:m.error?m.error.message:null,refetchConfig:b}},Id=oi("useOAuthCallback"),oge=()=>{const[t,e]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,c,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{Id.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),h=f.get("access_token"),m=f.get("refresh_token"),y=new URLSearchParams(o).get("session");if(!h)throw new Error("No access token found in URL");if(!y)throw new Error("No session ID found in URL");Id.info(`Completing OAuth with session: ${y}`);const _=await fetch(`${mS}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:y,accessToken:h,refreshToken:m}),signal:n.signal}),b=await _.json();if(!_.ok||!b.success)throw new Error(b.error||b.message||"Failed to complete authentication");if(Id.info("OAuth authentication completed successfully"),r)return;if(ZN({userId:(l=b.user)==null?void 0:l.id,email:(c=b.user)==null?void 0:c.email}),(d=b.user)!=null&&d.email&&h)try{const k=await Ft("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b.user.email,token:h,refreshToken:m,userId:b.user.id}),signal:n.signal});k.ok||Id.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;Id.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(g1,"1");const x=window.location.pathname;window.history.replaceState({},document.title,x),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;Id.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:Gs(f,"Unknown error occurred")})}}})(),()=>{r=!0,n.abort()}},[]),t},age=3e3,lge=(t,e=Ft)=>{const n=new AbortController;let r;const s={onmessage:null,onerror:null,close:()=>{n.abort(),clearTimeout(r)}},i=async()=>{var l,c,d;let o=!1;try{const f=await e(t,{signal:n.signal,headers:{Accept:"text/event-stream"}});if(o=f.status===401||f.status===403,!f.ok||!f.body)throw await((l=f.body)==null?void 0:l.cancel()),new Error(`Event stream request failed (${f.status}).`);const h=f.body.getReader(),m=new TextDecoder;let v="",y=[];try{for(;!n.signal.aborted;){const _=await h.read();if(_.done)break;v+=m.decode(_.value,{stream:!0});let b=v.indexOf(`
214
- `);for(;b!==-1;){const x=v.slice(0,b).replace(/\r$/,"");v=v.slice(b+1),x===""?(y.length>0&&!n.signal.aborted&&((c=s.onmessage)==null||c.call(s,{data:y.join(`
215
- `)})),y=[]):x.startsWith("data:")&&y.push(x.slice(5).replace(/^ /,"")),b=v.indexOf(`
216
- `)}}}finally{await h.cancel().catch(()=>{}),h.releaseLock()}}catch(f){n.signal.aborted||(d=s.onerror)==null||d.call(s,f)}!n.signal.aborted&&!o&&(r=setTimeout(()=>void i(),age))};return i(),s},Yw=oi("useAgentVariantsSession"),cge=({enabled:t=!0}={})=>{const e=Nt(Vm),n=Nt(PF),r=Nt(xF),s=Nt(TF),i=g.useRef(null);g.useEffect(()=>{if(n(!1),!t)return;const o=lge("/api/variants/events");return o.onmessage=l=>{try{const c=JSON.parse(l.data),d=i.current;if(c.active){const h=new Set(c.variants.map(m=>m.requestId).filter(m=>!!m));s(m=>m.filter(y=>!h.has(y.requestId))),c.sessionId!==i.current&&(i.current=c.sessionId,r(!0))}else i.current=null;e(c),n(!0),c.active&&c.sessionId!==d&&Ft(`/api/variants/${c.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(h=>Yw.warn("failed to reset preview-port on session switch",h))}catch(c){Yw.warn("failed to parse SSE event payload",c)}},o.onerror=l=>{Yw.warn("SSE error (auto-reconnects)",l)},()=>{o.close()}},[t,e,n,r,s])};var uge=Object.defineProperty,Or=(t,e)=>uge(t,"name",{value:e,configurable:!0});function l7(t){const e=t+"CollectionProvider",[n,r]=pa(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=Or(_=>{const{scope:b,children:x}=_,k=g.useRef(null),C=g.useRef(new Map).current;return S.jsx(s,{scope:b,itemMap:C,collectionRef:k,children:x})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",c=fc(l),d=g.forwardRef((_,b)=>{const{scope:x,children:k}=_,C=i(l,x),P=xn(b,C.collectionRef);return S.jsx(c,{ref:P,children:k})});d.displayName=l;const f=t+"CollectionItemSlot",h="data-radix-collection-item",m=fc(f),v=g.forwardRef((_,b)=>{const{scope:x,children:k,...C}=_,P=g.useRef(null),R=xn(b,P),O=i(f,x);return g.useEffect(()=>(O.itemMap.set(P,{ref:P,...C}),()=>void O.itemMap.delete(P))),S.jsx(m,{[h]:"",ref:R,children:k})});v.displayName=f;function y(_){const b=i(t+"CollectionConsumer",_);return g.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((O,I)=>C.indexOf(O.ref.current)-C.indexOf(I.ref.current))},[b.collectionRef,b.itemMap])}return Or(y,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},y,r]}Or(l7,"createCollection");var O4=new WeakMap,dr,mi,Mg=(mi=class extends Map{constructor(n){super(n);rt(this,dr);Me(this,dr,[...super.keys()]),O4.set(this,!0)}set(n,r){return O4.get(this)&&!this.has(n)&&W(this,dr).push(n),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=i?this.size:this.size+1,l=yE(n),c=l>=0?Math.min(l,o-1):Math.max(o+l,0);if(i?W(this,dr).indexOf(r)===c:c===this.size)return this.set(r,s),this;const d=W(this,dr).filter(h=>h!==r);d.splice(c,0,r);const f=d.map(h=>[h,h===r?s:this.get(h)]);this.clear();for(const[h,m]of f)this.set(h,m);return this}with(n,r,s){const i=new mi(this);return i.insert(n,r,s),i}before(n){const r=W(this,dr).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=W(this,dr).indexOf(n);if(i===-1)return this;const o=W(this,dr).indexOf(r),l=o!==-1&&o<i?i-1:i;return this.insert(l,r,s)}after(n){let r=W(this,dr).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=W(this,dr).indexOf(n);if(i===-1)return this;const o=W(this,dr).indexOf(r),l=o!==-1&&o<=i?i:i+1;return this.insert(l,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Me(this,dr,[]),super.clear()}delete(n){const r=super.delete(n);return r&&W(this,dr).splice(W(this,dr).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=pv(W(this,dr),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=pv(W(this,dr),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return W(this,dr).indexOf(n)}keyAt(n){return pv(W(this,dr),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const o of this)Reflect.apply(n,r,[o,i,this])&&s.push(o),i++;return new mi(s)}map(n,r){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(n,r,[o,i,this])]),i++;return new mi(s)}reduce(...n){const[r,s]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let o=0,l=s;for(const c of this)o===0&&!i?l=c:l=Reflect.apply(r,this,[l,c,o,this]),o++;return l}reduceRight(...n){const[r,s]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let o=s;for(let l=this.size-1;l>=0;l--){const c=this.entryAt(l);l===this.size-1&&!i?o=c:o=Reflect.apply(r,this,[o,c,l,this])}return o}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[s,i]of r)this.set(s,i);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new mi(r)}toReversed(){const n=new mi;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new mi(r)}slice(n,r){const s=new mi;for(const i of W(this,dr).slice(n,r))s.set(i,this.get(i));return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},dr=new WeakMap,Or(mi,"OrderedDict"),mi);function pv(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=c7(t,e);return n===-1?void 0:t[n]}Or(pv,"at");function c7(t,e){const n=t.length,r=yE(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}Or(c7,"toSafeIndex");function yE(t){return t!==t||t===0?0:Math.trunc(t)}Or(yE,"toSafeInteger");function u7(t){const e=t+"CollectionProvider",[n,r]=pa(e),[s,i]=n(e);s.displayName=t+"CollectionStableContextProvider";const[o,l]=n(e);o.displayName=t+"CollectionStatefulContextProvider";const c=Or(({state:O,...I})=>O?S.jsx(f,{...I,state:O}):S.jsx(d,{...I}),"CollectionProvider");c.displayName=e;const d=Or(O=>{const I=k();return S.jsx(f,{...O,state:I})},"CollectionInit");d.displayName=t+"CollectionInit";const f=Or(O=>{const{scope:I,children:A,state:M}=O,L=g.useRef(null),[z,$]=g.useState(null),q=xn(L,$),[X,K]=M,H=g.useRef(new Mg),ee=g.useCallback(()=>{const V=H.current;return h7(V)||V.sort(mv),V},[]);return g.useEffect(()=>{if(!z)return;const V=p7(()=>{K(Q=>{const B=Q.toSorted(mv);return B.some(([G],fe)=>Q.keyAt(fe)!==G)?B:Q})});return V.observe(z,{childList:!0,subtree:!0}),()=>{V.disconnect()}},[z,K]),S.jsx(s,{scope:I,collectionElementRef:q,collectionElementRefObject:L,getCollection:ee,setCollection:K,registryRef:H,children:S.jsx(o,{scope:I,collectionElement:z,collection:X,children:A})})},"CollectionProviderImpl");f.displayName=t+"CollectionProviderImpl";const h=t+"CollectionSlot",m=fc(h),v=g.forwardRef((O,I)=>{const{scope:A,children:M}=O,L=i(h,A),z=xn(I,L.collectionElementRef);return S.jsx(m,{ref:z,children:M})});v.displayName=h;const y=t+"CollectionItemSlot",_="data-radix-collection-item",b=fc(y),x=g.forwardRef((O,I)=>{const{scope:A,children:M,...L}=O,z=g.useRef(null),$=i(y,A),{setCollection:q,registryRef:X}=$,K=g.useRef(L);d7(K.current,L)||(K.current=L);const H=K.current,ee=g.useCallback(B=>{const D=X.current;B?D.set(B,{...K.current,element:B}):z.current&&D.delete(z.current)},[X]),V=xn(I,ee,z);_s(()=>{const B=z.current,D=X.current;B&&D.has(B)&&D.set(B,{...H,element:B})},[H,X]);const Q=g.useRef(null);return g.useEffect(()=>{const B=z.current,D=Q.current;((D==null?void 0:D.element)??null)===B&&(!B||(D==null?void 0:D.itemData)===H)||(Q.current=B?{element:B,itemData:H}:null,q(G=>{const fe=new Mg(G);return D&&D.element!==B&&fe.delete(D.element),B&&fe.set(B,{...H,element:B}),fe.sort(mv)}))}),g.useEffect(()=>()=>{const B=Q.current;Q.current=null,B&&q(D=>{if(!D.has(B.element))return D;const G=new Mg(D);return G.delete(B.element),G})},[q]),S.jsx(b,{[_]:"",ref:V,children:M})});x.displayName=y;function k(){return g.useState(new Mg)}Or(k,"useInitCollection");function C(O){const{collection:I}=l(t+"CollectionConsumer",O);return I}Or(C,"useCollection");function P(O){const{getCollection:I}=i(t+"CollectionConsumer",O);return I}return Or(P,"useGetCollection"),[{Provider:c,Slot:v,ItemSlot:x},{createCollectionScope:r,useCollection:C,useGetCollection:P,useInitCollection:k}]}Or(u7,"createCollection");function d7(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}Or(d7,"shallowEqual");function f7(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Or(f7,"isElementPreceding");function h7(t){let e;for(const n of t.keys()){if(e){const r=e.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}e=n}return!0}Or(h7,"isInDocumentOrder");function mv(t,e){return!t[1].element||!e[1].element?0:f7(t[1].element,e[1].element)?-1:1}Or(mv,"sortByDocumentPosition");function p7(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Or(p7,"getChildListObserver");var dge=Object.defineProperty,Bm=(t,e)=>dge(t,"name",{value:e,configurable:!0}),_E="Collapsible",[fge,m7]=pa(_E),[hge,wE]=fge(_E),pge=g.forwardRef(Bm(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...c}=e,[d,f]=kc({prop:s,defaultProp:i??!1,onChange:l,caller:_E});return S.jsx(hge,{scope:r,disabled:o,contentId:ia(),open:d,onOpenToggle:g.useCallback(()=>f(h=>!h),[f]),children:S.jsx(er.div,{"data-state":gy(d),"data-disabled":o?"":void 0,...c,ref:n})})},"Collapsible")),mge="CollapsibleTrigger",gge=g.forwardRef(Bm(function(e,n){const{__scopeCollapsible:r,...s}=e,i=wE(mge,r);return S.jsx(er.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":gy(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:bn(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),g7="CollapsibleContent",vge=g.forwardRef(Bm(function(e,n){const{forceMount:r,...s}=e,i=wE(g7,e.__scopeCollapsible);return S.jsx(Sc,{present:r||i.open,children:({present:o})=>S.jsx(yge,{...s,ref:n,present:o})})},"CollapsibleContent")),yge=g.forwardRef(Bm(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=wE(g7,r),[c,d]=g.useState(s),f=g.useRef(null),h=xn(n,f),m=g.useRef(0),v=m.current,y=g.useRef(0),_=y.current,b=l.open||c,x=g.useRef(b),k=g.useRef(void 0);return g.useEffect(()=>{const C=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(C)},[]),_s(()=>{const C=f.current;if(C){k.current=k.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const P=C.getBoundingClientRect();m.current=P.height,y.current=P.width,x.current||(C.style.transitionDuration=k.current.transitionDuration,C.style.animationName=k.current.animationName),d(s)}},[l.open,s]),S.jsx(er.div,{"data-state":gy(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!b,...o,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:b&&i})},"CollapsibleContentImpl"));function gy(t){return t?"open":"closed"}Bm(gy,"getState");var _ge=Object.defineProperty,wge=(t,e)=>_ge(t,"name",{value:e,configurable:!0}),bge={LTR:"ltr"},xge=g.createContext(void 0);function bE(t){const e=g.useContext(xge);return t||e||bge.LTR}wge(bE,"useDirection");var Sge=Object.defineProperty,Ci=(t,e)=>Sge(t,"name",{value:e,configurable:!0}),kge={Multiple:"multiple"},Xh={Vertical:"vertical",Horizontal:"horizontal"},Ege={LTR:"ltr"},ma="Accordion",Cge=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[xE,{useGetCollection:Pge,createCollectionScope:Tge}]=u7(ma),[vy,fye]=pa(ma,[Tge,m7]),SE=m7(),v7=g.forwardRef(Ci(function(e,n){const{type:r,...s}=e,i=s,o=s;return S.jsx(xE.Provider,{scope:e.__scopeAccordion,children:r===kge.Multiple?S.jsx(Oge,{...o,ref:n}):S.jsx(Ige,{...i,ref:n})})},"Accordion")),[y7,Rge]=vy(ma),[_7,Age]=vy(ma,{collapsible:!1}),Ige=g.forwardRef(Ci(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Ci(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[c,d]=kc({prop:r,defaultProp:s??"",onChange:i,caller:ma});return S.jsx(y7,{scope:e.__scopeAccordion,value:g.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:g.useCallback(()=>o&&d(""),[o,d]),children:S.jsx(_7,{scope:e.__scopeAccordion,collapsible:o,children:S.jsx(w7,{...l,ref:n})})})},"AccordionImplSingle")),Oge=g.forwardRef(Ci(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Ci(()=>{},"onValueChange"),...o}=e,[l,c]=kc({prop:r,defaultProp:s??[],onChange:i,caller:ma}),d=g.useCallback(h=>c((m=[])=>[...m,h]),[c]),f=g.useCallback(h=>c((m=[])=>m.filter(v=>v!==h)),[c]);return S.jsx(y7,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:S.jsx(_7,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(w7,{...o,ref:n})})})},"AccordionImplMultiple")),[Mge,yy]=vy(ma),w7=g.forwardRef(Ci(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o=Xh.Vertical,...l}=e,c=g.useRef(null),d=xn(c,n),f=Pge(r),m=bE(i)===Ege.LTR,v=bn(e.onKeyDown,y=>{var L;if(!Cge.includes(y.key))return;const _=f(),b=y.target,x=_.filter(([,z])=>!z.element.disabled),k=x.findIndex(([,z])=>z.element===b),C=x.size;if(k===-1)return;y.preventDefault();let P=k;const R=0,O=C-1,I=Ci(()=>{P=k+1,P>O&&(P=R)},"moveNext"),A=Ci(()=>{P=k-1,P<R&&(P=O)},"movePrev");switch(y.key){case"Home":P=R;break;case"End":P=O;break;case"ArrowRight":o===Xh.Horizontal&&(m?I():A());break;case"ArrowDown":o===Xh.Vertical&&I();break;case"ArrowLeft":o===Xh.Horizontal&&(m?A():I());break;case"ArrowUp":o===Xh.Vertical&&A();break}const M=P%C;(L=x.at(M))==null||L.element.focus()});return S.jsx(Mge,{scope:r,disabled:s,direction:i,orientation:o,children:S.jsx(xE.Slot,{scope:r,children:S.jsx(er.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),MS="AccordionItem",[Nge,kE]=vy(MS),Lge=g.forwardRef(Ci(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=yy(MS,r),l=Rge(MS,r),c=SE(r),d=ia(),f=s&&l.value.includes(s)||!1,h=o.disabled||e.disabled;return S.jsx(Nge,{scope:r,open:f,disabled:h,triggerId:d,children:S.jsx(pge,{"data-orientation":o.orientation,"data-state":EE(f),...c,...i,ref:n,disabled:h,open:f,onOpenChange:m=>{m?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),Dge="AccordionHeader",$ge=g.forwardRef(Ci(function(e,n){const{__scopeAccordion:r,...s}=e,i=yy(ma,r),o=kE(Dge,r);return S.jsx(er.h3,{"data-orientation":i.orientation,"data-state":EE(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),M4="AccordionTrigger",Fge=g.forwardRef(Ci(function(e,n){const{__scopeAccordion:r,...s}=e,i=yy(ma,r),o=kE(M4,r),l=Age(M4,r),c=SE(r);return S.jsx(xE.ItemSlot,{scope:r,children:S.jsx(gge,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...c,...s,ref:n})})},"AccordionTrigger")),jge="AccordionContent",zge=g.forwardRef(Ci(function(e,n){const{__scopeAccordion:r,...s}=e,i=yy(ma,r),o=kE(jge,r),l=SE(r);return S.jsx(vge,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function EE(t){return t?"open":"closed"}Ci(EE,"getState");/**
217
- * @license lucide-react v1.69.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const Vge=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
222
- * @license lucide-react v1.69.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */function Hge(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Vge(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
227
- * @license lucide-react v1.69.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const Uge=t=>{let e="",n=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){n=e.length>0;continue}e.length===0?e+=r.toLowerCase():e+=n?r.toUpperCase():r,n=!1}return e};/**
232
- * @license lucide-react v1.69.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const Bge=t=>{const e=Uge(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
237
- * @license lucide-react v1.69.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const NS=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
242
- * @license lucide-react v1.69.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const tu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
247
- * @license lucide-react v1.69.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */function Xw(t){return t!=null}function Zge(t,e={}){var m,v;const n=e.attributeNames??{},r=y=>n[y]??y,s=t.size??t.width??tu.width,i=t.size??t.height??tu.height,o=((m=t.aliases)==null?void 0:m.filter(y=>typeof y=="string"&&y.trim()!=="").map(y=>`lucide-${y}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],c=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?NS(...c):NS("lucide",...l,...c),f=e.absoluteStrokeWidth?Number(e.strokeWidth??tu["stroke-width"])*Number(t.size??t.width??tu.width)/Number(e.size??e.width??tu.width):e.strokeWidth??tu["stroke-width"];return["svg",{...Object.entries(tu).reduce((y,[_,b])=>(y[r(_)]=b,y),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&Xw(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&Xw(e.width)&&{[r("width")]:e.width},..."height"in e&&Xw(e.height)&&{[r("height")]:e.height},[r("stroke-width")]:f,...d&&{[r("class")]:d},[r("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(y=>{const[_,b,x]=y,k=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...b}:b;return x?[_,k,x]:[_,k]})]}/**
252
- * @license lucide-react v1.69.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */function Wge(t,e={}){return Zge(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
257
- * @license lucide-react v1.69.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const Kge=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},qge=g.createContext({}),Gge=()=>g.useContext(qge),Yge=g.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:c,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...h},m)=>{const{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:_=!1,nonScalingStroke:b=!1,color:x="currentColor",className:k=""}=Gge()??{},C=!!c||Kge(h),[P,R,O=[]]=Wge(f,{color:t??x,width:n??e??v,height:r??e??v,strokeWidth:s??y,absoluteStrokeWidth:i??_,nonScalingStroke:o??b,className:NS(k,l),hasA11yProp:C,attributes:h});return g.createElement(P,{ref:m,...R},[...O.map(([I,A])=>g.createElement(I,A)),...Array.isArray(c)?c:[c]])});/**
262
- * @license lucide-react v1.69.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */function yt(t,e=[],n=[]){const r=typeof t=="string"?Hge(t,e,n):t,s=g.forwardRef(({className:i,...o},l)=>g.createElement(Yge,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Bge(r.name)),s}/**
267
- * @license lucide-react v1.69.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const b7={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};b7.node;const Xge=yt(b7);/**
272
- * @license lucide-react v1.69.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const x7={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};x7.node;const Qge=yt(x7);/**
277
- * @license lucide-react v1.69.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const S7={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};S7.node;const Jge=yt(S7);/**
282
- * @license lucide-react v1.69.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const k7={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};k7.node;const eve=yt(k7);/**
287
- * @license lucide-react v1.69.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const E7={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4",key:"5nuw1p"}],["path",{d:"M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294",key:"18ldcf"}],["path",{d:"M17.996 5.125a4 4 0 012.526 5.77",key:"1sdu8q"}],["path",{d:"M18 18a4 4 0 002-7.465",key:"7xqqvr"}],["path",{d:"M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517",key:"t46ysz"}],["path",{d:"M6 18a4 4 0 01-2-7.465",key:"1y2m15"}],["path",{d:"M6.004 5.125a4 4 0 00-2.526 5.77",key:"3cw1ss"}]]};E7.node;const tve=yt(E7);/**
292
- * @license lucide-react v1.69.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const C7={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};C7.node;const nve=yt(C7);/**
297
- * @license lucide-react v1.69.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const P7={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};P7.node;const rve=yt(P7);/**
302
- * @license lucide-react v1.69.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const T7={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};T7.node;const sve=yt(T7);/**
307
- * @license lucide-react v1.69.0 - ISC
308
- *
309
- * This source code is licensed under the ISC license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */const R7={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};R7.node;const ive=yt(R7);/**
312
- * @license lucide-react v1.69.0 - ISC
313
- *
314
- * This source code is licensed under the ISC license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */const A7={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};A7.node;const ove=yt(A7);/**
317
- * @license lucide-react v1.69.0 - ISC
318
- *
319
- * This source code is licensed under the ISC license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */const I7={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};I7.node;const ave=yt(I7);/**
322
- * @license lucide-react v1.69.0 - ISC
323
- *
324
- * This source code is licensed under the ISC license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */const O7={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};O7.node;const lve=yt(O7);/**
327
- * @license lucide-react v1.69.0 - ISC
328
- *
329
- * This source code is licensed under the ISC license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */const M7={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};M7.node;const cve=yt(M7);/**
332
- * @license lucide-react v1.69.0 - ISC
333
- *
334
- * This source code is licensed under the ISC license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */const N7={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};N7.node;const uve=yt(N7);/**
337
- * @license lucide-react v1.69.0 - ISC
338
- *
339
- * This source code is licensed under the ISC license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */const L7={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};L7.node;const dve=yt(L7);/**
342
- * @license lucide-react v1.69.0 - ISC
343
- *
344
- * This source code is licensed under the ISC license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */const D7={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};D7.node;const fve=yt(D7);/**
347
- * @license lucide-react v1.69.0 - ISC
348
- *
349
- * This source code is licensed under the ISC license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */const $7={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};$7.node;const hve=yt($7);/**
352
- * @license lucide-react v1.69.0 - ISC
353
- *
354
- * This source code is licensed under the ISC license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */const F7={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};F7.node;const pve=yt(F7);/**
357
- * @license lucide-react v1.69.0 - ISC
358
- *
359
- * This source code is licensed under the ISC license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */const j7={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};j7.node;const mve=yt(j7);/**
362
- * @license lucide-react v1.69.0 - ISC
363
- *
364
- * This source code is licensed under the ISC license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */const z7={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};z7.node;const gve=yt(z7);/**
367
- * @license lucide-react v1.69.0 - ISC
368
- *
369
- * This source code is licensed under the ISC license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */const V7={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};V7.node;const vve=yt(V7);/**
372
- * @license lucide-react v1.69.0 - ISC
373
- *
374
- * This source code is licensed under the ISC license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */const H7={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};H7.node;const yve=yt(H7);/**
377
- * @license lucide-react v1.69.0 - ISC
378
- *
379
- * This source code is licensed under the ISC license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */const U7={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};U7.node;const _ve=yt(U7);/**
382
- * @license lucide-react v1.69.0 - ISC
383
- *
384
- * This source code is licensed under the ISC license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */const B7={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};B7.node;const wve=yt(B7);/**
387
- * @license lucide-react v1.69.0 - ISC
388
- *
389
- * This source code is licensed under the ISC license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */const Z7={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};Z7.node;const bve=yt(Z7);/**
392
- * @license lucide-react v1.69.0 - ISC
393
- *
394
- * This source code is licensed under the ISC license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */const W7={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};W7.node;const xve=yt(W7);/**
397
- * @license lucide-react v1.69.0 - ISC
398
- *
399
- * This source code is licensed under the ISC license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */const K7={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};K7.node;const Sve=yt(K7);/**
402
- * @license lucide-react v1.69.0 - ISC
403
- *
404
- * This source code is licensed under the ISC license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */const q7={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};q7.node;const kve=yt(q7);/**
407
- * @license lucide-react v1.69.0 - ISC
408
- *
409
- * This source code is licensed under the ISC license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */const G7={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};G7.node;const Eve=yt(G7);/**
412
- * @license lucide-react v1.69.0 - ISC
413
- *
414
- * This source code is licensed under the ISC license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */const Y7={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};Y7.node;const Cve=yt(Y7);/**
417
- * @license lucide-react v1.69.0 - ISC
418
- *
419
- * This source code is licensed under the ISC license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */const X7={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};X7.node;const Pve=yt(X7);/**
422
- * @license lucide-react v1.69.0 - ISC
423
- *
424
- * This source code is licensed under the ISC license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */const Q7={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};Q7.node;const Tve=yt(Q7);/**
427
- * @license lucide-react v1.69.0 - ISC
428
- *
429
- * This source code is licensed under the ISC license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */const J7={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};J7.node;const Rve=yt(J7);/**
432
- * @license lucide-react v1.69.0 - ISC
433
- *
434
- * This source code is licensed under the ISC license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */const ez={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};ez.node;const Ave=yt(ez);/**
437
- * @license lucide-react v1.69.0 - ISC
438
- *
439
- * This source code is licensed under the ISC license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */const tz={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};tz.node;const Ive=yt(tz);/**
442
- * @license lucide-react v1.69.0 - ISC
443
- *
444
- * This source code is licensed under the ISC license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */const nz={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};nz.node;const Ove=yt(nz);/**
447
- * @license lucide-react v1.69.0 - ISC
448
- *
449
- * This source code is licensed under the ISC license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */const rz={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};rz.node;const Mve=yt(rz);/**
452
- * @license lucide-react v1.69.0 - ISC
453
- *
454
- * This source code is licensed under the ISC license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */const sz={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};sz.node;const Nve=yt(sz);/**
457
- * @license lucide-react v1.69.0 - ISC
458
- *
459
- * This source code is licensed under the ISC license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */const iz={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};iz.node;const Lve=yt(iz);/**
462
- * @license lucide-react v1.69.0 - ISC
463
- *
464
- * This source code is licensed under the ISC license.
465
- * See the LICENSE file in the root directory of this source tree.
466
- */const oz={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};oz.node;const Dve=yt(oz);/**
467
- * @license lucide-react v1.69.0 - ISC
468
- *
469
- * This source code is licensed under the ISC license.
470
- * See the LICENSE file in the root directory of this source tree.
471
- */const az={name:"square-library",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],aliases:["library-square"]};az.node;const $ve=yt(az);/**
472
- * @license lucide-react v1.69.0 - ISC
473
- *
474
- * This source code is licensed under the ISC license.
475
- * See the LICENSE file in the root directory of this source tree.
476
- */const lz={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};lz.node;const Fve=yt(lz);/**
477
- * @license lucide-react v1.69.0 - ISC
478
- *
479
- * This source code is licensed under the ISC license.
480
- * See the LICENSE file in the root directory of this source tree.
481
- */const cz={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};cz.node;const jve=yt(cz);/**
482
- * @license lucide-react v1.69.0 - ISC
483
- *
484
- * This source code is licensed under the ISC license.
485
- * See the LICENSE file in the root directory of this source tree.
486
- */const uz={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};uz.node;const zve=yt(uz);/**
487
- * @license lucide-react v1.69.0 - ISC
488
- *
489
- * This source code is licensed under the ISC license.
490
- * See the LICENSE file in the root directory of this source tree.
491
- */const dz={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};dz.node;const Vve=yt(dz);/**
492
- * @license lucide-react v1.69.0 - ISC
493
- *
494
- * This source code is licensed under the ISC license.
495
- * See the LICENSE file in the root directory of this source tree.
496
- */const fz={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};fz.node;const Hve=yt(fz),Uve={"chevron-right":sve,"chevron-down":rve,pipette:Pve,x:Hve,copy:ave,menu:_ve,dot:lve,monitor:bve,sun:jve,moon:xve,"rectangle-horizontal":Ave,circle:ive,"square-library":$ve,clock:ove,star:Fve,settings:Nve,plus:Rve,"arrow-left":Xge,"arrow-right":Qge,"arrow-up":Jge,search:Mve,loader:gve,users:Vve,lock:vve,mail:yve,bell:eve,shield:Lve,palette:kve,lightbulb:pve,rocket:Ive,heart:uve,paintbrush:Sve,brain:tve,globe:cve,user:zve,image:fve,link:mve,check:nve,"rotate-ccw":Ove,play:Tve,pause:Eve,home:dve,"message-circle":wve,inbox:hve,pencil:Cve,"skip-forward":Dve},N4={lucide:Uve},hz=g.createContext(null);function Bve(t){const e=g.useContext(hz);return e?N4[e.iconLibrary][t]:N4.lucide[t]}function Zve({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(hz.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const pz=g.createContext(null);function CE(){return g.useContext(pz)}const mz=g.createContext(null);function gz(){const t=g.useContext(mz);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Wve=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=g.useRef(null),l=g.useRef(new Map),[c,d]=g.useState(new Map),{activeIndex:f,setActiveIndex:h,itemRects:m,sessionRef:v,handlers:y,registerItem:_,measureItems:b}=vF(o),x=g.useCallback((le,ne)=>{ne?l.current.set(le,ne):l.current.delete(le)},[]),k=g.useCallback(()=>{if(!o.current)return;const le=new Map;l.current.forEach((ne,be)=>{le.set(be,{top:ne.offsetTop,left:ne.offsetLeft,width:ne.offsetWidth,height:ne.offsetHeight})}),d(le)},[]),[C,P]=g.useState(()=>r==="single"?t.defaultValue??"":""),[R,O]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),I=t.onValueChange,A=t.onValueChange,M=t.value,L=new Set(r==="multiple"?t.value??R:(()=>{const le=t.value??C;return le?[le]:[]})()),z=g.useCallback(le=>{const ne=t;ne.onValueChange?ne.onValueChange(le):P(le)},[I]),$=g.useCallback(le=>{const ne=t;ne.onValueChange?ne.onValueChange(le):O(le)},[A]),q=g.useCallback(le=>{if(r==="multiple"){const ne=t.value??R;$(ne.filter(be=>be!==le))}else z("")},[r,z,$,R,M]);g.useEffect(()=>{b(),k()},[b,k,n]);const X=[...L].join(",");g.useEffect(()=>{b(),k()},[b,k,X]);const[K,H]=g.useState(null),ee=f!==null?m[f]:null,V=K!==null?m[K]:null,Q=f!==null&&!c.has(f),B=Fm(),{value:D,defaultValue:G,onValueChange:fe,collapsible:ie,type:ue,...he}=i,_e=r==="multiple"?{type:"multiple",value:t.value??R,onValueChange:$}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:z};return S.jsx(pz.Provider,{value:{registerItem:_,registerFullItem:x,activeIndex:f,grouped:!0,remeasure:()=>{b(),k()},openValues:L,openItemRects:c,toggleValue:q},children:S.jsx(v7,{..._e,asChild:!0,children:S.jsxs("div",{ref:le=>{o.current=le,typeof e=="function"?e(le):e&&(e.current=le)},onMouseEnter:y.onMouseEnter,onMouseMove:le=>{const ne=o.current;if(ne){const be=ne.getBoundingClientRect(),Ve=ne.offsetHeight,De=be.height,$e=Ve>0?De/Ve:1,Ut=(le.clientY-be.top)/$e+ne.scrollTop;for(const[nn,kt]of c){const Dt=m[nn];if(!Dt)continue;const un=Dt.top+Dt.height,qt=kt.top+kt.height;if(Ut>=un&&Ut<=qt){h(null);return}}}y.onMouseMove(le)},onMouseLeave:y.onMouseLeave,onFocus:le=>{var be;const ne=(be=le.target.closest("[data-proximity-index]"))==null?void 0:be.getAttribute("data-proximity-index");if(ne!=null){const Ve=Number(ne);h(Ve),H(le.target.matches(":focus-visible")?Ve:null)}},onBlur:le=>{var ne;(ne=o.current)!=null&&ne.contains(le.relatedTarget)||(H(null),h(null))},className:mn("relative flex flex-col gap-0.5 w-72 max-w-full",s),...he,children:[S.jsx(ki,{children:[...c.entries()].map(([le,ne])=>S.jsx(Ka.div,{className:`absolute ${B.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:ne.top,left:ne.left,width:ne.width,height:ne.height,opacity:Q?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${le}`))}),S.jsx(ki,{children:ee&&S.jsx(Ka.div,{className:`absolute ${B.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:ee.top,left:ee.left,width:ee.width,height:ee.height},animate:{opacity:1,top:ee.top,left:ee.left,width:ee.width,height:ee.height},exit:{opacity:0,transition:{duration:.06}},transition:{...cm.fast,opacity:{duration:.08}}},v.current)}),S.jsx(ki,{children:V&&S.jsx(Ka.div,{className:`absolute ${B.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:V.left-2,top:V.top-2,width:V.width+4,height:V.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...cm.fast,opacity:{duration:.08}}})}),n]})})})});Wve.displayName="AccordionGroup";const vz=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},c)=>{const[d,f]=g.useState(()=>e==="single"?r??"":""),[h,m]=g.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??h:(()=>{const k=s??d;return k?[k]:[]})()),y=g.useCallback(k=>{i?i(k):f(k)},[i]),_=g.useCallback(k=>{i?i(k):m(k)},[i]),b=g.useCallback(k=>{e==="multiple"?_((s??h).filter(P=>P!==k)):y("")},[e,s,h,y,_]),x=e==="multiple"?{type:"multiple",value:s??h,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:y};return S.jsx(v7,{...x,asChild:!0,children:S.jsx("div",{ref:c,className:mn("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:S.jsx(yz.Provider,{value:v,children:S.jsx(_z.Provider,{value:b,children:t})})})})});vz.displayName="Accordion";const yz=g.createContext(new Set),_z=g.createContext(()=>{}),wz=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=g.useRef(null),c=CE(),d=g.useContext(yz),f=g.useContext(_z),h=Fm(),m=c!=null&&c.grouped?c.openValues.has(t):d.has(t),v=g.useRef(null),y=g.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):f(t)},[c,f,t]);return g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,v.current),()=>c.registerItem(e,null)},[e,c]),g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return m?c.registerFullItem(e,l.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,m]),S.jsx(mz.Provider,{value:{index:e,value:t,isOpen:m,onToggle:y,triggerRef:v},children:S.jsxs(Lge,{ref:_=>{l.current=_,typeof o=="function"?o(_):o&&(o.current=_)},value:t,disabled:n,"data-proximity-index":e,className:mn(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&S.jsx(ki,{children:m&&S.jsx(Ka.div,{className:`absolute inset-0 ${h.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),r]})})});wz.displayName="AccordionItem";const bz=g.forwardRef(({children:t,className:e,...n},r)=>{const s=Bve("chevron-right"),i=CE(),{index:o,isOpen:l,triggerRef:c}=gz(),d=Fm(),[f,h]=g.useState(!1),m=i!=null&&i.grouped?i.activeIndex===o:f,v=S.jsx($ge,{asChild:!0,children:S.jsx("div",{children:S.jsxs(Fge,{ref:r,className:mn(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Ip.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:mn("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?Ip.semibold:Ip.normal},children:t})]}),S.jsx(Ka.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:cm.fast,children:S.jsx(s,{size:16,strokeWidth:l||m?2:1.5,className:mn("transition-[color,stroke-width] duration-80",l||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:c,children:v}):S.jsxs("div",{className:"relative",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[S.jsx(ki,{children:f&&S.jsx(Ka.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),v]})});bz.displayName="AccordionTrigger";const xz=g.forwardRef(({children:t,className:e,...n},r)=>{const s=CE(),{isOpen:i}=gz();return S.jsx(ki,{initial:!1,children:i&&S.jsx(zge,{forceMount:!0,asChild:!0,...n,children:S.jsx(Ka.div,{ref:r,className:mn("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...cm.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});xz.displayName="AccordionContent";const gv=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(vz,{type:"multiple",defaultValue:e,className:mn("w-full",n),children:t}),Kve=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return S.jsxs(wz,{value:t,className:mn("w-full",!l&&"border-t border-main-border"),children:[S.jsxs(bz,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(xz,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};gv.Item=Kve;const qve=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(W1,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),Gve=()=>{const[t,e]=g.useState(0);return g.useEffect(()=>{const n=Date.now(),r=setInterval(()=>e(Math.max(0,Math.floor((Date.now()-n)/1e3))),1e3);return()=>clearInterval(r)},[]),t},Yve=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},L4="M 12 8 C 14.21 8 16 9.79 16 12 C 16 14.21 14.21 16 12 16 C 9.79 16 8 14.21 8 12 C 8 9.79 9.79 8 12 8 Z",D4="M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",Xve="M 12 16 C 14.21 16 16 14.21 16 12 C 16 9.79 14.21 8 12 8 C 9.79 8 8 9.79 8 12 C 8 14.21 9.79 16 12 16 Z",vv=["Applying","Thinking","Planning","Crafting"],Qve=vv.reduce((t,e)=>t.length>=e.length?t:e),Jve=20,e1e="Still working — runs can take a few minutes.",t1e=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=Gve();g.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%vv.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=Jve?e1e:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(So.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(So.path,{animate:{d:[L4,D4,Xve,D4,L4]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Ip.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:Qve}),S.jsx(ki,{mode:"popLayout",initial:!1,children:S.jsx(So.span,{className:"shimmer-text col-start-1 row-start-1",initial:{y:"80%",opacity:0},animate:{y:0,opacity:1,transition:{duration:.24,ease:[.4,0,.2,1]}},exit:{y:"-80%",opacity:0,transition:{duration:.16,ease:[.4,0,.2,1]}},children:vv[n]},vv[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:Yve(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var n1e=Object.defineProperty,r1e=(t,e)=>n1e(t,"name",{value:e,configurable:!0});function P1(t,[e,n]){return Math.min(n,Math.max(e,t))}r1e(P1,"clamp");var s1e=Object.defineProperty,Xt=(t,e)=>s1e(t,"name",{value:e,configurable:!0}),$4={Horizontal:"horizontal"},i1e={LTR:"ltr"},Sz=["PageUp","PageDown"],kz=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ez={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Zm="Slider",[LS,o1e,a1e]=l7(Zm),[PE,hye]=pa(Zm,[a1e]),[l1e,nh]=PE(Zm),c1e=g.forwardRef(Xt(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l=$4.Horizontal,disabled:c=!1,minStepsBetweenThumbs:d=0,preserveThumbOrder:f=!1,defaultValue:h=[s],value:m,onValueChange:v=Xt(()=>{},"onValueChange"),onValueCommit:y=Xt(()=>{},"onValueCommit"),inverted:_=!1,form:b,...x}=e,k=g.useRef(new Set),C=g.useRef(0),P=g.useRef(!1),[R,O]=g.useState(null),A=l===$4.Horizontal?u1e:d1e,[M,L]=g.useState(null),z=xn(n,L),[$=[],q]=kc({prop:m,defaultProp:h,onChange:Xt(B=>{var G;(G=[...k.current][C.current])==null||G.focus({preventScroll:!0,focusVisible:P.current}),P.current=!1,v(B)},"onChange")}),X=g.useRef($),K=g.useRef($);g.useEffect(()=>{const B=b?M==null?void 0:M.ownerDocument.getElementById(b):M==null?void 0:M.closest("form");if(B instanceof HTMLFormElement){const D=Xt(()=>q(K.current),"reset");return B.addEventListener("reset",D),()=>B.removeEventListener("reset",D)}},[M,b,q]);function H(B){const D=Mz($,B);Q(B,D)}Xt(H,"handleSlideStart");function ee(B){Q(B,C.current)}Xt(ee,"handleSlideMove");function V(){String($)!==String(X.current)&&y($)}Xt(V,"handleSlideEnd");function Q(B,D,{commit:G}={commit:!1}){const fe=RE(o),ie=Lp(Math.round((B-s)/o)*o+s,fe),ue=P1(ie,[s,i]),he=d*o;function _e(ne){const be=f?P1(ue,[ne[D-1]===void 0?s:ne[D-1]+he,ne[D+1]===void 0?i:ne[D+1]-he]):ue,Ve=Iz(ne,be,D);return Dz(Ve,he)?{nextValues:Ve,changedIndex:f?D:Ve.indexOf(be),hasChanged:String(Ve)!==String(ne)}:null}Xt(_e,"getNextValues");const le=_e($);le!=null&&le.hasChanged&&O(le.nextValues),q((ne=[])=>{const be=_e(ne);return be?(C.current=be.changedIndex,be.hasChanged&&G&&y(be.nextValues),be.hasChanged?be.nextValues:ne):ne})}return Xt(Q,"updateValues"),S.jsx(l1e,{scope:e.__scopeSlider,name:r,disabled:c,min:s,max:i,valueIndexToChangeRef:C,thumbs:k.current,values:$,orientation:l,form:b,userRequestedValues:R,children:S.jsx(LS.Provider,{scope:e.__scopeSlider,children:S.jsx(LS.Slot,{scope:e.__scopeSlider,children:S.jsx(A,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:z,onPointerDown:bn(x.onPointerDown,()=>{c||(X.current=$,P.current=!1)}),min:s,max:i,inverted:_,onSlideStart:c?void 0:H,onSlideMove:c?void 0:ee,onSlideEnd:c?void 0:V,onHomeKeyDown:()=>{c||(P.current=!0,Q(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(P.current=!0,Q(i,$.length-1,{commit:!0}))},onStepKeyDown:({event:B,direction:D})=>{if(!c){P.current=!0;const ie=Sz.includes(B.key)||B.shiftKey&&kz.includes(B.key)?10:1,ue=C.current,he=$[ue],_e=$z(he,{min:s,step:o,direction:D,multiplier:ie});Q(_e,ue,{commit:!0})}}})})})})},"Slider")),[Cz,Pz]=PE(Zm,{startEdge:"left",endEdge:"right",size:"width",direction:1}),u1e=g.forwardRef(Xt(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[m,v]=g.useState(null),y=xn(n,v),_=g.useRef(void 0),b=bE(i),x=b===i1e.LTR,k=x&&!o||!x&&o;function C(P){const R=_.current||m.getBoundingClientRect(),O=[0,R.width],A=_y(O,k?[r,s]:[s,r]);return _.current=R,A(P-R.left)}return Xt(C,"getValueFromPointer"),S.jsx(Cz,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:S.jsx(Tz,{dir:b,"data-orientation":"horizontal",...h,ref:y,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const R=C(P.clientX);l==null||l(R)},onSlideMove:P=>{const R=C(P.clientX);c==null||c(R)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:P=>{const O=Ez[k?"from-left":"from-right"].includes(P.key);f==null||f({event:P,direction:O?-1:1})}})})},"SliderHorizontal")),d1e=g.forwardRef(Xt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=g.useRef(null),m=xn(n,h),v=g.useRef(void 0),y=!i;function _(b){const x=v.current||h.current.getBoundingClientRect(),k=[0,x.height],P=_y(k,y?[s,r]:[r,s]);return v.current=x,P(b-x.top)}return Xt(_,"getValueFromPointer"),S.jsx(Cz,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:S.jsx(Tz,{"data-orientation":"vertical",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const x=_(b.clientY);o==null||o(x)},onSlideMove:b=>{const x=_(b.clientY);l==null||l(x)},onSlideEnd:()=>{v.current=void 0,c==null||c()},onStepKeyDown:b=>{const k=Ez[y?"from-bottom":"from-top"].includes(b.key);d==null||d({event:b,direction:k?-1:1})}})})},"SliderVertical")),Tz=g.forwardRef(Xt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=nh(Zm,r);return S.jsx(er.span,{...f,ref:n,onKeyDown:bn(e.onKeyDown,m=>{m.key==="Home"?(l(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):Sz.concat(kz).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:bn(e.onPointerDown,m=>{const v=m.target;v.setPointerCapture(m.pointerId),m.preventDefault(),h.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:bn(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:bn(e.onPointerUp,m=>{const v=m.target;v.hasPointerCapture(m.pointerId)&&(v.releasePointerCapture(m.pointerId),o(m))})})},"SliderImpl")),f1e="SliderTrack",h1e=g.forwardRef(Xt(function(e,n){const{__scopeSlider:r,...s}=e,i=nh(f1e,r);return S.jsx(er.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),F4="SliderRange",p1e=g.forwardRef(Xt(function(e,n){const{__scopeSlider:r,...s}=e,i=nh(F4,r),o=Pz(F4,r),l=g.useRef(null),c=xn(n,l),d=i.values.length,f=i.values.map(v=>TE(v,i.min,i.max)),h=d>1?Math.min(...f):0,m=100-Math.max(...f);return S.jsx(er.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:c,style:{...e.style,[o.startEdge]:h+"%",[o.endEdge]:m+"%"}})},"SliderRange")),m1e="SliderThumb",[g1e,Rz]=PE(m1e),v1e="SliderThumbProvider";function Az(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=nh(v1e,e),o=o1e(e),[l,c]=g.useState(null),d=g.useMemo(()=>l?o().findIndex(b=>b.ref.current===l):-1,[o,l]),f=R6(l),h=l?!!i.form||!!l.closest("form"):!0,m=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),y=m===void 0?0:TE(m,i.min,i.max);g.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:m,name:v,form:i.form,isFormControl:h,index:d,thumb:l,onThumbChange:c,percent:y,size:f};return S.jsx(g1e,{scope:e,..._,children:Fz(s)?s(_):r})}Xt(Az,"SliderThumbProvider");var Qw="SliderThumbTrigger",y1e=g.forwardRef(Xt(function(e,n){const{__scopeSlider:r,...s}=e,i=nh(Qw,r),o=Pz(Qw,r),{index:l,value:c,percent:d,size:f,onThumbChange:h}=Rz(Qw,r),m=xn(n,h),v=Oz(l,i.values.length),y=f==null?void 0:f[o.size],_=y?Nz(y,d,o.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${d}% + ${_}px)`},children:S.jsx(LS.ItemSlot,{scope:r,children:S.jsx(er.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:c===void 0?{display:"none"}:e.style,onFocus:bn(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),_1e=g.forwardRef(Xt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(Az,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>S.jsxs(S.Fragment,{children:[S.jsx(y1e,{...i,ref:n,__scopeSlider:r}),l?S.jsx(w1e,{__scopeSlider:r},o):null]})})},"SliderThumb")),j4="SliderBubbleInput",w1e=g.forwardRef(Xt(function({__scopeSlider:e,onInput:n,...r},s){const{index:i,value:o,name:l,form:c}=Rz(j4,e),{userRequestedValues:d}=nh(j4,e),f=g.useRef(null),h=xn(f,s),m=g.useRef(!1),v=g.useRef(o),y=g.useRef(d),_=g.useRef(d);return g.useEffect(()=>{const b=f.current;if(!b)return;const x=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(x,"value").set,P=v.current,R=P!==o;v.current=o;const O=d!==_.current;if(_.current=d,R&&C){const I=d!==y.current;y.current=d;const A=d==null?void 0:d[i],M=I&&(O&&A!==P||A===o);m.current=!M;const L=new Event("input",{bubbles:!0});C.call(b,o),b.dispatchEvent(L),m.current=!1}},[i,o,d]),S.jsx(er.input,{style:{display:"none"},name:l,form:c,...r,ref:h,defaultValue:o,onInput:bn(n,b=>{m.current&&b.stopPropagation()})})},"SliderBubbleInput"));function Iz(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}Xt(Iz,"getNextSortedValues");function TE(t,e,n){const i=100/(n-e)*(t-e);return P1(i,[0,100])}Xt(TE,"convertValueToPercentage");function Oz(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}Xt(Oz,"getLabel");function Mz(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}Xt(Mz,"getClosestValueIndex");function Nz(t,e,n){const r=t/2,i=_y([0,50],[0,r]);return(r-i(e)*n)*n}Xt(Nz,"getThumbInBoundsOffset");function Lz(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}Xt(Lz,"getStepsBetweenValues");function Dz(t,e){if(e>0){const n=Lz(t);return Math.min(...n)>=e}return!0}Xt(Dz,"hasMinStepsBetweenValues");function _y(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}Xt(_y,"linearScale");function RE(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",o=Number(s);return Math.max(0,i.length-o)}const n=e.split(".")[1];return n?n.length:0}Xt(RE,"getDecimalCount");function Lp(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}Xt(Lp,"roundValue");function $z(t,{min:e,step:n,direction:r,multiplier:s}){const i=RE(n),o=(t-e)/n,l=Math.round(o),c=Lp(l*n+e,i)===Lp(t,i);let d;return c?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),Lp(d*n+e,i)}Xt($z,"getNextStepValue");function Fz(t){return typeof t=="function"}Xt(Fz,"isFunction");const DS=g.forwardRef(({className:t,...e},n)=>S.jsxs(c1e,{ref:n,className:mn("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(h1e,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(p1e,{className:"absolute h-full bg-primary"})}),S.jsx(_1e,{className:mn("block h-3.5 w-3.5 rounded-full border border-border bg-foreground shadow-sm","transition-transform hover:scale-110 active:scale-95","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#6B97FF]","disabled:pointer-events-none")})]}));DS.displayName="Slider";const b1e=[{name:"surface-1",utility:"bg-surface-1",className:"bg-surface-1"},{name:"surface-2",utility:"bg-surface-2",className:"bg-surface-2"},{name:"surface-3",utility:"bg-surface-3",className:"bg-surface-3"},{name:"surface-4",utility:"bg-surface-4",className:"bg-surface-4"},{name:"surface-5",utility:"bg-surface-5",className:"bg-surface-5"},{name:"surface-6",utility:"bg-surface-6",className:"bg-surface-6"}],x1e=[{name:"primary",utility:"bg-primary",className:"bg-primary"},{name:"selected",utility:"bg-selected",className:"bg-selected"},{name:"accent",utility:"bg-accent",className:"bg-accent"},{name:"success",utility:"bg-accent-success",className:"bg-accent-success"},{name:"warning",utility:"bg-accent-warning",className:"bg-accent-warning"},{name:"error",utility:"bg-accent-error",className:"bg-accent-error"}],S1e=[{name:"gap-1",className:"w-1"},{name:"gap-2",className:"w-2"},{name:"gap-3",className:"w-3"},{name:"gap-4",className:"w-4"},{name:"gap-6",className:"w-6"},{name:"gap-8",className:"w-8"}],Ng=[{name:"Accordion",path:"components/Accordion.tsx",status:"showcased",note:"Reusable primitive shown with local item composition."},{name:"AgentVariantsPanel",path:"components/AgentVariantsPanel.tsx",status:"feature-only",note:"Requires live variant session state and editor atoms."},{name:"AuthProgressScreen",path:"components/AuthProgressScreen.tsx",status:"feature-only",note:"Auth flow surface; represented through progress treatment."},{name:"AuthScreenView",path:"components/AuthScreenView.tsx",status:"feature-only",note:"Auth flow surface that depends on sign-in actions."},{name:"Button",path:"components/Button.tsx",status:"showcased",note:"Reusable tooltip-wrapped button shown in multiple states."},{name:"CommentCarouselLayer",path:"components/CommentCarouselLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to iframe geometry."},{name:"ElementInspector",path:"components/ElementInspector.tsx",status:"feature-only",note:"Primary editor surface with many app-level dependencies."},{name:"GitHome",path:"components/GitHome.tsx",status:"feature-only",note:"Git dashboard tied to repository state."},{name:"IframePreview",path:"components/IframePreview.tsx",status:"unsuitable",note:"Needs live iframe target and cross-window integration."},{name:"PreviewFrame",path:"components/PreviewFrame.tsx",status:"unsuitable",note:"Requires proxied app URL and iframe lifecycle."},{name:"PreviewSurface",path:"components/PreviewSurface.tsx",status:"unsuitable",note:"Requires preview iframe and overlay orchestration."},{name:"ProfileAvatar",path:"components/ProfileAvatar.tsx",status:"feature-only",note:"Account chrome tied to user identity data."},{name:"Progress",path:"components/Progress.tsx",status:"showcased",note:"Reusable inline loading/status primitive."},{name:"SecondaryVariantIframe",path:"components/SecondaryVariantIframe.tsx",status:"unsuitable",note:"Requires variant preview iframe lifecycle."},{name:"SparkleLoader",path:"components/SparkleLoader.tsx",status:"showcased",note:"Reusable loading animation shown in feedback states."},{name:"SplitButton",path:"components/SplitButton.tsx",status:"showcased",note:"Reusable compound action button shown with dropdown."},{name:"StatusSurface",path:"components/StatusSurface.tsx",status:"showcased",note:"Unified full-surface primitive: LoadingSurface / EmptyState / ErrorState."},{name:"SupportTicketModal",path:"components/SupportTicketModal.tsx",status:"feature-only",note:"Support workflow modal tied to form submission."},{name:"ThinkingIndicator",path:"components/ThinkingIndicator.tsx",status:"showcased",note:"Reusable thinking/loading indicator shown in feedback states."},{name:"Tooltip",path:"components/Tooltip.tsx",status:"showcased",note:"Reusable tooltip API shown with hover target."},{name:"VariantDragGhost",path:"components/VariantDragGhost.tsx",status:"feature-only",note:"Drag visual tied to variant split interactions."},{name:"VariantSplitDropZones",path:"components/VariantSplitDropZones.tsx",status:"feature-only",note:"Drop-zone visual tied to variant split interactions."},{name:"ui/accordion",path:"components/ui/accordion.tsx",status:"showcased",note:"Radix accordion primitive backing the local Accordion showcase."},{name:"ui/slider",path:"components/ui/slider.tsx",status:"showcased",note:"Radix slider primitive shown in enabled and disabled states."},{name:"ui/tooltip",path:"components/ui/tooltip.tsx",status:"showcased",note:"Radix tooltip primitive shown with forced-open preview."}],k1e=()=>{window.location.hash=""},Ia=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),z4=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),E1e=t=>t==="showcased"?"border-accent-success/40 bg-accent-success/10 text-accent-success":t==="cataloged"?"border-primary/40 bg-primary/10 text-primary":t==="generated"?"border-accent/40 bg-accent/10 text-accent":t==="unsuitable"?"border-accent-warning/40 bg-accent-warning/10 text-accent-warning":"border-border bg-surface-4 text-content-muted",C1e=()=>{const t=Ng.filter(n=>n.status==="showcased").length,e=Ng.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:k1e,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(wae,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(_D,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Ia,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"Rivet's shared Button exposes variants and sizes backed by Fluid Functionalism, alongside the split button and tooltip controls.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(oa,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),S.jsx(oa,{title:"Secondary action",variant:"secondary",children:"Secondary"}),S.jsx(oa,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),S.jsx(OF,{primaryLabel:"Ship",primaryIcon:yw,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(zu,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(N6,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(Ia,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx(z4,{swatches:b1e})}),S.jsx(Ia,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(z4,{swatches:x1e})}),S.jsx(Ia,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(Ia,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:S1e.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(Ia,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(gv,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(gv.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(yw,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(gv.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx(DS,{defaultValue:[64],max:100,step:1}),S.jsx(DS,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Ia,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(qve,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(W6,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx(t1e,{hint:"Reading selected elements"})})]})}),S.jsx(Ia,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(_S,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(uj,{icon:S.jsx(yw,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(Q6,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Ia,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:Ng.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:Ng.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${E1e(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},P1e=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",$S=274,T1=395,Jw=Math.min(T1,Math.round(($S+T1)/2*1.1)),V4="rivet:panelWidth:v2",T1e=({projectPath:t,libraryOrigin:e})=>{const n=bt(kF)>0,[r,s]=h9(xF),i=Ai(),o=voe(),l=g.useCallback(M=>{const L=!r;i==null||i.capture("editor.ui_toggled",{source:M,isOpen:L}),s(L)},[r,i,s]),[c,d]=g.useState(()=>{if(typeof window>"u")return Jw;const M=Number(window.localStorage.getItem(V4));return Number.isFinite(M)&&M>=$S&&M<=T1?M:Jw}),[f,h]=g.useState(!1),[m,v]=g.useState(W0e),y=r?c:0,[_,b]=g.useState(r);!r&&_&&b(!1);const[x,k]=g.useState(0);y!==x&&(k(y),r&&v(M=>Z0e({position:M,boundsLeftPx:c}))),g.useEffect(()=>{window.localStorage.setItem(V4,String(c))},[c]),g.useEffect(()=>{const M=L=>{if(!o9(L.target)){if(dhe(L)){L.preventDefault(),l("shortcut");return}L.key!=="Escape"||!r||(L.preventDefault(),s(!1))}};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[r,s,l]);const C=g.useCallback(M=>{M.preventDefault(),M.stopPropagation();const L=M.clientX,z=c;h(!0);const $=X=>{const K=Math.min(T1,Math.max($S,z+(X.clientX-L)));d(K)},q=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",q),window.removeEventListener("pointercancel",q),h(!1)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",q),window.addEventListener("pointercancel",q)},[c]),P=g.useCallback(()=>d(Jw),[]),R=oge(),O=bt(uy);cge({enabled:!O});const I=R.isProcessing?"Completing authentication...":null,A=Nt(cy);return g.useEffect(()=>{A(t??null)},[t,A]),S.jsxs(So.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[I!==null?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(O0e,{message:I})}):null,S.jsx(ome,{}),S.jsx(S.Fragment,{children:n?null:S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:_?c:0},children:S.jsxs(So.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:r?0:-c},transition:o?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{r&&b(!0)},style:{width:c,willChange:"transform"},children:[S.jsx(hpe,{onClose:()=>s(!1),libraryOrigin:e}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:C,onDoubleClick:P,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${f?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),f&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(G0e,{isVisible:!0,isPanelOpen:r,isReducedMotion:!!o,position:m,dragBoundsLeftPx:y,onPositionChange:v,onToggle:()=>l("click")})]})}),S.jsx(Koe,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},FS="rivet_connect_deep_link",R1e=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(FS);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(FS,n),e){t.delete("connect");const r=t.toString();window.history.replaceState(null,document.title,window.location.pathname+(r?`?${r}`:"")+window.location.hash)}return n},A1e=R1e(),I1e=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(g1)==="1"),[r,s]=g.useState(!1),[i,o]=g.useState(A1e);g.useEffect(()=>{n&&window.sessionStorage.removeItem(g1)},[n]);const{config:l,refetchConfig:c,loading:d,error:f}=ige(),h=Nt(uy),{startLogin:m,isStartingLogin:v,loginError:y}=QF(),[_,b]=g.useState(!1);Hee(l??void 0),g.useEffect(()=>{l&&Qe.register({source:"visual_editor",surface:"visual_editor"})},[l]);const x=l!=null&&l.agentModeAvailable!==!0,k=P1e(t),C=g.useCallback(async()=>{b(!0),h(!0);try{await c()}finally{h(!1),b(!1)}},[c,h]);if(g.useEffect(()=>{const I=()=>{const A=window.location.hash;e(A)};return window.addEventListener("hashchange",I),()=>window.removeEventListener("hashchange",I)},[]),k==="design-system")return S.jsx(C1e,{});if(!d&&l===null&&!_){const I=f||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-muted mt-2 text-xs",children:I}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{C()},children:"Retry"})]})})}if(x)return S.jsx(A0e,{isSigningIn:v,onStartSignIn:()=>{m()},errorMessage:y,displayMode:"full"});const R=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,O=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!R;return S.jsxs(S.Fragment,{children:[S.jsx(T1e,{projectPath:l==null?void 0:l.projectPath,libraryOrigin:(l==null?void 0:l.libraryOrigin)??null}),S.jsx(gS,{context:"onboarding",isOpen:O,onClose:()=>s(!0)}),S.jsx(gS,{context:"menu",isOpen:R,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(FS),o(null)}})]})};EH();const O1e=g.lazy(()=>J4(()=>import("./LibraryEntry-BZ5EdFgA.js"),[])),AE=window.location.pathname.startsWith("/rivet/library");AE||Lee();const M1e=new oee,N1e=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})}),jz=document.getElementById("root");if(!jz)throw new Error("Rivet root element is missing");const L1e=()=>Vee.createRoot(jz).render(S.jsx(Ee.StrictMode,{children:S.jsx(bee,{client:Qe,children:S.jsx(Pee,{fallback:S.jsx(N1e,{}),children:S.jsx(NJ,{client:M1e,children:S.jsx(Dle,{defaultShape:"rounded",children:S.jsx(Zve,{defaultLibrary:"lucide",children:AE?S.jsx(g.Suspense,{fallback:S.jsx("div",{className:"bg-background h-screen"}),children:S.jsx(O1e,{})}):S.jsx(I1e,{})})})})})})})),D1e=async()=>{AE&&await EJ(),await MJ(),L1e()};D1e();export{Ek as $,oy as A,oa as B,ay as C,ny as D,z1e as E,on as F,Gs as G,M0e as H,$m as I,Mve as J,UN as K,ca as L,CD as M,Qs as N,nve as O,z6 as P,eee as Q,Ap as R,qf as S,ze as T,j1e as U,F1e as V,Rt as W,Hve as X,Im as Y,Dn as Z,se as _,aee as a,Ys as a0,cye as a1,uye as a2,CJ as a3,whe as a4,mn as a5,s9 as a6,B1e as a7,U1e as a8,Hee as a9,sye as aa,iye as ab,Xge as ac,fpe as ad,Koe as ae,Y1e as af,X1e as ag,fhe as ah,G1e as ai,W1e as aj,Z1e as ak,H1e as al,V1e as am,K1e as an,q1e as ao,tye as ap,eye as aq,Q1e as ar,QF as as,Ft as at,$N as au,kJ as av,SJ as aw,J1e as ax,uee as b,g as c,dee as d,pee as e,fee as f,Is as g,mee as h,gee as i,hee as j,yt as k,Ai as l,yF as m,Ir as n,S as o,Bx as p,V6 as q,YN as r,Zg as s,H6 as t,Om as u,U6 as v,Cve as w,ry as x,sy as y,iy as z};
497
- //# sourceMappingURL=main-RriU35pI.js.map