rivet-design 0.16.2 → 0.16.3

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,423 +0,0 @@
1
- var sL=Object.defineProperty;var Z6=t=>{throw TypeError(t)};var iL=(t,e,n)=>e in t?sL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Jo=(t,e,n)=>iL(t,typeof e!="symbol"?e+"":e,n),e1=(t,e,n)=>e.has(t)||Z6("Cannot "+n);var B=(t,e,n)=>(e1(t,e,"read from private field"),n?n.call(t):e.get(t)),Ke=(t,e,n)=>e.has(t)?Z6("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ae=(t,e,n,r)=>(e1(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),vt=(t,e,n)=>(e1(t,e,"access private method"),n);var kp=(t,e,n,r)=>({set _(s){Ae(t,e,s,n)},get _(){return B(t,e,r)}});function oL(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)}})();function Bm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var t1={exports:{}},Md={},n1={exports:{}},ht={};/**
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 q6;function aL(){if(q6)return ht;q6=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"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function v(N){return N===null||typeof N!="object"?null:(N=p&&N[p]||N["@@iterator"],typeof N=="function"?N:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function x(N,G,oe){this.props=N,this.context=G,this.refs=_,this.updater=oe||y}x.prototype.isReactComponent={},x.prototype.setState=function(N,G){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,G,"setState")},x.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function b(){}b.prototype=x.prototype;function k(N,G,oe){this.props=N,this.context=G,this.refs=_,this.updater=oe||y}var C=k.prototype=new b;C.constructor=k,w(C,x.prototype),C.isPureReactComponent=!0;var P=Array.isArray,T=Object.prototype.hasOwnProperty,O={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function R(N,G,oe){var se,ee={},de=null,ve=null;if(G!=null)for(se in G.ref!==void 0&&(ve=G.ref),G.key!==void 0&&(de=""+G.key),G)T.call(G,se)&&!M.hasOwnProperty(se)&&(ee[se]=G[se]);var le=arguments.length-2;if(le===1)ee.children=oe;else if(1<le){for(var te=Array(le),Pe=0;Pe<le;Pe++)te[Pe]=arguments[Pe+2];ee.children=te}if(N&&N.defaultProps)for(se in le=N.defaultProps,le)ee[se]===void 0&&(ee[se]=le[se]);return{$$typeof:t,type:N,key:de,ref:ve,props:ee,_owner:O.current}}function L(N,G){return{$$typeof:t,type:N.type,key:G,ref:N.ref,props:N.props,_owner:N._owner}}function D(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function V(N){var G={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(oe){return G[oe]})}var j=/\/+/g;function U(N,G){return typeof N=="object"&&N!==null&&N.key!=null?V(""+N.key):G.toString(36)}function X(N,G,oe,se,ee){var de=typeof N;(de==="undefined"||de==="boolean")&&(N=null);var ve=!1;if(N===null)ve=!0;else switch(de){case"string":case"number":ve=!0;break;case"object":switch(N.$$typeof){case t:case e:ve=!0}}if(ve)return ve=N,ee=ee(ve),N=se===""?"."+U(ve,0):se,P(ee)?(oe="",N!=null&&(oe=N.replace(j,"$&/")+"/"),X(ee,G,oe,"",function(Pe){return Pe})):ee!=null&&(D(ee)&&(ee=L(ee,oe+(!ee.key||ve&&ve.key===ee.key?"":(""+ee.key).replace(j,"$&/")+"/")+N)),G.push(ee)),1;if(ve=0,se=se===""?".":se+":",P(N))for(var le=0;le<N.length;le++){de=N[le];var te=se+U(de,le);ve+=X(de,G,oe,te,ee)}else if(te=v(N),typeof te=="function")for(N=te.call(N),le=0;!(de=N.next()).done;)de=de.value,te=se+U(de,le++),ve+=X(de,G,oe,te,ee);else if(de==="object")throw G=String(N),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return ve}function q(N,G,oe){if(N==null)return N;var se=[],ee=0;return X(N,se,"","",function(de){return G.call(oe,de,ee++)}),se}function Z(N){if(N._status===-1){var G=N._result;G=G(),G.then(function(oe){(N._status===0||N._status===-1)&&(N._status=1,N._result=oe)},function(oe){(N._status===0||N._status===-1)&&(N._status=2,N._result=oe)}),N._status===-1&&(N._status=0,N._result=G)}if(N._status===1)return N._result.default;throw N._result}var Y={current:null},H={transition:null},Q={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:H,ReactCurrentOwner:O};function z(){throw Error("act(...) is not supported in production builds of React.")}return ht.Children={map:q,forEach:function(N,G,oe){q(N,function(){G.apply(this,arguments)},oe)},count:function(N){var G=0;return q(N,function(){G++}),G},toArray:function(N){return q(N,function(G){return G})||[]},only:function(N){if(!D(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},ht.Component=x,ht.Fragment=n,ht.Profiler=s,ht.PureComponent=k,ht.StrictMode=r,ht.Suspense=u,ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,ht.act=z,ht.cloneElement=function(N,G,oe){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var se=w({},N.props),ee=N.key,de=N.ref,ve=N._owner;if(G!=null){if(G.ref!==void 0&&(de=G.ref,ve=O.current),G.key!==void 0&&(ee=""+G.key),N.type&&N.type.defaultProps)var le=N.type.defaultProps;for(te in G)T.call(G,te)&&!M.hasOwnProperty(te)&&(se[te]=G[te]===void 0&&le!==void 0?le[te]:G[te])}var te=arguments.length-2;if(te===1)se.children=oe;else if(1<te){le=Array(te);for(var Pe=0;Pe<te;Pe++)le[Pe]=arguments[Pe+2];se.children=le}return{$$typeof:t,type:N.type,key:ee,ref:de,props:se,_owner:ve}},ht.createContext=function(N){return N={$$typeof:o,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:i,_context:N},N.Consumer=N},ht.createElement=R,ht.createFactory=function(N){var G=R.bind(null,N);return G.type=N,G},ht.createRef=function(){return{current:null}},ht.forwardRef=function(N){return{$$typeof:l,render:N}},ht.isValidElement=D,ht.lazy=function(N){return{$$typeof:f,_payload:{_status:-1,_result:N},_init:Z}},ht.memo=function(N,G){return{$$typeof:d,type:N,compare:G===void 0?null:G}},ht.startTransition=function(N){var G=H.transition;H.transition={};try{N()}finally{H.transition=G}},ht.unstable_act=z,ht.useCallback=function(N,G){return Y.current.useCallback(N,G)},ht.useContext=function(N){return Y.current.useContext(N)},ht.useDebugValue=function(){},ht.useDeferredValue=function(N){return Y.current.useDeferredValue(N)},ht.useEffect=function(N,G){return Y.current.useEffect(N,G)},ht.useId=function(){return Y.current.useId()},ht.useImperativeHandle=function(N,G,oe){return Y.current.useImperativeHandle(N,G,oe)},ht.useInsertionEffect=function(N,G){return Y.current.useInsertionEffect(N,G)},ht.useLayoutEffect=function(N,G){return Y.current.useLayoutEffect(N,G)},ht.useMemo=function(N,G){return Y.current.useMemo(N,G)},ht.useReducer=function(N,G,oe){return Y.current.useReducer(N,G,oe)},ht.useRef=function(N){return Y.current.useRef(N)},ht.useState=function(N){return Y.current.useState(N)},ht.useSyncExternalStore=function(N,G,oe){return Y.current.useSyncExternalStore(N,G,oe)},ht.useTransition=function(){return Y.current.useTransition()},ht.version="18.3.1",ht}var G6;function dw(){return G6||(G6=1,n1.exports=aL()),n1.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 K6;function lL(){if(K6)return Md;K6=1;var t=dw(),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,u,d){var f,p={},v=null,y=null;d!==void 0&&(v=""+d),u.key!==void 0&&(v=""+u.key),u.ref!==void 0&&(y=u.ref);for(f in u)r.call(u,f)&&!i.hasOwnProperty(f)&&(p[f]=u[f]);if(l&&l.defaultProps)for(f in u=l.defaultProps,u)p[f]===void 0&&(p[f]=u[f]);return{$$typeof:e,type:l,key:v,ref:y,props:p,_owner:s.current}}return Md.Fragment=n,Md.jsx=o,Md.jsxs=o,Md}var Y6;function cL(){return Y6||(Y6=1,t1.exports=lL()),t1.exports}var S=cL(),m=dw();const we=Bm(m),th=oL({__proto__:null,default:we},[m]),t3=m.createContext(void 0),n3=t=>{const e=m.useContext(t3);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},uL=({client:t,children:e})=>(m.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(t3.Provider,{value:t,children:e})),dL={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var oa,uw,WC,fL=(WC=class{constructor(){Ke(this,oa,dL);Ke(this,uw,!1)}setTimeoutProvider(t){Ae(this,oa,t)}setTimeout(t,e){return B(this,oa).setTimeout(t,e)}clearTimeout(t){B(this,oa).clearTimeout(t)}setInterval(t,e){return B(this,oa).setInterval(t,e)}clearInterval(t){B(this,oa).clearInterval(t)}},oa=new WeakMap,uw=new WeakMap,WC);const Sl=new fL;function hL(t){setTimeout(t,0)}const pL=typeof window>"u"||"Deno"in globalThis;function Vr(){}function mL(t,e){return typeof t=="function"?t(e):t}function r3(t){return typeof t=="number"&&t>=0&&t!==1/0}function s3(t,e){return Math.max(t+(e||0)-Date.now(),0)}function pn(t,e){return typeof t=="function"?t(e):t}function X6(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==fw(o,e.options))return!1}else if(!Su(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function Q6(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(xf(e.options.mutationKey)!==xf(i))return!1}else if(!Su(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function fw(t,e){return((e==null?void 0:e.queryKeyHashFn)||xf)(t)}function xf(t){return JSON.stringify(t,(e,n)=>Vy(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Su(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)){for(let r=0;r<e.length;r++)if(!Su(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Su(t[r],e[r]))return!1;return!0}return!1}const vL=Object.prototype.hasOwnProperty;function i3(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=J6(t)&&J6(e);if(!r&&!(Vy(t)&&Vy(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 u=0;for(let d=0;d<o;d++){const f=r?d:i[d],p=t[f],v=e[f];if(p===v){l[f]=p,(r?d<s:vL.call(t,f))&&u++;continue}if(p===null||v===null||typeof p!="object"||typeof v!="object"){l[f]=v;continue}const y=i3(p,v,n+1);l[f]=y,y===p&&u++}return s===o&&u===s?t:l}function r1(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function J6(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Vy(t){if(!eS(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!eS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function eS(t){return Object.prototype.toString.call(t)==="[object Object]"}function gL(t){return new Promise(e=>{Sl.setTimeout(e,t)})}function $y(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?i3(t,e):e}function yL(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function _L(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const hw=Symbol();function o3(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===hw?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function a3(t,e){return typeof t=="function"?t(...e):!!t}function wL(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}let xL=()=>pL;const pw=()=>xL();var nh=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(){}},Al,aa,uu,ZC,bL=(ZC=class extends nh{constructor(){super();Ke(this,Al);Ke(this,aa);Ke(this,uu);Ae(this,uu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){B(this,aa)||this.setEventListener(B(this,uu))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,aa))==null||e.call(this),Ae(this,aa,void 0))}setEventListener(e){var n;Ae(this,uu,e),(n=B(this,aa))==null||n.call(this),Ae(this,aa,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){B(this,Al)!==e&&(Ae(this,Al,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof B(this,Al)=="boolean"?B(this,Al):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Al=new WeakMap,aa=new WeakMap,uu=new WeakMap,ZC);const mw=new bL,SL=hL;function EL(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=SL;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||o()}return u},batchCalls:l=>(...u)=>{i(()=>{l(...u)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const or=EL();var du,la,fu,qC,kL=(qC=class extends nh{constructor(){super();Ke(this,du,!0);Ke(this,la);Ke(this,fu);Ae(this,fu,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(){B(this,la)||this.setEventListener(B(this,fu))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,la))==null||e.call(this),Ae(this,la,void 0))}setEventListener(e){var n;Ae(this,fu,e),(n=B(this,la))==null||n.call(this),Ae(this,la,e(this.setOnline.bind(this)))}setOnline(e){B(this,du)!==e&&(Ae(this,du,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return B(this,du)}},du=new WeakMap,la=new WeakMap,fu=new WeakMap,qC);const z0=new kL;function CL(t){return Math.min(1e3*2**t,3e4)}function l3(t){return(t??"online")==="online"?z0.isOnline():!0}var Hy=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function c3(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((k,C)=>{i=k,o=C});l.catch(Vr);const u=()=>s!=="pending",d=k=>{var C;if(!u()){const P=new Hy(k);_(P),(C=t.onCancel)==null||C.call(t,P)}},f=()=>{e=!0},p=()=>{e=!1},v=()=>mw.isFocused()&&(t.networkMode==="always"||z0.isOnline())&&t.canRun(),y=()=>l3(t.networkMode)&&t.canRun(),w=k=>{u()||(r==null||r(),s="resolved",i(k))},_=k=>{u()||(r==null||r(),s="rejected",o(k))},x=()=>new Promise(k=>{var C;r=P=>{(u()||v())&&k(P)},(C=t.onPause)==null||C.call(t)}).then(()=>{var k;r=void 0,u()||(k=t.onContinue)==null||k.call(t)}),b=()=>{if(u())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(w).catch(P=>{var L;if(u())return;const T=t.retry??(pw()?0:3),O=t.retryDelay??CL,M=typeof O=="function"?O(n,P):O,R=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,P);if(e||!R){_(P);return}n++,(L=t.onFail)==null||L.call(t,n,P),gL(M).then(()=>v()?void 0:x()).then(()=>{e?_(P):b()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:p,canStart:y,start:()=>(y()?b():x().then(b),l)}}var Tl,GC,u3=(GC=class{constructor(){Ke(this,Tl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),r3(this.gcTime)&&Ae(this,Tl,Sl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(pw()?1/0:3e5))}clearGcTimeout(){B(this,Tl)!==void 0&&(Sl.clearTimeout(B(this,Tl)),Ae(this,Tl,void 0))}},Tl=new WeakMap,GC);function PL(t){return{onFetch:(e,n)=>{var f,p,v,y,w;const r=e.options,s=(v=(p=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,i=((y=e.state.data)==null?void 0:y.pages)||[],o=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const x=C=>{wL(C,()=>e.signal,()=>_=!0)},b=o3(e.options,e.fetchOptions),k=async(C,P,T)=>{if(_)return Promise.reject(e.signal.reason);if(P==null&&C.pages.length)return Promise.resolve(C);const M=(()=>{const V={client:e.client,queryKey:e.queryKey,pageParam:P,direction:T?"backward":"forward",meta:e.options.meta};return x(V),V})(),R=await b(M),{maxPages:L}=e.options,D=T?_L:yL;return{pages:D(C.pages,R,L),pageParams:D(C.pageParams,P,L)}};if(s&&i.length){const C=s==="backward",P=C?AL:tS,T={pages:i,pageParams:o};l=await k(T,P(r,T),C)}else{const C=t??i.length;do{const P=u===0?o[0]??r.initialPageParam:tS(r,l);if(u>0&&P==null)break;l=await k(l,P),u++}while(u<C)}return l};e.options.persister?e.fetchFn=()=>{var _,x;return(x=(_=e.options).persister)==null?void 0:x.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function tS(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 AL(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 hu,Rl,pu,Ds,Il,jn,Yf,Ml,oi,lo,KC,TL=(KC=class extends u3{constructor(e){super();Ke(this,oi);Ke(this,hu);Ke(this,Rl);Ke(this,pu);Ke(this,Ds);Ke(this,Il);Ke(this,jn);Ke(this,Yf);Ke(this,Ml);Ae(this,Ml,!1),Ae(this,Yf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ae(this,Il,e.client),Ae(this,Ds,B(this,Il).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ae(this,Rl,rS(this.options)),this.state=e.state??B(this,Rl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return B(this,hu)}get promise(){var e;return(e=B(this,jn))==null?void 0:e.promise}setOptions(e){if(this.options={...B(this,Yf),...e},e!=null&&e._type&&Ae(this,hu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=rS(this.options);n.data!==void 0&&(this.setState(nS(n.data,n.dataUpdatedAt)),Ae(this,Rl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&B(this,Ds).remove(this)}setData(e,n){const r=$y(this.state.data,e,this.options);return vt(this,oi,lo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){vt(this,oi,lo).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=B(this,jn))==null?void 0:r.promise;return(s=B(this,jn))==null||s.cancel(e),n?n.then(Vr).catch(Vr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return B(this,Rl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>pn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hw||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>pn(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:!s3(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=B(this,jn))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=B(this,jn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),B(this,Ds).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||(B(this,jn)&&(B(this,Ml)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?B(this,jn).cancel({revert:!0}):B(this,jn).cancelRetry()),this.scheduleGc()),B(this,Ds).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||vt(this,oi,lo).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,p,v,y,w,_,x,b,k,C,P;if(this.state.fetchStatus!=="idle"&&((d=B(this,jn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(B(this,jn))return B(this,jn).continueRetry(),B(this,jn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(O=>O.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Ae(this,Ml,!0),r.signal)})},i=()=>{const T=o3(this.options,n),M=(()=>{const R={client:B(this,Il),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return Ae(this,Ml,!1),this.options.persister?this.options.persister(T,M,this):T(M)},l=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:B(this,Il),state:this.state,fetchFn:i};return s(T),T})();(f=B(this,hu)==="infinite"?PL(this.options.pages):this.options.behavior)==null||f.onFetch(l,this),Ae(this,pu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&vt(this,oi,lo).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta});const u=Ae(this,jn,c3({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:T=>{T instanceof Hy&&T.revert&&this.setState({...B(this,pu),fetchStatus:"idle"}),r.abort()},onFail:(T,O)=>{vt(this,oi,lo).call(this,{type:"failed",failureCount:T,error:O})},onPause:()=>{vt(this,oi,lo).call(this,{type:"pause"})},onContinue:()=>{vt(this,oi,lo).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const T=await u.start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(w=(y=B(this,Ds).config).onSuccess)==null||w.call(y,T,this),(x=(_=B(this,Ds).config).onSettled)==null||x.call(_,T,this.state.error,this),T}catch(T){if(T instanceof Hy){if(T.silent)return B(this,jn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw vt(this,oi,lo).call(this,{type:"error",error:T}),(k=(b=B(this,Ds).config).onError)==null||k.call(b,T,this),(P=(C=B(this,Ds).config).onSettled)==null||P.call(C,this.state.data,T,this),T}finally{B(this,jn)===u&&Ae(this,jn,void 0),this.scheduleGc()}}},hu=new WeakMap,Rl=new WeakMap,pu=new WeakMap,Ds=new WeakMap,Il=new WeakMap,jn=new WeakMap,Yf=new WeakMap,Ml=new WeakMap,oi=new WeakSet,lo=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,...d3(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...nS(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(this,pu,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),or.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),B(this,Ds).notify({query:this,type:"updated",action:e})})},KC);function d3(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l3(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function nS(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rS(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 br,gt,Xf,Sr,Ol,mu,vo,Qf,vu,gu,Ll,Dl,ca,yu,Tt,Gd,zy,By,Uy,Wy,Zy,qy,Gy,Ky,YC,RL=(YC=class extends nh{constructor(e,n){super();Ke(this,Tt);Ke(this,br);Ke(this,gt);Ke(this,Xf);Ke(this,Sr);Ke(this,Ol);Ke(this,mu);Ke(this,vo);Ke(this,Qf);Ke(this,vu);Ke(this,gu);Ke(this,Ll);Ke(this,Dl);Ke(this,ca);Ke(this,yu,new Set);this.options=n,Ae(this,br,e),Ae(this,vo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(B(this,gt).addObserver(this),sS(B(this,gt),this.options)?vt(this,Tt,Gd).call(this):this.updateResult(),vt(this,Tt,Zy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yy(B(this,gt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yy(B(this,gt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,vt(this,Tt,qy).call(this),vt(this,Tt,Gy).call(this),B(this,gt).removeObserver(this)}setOptions(e){const n=this.options,r=B(this,gt);if(this.options=B(this,br).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pn(this.options.enabled,B(this,gt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");vt(this,Tt,Ky).call(this),B(this,gt).setOptions(this.options),n._defaulted&&!r1(this.options,n)&&B(this,br).getQueryCache().notify({type:"observerOptionsUpdated",query:B(this,gt),observer:this});const s=this.hasListeners();s&&iS(B(this,gt),r,this.options,n)&&vt(this,Tt,Gd).call(this),this.updateResult(),s&&(B(this,gt)!==r||pn(this.options.enabled,B(this,gt))!==pn(n.enabled,B(this,gt))||pn(this.options.staleTime,B(this,gt))!==pn(n.staleTime,B(this,gt)))&&vt(this,Tt,By).call(this);const i=vt(this,Tt,Uy).call(this);s&&(B(this,gt)!==r||pn(this.options.enabled,B(this,gt))!==pn(n.enabled,B(this,gt))||i!==B(this,ca))&&vt(this,Tt,Wy).call(this,i)}getOptimisticResult(e){const n=B(this,br).getQueryCache().build(B(this,br),e),r=this.createResult(n,e);return r1(this.getCurrentResult(),r)||(Ae(this,Sr,r),Ae(this,mu,this.options),Ae(this,Ol,B(this,gt).state)),r}getCurrentResult(){return B(this,Sr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){B(this,yu).add(e)}getCurrentQuery(){return B(this,gt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=B(this,br).defaultQueryOptions(e),r=B(this,br).getQueryCache().build(B(this,br),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=B(this,br).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return vt(this,Tt,Gd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),B(this,Sr)))}createResult(e,n){var O;const r=B(this,gt),s=this.options,i=B(this,Sr),o=B(this,Ol),l=B(this,mu),u=e!==r?e.state:B(this,Xf),{state:d}=e;let f={...d},p=!1,v;if(n._optimisticResults){const M=this.hasListeners(),R=!M&&sS(e,n),L=M&&iS(e,r,n,s);(R||L)&&(f={...f,...d3(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:_}=f;v=f.data;let x=!1;if(n.placeholderData!==void 0&&v===void 0&&_==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(M=i.data,x=!0):M=typeof n.placeholderData=="function"?n.placeholderData((O=B(this,gu))==null?void 0:O.state.data,B(this,gu)):n.placeholderData,M!==void 0&&(_="success",v=$y(i==null?void 0:i.data,M,n),p=!0)}if(n.select&&v!==void 0&&!x)if(i&&v===(o==null?void 0:o.data)&&n.select===B(this,Qf))v=B(this,vu);else try{Ae(this,Qf,n.select),v=n.select(v),v=$y(i==null?void 0:i.data,v,n),Ae(this,vu,v),Ae(this,vo,null)}catch(M){Ae(this,vo,M)}else v===void 0&&Ae(this,vo,null);B(this,vo)&&(y=B(this,vo),v=B(this,vu),w=Date.now(),_="error",p=!1);const b=f.fetchStatus==="fetching",k=_==="pending",C=_==="error",P=k&&b,T=v!==void 0;return{status:_,fetchStatus:f.fetchStatus,isPending:k,isSuccess:_==="success",isError:C,isInitialLoading:P,isLoading:P,data:v,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!k,isLoadingError:C&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:C&&T,isStale:vw(e,n),refetch:this.refetch,isEnabled:pn(n.enabled,e)!==!1}}updateResult(){const e=B(this,Sr),n=this.createResult(B(this,gt),this.options);if(Ae(this,Ol,B(this,gt).state),Ae(this,mu,this.options),B(this,Ol).data!==void 0&&Ae(this,gu,B(this,gt)),r1(n,e))return;Ae(this,Sr,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!B(this,yu).size)return!0;const l=new Set(o??B(this,yu));return this.options.throwOnError&&l.add("error"),Object.keys(B(this,Sr)).some(u=>{const d=u;return B(this,Sr)[d]!==e[d]&&l.has(d)})})();or.batch(()=>{s&&this.listeners.forEach(i=>{i(B(this,Sr))}),B(this,br).getQueryCache().notify({query:B(this,gt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&vt(this,Tt,Zy).call(this)}},br=new WeakMap,gt=new WeakMap,Xf=new WeakMap,Sr=new WeakMap,Ol=new WeakMap,mu=new WeakMap,vo=new WeakMap,Qf=new WeakMap,vu=new WeakMap,gu=new WeakMap,Ll=new WeakMap,Dl=new WeakMap,ca=new WeakMap,yu=new WeakMap,Tt=new WeakSet,Gd=function(e){vt(this,Tt,Ky).call(this);let n=B(this,gt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Vr)),n},zy=function(e){return!pw()&&pn(this.options.enabled,B(this,gt))!==!1&&r3(e)},By=function(){vt(this,Tt,qy).call(this);const e=pn(this.options.staleTime,B(this,gt));if(B(this,Sr).isStale||!vt(this,Tt,zy).call(this,e))return;const n=s3(B(this,Sr).dataUpdatedAt,e)+1;Ae(this,Ll,Sl.setTimeout(()=>{B(this,Sr).isStale||this.updateResult()},n))},Uy=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(B(this,gt)):this.options.refetchInterval)??!1},Wy=function(e){vt(this,Tt,Gy).call(this),Ae(this,ca,e),!(B(this,ca)===0||!vt(this,Tt,zy).call(this,B(this,ca)))&&Ae(this,Dl,Sl.setInterval(()=>{(this.options.refetchIntervalInBackground||mw.isFocused())&&vt(this,Tt,Gd).call(this)},B(this,ca)))},Zy=function(){vt(this,Tt,By).call(this),vt(this,Tt,Wy).call(this,vt(this,Tt,Uy).call(this))},qy=function(){B(this,Ll)!==void 0&&(Sl.clearTimeout(B(this,Ll)),Ae(this,Ll,void 0))},Gy=function(){B(this,Dl)!==void 0&&(Sl.clearInterval(B(this,Dl)),Ae(this,Dl,void 0))},Ky=function(){const e=B(this,br).getQueryCache().build(B(this,br),this.options);if(e===B(this,gt))return;const n=B(this,gt);Ae(this,gt,e),Ae(this,Xf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},YC);function IL(t,e){return pn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&pn(e.retryOnMount,t)===!1)}function sS(t,e){return IL(t,e)||t.state.data!==void 0&&Yy(t,e,e.refetchOnMount)}function Yy(t,e,n){if(pn(e.enabled,t)!==!1&&pn(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&vw(t,e)}return!1}function iS(t,e,n,r){return(t!==e||pn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&vw(t,n)}function vw(t,e){return pn(e.enabled,t)!==!1&&t.isStaleByTime(pn(e.staleTime,t))}var Jf,Ti,pr,Nl,Ri,ra,XC,ML=(XC=class extends u3{constructor(e){super();Ke(this,Ri);Ke(this,Jf);Ke(this,Ti);Ke(this,pr);Ke(this,Nl);Ae(this,Jf,e.client),this.mutationId=e.mutationId,Ae(this,pr,e.mutationCache),Ae(this,Ti,[]),this.state=e.state||OL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){B(this,Ti).includes(e)||(B(this,Ti).push(e),this.clearGcTimeout(),B(this,pr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ae(this,Ti,B(this,Ti).filter(n=>n!==e)),this.scheduleGc(),B(this,pr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){B(this,Ti).length||(this.state.status==="pending"?this.scheduleGc():B(this,pr).remove(this))}continue(){var e;return((e=B(this,Nl))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,u,d,f,p,v,y,w,_,x,b,k,C,P,T,O,M,R;const n=()=>{vt(this,Ri,ra).call(this,{type:"continue"})},r={client:B(this,Jf),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Ae(this,Nl,c3({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,D)=>{vt(this,Ri,ra).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{vt(this,Ri,ra).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>B(this,pr).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{vt(this,Ri,ra).call(this,{type:"pending",variables:e,isPaused:o}),B(this,pr).config.onMutate&&await B(this,pr).config.onMutate(e,this,r);const D=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));D!==this.state.context&&vt(this,Ri,ra).call(this,{type:"pending",context:D,variables:e,isPaused:o})}const L=await s.start();return await((f=(d=B(this,pr).config).onSuccess)==null?void 0:f.call(d,L,e,this.state.context,this,r)),await((v=(p=this.options).onSuccess)==null?void 0:v.call(p,L,e,this.state.context,r)),await((w=(y=B(this,pr).config).onSettled)==null?void 0:w.call(y,L,null,this.state.variables,this.state.context,this,r)),await((x=(_=this.options).onSettled)==null?void 0:x.call(_,L,null,e,this.state.context,r)),vt(this,Ri,ra).call(this,{type:"success",data:L}),L}catch(L){try{await((k=(b=B(this,pr).config).onError)==null?void 0:k.call(b,L,e,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((P=(C=this.options).onError)==null?void 0:P.call(C,L,e,this.state.context,r))}catch(D){Promise.reject(D)}try{await((O=(T=B(this,pr).config).onSettled)==null?void 0:O.call(T,void 0,L,this.state.variables,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((R=(M=this.options).onSettled)==null?void 0:R.call(M,void 0,L,e,this.state.context,r))}catch(D){Promise.reject(D)}throw vt(this,Ri,ra).call(this,{type:"error",error:L}),L}finally{B(this,Nl)===s&&Ae(this,Nl,void 0),B(this,pr).runNext(this)}}},Jf=new WeakMap,Ti=new WeakMap,pr=new WeakMap,Nl=new WeakMap,Ri=new WeakSet,ra=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),or.batch(()=>{B(this,Ti).forEach(r=>{r.onMutationUpdate(e)}),B(this,pr).notify({mutation:this,type:"updated",action:e})})},XC);function OL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var go,ai,eh,QC,LL=(QC=class extends nh{constructor(e={}){super();Ke(this,go);Ke(this,ai);Ke(this,eh);this.config=e,Ae(this,go,new Set),Ae(this,ai,new Map),Ae(this,eh,0)}build(e,n,r){const s=new ML({client:e,mutationCache:this,mutationId:++kp(this,eh)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){B(this,go).add(e);const n=Cp(e);if(typeof n=="string"){const r=B(this,ai).get(n);r?r.push(e):B(this,ai).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(B(this,go).delete(e)){const n=Cp(e);if(typeof n=="string"){const r=B(this,ai).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&B(this,ai).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=Cp(e);if(typeof n=="string"){const s=(r=B(this,ai).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=Cp(e);return typeof n=="string"?((s=(r=B(this,ai).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){or.batch(()=>{B(this,go).forEach(e=>{this.notify({type:"removed",mutation:e})}),B(this,go).clear(),B(this,ai).clear()})}getAll(){return Array.from(B(this,go))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Q6(n,r))}findAll(e={}){return this.getAll().filter(n=>Q6(e,n))}notify(e){or.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return or.batch(()=>Promise.all(e.map(n=>n.continue().catch(Vr))))}},go=new WeakMap,ai=new WeakMap,eh=new WeakMap,QC);function Cp(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Ii,JC,DL=(JC=class extends nh{constructor(e={}){super();Ke(this,Ii);this.config=e,Ae(this,Ii,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??fw(s,n);let o=this.get(i);return o||(o=new TL({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){B(this,Ii).has(e.queryHash)||(B(this,Ii).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=B(this,Ii).get(e.queryHash);n&&(e.destroy(),n===e&&B(this,Ii).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){or.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return B(this,Ii).get(e)}getAll(){return[...B(this,Ii).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>X6(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>X6(e,r)):n}notify(e){or.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){or.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){or.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ii=new WeakMap,JC),nn,ua,da,_u,wu,fa,xu,bu,e3,NL=(e3=class{constructor(t={}){Ke(this,nn);Ke(this,ua);Ke(this,da);Ke(this,_u);Ke(this,wu);Ke(this,fa);Ke(this,xu);Ke(this,bu);Ae(this,nn,t.queryCache||new DL),Ae(this,ua,t.mutationCache||new LL),Ae(this,da,t.defaultOptions||{}),Ae(this,_u,new Map),Ae(this,wu,new Map),Ae(this,fa,0)}mount(){kp(this,fa)._++,B(this,fa)===1&&(Ae(this,xu,mw.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,nn).onFocus())})),Ae(this,bu,z0.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,nn).onOnline())})))}unmount(){var t,e;kp(this,fa)._--,B(this,fa)===0&&((t=B(this,xu))==null||t.call(this),Ae(this,xu,void 0),(e=B(this,bu))==null||e.call(this),Ae(this,bu,void 0))}isFetching(t){return B(this,nn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return B(this,ua).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,nn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=B(this,nn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(pn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return B(this,nn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=B(this,nn).get(r.queryHash))==null?void 0:o.state.data,i=mL(e,s);if(i!==void 0)return B(this,nn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return or.batch(()=>B(this,nn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,nn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=B(this,nn);or.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=B(this,nn);return or.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=or.batch(()=>B(this,nn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Vr).catch(Vr)}invalidateQueries(t,e={}){return or.batch(()=>(B(this,nn).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=or.batch(()=>B(this,nn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Vr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Vr)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=B(this,nn).build(this,e),r=n.isStaleByTime(pn(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=B(this,nn).build(this,e);return n.isStaleByTime(pn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Vr).catch(Vr)}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(Vr).catch(Vr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return z0.isOnline()?B(this,ua).resumePausedMutations():Promise.resolve()}getQueryCache(){return B(this,nn)}getMutationCache(){return B(this,ua)}getDefaultOptions(){return B(this,da)}setDefaultOptions(t){Ae(this,da,t)}setQueryDefaults(t,e){B(this,_u).set(xf(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...B(this,_u).values()],n={};return e.forEach(r=>{Su(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){B(this,wu).set(xf(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...B(this,wu).values()],n={};return e.forEach(r=>{Su(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...B(this,da).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=fw(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===hw&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...B(this,da).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){B(this,nn).clear(),B(this,ua).clear()}},nn=new WeakMap,ua=new WeakMap,da=new WeakMap,_u=new WeakMap,wu=new WeakMap,fa=new WeakMap,xu=new WeakMap,bu=new WeakMap,e3);const f3=m.createContext(!1),jL=()=>m.useContext(f3);f3.Provider;function FL(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const VL=m.createContext(FL()),$L=()=>m.useContext(VL),HL=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?a3(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},zL=t=>{m.useEffect(()=>{t.clearReset()},[t])},BL=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||a3(n,[t.error,r])),UL=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))}},WL=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,ZL=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function qL(t,e,n){const r=jL(),s=$L(),i=n3(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,UL(o),HL(o,s,l),zL(s);const[d]=m.useState(()=>new e(i,o)),f=d.getOptimisticResult(o),p=!r&&u;if(m.useSyncExternalStore(m.useCallback(v=>{const y=p?d.subscribe(or.batchCalls(v)):Vr;return d.updateResult(),y},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(o)},[o,d]),WL(o,f))throw ZL(o,d,s);if(BL({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function Xy(t,e){return qL(t,RL)}var ne="u">typeof window?window:void 0,gr="u">typeof globalThis?globalThis:ne,Vn=gr==null?void 0:gr.navigator,fe=gr==null?void 0:gr.document,qt=gr==null?void 0:gr.location,gw=gr==null?void 0:gr.fetch,Qy=gr!=null&&gr.XMLHttpRequest&&"withCredentials"in new gr.XMLHttpRequest?gr.XMLHttpRequest:void 0,oS=gr==null?void 0:gr.AbortController,GL=gr==null?void 0:gr.CompressionStream,jr=Vn==null?void 0:Vn.userAgent;function h3(){return!(!ne||ne.navigator.onLine===!1)}var Od=typeof globalThis<"u"?globalThis:ne;Od&&typeof self>"u"&&(Od.self=Od),Od&&typeof File>"u"&&(Od.File=function(){});var De=ne??{},Ot={DEBUG:!1,LIB_VERSION:"0.7.2",LIB_NAME:"browser-common"};function aS(t,e,n,r,s,i,o){try{var l=t[i](o),u=l.value}catch(d){return void n(d)}l.done?e(u):Promise.resolve(u).then(r,s)}function Dt(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function o(u){aS(i,r,s,o,l,"next",u)}function l(u){aS(i,r,s,o,l,"throw",u)}o(void 0)}))}}function ue(){return ue=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ue.apply(null,arguments)}function p3(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var KL=["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","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"],lS=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return KL.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Ye(t,e){return t.indexOf(e)!==-1}var Um=function(t){return t.trim()},Jy=function(t){return t.replace(/^\$/,"")};function m3(t){var e,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"}var Ci=(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.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),e2=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),YL=["$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"],XL=["token"],v3=Object.prototype,g3=v3.hasOwnProperty,Wm=v3.toString,ze=Array.isArray||function(t){return Wm.call(t)==="[object Array]"},mr=t=>typeof t=="function",ot=t=>t===Object(t)&&!ze(t),fs=t=>{if(ot(t)){for(var e in t)if(g3.call(t,e))return!1;return!0}return!1},ce=t=>t===void 0,at=t=>Wm.call(t)=="[object String]",rf=t=>at(t)&&t.trim().length===0,sn=t=>t===null,et=t=>ce(t)||sn(t),ln=t=>Wm.call(t)=="[object Number]"&&t==t,co=t=>ln(t)&&t>0,Er=t=>Wm.call(t)==="[object Boolean]",QL=t=>t instanceof FormData,JL=t=>Ye(YL,t),eD=t=>Ye(XL,t);function y3(t){return t===null||typeof t!="object"}function B0(t,e){return{}.toString.call(t)==="[object "+e+"]"}function yw(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 _3(t,Error)}}function _w(t){return"u">typeof Event&&_3(t,Event)}function _3(t,e){try{return t instanceof e}catch{return!1}}var tD=[!0,"true",1,"1","yes"],s1=t=>Ye(tD,t),nD=[!1,"false",0,"0","no"];function Ni(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),ln(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),Ni(s??n,e,n,r))}class rD{constructor(e){this.C={},this.I=e.I,this.R=Ni(e.bucketSize,0,100,e.A),this.O=Ni(e.refillRate,0,this.R,e.A),this.N=Ni(e.refillInterval,0,864e5,e.A)}F(e,n){var r=Math.floor((n-e.lastAccess)/this.N);r>0&&(e.tokens=Math.min(e.tokens+r*this.O,this.R),e.lastAccess=e.lastAccess+r*this.N)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.C[s];return i?this.F(i,r):this.C[s]=i={tokens:this.R,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.I)==null||n.call(this,e)),i.tokens===0)}stop(){this.C={}}}var gs="Mobile",U0="iOS",bo="Android",Eu="Tablet",w3=bo+" "+Eu,x3="iPad",b3="Apple",S3=b3+" Watch",sf="Safari",ku="BlackBerry",E3="Samsung",k3=E3+"Browser",C3=E3+" Internet",jl="Chrome",sD=jl+" OS",P3=jl+" "+U0,ww="Internet Explorer",A3=ww+" "+gs,xw="Opera",iD=xw+" Mini",bw="Edge",T3="Microsoft "+bw,Qc="Firefox",R3=Qc+" "+U0,bf="Nintendo",Sf="PlayStation",Jc="Xbox",I3=bo+" "+gs,M3=gs+" "+sf,Kd="Windows",t2=Kd+" Phone",cS="Nokia",n2="Ouya",O3="Generic",oD=O3+" "+gs.toLowerCase(),L3=O3+" "+Eu.toLowerCase(),r2="Konqueror",D3="Oculus Browser",W0="Vivaldi",N3="Yandex",Z0="Whale",s2="DuckDuckGo",j3="Pale Moon",q0="Waterfox",of="Brave",G0="Claude",K0="Codex",Y0="ChatGPT",F3="Google Search App",Wt="(\\d+(\\.\\d+)?)",i1=new RegExp("Version/"+Wt),o1=new RegExp("("+G0+"|"+K0+"|"+Y0+")\\/"+Wt),aD=new RegExp(Jc,"i"),lD=new RegExp(Sf+" \\w+","i"),cD=new RegExp(bf+" \\w+","i"),Sw=new RegExp(ku+"|PlayBook|BB10","i"),uD={"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"},V3=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?of:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Ye(t,"GSA/")?F3:Ye(t," OPR/")&&Ye(t,"Mini")?iD:Ye(t," OPR/")?xw:Sw.test(t)?ku:Ye(t,"IE"+gs)||Ye(t,"WPDesktop")?A3:Ye(t,"OculusBrowser")?D3:Ye(t,k3)?C3:Ye(t,bw)||Ye(t,"Edg/")?T3:Ye(t,W0+"/")?W0:Ye(t,"YaBrowser/")?N3:Ye(t,Z0+"/")?Z0:Ye(t,s2+"/")||Ye(t,"Ddg/")?s2:Ye(t,G0+"/")?G0:Ye(t,K0+"/")?K0:Ye(t,Y0+"/")?Y0:Ye(t,"FBIOS")?"Facebook "+gs:Ye(t,"UCWEB")||Ye(t,"UCBrowser")?"UC Browser":Ye(t,"CriOS")?P3:Ye(t,"CrMo")||Ye(t,jl)?jl:Ye(t,bo)&&Ye(t,sf)?I3:Ye(t,"FxiOS")?R3:Ye(t.toLowerCase(),r2.toLowerCase())?r2:Ye(t,of+"/")?of:((i,o)=>o&&Ye(o,b3)||(function(l){return Ye(l,sf)&&!Ye(l,jl)&&!Ye(l,bo)})(i))(t,e)?Ye(t,gs)?M3:sf:Ye(t,"PaleMoon/")?j3:Ye(t,q0+"/")?q0:Ye(t,Qc)?Qc:Ye(t,"MSIE")||Ye(t,"Trident/")?ww:Ye(t,"Gecko")?Qc:"")},dD={[A3]:[new RegExp("rv:"+Wt)],[T3]:[new RegExp(bw+"?\\/"+Wt)],[jl]:[new RegExp("("+jl+"|CrMo)\\/"+Wt)],[P3]:[new RegExp("CriOS\\/"+Wt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Wt)],[sf]:[i1],[M3]:[i1],[xw]:[new RegExp("(Opera|OPR)\\/"+Wt)],[Qc]:[new RegExp(Qc+"\\/"+Wt)],[R3]:[new RegExp("FxiOS\\/"+Wt)],[r2]:[new RegExp("Konqueror[:/]?"+Wt,"i")],[ku]:[new RegExp(ku+" "+Wt),i1],[I3]:[new RegExp("android\\s"+Wt,"i")],[C3]:[new RegExp(k3+"\\/"+Wt)],[D3]:[new RegExp("OculusBrowser\\/"+Wt)],[W0]:[new RegExp(W0+"\\/"+Wt)],[N3]:[new RegExp("YaBrowser\\/"+Wt)],[Z0]:[new RegExp(Z0+"\\/"+Wt)],[of]:[new RegExp(of+"\\/"+Wt)],[G0]:[o1],[K0]:[o1],[Y0]:[o1],[s2]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Wt)],[j3]:[new RegExp("PaleMoon\\/"+Wt)],[q0]:[new RegExp(q0+"\\/"+Wt)],[F3]:[new RegExp("GSA\\/"+Wt)],[ww]:[new RegExp("(rv:|MSIE )"+Wt)],Mozilla:[new RegExp("rv:"+Wt)]},fD=function(t,e,n,r){var s=V3(t,e,n,r),i=dD[s];if(ce(i))return null;for(var o=0;i.length>o;o++){var l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},uS=[[new RegExp(Jc+"; "+Jc+" (.*?)[);]","i"),t=>[Jc,t&&t[1]||""]],[new RegExp(bf,"i"),[bf,""]],[new RegExp(Sf,"i"),[Sf,""]],[Sw,[ku,""]],[new RegExp(Kd,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[t2,""];if(new RegExp(gs).test(e)&&!/IEMobile\b/.test(e))return[Kd+" "+gs,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=uD[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[Kd,r]}return[Kd,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[U0,[t[3],t[4],t[5]||"0"].join(".")]:[U0,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ce(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+bo+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+bo+")","i"),t=>t&&t[2]?[bo,[t[2],t[3],t[4]||"0"].join(".")]:[bo,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var 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/,[sD,""]],[/Linux|debian/i,["Linux",""]]],$3=function(t){for(var e=0;uS.length>e;e++){var n=uS[e],r=n[1],s=n[0].exec(t),i=s&&(mr(r)?r(s,t):r);if(i)return i}return["",""]},dS=function(t){return cD.test(t)?bf:lD.test(t)?Sf:aD.test(t)?Jc:new RegExp(n2,"i").test(t)?n2:new RegExp("("+t2+"|WPDesktop)","i").test(t)?t2:/iPad/.test(t)?x3:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?S3:Sw.test(t)?ku:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(cS,"i").test(t)?cS:/(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(gs).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)?bo:w3:new RegExp("(pda|"+gs+")","i").test(t)?oD:new RegExp(Eu,"i").test(t)&&!new RegExp(Eu+" pc","i").test(t)?L3:""},hD=20,H3=1e3,pD=1e4,mD="[Circular]",i2="[Truncated]",Zm="[Unserializable]",vD="[Function]";function eu(t){for(var e="",n=0;t.length>n;n++){var r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{var s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}var Pp,fS,a1,gD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function hS(t,e){return typeof(n=t)=="string"&&gD.test(n)?t:e();var n}function z3(t,e){var n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function Sa(t){return t&&t.split("#")[0]}function Ew(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function pS(t,e,n){return B3.apply(this,arguments)}function B3(){return(B3=Dt((function*(t,e,n){var r;try{return yield Promise.race([t,new Promise(((s,i)=>{r=Ew((()=>{try{n==null||n(),s()}catch(o){i(o)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}function yD(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return a1&&n.length===fS||(fS=n.length,a1=n.reduce(((r,s)=>{Pp||(Pp={});var i=Pp[s];if(i)r[i[0]]=i[1];else for(var o=t(s),l=o.length-1;l>=0;l--){var u=o[l],d=u==null?void 0:u.filename,f=e[s];if(d&&f){r[d]=f,Pp[s]=[d,f];break}}return r}),{})),a1}}class _D{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),o=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var n=this;return Dt((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&ze(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),ue({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Dt((function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(e,n){var r,s,i,o={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var l=[o];return e.cause!=null&&l.push(...this.convertToExceptionList(e.cause,ue({},n,{handled:!0}))),l}buildParsingContext(e){var n;return{chunkIdMap:yD(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,o)=>{if(4>=o){var l=this.buildCoercingContext(e,n,o);return this.applyCoercers(i,l)}};return ue({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Cu="?";function o2(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?Cu:n,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&e!=="<anonymous>"};return ce(r)||(i.lineno=r),ce(s)||(i.colno=s),i}var U3=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Cu,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},wD=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xD=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bD=/\((\S*)(?::(\d+))(?::(\d+))\)/,SD=(t,e)=>{var n=wD.exec(t);if(n)return o2(e,n[1],Cu,+n[2],+n[3]);var r=xD.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=bD.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=U3(r[1]||Cu,r[2]);return o2(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},ED=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,kD=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,CD=(t,e)=>{var n=ED.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=kD.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||Cu,o=U3(i,s);return o2(e,s=o[1],i=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},mS=/\(error: (.*)\)/;class PD{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=at(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return B0(e,"DOMException")}isDOMError(e){return B0(e,"DOMError")}}class AD{match(e){return yw(e)}coerce(e,n){var r,s=this.getStack(e),i=s===void 0;return{type:this.getType(e),value:this.getMessage(e,n),stack:s??((r=n.syntheticException)==null?void 0:r.stack),cause:e.cause?n.next(e.cause):void 0,synthetic:i}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class TD{match(e){return!!B0(e,"ErrorEvent")&&(e.error!=null||this.Vi(e))}coerce(e,n){var r;if(e.error!=null)return n.apply(e.error);var s=n.apply(e.message);return ue({},s,{stack:(r=this.Zi(e))!==null&&r!==void 0?r:s.stack,synthetic:!0})}Vi(e){return at(e.message)&&e.message.length>0}Zi(e){var n,r,s=e,i=(n=s.lineno)!==null&&n!==void 0?n:0,o=(r=s.colno)!==null&&r!==void 0?r:0;if(at(s.filename)&&s.filename.length!==0&&i!==0)return`Error
18
- at `+s.filename+":"+i+":"+o}}var RD=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class ID{match(e){return typeof e=="string"}coerce(e,n){var r,s=this.getInfos(e),i=s[0],o=s[1];return{type:i??"Error",value:o??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(RD);return s&&(n=s[1],r=s[2]),[n,r]}}var MD=["fatal","error","warning","log","info","debug"];function W3(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class OD{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=this.getStack(e))!==null&&r!==void 0?r:(s=n.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(_w(e))return e.constructor.name;var n="name"in e?e.name:void 0;return at(n)&&!rf(n)?n:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+W3(e)}isSeverityLevel(e){return at(e)&&!rf(e)&&MD.indexOf(e)>=0}getStack(e){try{return at(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:at(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(yw(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class LD{match(e){return _w(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+W3(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class DD{match(e){return y3(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class ND{match(e){return B0(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!_w(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return y3(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var X0="$message",Q0="$timestamp",jD=new Set([X0,Q0]),l1={enabled:!0,max_bytes:32768};function J0(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:l1.enabled,max_bytes:VD(t.max_bytes,l1.max_bytes)}:ue({},l1)}class FD{constructor(e){this.Fn=[],this.Dn=0,this.mn=J0(e)}setConfig(e){this.mn=J0(e),this.$n()}add(e){var n=(function(s){var i;try{i=m3(s)}catch{return}try{var o=JSON.parse(i);if(!ot(o))return;var l=o,u=l[X0],d=l[Q0];return!at(u)||u.trim().length===0||!at(d)&&!ln(d)?void 0:{step:l,json:i}}catch{return}})(e);if(n){var r=(function(s){if("u">typeof TextEncoder)return new TextEncoder().encode(s).length;for(var i=encodeURIComponent(s),o=0,l=0;i.length>l;l++)i[l]==="%"?(o+=1,l+=2):o+=1;return o})(n.json);r>this.mn.max_bytes||(this.Fn.push({step:n.step,bytes:r}),this.Dn+=r,this.$n())}}getAttachable(){return this.Fn.map((e=>e.step))}clear(){this.Fn=[],this.Dn=0}size(){return this.Fn.length}$n(){for(;this.Dn>this.mn.max_bytes&&this.Fn.length>0;){var e=this.Fn.shift();e&&(this.Dn-=e.bytes)}}}function VD(t,e){if(!ln(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var vS=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function gS(t){return typeof t=="string"||t}function yS(t){return typeof t=="string"?t:void 0}var Ld,$D=["$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","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Z3="NativeGzipValidationError",a2=t=>t.length>=2&&t[0]===31&&t[1]===139,_S=(t,e)=>t===e2.GZipJS||e===e2.GZipJS||e==="gzip",wS=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Ap=t=>{throw z3(Z3,"Native gzip produced invalid output: "+t)},HD=(function(){var t=Dt((function*(e,n){18>e.size&&Ap("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());a2(r)&&r[2]===8||Ap("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(o=>{for(var l=(()=>{if(Ld)return Ld;Ld=[];for(var f=0;256>f;f++){for(var p=f,v=0;8>v;v++)p=1&p?3988292384^p>>>1:p>>>1;Ld[f]=p>>>0}return Ld})(),u=4294967295,d=0;o.length>d;d++)u=l[255&(u^o[d])]^u>>>8;return(4294967295^u)>>>0})(n)&&Ap("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Ap("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function l2(){return l2=Dt((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),o=i.write(r).then((()=>i.close())).catch((function(){var d=Dt((function*(f){try{yield i.abort(f)}catch{}throw f}));return function(f){return d.apply(this,arguments)}})()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield HD(u,r),u}catch(d){if(n!=null&&n.rethrow)throw d;return e&&console.error("Failed to gzip compress data",d),null}})),l2.apply(this,arguments)}var xS=9223372036854776e3,zD="9223372036854775808",BD={}.propertyIsEnumerable;function em(t,e){try{return q3(t,e,{ancestors:new WeakSet,remainingNodes:pD},0)}catch{return[]}}function kw(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:i2};if(n.remainingNodes--,Er(t))return{boolValue:t};if(typeof t=="bigint")return(function(u,d){var f=u.toString(),p=BigInt(zD);return u>=p||-p>u?(d==null||d.debug("Attribute "+f+" is outside the int64 range; encoding it as a string"),{stringValue:f}):{intValue:f}})(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)};var s=BigInt(t).toString();return t>=xS||-xS>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:eu(t)};if(typeof t=="function")return{stringValue:vD};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:mD};if(r>=hD)return{stringValue:i2};if(t instanceof Date){var i=t.getTime(),o=Number.isFinite(i)?t.toISOString():String(t);return{stringValue:typeof o=="string"?eu(o):String(o)}}n.ancestors.add(t);try{try{var l=t.toJSON;if(typeof l=="function")return kw(l.call(t),e,n,r+1)}catch{}return ze(t)?{arrayValue:{values:UD(t,e,n,r+1)}}:{kvlistValue:{values:q3(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:eu(String(t))}}function UD(t,e,n,r){for(var s=[],i=Math.min(t.length,H3),o=0;i>o&&n.remainingNodes>0;o++)try{var l=o in t?t[o]:void 0;if(et(l))continue;s.push(kw(l,e,n,r))}catch{s.push({stringValue:Zm})}return t.length>o&&s.push({stringValue:i2}),s}function q3(t,e,n,r){var s=[];for(var i in t)if(BD.call(t,i)){if(!i){e==null||e.debug("Dropping an attribute with an empty key");continue}if(s.length>=H3||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[i];if(sn(o)||ce(o))continue;s.push({key:eu(i),value:kw(o,e,n,r)})}catch{s.push({key:eu(i),value:{stringValue:Zm}})}}return s}function G3(t,e,n){return ue({},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})}var bS={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"},K3={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},WD=K3.info;function ZD(t){try{return eu(String(t))}catch{return Zm}}function qD(t,e,n,r){var s,i=K3[t.level||"info"]||WD,o=i.text,l=i.number,u=((s=ln(r)?r:void 0)===void 0&&(s=Date.now()),String(s)+"000000"),d={};e.distinctId&&(d.posthogDistinctId=e.distinctId),e.sessionId&&(d.sessionId=e.sessionId),e.windowId&&(d["window.id"]=e.windowId),et(e.sessionStartTimestamp)||(d.sessionStartTimestamp=String(e.sessionStartTimestamp)),et(e.lastActivityTimestamp)||(d.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(d["url.full"]=e.currentUrl),e.screenName&&(d["screen.name"]=e.screenName),e.appState&&(d["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(d.feature_flags=e.activeFeatureFlags);var f=ue({},d),p=t.attributes;if(p){var v=[];try{v=Object.keys(p)}catch{v=[]}for(var y of v){var w=void 0;try{w=p[y]}catch{w=Zm}Object.defineProperty(f,y,{value:w,enumerable:!0,writable:!0,configurable:!0})}}var _={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:o,body:{stringValue:ZD(t.body)},attributes:em(f,n)};return t.trace_id&&(_.traceId=t.trace_id),t.span_id&&(_.spanId=t.span_id),ce(t.trace_flags)||(_.flags=t.trace_flags),_}function Y3(t,e,n){return G3(t,e,n)}function X3(t,e,n,r){return{resourceLogs:[{resource:{attributes:em(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let GD=class{constructor(t,e,n,r,s,i,o){var l;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.mn=e,this.A=n,this.Nn=r,this.qn=s,this.jn=i,this.Bn=o,this.Hn=null,this.zn=0,this.Un=0,this.Wn=0,this.Vn=0,this.Gn=0,this.Zn=!1,this.Qn=e.maxBufferSize,this.Jn=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Kn=e.flushIntervalMs,this.Yn=e.maxBatchRecordsPerPost,this.Xn=e.rateCapWindowMs,this.ts=e.maxLogsPerInterval}clearQueue(){this.Un++,this._instance.setPersistedProperty(Ci.LogsQueue,[])}reset(){this.es(),this.Vn=0,this.Gn=0,this.Zn=!1,this.Wn=0,this.Yn=this.mn.maxBatchRecordsPerPost}onReconnect(){this.Wn=0,this.rs()}captureLog(t,e){var n;if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var r=this.ns(t);if(r!==null)if(r.body){if(this.ss()){var s={record:qD(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.Nn(),this.A,e==null?void 0:e.occurredAtMs)};this.qn((()=>this.os(s)))}}else this.A.info("Log was rejected in beforeSend function")}}ns(t){var e=this.mn.beforeSend;if(!e)return t;var n=ze(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.A.info("Log was rejected in beforeSend function"),null;r=i}catch(o){return this.A.error("Error in beforeSend function for log:",o),null}return r}ss(){if(this.ts===void 0)return!0;var t=Date.now(),e=t-this.Vn;return this.Xn>e&&e>=0||(this.Vn=t,this.Gn=0,this.Zn=!1),this.ts>this.Gn?(this.Gn++,!0):(this.Zn||(this.A.warn("captureLog dropping logs: exceeded "+this.ts+" logs per "+this.Xn+"ms"),this.Zn=!0),!1)}flush(){var t=this;return Dt((function*(){if(!t._instance.isDisabled)return t.Hn||(t.Hn=t.ls().finally((()=>{t.Hn=null}))),t.Hn}))()}ls(){var t=this;return Dt((function*(){var e;t.es();var n=(e=t._instance.getPersistedProperty(Ci.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,s=0;n.length>0&&r>s;){var i,o,l=t.Un;t.zn=0;var u=Math.min(n.length,t.Yn),d=n.slice(0,u),f=X3(d.map((v=>v.record)),t.us(),(i=t.Bn)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),p=yield t._instance.hs(f);if(t.Un!==l)return;if(p.kind==="too-large"&&d.length>1)t.Yn=Math.max(1,Math.floor(d.length/2)),t.A.warn("Received 413 when sending logs batch of size "+d.length+", reducing batch size to "+t.Yn);else if(p.kind==="retry-later"||(p.kind==="too-large"?t.A.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&t.mn.maxBatchRecordsPerPost>t.Yn&&(t.Yn=Math.min(t.mn.maxBatchRecordsPerPost,t.Yn+1)),yield t.ds(d.length),n=(o=t._instance.getPersistedProperty(Ci.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,p.kind==="fatal"))throw p.error}}))()}ds(t){var e=this;return Dt((function*(){var n,r=Math.max(0,t-e.zn),s=(n=e._instance.getPersistedProperty(Ci.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Ci.LogsQueue,s.slice(r)),yield e.jn()}))()}us(){return Y3(this.mn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}os(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Ci.LogsQueue))!==null&&e!==void 0?e:[];this.Jn>n.length||(n.shift(),this.zn++,this.A.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Ci.LogsQueue,n),this.Qn>n.length?this.vs():this.rs()}}vs(t){t===void 0&&(t=this.Kn),this.cs||(this.cs=Ew((()=>{this.cs=void 0,this.rs()}),t))}fs(){var t=Math.min(Math.max(0,this.Wn-1),6);return this.Kn*Math.pow(2,t)}ps(){var t=this._instance.getPersistedProperty(Ci.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Dt((function*(){e.es();var n=e.flush().catch((()=>{}));t!==void 0?yield pS(n,t):yield n}))()}flushWithTimeout(t){var e=this;return Dt((function*(){var n=e.flush();yield pS(n,t,(()=>{n.catch((()=>{}))}))}))()}rs(){this.flush().then((()=>{this.Wn=0}),(t=>{this.Wn++,this.A.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.ps()&&this.vs(this.fs())}))}es(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};var c1=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function SS(t){return String(t)+"000000"}function ES(t,e,n,r){var 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}let KD=class{constructor(t,e,n){this._instance=t,this.mn=e,this.A=n,this.gs=new Map,this.Hn=null,this.ys=!1,this.bs=new Map,this._s=new Set,this.ws=0}count(t,e,n){e===void 0&&(e=1),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})}flush(){var t=this,e=this.Hn,n=(function(){var s=Dt((function*(){e&&(yield e.catch((()=>{}))),yield t.Ss()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.Hn===r&&(this.Hn=null)}));return this.Hn=r,r}drainWindow(){if(this.gs.size===0)return null;var t=this.gs;return this.gs=new Map,this.ys=!1,this.bs=new Map,this._s=new Set,this.xs(t)}reset(){this.ws++,this.es(),this.gs=new Map,this.Hn=null,this.ys=!1,this.bs=new Map,this._s=new Set}ks(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.ns(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.A.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?ue({},e.attributes):void 0,r=ES(e.type,e.name,e.unit,n)}catch(o){return void this.A.warn("Dropping metric '"+e.name+"': attributes could not be serialized",o)}var s=this.gs.get(r);if(!s){if(!this.Cs())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.gs.set(r,s)}var i=this.bs.get(e.name);i===void 0?this.bs.set(e.name,e.type):i===e.type||this._s.has(e.name)||(this._s.add(e.name),this.A.warn("Metric name '"+e.name+"' is already used as a "+i+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Ts(s,e.value),this.vs()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Cs(){return this.mn.maxSeriesPerFlush>this.gs.size||(this.ys||(this.ys=!0,this.A.warn("Metric series cap reached ("+this.mn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ts(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(c1.length+1).fill(0)});var 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(var o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(e,c1)]+=1}}ns(t){var e=this.mn.beforeSend;if(!e)return t;var n=ze(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.A.info("Metric was rejected in beforeSend function"),null;r=i}catch(o){return this.A.error("Error in beforeSend function for metric:",o),null}return r}vs(){this.cs||(this.cs=Ew((()=>{this.cs=void 0,this.flush().catch((t=>{this.A.error("Metrics flush failed:",t)}))}),this.mn.flushIntervalMs))}es(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}Ss(){var t=this;return Dt((function*(){if(t.gs.size!==0){var e=t.gs;t.gs=new Map,t.ys=!1,t.bs=new Map,t._s=new Set;var n=t.ws,r=yield t._instance.Ms(t.xs(e));if(n===t.ws)switch(r.kind){case"ok":return;case"retry-later":return t.Is(e),void t.vs();case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}}}))()}xs(t){return e=this.Es(t),n=(function(i,o,l){return G3(i,o,l)})(this.mn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:em(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}Es(t){var e=SS(Date.now()),n=new Map;for(var r of t.values()){var s,i=ES(r.type,r.name,r.unit,void 0),o=n.get(i);o||(o=ue({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,o));var l=em((s=r.attributes)!==null&&s!==void 0?s:{},this.A),u=SS(r.windowStartMs);if(r.type==="count"){var d,f={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:(d=r.total)!==null&&d!==void 0?d:0};o.sum.dataPoints.push(f)}else if(r.type==="gauge"){var p,v={attributes:l,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};o.gauge.dataPoints.push(v)}else r.hist&&o.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:c1})}return Array.from(n.values())}Is(t){var e,n;for(var r of t){var s=r[0],i=r[1],o=this.gs.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.type){case"count":o.total=((e=o.total)!==null&&e!==void 0?e:0)+((n=i.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(i.hist)if(o.hist){o.hist.count+=i.hist.count,o.hist.sum+=i.hist.sum,o.hist.min=Math.min(o.hist.min,i.hist.min),o.hist.max=Math.max(o.hist.max,i.hist.max);for(var l=0;o.hist.bucketCounts.length>l;l++)o.hist.bucketCounts[l]+=i.hist.bucketCounts[l]}else o.hist=i.hist}else this.Cs()&&this.gs.set(s,i)}}};var Q3=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={q(s){if(ne&&(Ot.DEBUG||ne.POSTHOG_DEBUG||n)&&!ce(ne.console)&&ne.console){for(var i=("__rrweb_original__"in ne.console[s])?ne.console[s].__rrweb_original__:ne.console[s],o=arguments.length,l=new Array(o>1?o-1:0),u=1;o>u;u++)l[u-1]=arguments[u];i(t,...l)}},debug(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.q("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.q("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.q("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.q("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];console.error(t,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>Q3(t+" "+s,i)};return r},ge=Q3("[PostHog.js]"),Ht=ge.createLogger,YD=Ht("[ExternalScriptsLoader]"),tm=t=>{var e=fe==null?void 0:fe.querySelectorAll("script");if(e){for(var n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},yl=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return YD.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=tm(e);if(r){if(r.__posthog_loading_callback_fired)return n();var s=r.__posthog_loading_error;return s?n(s):(r.addEventListener("load",(o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)})),void r.addEventListener("error",(o=>{r.__posthog_loading_error=o,n(o)})))}var i=()=>{if(!fe)return n("document not found");if(tm(e))return yl(t,e,n);var o=fe.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",o.src=e,o.onload=d=>{o.__posthog_loading_callback_fired=!0,n(void 0,d)},o.onerror=d=>{o.__posthog_loading_error=d,n(d)},t.config.prepare_external_dependency_script&&(o=t.config.prepare_external_dependency_script(o)),!o)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")fe.head.appendChild(o);else{var l,u=fe.querySelectorAll("body > script");u.length>0?(l=u[0].parentNode)==null||l.insertBefore(o,u[0]):fe.body.appendChild(o)}};fe!=null&&fe.body?i():fe==null||fe.addEventListener("DOMContentLoaded",i)},u1={},kS=(t,e)=>{var n="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",n)};De.__PosthogExtensions__=De.__PosthogExtensions__||{},De.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r=t.config.strict_script_versioning;if(r){var s=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),i=u1[s];if(r==="fallback"&&i){if(tm(i))return void yl(t,i,n);delete u1[s]}yl(t,s,r==="fallback"?(l,u)=>{if(l)if(typeof l=="string")n(l);else{var d,f=kS(t,e);u1[s]=f;var p=tm(s);p==null||(d=p.parentNode)==null||d.removeChild(p),yl(t,f,n)}else n(void 0,u)}:n)}else yl(t,kS(t,e),n)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");yl(t,o,n)}},De.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);yl(t,r,n)};Ot.DEBUG=!1,Ot.LIB_VERSION="1.427.2",Ot.LIB_NAME="web";var J3="$people_distinct_id",Wn="distinct_id",Ef="$device_id",d1="$device_model",zc="__alias",no="$fbc",$r="$fbc_persistence",Yd="__timers",c2="$autocapture_disabled_server_side",u2="$heatmaps_enabled_server_side",d2="$exception_capture_enabled_server_side",f2="$error_tracking_suppression_rules",h2="$error_tracking_capture_extension_exceptions",p2="$web_vitals_enabled_server_side",Cw="$dead_clicks_enabled_server_side",Pw="$product_tours_enabled_server_side",m2="$logs_capture_enabled_server_side",v2="$web_vitals_allowed_metrics",El="$session_recording_remote_config",eP="$replay_sample_rate",tP="$replay_override_sampling",nP="$replay_override_linked_flag",rP="$replay_override_url_trigger",sP="$replay_override_event_trigger",Bc="$sesid",Aw="$session_is_sampled",rr="$enabled_feature_flags",Ns="$active_feature_flags",h0="$early_access_features",ha="$feature_flag_details",li="$feature_flag_payloads",pa="$feature_flag_request_id",tu="$minimal_flag_called_events",ki="$override_feature_flags",_l="$override_feature_flag_payloads",as="$stored_person_properties",Mi="$stored_group_properties",iP="$groups",g2="$surveys",nm="$surveys_loaded_at",y2="$surveys_activated",p0="$surveys_activated_session",m0="$surveys_activated_timestamps",Xd="ph_product_tours",yo="$flag_call_reported",Qd="$flag_call_reported_session_id",nu="$feature_flag_errors",So="$feature_flag_evaluated_at",it="$user_state",_2="$client_session_props",w2="$capture_rate_limit",x2="$initial_campaign_params",b2="$initial_referrer_info",Uc="$initial_person_info",rm="$epp",kc="$posthog_cookieless",oP="$cookieless_mode",aP="$sdk_debug_extensions_init_method",lP="$sdk_debug_extensions_init_time_ms",S2="$sdk_debug_recording_script_not_loaded",Tw="PostHog loadExternalDependency extension not found.",sa="on_reject",_o="always",hn="anonymous",ir="identified",E2="identified_only",Pu="visibilitychange",sm="beforeunload",Wc="$pageview",f1="$pageleave",k2="$identify",CS="$groupidentify";function Tp(t,e){ze(t)&&t.forEach(e)}function kt(t,e){if(!et(t))if(ze(t))t.forEach(e);else if(QL(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)g3.call(t,n)&&e(t[n],n)}var Lt=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];for(var s of n)for(var i in s)s[i]!==void 0&&(t[i]=s[i]);return t};function v0(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var PS=function(t){try{return t()}catch{return}},XD=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){ge.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ge.critical(s)}}},Rw=function(t){var e={};return kt(t,(function(n,r){(at(n)&&n.length>0||ln(n))&&(e[r]=n)})),e},QD=["herokuapp.com","vercel.app","netlify.app"];function JD(t){var e=t==null?void 0:t.hostname;if(!at(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of QD)if(n===r)return!1;return!0}function Mt(t,e,n,r){var s=r??{},i=s.capture,o=s.passive;t==null||t.addEventListener(e,n,{capture:i!==void 0&&i,passive:o===void 0||o})}function C2(t){return t.name==="ph_toolbar_internal"}var P2=t=>{if(fe){try{for(var e=t+"=",n=fe.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];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}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ln(t)&&isFinite(t)&&Math.floor(t)===t});class im{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");var 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 im(i)}toString(){for(var e="",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 im(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class eN{generate(){var e=this.generateOrAbort();if(!ce(e))return e;this.Kr=0;var n=this.generateOrAbort();if(ce(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.Kr)this.Kr=e,this.Xr();else{if(this.Kr>=e+1e4)return;this.ti++,this.ti>4398046511103&&(this.Kr++,this.Xr())}return im.fromFieldsV7(this.Kr,Math.trunc(this.ti/Math.pow(2,30)),this.ti&Math.pow(2,30)-1,this.ei.nextUint32())}Xr(){this.ti=1024*this.ei.nextUint32()+(1023&this.ei.nextUint32())}constructor(){this.Kr=0,this.ti=0,this.ei=new tN}}var AS,cP=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};ne&&!ce(ne.crypto)&&crypto.getRandomValues&&(cP=t=>crypto.getRandomValues(t));class tN{nextUint32(){return this.De.length>this.ri||(cP(this.De),this.ri=0),this.De[this.ri++]}constructor(){this.De=new Uint32Array(8),this.ri=1/0}}var ci=()=>nN().toString(),nN=()=>(AS||(AS=new eN)).generate(),Dd="",rN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Cc=null,Zt={ii(){if(!sn(Cc))return Cc;if(Cc=!1,fe)try{var t="__ph_cookie_support_"+ci();Zt.ni(t,"xyz"),Cc=P2(t)==='"xyz"',Zt.oi(t)}catch{Cc=!1}return Cc},si(t){ge.error("cookieStore error: "+t)},ai:P2,ui(t){var e;try{e=JSON.parse(Zt.ai(t))||{}}catch{}return e},ni(t,e,n,r,s){if(!fe)return!1;try{var i="",o="",l=(function(f,p){if(p){var v=(function(w,_){if(_===void 0&&(_=fe),Dd)return Dd;if(!_||["localhost","127.0.0.1"].includes(w))return"";for(var x=w.split("."),b=Math.min(x.length,8),k="dmn_chk_"+ci();!Dd&&b--;){var C=x.slice(b).join("."),P=k+"=1;domain=."+C+";path=/";_.cookie=P+";max-age=3",_.cookie.includes(k)&&(_.cookie=P+";max-age=0",Dd=C)}return Dd})(f);if(!v){var y=(w=>{var _=w.match(rN);return _?_[0]:""})(f);y!==v&&ge.info("Warning: cookie subdomain discovery mismatch",y,v),v=y}return v?"; domain=."+v:""}return""})(fe.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),i="; expires="+u.toUTCString()}s&&(o="; secure");var d=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return d.length>3686.4&&ge.warn("cookieStore warning: large cookie, len="+d.length),fe.cookie=d,!0}catch{return!1}},oi(t,e){if(fe!=null&&fe.cookie)try{Zt.ni(t,"",-1,e)}catch{return}}},h1=null,pt={ii(){if(!sn(h1))return h1;var t=!0;if(ce(ne))t=!1;else try{var e="__mplssupport__";pt.ni(e,"xyz"),pt.ai(e)!=='"xyz"'&&(t=!1),pt.oi(e)}catch{t=!1}return t||ge.error("localStorage unsupported; falling back to cookie store"),h1=t,t},si(t){ge.error("localStorage error: "+t)},ai(t){try{return ne==null?void 0:ne.localStorage.getItem(t)}catch(e){pt.si(e)}return null},ui(t){try{return JSON.parse(pt.ai(t))||{}}catch{}return null},ni(t,e){try{return ne==null||ne.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){pt.si(n)}return!1},oi(t){try{ne==null||ne.localStorage.removeItem(t)}catch(e){pt.si(e)}}},p1=[as,Ns,rr,ha,li,pa,So,nu,yo],wl=[Ef,Wn,Bc,Aw,rm,Uc,$r,it],om=t=>t+"_cpm",sN=["__proto__","constructor","prototype"],m1=t=>{if(!ot(t))return{};var e={};return Object.keys(t).forEach((n=>{sN.indexOf(n)===-1&&(e[n]=t[n])})),e},v1=function(t,e){e===void 0&&(e=[]);var n={};return[...wl,...e].forEach((r=>{var s=t[r];ce(s)||sn(s)||s===""||(n[r]=s)})),n},uP=t=>{for(var e=5381,n=2166136261,r=0;t.length>r;r++){var 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)},TS=(t,e)=>({p:e,f:uP(JSON.stringify(t))}),RS=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var n=Zt.ui(om(t)),r=(n==null?void 0:n.f)===uP(e)&&ze(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},g1=(t,e)=>e+"|"+(Zt.ai(om(t))||""),Pc={},A2={ii:()=>!0,si(t){ge.error("memoryStorage error: "+t)},ai:t=>t in Pc?Pc[t]:null,ui:t=>t in Pc?Pc[t]:null,ni:(t,e)=>(Pc[t]=e,!0),oi(t){delete Pc[t]}},ol=null,It={ii(){if(!sn(ol))return ol;if(ol=!0,ce(ne))ol=!1;else try{var t="__support__";It.ni(t,"xyz"),It.ai(t)!=='"xyz"'&&(ol=!1),It.oi(t)}catch{ol=!1}return ol},si(t){ge.error("sessionStorage error: ",t)},ai(t){try{return ne==null?void 0:ne.sessionStorage.getItem(t)}catch(e){It.si(e)}return null},ui(t){try{return JSON.parse(It.ai(t))||null}catch{}return null},ni(t,e){try{return ne==null||ne.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){It.si(n)}return!1},oi(t){try{ne==null||ne.sessionStorage.removeItem(t)}catch(e){It.si(e)}}};class iN{constructor(e){this._instance=e}get mn(){return this._instance.config}get consent(){return this.Vs()?0:this.Gs}isOptedOut(){return this.mn.cookieless_mode===_o||this.isRejected()||this.consent===-1&&this.mn.cookieless_mode===sa}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.mn.opt_out_capturing_by_default}optInOut(e){this.Zs.ni(this.Qs,e?1:0,this.mn.cookie_expiration,this.mn.cross_subdomain_cookie,this.mn.secure_cookie)}reset(){this.Zs.oi(this.Qs,this.mn.cross_subdomain_cookie)}get Qs(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get Gs(){var e=this.Zs.ai(this.Qs);return s1(e)?1:Ye(nD,e)?0:-1}get Zs(){var e=this.mn.opt_out_capturing_persistence_type,n=e==="localStorage"?pt:Zt,r=n.ii()?n:A2;if(!this.Js||this.Js!==r){this.Js=r;var s=e==="localStorage"?Zt:pt;s.ai(this.Qs)&&(this.Js.ai(this.Qs)||this.optInOut(s1(s.ai(this.Qs))),s.oi(this.Qs,this.mn.cross_subdomain_cookie))}return this.Js}Vs(){return!!this.mn.respect_dnt&&[Vn==null?void 0:Vn.doNotTrack,Vn==null?void 0:Vn.msDoNotTrack,De.doNotTrack,Vn==null?void 0:Vn.globalPrivacyControl].some((e=>s1(e)))}}function dP(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!mr(r))return e;try{var s=r(e);return at(s)&&s?s:e}catch(i){return ge.error("Error in get_current_url, falling back to window.location.href",i),e}}var fP="__POSTHOG_TOOLBAR__",oN=1,aN=3,lN=11;function IS(t){return t instanceof Element&&(t.id===fP||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Ea(t){return!!t&&t.nodeType===oN}function ps(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function hP(t){return!!t&&t.nodeType===aN}function pP(t){return!!t&&t.nodeType===lN&&Ea(t.host)}var mP=1e3;function Iw(t){return t?Um(t).split(/\s+/):[]}function MS(t,e){var n=(function(r){var s,i=ne==null||(s=ne.location)==null?void 0:s.href;return ce(i)?void 0:dP(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function am(t){var 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 Iw(e)}function vP(t){return et(t)?null:Um(t).split(/(\s+)/).filter((e=>af(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function kf(t){var e="";return I2(t)&&!xP(t)&&t.childNodes&&t.childNodes.length&&kt(t.childNodes,(function(n){var r;hP(n)&&n.textContent&&(e+=(r=vP(n.textContent))!==null&&r!==void 0?r:"")})),Um(e)}function T2(t){var e;return ce(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Mw=["a","button","form","input","select","textarea","label"];function R2(t,e){if(ce(e))return!0;var n,r=function(i){if(e.some((o=>(function(l,u){var d=l.matches||l.matchesSelector||l.msMatchesSelector||l.mozMatchesSelector||l.webkitMatchesSelector||l.oMatchesSelector;try{return!!d&&d.call(l,u)}catch{return!1}})(i,o))))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function gP(t){var e=t.parentNode;return!(!e||!Ea(e))&&e}var cN=[".ph-no-autocapture","[data-ph-no-autocapture]"],yP=["next","previous","prev",">","<"],uN=[...yP,"+","-","−","–"],OS=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,LS=[".ph-no-rageclick",".ph-no-capture"],dN=["","text","search","email","password","url","tel","number"];function _P(t,e){if(!ne||Ow(t))return!1;var n,r,s,i,o;if(Er(e)?(n=!!e&&LS,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:LS,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(u){return!(!u||!Ea(u))&&(!!ps(u,"textarea")||(ps(u,"input")?Ye(dN,(u.getAttribute("type")||"").toLowerCase()):(function(d){if(d.isContentEditable)return!0;var f=d.getAttribute==null?void 0:d.getAttribute("contenteditable");return f==="true"||f===""})(u)))})(t))return!1;var l=wP(t,!1).targetElementList;return!(function(u,d){if(u===!1||ce(u))return!1;var f;if(u===!0)f=yP;else{if(!ze(u))return!1;if(u.length>10)return ge.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;f=u.map((p=>p.toLowerCase()))}return d.some((p=>{var v=p.safeText,y=p.ariaLabel;return f.some((w=>OS(v,w)||OS(y,w)))}))})(r,l.map((u=>{var d;return{safeText:kf(u).toLowerCase(),ariaLabel:((d=u.getAttribute("aria-label"))==null?void 0:d.toLowerCase().trim())||""}})))&&!R2(l,n)}var Ow=t=>!t||ps(t,"html")||!Ea(t),wP=(t,e)=>{if(!ne||Ow(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!ps(s,"body");)if(pP(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=gP(s);if(!i)break;if(e||Mw.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var o=ne.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function I2(t){for(var e=new Set,n=0,r=t;r.parentNode&&!ps(r,"body");r=r.parentNode){if(n++>=mP||e.has(r))return!1;e.add(r);var s=am(r);if(Ye(s,"ph-sensitive")||Ye(s,"ph-no-capture"))return!1}if(Ye(am(t),"ph-include"))return!0;var i=t.type||"";if(at(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!at(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function xP(t){return!!(ps(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ps(t,"select")||ps(t,"textarea")||t.getAttribute("contenteditable")==="true")}var DS=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}))$"),NS=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,fN=[16,15,14,13],hN=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),jS=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),FS=/[0-9A-Za-z_]/;function pN(t){for(var e=0,n=!1,r=t.length-1;r>=0;r--){var s=t.charCodeAt(r)-48;n&&(s*=2)>9&&(s-=9),e+=s,n=!n}return e%10==0}function af(t,e){if(e===void 0&&(e=!0),et(t))return!1;if(at(t)){t=Um(t);var n=e?DS.test((t||"").replace(/[- ]/g,"")):(function(s){var i;for(NS.lastIndex=0;i=NS.exec(s);){var o=i[2];if(o)for(var l=o.replace(/[- ]/g,""),u=0;l.length>u;u++)for(var d of fN){var f=u+d;if(l.length>=f){var p=l.slice(u,f);if(DS.test(p)&&pN(p))return!0}}}return!1})(t);if(n)return!1;var r=e?hN.test(t):(function(s){var i;for(jS.lastIndex=0;i=jS.exec(s);){var o=i[1],l=i[3];if(!(o&&l&&FS.test(o)&&FS.test(l)))return!0}return!1})(t);if(r)return!1}return!0}function VS(t){var e=kf(t);return af(e=(e+" "+bP(t)).trim())?e:""}function bP(t){var e="";return t&&t.childNodes&&t.childNodes.length&&kt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=kf(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+bP(n)).trim())}catch(i){ge.error("[AutoCapture]",i)}})),e}function $S(t){return t.replace(/"|\\"/g,'\\"')}function mN(t){var e=t.attr__class;if(e)return ze(e)?e:Iw(e)}var Rp=Ht("[Dead Clicks]"),vN=()=>!0,gN=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Cw)),r=t.instance.config.capture_dead_clicks;return Er(r)?r:!!ot(r)||n};class HS{get lazyLoadedDeadClicksAutocapture(){return this.Ks}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[Cw]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ys((()=>{this.Xs()})):this.stop()}Ys(e){var n,r;(n=De.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=De.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Rp.error("failed to load script",s):e()}))}Xs(){var e;if(fe){if(!this.Ks&&(e=De.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=ot(this.instance.config.capture_dead_clicks)?ue({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Ks=De.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Ks.start(fe),Rp.info("starting...")}}else Rp.error("`document` not found. Cannot start.")}stop(){this.Ks&&(this.Ks.stop(),this.Ks=void 0,Rp.info("stopping..."))}}var Ip=Ht("[SegmentIntegration]");function zS(t,e,n){n===void 0&&(n=!0);var r=t.config.segment;if(!r)return e();(function(s,i,o){var l=s.config.segment;if(!l)return i();var u=f=>{var p=()=>f.anonymousId()||ci();s.config.get_device_id=p,o&&f.id()&&(s.register({distinct_id:f.id(),$device_id:p()}),s.persistence.set_property(it,ir)),i(o?void 0:f.anonymousId()||void 0)},d=l.user();"then"in d&&mr(d.then)?d.then(u):u(d)})(t,(s=>{r.register(((i,o)=>{typeof Promise<"u"&&Promise.resolve||Ip.warn("This browser does not have Promise support, and can not use the segment integration");var l=(u,d)=>{if(!d)return u;var f=!!o&&u.event.anonymousId===o&&!u.event.userId;f||u.event.userId||u.event.anonymousId===i.get_distinct_id()||(Ip.info("No userId set, resetting PostHog"),i.reset()),f||(o=void 0),u.event.userId&&u.event.userId!==i.get_distinct_id()&&(Ip.info("UserId set, identifying with PostHog"),i.identify(u.event.userId));var p=i.calculateEventProperties(d,u.event.properties);return u.event.properties=Object.assign({},p,u.event.properties),u};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(u){return l(u,u.event.event)},page(u){return l(u,Wc)},identify(u){return l(u,k2)},screen(u){return l(u,"$screen")}}})(t,s)).then((()=>{e()}),(i=>{Ip.error("Failed to register the Segment integration",i),e()}))}),n)}var SP="posthog-js";function EP(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,i=n.prefix,o=n.severityAllowList,l=o===void 0?["error"]:o,u=n.sendExceptionsToPostHog,d=u===void 0||u;return f=>{var p,v,y,w,_;if(l!=="*"&&!l.includes(f.level)||!t.__loaded)return f;f.tags||(f.tags={});var x=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());f.tags["PostHog Person URL"]=x,t.sessionRecordingStarted()&&(f.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var b,k=((p=f.exception)==null?void 0:p.values)||[],C=k.map((T=>ue({},T,{stacktrace:T.stacktrace?ue({},T.stacktrace,{type:"raw",frames:(T.stacktrace.frames||[]).map((O=>ue({},O,{platform:"web:javascript"})))}):void 0}))),P={$exception_message:((v=k[0])==null?void 0:v.value)||f.message,$exception_type:(y=k[0])==null?void 0:y.type,$exception_level:f.level,$exception_list:C,$sentry_event_id:f.event_id,$sentry_exception:f.exception,$sentry_exception_message:((w=k[0])==null?void 0:w.value)||f.message,$sentry_exception_type:(_=k[0])==null?void 0:_.type,$sentry_tags:f.tags};return r&&s&&(P.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+f.event_id),d&&((b=t.exceptions)==null||b.sendExceptionEvent(P)),f}}class yN{constructor(e,n,r,s,i,o){this.name=SP,this.setupOnce=function(l){l(EP(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:o==null||o}))}}}class BS{constructor(e){this.eo=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(ge.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.io=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.ro()}ro(){var e;this.no=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.eo)}destroy(){var e;(e=this.no)==null||e.call(this),this.no=void 0}doPageView(e,n){var r,s=this.so(e,n);return this.io={pathname:(r=ne==null?void 0:ne.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.so(e,(n=this.io)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.io)==null?void 0:e.pageViewId}}so(e,n){var r=this.io;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var o=i.maxScrollHeight,l=i.lastScrollY,u=i.maxScrollY,d=i.maxContentHeight,f=i.lastContentY,p=i.maxContentY;if(!(ce(o)||ce(l)||ce(u)||ce(d)||ce(f)||ce(p))){o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f),p=Math.ceil(p);var v=o>1?Ni(l/o,0,1,ge):1,y=o>1?Ni(u/o,0,1,ge):1,w=d>1?Ni(f/d,0,1,ge):1,_=d>1?Ni(p/d,0,1,ge):1;s=Lt(s,{$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:v,$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:f,$prev_pageview_last_content_percentage:w,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var Nd=["flags","surveys"],_N={[J3]:{exposure:"hidden"},[zc]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Yd]:{exposure:"hidden"},[$r]:{exposure:"hidden"},[c2]:{exposure:"event"},[u2]:{exposure:"hidden"},[m2]:{exposure:"hidden"},[d2]:{exposure:"event"},[f2]:{exposure:"hidden"},[h2]:{exposure:"event"},[p2]:{exposure:"event"},[Cw]:{exposure:"event"},[Pw]:{exposure:"hidden"},[v2]:{exposure:"event"},[El]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Bc]:{exposure:"hidden"},[Aw]:{exposure:"event"},[eP]:{exposure:"event",shouldSkipFromEventProperties:t=>sn(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[rr]:{exposure:"hidden",storageGroup:"flags"},[Ns]:{exposure:"hidden",storageGroup:"flags"},[h0]:{exposure:"hidden"},[ha]:{exposure:"hidden",storageGroup:"flags"},[li]:{exposure:"hidden",storageGroup:"flags"},[pa]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[tu]:{exposure:"hidden",storageGroup:"flags"},[ki]:{exposure:"hidden"},[_l]:{exposure:"hidden"},[as]:{exposure:"hidden"},[Mi]:{exposure:"hidden"},[g2]:{exposure:"hidden",storageGroup:"surveys"},[nm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[y2]:{exposure:"event"},[p0]:{exposure:"hidden"},[m0]:{exposure:"hidden"},[Xd]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[yo]:{exposure:"hidden"},[Qd]:{exposure:"hidden"},[iP]:{exposure:"event"},[nu]:{exposure:"hidden"},[So]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[it]:{exposure:"hidden"},[_2]:{exposure:"hidden"},[w2]:{exposure:"hidden"},[x2]:{exposure:"hidden"},[b2]:{exposure:"hidden"},[Uc]:{exposure:"hidden"},[rm]:{exposure:"hidden"},[tP]:{exposure:"event"},[nP]:{exposure:"event"},[rP]:{exposure:"event"},[sP]:{exposure:"event"},[aP]:{exposure:"event"},[lP]:{exposure:"event"},[S2]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},wN=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Zn=t=>{var e=_N[t];if(e)return e;for(var n of wN){var r=n[1];if(t.indexOf(n[0])===0)return r}},Zc=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return m3(t)}},Au=t=>{var e=fe==null?void 0:fe.createElement("a");return ce(e)?null:(e.href=t,e)},Tu=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!ze(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{ge.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Cf=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),o=i[1],l=i[0],u=(o||"").split("&"),d=[],f=0;u.length>f;f++){var p=u[f].split("=");ze(p)&&(e.includes(p[0])?d.push(p[0]+"="+n):d.push(u[f]))}var v=l;return o!=null&&(v+="?"+d.join("&")),s!=null&&(v+="#"+s),v},lm=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},kP=(t,e)=>t>=e&&h3(),CP=(t,e,n,r)=>{if(t===0){if(h3()){var s=e+1;return s===n&&r(),s}return e}return 0},Mp="https?://(.*)",Ru=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],xN=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ru],Pf="<masked>",bN=["li_fat_id"];function PP(t,e,n){if(!fe)return{};var r,s=e?[...Ru,...n||[]]:[],i=AP(Cf(fe.URL,s,Pf),t),o=(r={},kt(bN,(function(l){var u=P2(l);r[l]=u||null})),r);return Lt(o,i)}function AP(t,e){var n=xN.concat(e||[]),r={};return kt(n,(function(s){var i=Tu(t,s);r[s]=i||null})),r}function TP(t){var e=(function(i){return i?i.search(Mp+"google.([^/?]*)")===0?"google":i.search(Mp+"bing.com")===0?"bing":i.search(Mp+"yahoo.com")===0?"yahoo":i.search(Mp+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!sn(e)){r.$search_engine=e;var s=fe?Tu(fe.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function US(){return navigator.language||navigator.userLanguage}var cm="$direct";function RP(){return(fe==null?void 0:fe.referrer)||cm}function IP(t,e,n){n===void 0&&(n=!1);var r=t?[...Ru,...e||[]]:[],s=n?Sa(qt==null?void 0:qt.href):qt==null?void 0:qt.href,i=s==null?void 0:s.substring(0,1e3);return{r:RP().substring(0,1e3),u:i?Cf(i,r,Pf):void 0}}function MP(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?Sa(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==cm?cm:(n=Au(r))==null?void 0:n.host};if(i){o.$current_url=i;var l=Au(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;var u=AP(i);Lt(o,u)}if(r){var d=TP(r);Lt(o,d)}return o}function OP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function SN(){try{return new Date().getTimezoneOffset()}catch{return}}var EN={flags:So,surveys:nm},kN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Op=t=>t+"_cookie_identity_change_pending",Lp=t=>{var e="",n=0;for(var r of t){var s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;e+=r,n+=s}return e},Tn="main",uo=[rr,Ns,ha,li,pa,So,tu,as],y1=t=>uo.indexOf(t)!==-1,ea=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},Ac=t=>{if(!t)return{};var e=JSON.parse(t);return ot(e)?e:{}},WS=(t,e)=>{kt(t,((n,r)=>{var s=Zn(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class _1{constructor(e,n,r){if(r===void 0&&(r=!0),this.oo={},this.ao=!1,this.lo=!1,this.uo=!1,this.ho=!1,this.do=!1,this.vo=new Map,this.co=!1,this.fo=!1,this.po=!1,this.mo=!1,this.yo=new Set,this.mn=e,this.bo=r,this.props={},this._o=void 0,this.wo=(i=>{var o="";return i.token&&(o=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+o+"_posthog"})(e),this.Zs=this.ko(e),this.uo=this.So(e),this.load(),this.xo(),e.debug&&ge.info("Persistence loaded",e.persistence,ue({},this.props)),this.update_config(e,e,n),this.save(),ne){var s=()=>this.flush();Mt(ne,"beforeunload",s,{capture:!1}),Mt(ne,"pagehide",s,{capture:!1}),this.Co=i=>{if(this.ao&&(!i.storageArea||i.storageArea===(ne==null?void 0:ne.localStorage))&&i.key)if(i.key!==this.wo){if(this.uo){var o=Nd.find((l=>i.key===this.To(l)));o&&this.Mo(i.key,o)}}else this.Mo(i.key,Tn)},Mt(ne,"storage",this.Co)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach((n=>{var r=n[0],s=n[1],i=this.vo.get(r);if(y1(r)&&i!==!0)if(s!==!0){var o=new Set(i||[]);s.forEach((l=>o.add(l))),o.size&&this.Io(r,o)}else this.Io(r,!0)}))}onCrossTabFeatureFlagChange(e){return this.yo.add(e),()=>this.yo.delete(e)}destroy(){this.Co&&ne&&(ne.removeEventListener("storage",this.Co),this.Co=void 0),this.yo.clear()}Mo(e,n,r){if(r===void 0&&(r=!0),this.Eo)return!1;var s,i;try{if(i=pt.ai(e),sn(i)){var o=this.Ro(n);return o.storageValue=null,n!==Tn&&(o.persisted=!1),!1}s=Ac(i)}catch{return!1}var l=n===Tn?s:pt.ui(this.wo);if(l&&this.Po(l))return!1;var u=this.Ao(s,n,r);return n===Tn&&this.uo&&!ea(this.Fo().main,s)||this.Oo(s,n,!0,i),u}Po(e){var n=this.props[Wn],r=e[Wn];return!ce(n)&&!ce(r)&&n!==r}Oo(e,n,r,s){var i=this.Ro(n);i.storageValue=s,n!==Tn&&(i.persisted=r);try{i.fingerprint=this.Lo(e,n)}catch{i.fingerprint=void 0}}Ao(e,n,r){var s=!1;return uo.forEach((i=>{var o,l=(o=Zn(i))==null?void 0:o.storageGroup;if(!(n===Tn&&this.uo&&l||n!==Tn&&l!==n)){var u=i in e,d=this.Do(i,u?e[i]:void 0),f=this.vo.has(i)?i in this.props:u;f===i in this.props&&ea(d,this.props[i])||(f?this.$o(i,d,!1):this.No(i,!1),s=!0)}})),s&&r&&this.yo.forEach((i=>i())),s}qo(){if(!this.ao)return!1;try{this.po=!1;var e,n=pt.ai(this.wo),r=this.Ro(Tn),s=!1,i=!1;if(n!==r.storageValue)if(sn(n))r.storageValue=null;else{if(e=Ac(n),this.po=!this.fo&&this.Po(e),this.po)return!1;i=this.Ao(e,Tn,!1),!this.uo||ea(this.Fo().main,e)?this.Oo(e,Tn,!0,n):r.storageValue=n,s=!0}return this.uo&&Nd.forEach((o=>{var l=pt.ai(this.To(o)),u=this.Ro(o),d=e||{},f=s&&uo.some((v=>{var y;return((y=Zn(v))==null?void 0:y.storageGroup)===o&&v in d}));if(l!==u.storageValue||f){if(sn(l))return u.storageValue=null,u.persisted=!1,void(f&&(i=this.Ao(d,o,!1)||i));var p=Ac(l);i=this.Ao(p,o,!1)||i,this.Oo(p,o,!0,l)}})),i}catch{return!1}}Io(e,n){this.vo.set(e,n);var r=Zn(e);r!=null&&r.volatile||(this.Ro((this.uo?r==null?void 0:r.storageGroup:void 0)||Tn).fingerprint=void 0,this.jo(e))}Bo(){uo.forEach((e=>this.vo.set(e,!0)))}xo(){if(this.ao)try{var e=pt.ai(this.wo),n=Ac(e);this.Ro(Tn).storageValue=e,uo.forEach((r=>{var s,i=this.uo?(s=Zn(r))==null?void 0:s.storageGroup:void 0,o=i?pt.ai(this.To(i)):null;if(i){var l=this.Ro(i);l.storageValue=o,l.persisted=!sn(o)}var u=i&&!sn(o)?Ac(o):n;r in this.props?this.Ho(r,u[r],this.props[r]):r in u&&this.Io(r,!0)}))}catch{}}Do(e,n){var r=this.vo.get(e);if(!r)return n;if(r===!0)return this.props[e];if(e===Ns){var s=new Set(ze(n)?n:[]),i=new Set(ze(this.props[e])?this.props[e]:[]);return r.forEach((u=>i.has(u)?s.add(u):s.delete(u))),Array.from(s)}var o=ot(n)?ue({},n):{},l=ot(this.props[e])?this.props[e]:{};return r.forEach((u=>{u in l?o[u]=l[u]:delete o[u]})),o}Ho(e,n,r){if(y1(e)){var s=this.vo.get(e);if(s!==!0){var i=n;if(this.ao)try{var o,l=this.uo?(o=Zn(e))==null?void 0:o.storageGroup:void 0,u=l?this.To(l):this.wo;i=Ac(pt.ai(u))[e]}catch{}var d=new Set(s||[]);if(e===Ns){if(!ce(n)&&!ze(n)||!ce(i)&&!ze(i)||!ze(r))return void this.Io(e,!0);var f=new Set(n||[]),p=new Set(i||[]),v=new Set(r);new Set([...f,...v]).forEach((_=>{f.has(_)!==v.has(_)&&d.add(_)})),d.forEach((_=>{p.has(_)===v.has(_)&&d.delete(_)}))}else{if(!ot(r))return void(ea(i,r)?this.vo.delete(e):this.Io(e,!0));if(!ce(n)&&!ot(n)||ce(n)&&fs(r)&&ce(i))return void this.Io(e,!0);var y=ot(n)?n:{},w=ot(i)?i:{};new Set([...Object.keys(y),...Object.keys(r)]).forEach((_=>{_ in y==_ in r&&ea(y[_],r[_])||d.add(_)})),d.forEach((_=>{_ in w==_ in r&&ea(w[_],r[_])&&d.delete(_)}))}d.size?this.Io(e,d):this.vo.delete(e)}}}zo(){var e,n=(e=this.mn)==null?void 0:e.persistence_save_debounce_ms;return ln(n)&&n>0?n:0}Uo(e){if(this.mn.cookieWinsOnConflict&&this.mn.persistence.toLowerCase()==="localstorage+cookie")if(e)try{var n=v1(e,this.mn.cookie_persisted_properties||[]),r=TS(n,this.mn.cookie_persisted_properties||[]),s=JSON.stringify(n)+"|"+JSON.stringify(r),i=Zt.ai(this.wo)||void 0;i&&g1(this.wo,i)===s&&(this.Wo=s,this.Vo=i)}catch{}else try{var o=Zt.ai(this.wo)||void 0;this.Wo=o?g1(this.wo,o):void 0,this.Vo=o}catch{}}syncCookieProperties(){return this.Go(this.mn)}Go(e,n){if(n===void 0&&(n=!1),this.Eo&&!n||this.do||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;var r;try{r=Zt.ai(this.wo)||void 0}catch{}if(!r||r===this.Vo)return!1;var s,i=g1(this.wo,r);try{s=m1(JSON.parse(r))}catch{return!1}if((Zt.ai(this.wo)||void 0)!==r)return!1;this.Wo=i,this.Vo=r;var o=RS(this.wo,r),l=[...wl,...o.properties],u={};if(Object.keys(s).forEach((x=>{var b=s[x];(ce(b)||sn(b)||b===""||x===it&&b!==hn&&b!==ir)&&(u[x]=!0,delete s[x])})),fs(s))return!1;var d=Wn in s||s[it]===hn||s[it]===ir,f=this.props,p=f[Wn],v=f[it],y=Lt({},f);[...wl,...e.cookie_persisted_properties||[]].forEach((x=>{if(l.indexOf(x)!==-1&&!(x in s)&&!u[x]&&(d||x!==Wn&&x!==it)){var b=y[x];!o.isValid&&wl.indexOf(x)!==-1&&(b===!1||b===0)||delete y[x]}})),this.props=Lt(y,s),uo.forEach((x=>{var b=x in this.props;x in f===b&&ea(f[x],this.props[x])||(b?this.Ho(x,f[x],this.props[x]):this.Io(x,!0))})),!d||it in s||it in this.props||this.$o(it,hn);var w=this.props[Wn],_=this.props[it];return!d||w===p&&_===v||(this.fo=!0,this.ho=!0,It.ni(Op(this.wo),!0),this.No(as),this.No(Ns),this.No(rr),this.No(ha),this.No(li),this.No(pa),this.No(So),this.No(nu),this.No(yo),_===hn&&(v===ir||s[it]===hn||!ce(p)&&w!==p)&&(WS(this.props,s),this.No(Mi)),_===ir?this.props.$user_id=w:delete this.props.$user_id,this.No(zc)),!0}consumeCookieIdentityChange(){var e=Op(this.wo),n=this.ho||!!It.ai(e);return this.ho=!1,n&&It.oi(e),n}Zo(e){return e===void 0&&(e=!1),!(this.do||this.Eo&&!e||!this.mn.cookieWinsOnConflict||this.mn.persistence.toLowerCase()!=="localstorage+cookie"||(this.do=!0,0))}Qo(){this.do&&(ce(this.Jo)||(clearTimeout(this.Jo),this.Jo=void 0),delete this.oo[Tn],this.Ko(!0))}Yo(e){if(e===void 0&&(e=!0),this.do)try{e?this.Qo():ce(this.Jo)||(clearTimeout(this.Jo),this.Jo=void 0)}finally{this.do=!1}}isDisabled(){return!!this.Eo}ko(e){kN.indexOf(e.persistence.toLowerCase())===-1&&(ge.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=(function(l,u){l===void 0&&(l=[]),u===void 0&&(u=!1);var d=[...wl,...l];return ue({},pt,{ui(f){try{var p,v={};try{p=Zt.ai(f)||void 0,v=p?m1(JSON.parse(p)):{}}catch{}var y,w=JSON.parse(pt.ai(f)||"{}");if(u){var _=RS(f,p),x=[...wl,..._.properties],b={};Object.keys(v).forEach((O=>{var M=v[O];sn(M)||M===""||O===it&&M!==hn&&M!==ir||(b[O]=M)}));var k=Wn in b||b[it]===hn||b[it]===ir;if(Object.keys(b).length>0){var C,P=w[Wn],T=(C=w[it])!==null&&C!==void 0?C:hn;d.forEach((O=>{if(x.indexOf(O)!==-1&&!(O in v)&&(k||O!==Wn&&O!==it)){var M=w[O];!_.isValid&&wl.indexOf(O)!==-1&&(M===!1||M===0)||delete w[O]}})),!k||it in v||it in w||(w[it]=hn),!k||(Wn in b?b[Wn]:w[Wn])===P&&(it in b?b[it]:w[it])===T||(p1.forEach((O=>delete w[O])),b[it]===ir&&Wn in b?w.$user_id=b[Wn]:delete w.$user_id,b[it]!==ir&&(delete w[iP],delete w[Mi]),delete w.__alias)}y=Lt(w,b)}else y=Lt(v,w);return pt.ni(f,y),y}catch{}return null},ni(f,p,v,y,w,_){var x=pt.ni(f,p,void 0,void 0,_);try{var b=v1(p,l);if(Object.keys(b).length){if(u){var k=om(f),C=TS(b,l);if(Zt.ni(k,C,v,y,w,_),Zt.ai(k)!==JSON.stringify(C)){Zt.oi(k,y);var P=v1(p);return Zt.ni(f,P,v,y,w,_),x}}Zt.ni(f,b,v,y,w,_)}}catch(T){pt.si(T)}return x},oi(f,p){try{ne==null||ne.localStorage.removeItem(f),Zt.oi(f,p),Zt.oi(om(f),p)}catch(v){pt.si(v)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),s=!1,i=!1,o=e.persistence.toLowerCase();return o==="localstorage"&&pt.ii()?(n=pt,i=!0):o==="localstorage+cookie"&&r.ii()?(n=r,i=!0,s=!0):o==="sessionstorage"&&It.ii()?n=It:o==="memory"?n=A2:o==="cookie"&&Zt.ii()?(n=Zt,s=!0):r.ii()?(n=r,i=!0,s=!0):Zt.ii()?(n=Zt,s=!0):n=A2,this.ao=i,this.lo=s,n}To(e){return this.wo+"__"+e}So(e){return this.ao&&!!e.split_storage}properties(){var e={};return kt(this.props,((n,r)=>{var s=Zn(r);if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n))return;e[r]=n}})),e}load(e){if(e===void 0&&(e=!1),!this.Eo||e){var n=this.mn.cookieWinsOnConflict&&this.mn.persistence.toLowerCase()==="localstorage+cookie",r=n?pt.ui(this.wo):null,s={};if(n)try{kt(s=m1(Zt.ui(this.wo)),((w,_)=>{(ce(w)||sn(w)||w==="")&&delete s[_]}))}catch{}var i=this.Zs.ui(this.wo);if(i&&(this.props=Lt({},i)),this.uo&&this.Xo(),n&&i){var o,l,u=r==null?void 0:r[Wn],d=(o=r==null?void 0:r[it])!==null&&o!==void 0?o:hn,f=i[Wn],p=(l=i[it])!==null&&l!==void 0?l:hn;if(f!==u||p!==d){this.ho=!0,It.ni(Op(this.wo),!0);var v=Lt({},this.props);p1.forEach((w=>delete v[w])),p===hn&&(d===ir||s[it]===hn||!ce(u)&&f!==u)&&(WS(v,s),delete v[Mi]),this.props=v;var y=new Set;p1.forEach((w=>{var _,x=(_=Zn(w))==null?void 0:_.storageGroup;x&&y.add(x)})),y.forEach((w=>{var _={};kt(this.props,((x,b)=>{var k;((k=Zn(b))==null?void 0:k.storageGroup)===w&&(_[b]=x)})),fs(_)?(pt.oi(this.To(w)),this.oo[w]={}):pt.ni(this.To(w),_)&&(this.oo[w]={persisted:!0,fingerprint:this.Lo(_,w)})}))}}It.ai(Op(this.wo))&&(this.ho=!0)}}Xo(){for(var e of Nd){var n=pt.ui(this.To(e));if(n&&!fs(n)){var r=this.Ro(e);r.persisted=!0,this.ta(e)||(r.fingerprint=this.Lo(n,e)),this.ea(e,n)||Lt(this.props,n)}}}ta(e){return Object.keys(this.props).some((n=>{var r;return((r=Zn(n))==null?void 0:r.storageGroup)===e}))}ea(e,n){var r=EN[e];if(!r)return!1;var s=n[r],i=this.props[r];return ln(s)&&ln(i)&&i>s}refreshKey(e){var n;if(!(this.Eo||e===$r&&this.mo)){var r=this.uo?(n=Zn(e))==null?void 0:n.storageGroup:void 0,s=r?pt.ui(this.To(r)):this.Zs.ui(this.wo);if(s&&e in s)this.$o(e,s[e],!1);else{if(r){var i=this.Zs.ui(this.wo);if(i&&e in i)return void this.$o(e,i[e],!1)}this.No(e,!1)}}}save(){if(!this.Eo){var e=this.zo();e>0?ce(this.Jo)&&(this.Jo=setTimeout((()=>{this.Jo=void 0,this.Ko()}),e)):this.Ko()}}flush(){ce(this.Jo)||(clearTimeout(this.Jo),this.Jo=void 0,this.Ko())}Ko(e){if(e===void 0&&(e=!1),!(this.Eo||this.do&&!e)){e||(this.syncCookieProperties(),this.mo||this.mn.cookieWinsOnConflict&&this.mn.persistence.toLowerCase()==="localstorage+cookie"||this.refreshKey($r));var n=!e&&!this.co;n||(this.po=!1);var r=!!n&&this.qo();if(this.po)this.mn.debug&&ge.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.uo)return this.ia(),void(r&&this.yo.forEach((i=>i())));var s=this.ra(this.Zs,this.wo,this.props,Tn);s==="written"&&this.Uo(this.props),s!=="failed"&&(this.vo.clear(),this.fo=!1,this.mo=!1),r&&this.yo.forEach((i=>i()))}}}ia(){var e=this,n=this.Fo(),r=n.main,s=n.groups,i=this.ra(this.Zs,this.wo,r,Tn);i==="written"&&this.Uo(r),i!=="failed"&&(this.fo=!1,this.mo=!1,uo.forEach((u=>{var d;(d=Zn(u))!=null&&d.storageGroup||this.vo.delete(u)})));var o=function(u){var d,f=s[u];if(fs(f)&&((d=e.oo[u])==null||!d.persisted))return uo.forEach((v=>{var y;((y=Zn(v))==null?void 0:y.storageGroup)===u&&e.vo.delete(v)})),1;var p=e.ra(pt,e.To(u),f,u);p!=="failed"&&uo.forEach((v=>{var y=Zn(v);(y==null?void 0:y.storageGroup)!==u||p!=="written"&&y.volatile||e.vo.delete(v)}))};for(var l of Nd)o(l)}Fo(){var e={},n={flags:{},surveys:{}};return kt(this.props,((r,s)=>{var i,o=(i=Zn(s))==null?void 0:i.storageGroup;o?n[o][s]=r:e[s]=r})),{main:e,groups:n}}Lo(e,n){if(n===Tn)return JSON.stringify(e)+"|"+this.na+"|"+this.sa+"|"+this.oa;var r={};return kt(e,((s,i)=>{var o;r[i]=(o=Zn(i))!=null&&o.volatile?"__volatile__":s})),JSON.stringify(r)}ra(e,n,r,s){var i,o=this.Ro(s);if(s!==Tn&&!o.dirty&&!ce(o.fingerprint))return"skipped";try{if((i=this.Lo(r,s))===o.fingerprint)return o.dirty=!1,"skipped"}catch{i=void 0}return e.ni(n,r,this.na,this.sa,this.oa,this.mn.debug)?(o.dirty=!1,s!==Tn&&(o.persisted=!0),ce(i)||(o.fingerprint=i),this.ao&&(o.storageValue=pt.ai(n)),"written"):(this.mn.debug&&ge.warn('failed to persist storage entry "'+n+'"; will retry on next save'),"failed")}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(this.Bo(),ce(this.Jo)||(clearTimeout(this.Jo),this.Jo=void 0),this.Zs.oi(this.wo,!1),this.Zs.oi(this.wo,!0),!r&&this.bo)for(var s of Nd)pt.oi(this.To(s));r?delete this.oo[Tn]:this.oo={},this.Wo=void 0,this.Vo=void 0}clear(){this.remove(),this.props={}}register_once(e,n,r){if(ot(e)){this.syncCookieProperties(),ce(n)&&(n="None"),this.na=ce(r)?this.aa:r;var s=!1;if(kt(e,((i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.$o(o,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(ot(e)){this.syncCookieProperties(),this.na=ce(n)?this.aa:n;var r=!1;if(kt(e,((s,i)=>{e.hasOwnProperty(i)&&(this.props[i]!==s||ot(s)||ze(s))&&(this.$o(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var n=typeof e=="string"?[e]:e,r=!1;for(var s of n)s in this.props&&(this.No(s),r=!0);r&&this.save()}update_campaign_params(){var e=fe==null?void 0:fe.URL;if(e!==this._o){var n=PP(this.mn.custom_campaign_params,this.mn.mask_personal_data_properties,this.mn.custom_personal_data_properties),r=!fs(Rw(n));return r&&this.register(n),this._o=e,r?n:void 0}}update_search_keyword(){var e;this.register((e=fe==null?void 0:fe.referrer)?TP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:RP(),$referring_domain:fe!=null&&fe.referrer&&((e=Au(fe.referrer))==null?void 0:e.host)||cm},void 0)}set_initial_person_info(){if(!this.props[x2]&&!this.props[b2]){var e=IP(this.mn.mask_personal_data_properties,this.mn.custom_personal_data_properties,this.mn.disable_capture_url_hashes);this.register_once({[Uc]:this.lo?{r:Lp(e.r),u:e.u?Lp(e.u):void 0}:e},void 0)}}get_initial_props(){var e={};kt([b2,x2],(s=>{var i=this.props[s];i&&kt(i,(function(o,l){e["$initial_"+Jy(l)]=o}))}));var n=this.props[Uc];if(n){var r=(function(s,i){i===void 0&&(i=!1);var o=MP(s,i),l={};return kt(o,(function(u,d){l["$initial_"+Jy(d)]=u})),l})(n,this.mn.disable_capture_url_hashes);Lt(e,r)}return e}safe_merge(e){return kt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){var s=e.persistence!==n.persistence,i=!((_,x)=>{if(_.length!==x.length)return!1;var b=[..._].sort(),k=[...x].sort();return b.every(((C,P)=>C===k[P]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),o=s||i,l=e.cookieWinsOnConflict!==n.cookieWinsOnConflict,u=e.disable_persistence||!!r,d=!!this.Eo&&!u;u||this.Go(n,d),this.mn=e,!u&&(s||i||l)&&(this.Wo=void 0,this.Vo=void 0,this.Go(ue({},e,{cookie_persisted_properties:n.cookie_persisted_properties}),d));var f=o||l?this.ko(e):this.Zs;this.la();var p=this.So(e),v=o||p!==this.uo,y=!u&&(v||e.cross_subdomain_cookie!==this.sa||e.secure_cookie!==this.oa)&&this.Zo(d);this.co=v;try{if(this.aa=this.na=e.cookie_expiration,this.set_disabled(u),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),v){var w=this.props;this.clear(),this.Zs=f,this.uo=p,this.props=w,this.save()}else l&&(this.Zs=f,u||(delete this.oo[Tn],this.Ko()))}finally{this.co=!1,y&&this.Yo()}}la(){var e=this.props[Uc];if(this.lo&&ot(e)&&typeof e.r=="string"){var n=Lp(e.r),r=typeof e.u=="string"?Lp(e.u):e.u;n===e.r&&r===e.u||this.$o(Uc,ue({},e,{r:n,u:r}))}}set_disabled(e){this.Eo=e,this.Eo?this.remove():this.save()}set_cross_subdomain(e){e!==this.sa&&(this.sa=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.oa&&(this.oa=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[Yd]||{};r[e]=n,this.$o(Yd,r),this.save()}remove_event_timer(e){var n=this.props[Yd]||{},r=n[e];return ce(r)||(delete n[e],this.$o(Yd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.$o(e,n),this.save()}$o(e,n,r){var s;r===void 0&&(r=!0);var i=this.props[e];this.props[e]=n,r&&(e!==Wn&&e!==it||i===n||(this.fo=!0),e!==$r||ea(i,n)||(this.mo=!0),this.Ho(e,i,n),(s=Zn(e))!=null&&s.volatile||this.jo(e))}No(e,n){n===void 0&&(n=!0),delete this.props[e],n&&(y1(e)&&this.Io(e,!0),e===$r&&(this.mo=!0),this.jo(e))}jo(e){var n,r=(n=Zn(e))==null?void 0:n.storageGroup;r&&(this.Ro(r).dirty=!0)}Ro(e){return this.oo[e]||(this.oo[e]={})}}var cs={GZipJS:"gzip-js",Base64:"base64"},jd={Activation:"events",Cancellation:"cancelEvents"},w1={Popover:"popover",API:"api",Widget:"widget"},wo={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},x1={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},M2={Popover:"popover",Inline:"inline"};function Dp(t){var e=!0;return{dispose(){if(e){e=!1;var n=t();n&&mr(n.then)&&n.then(void 0,(()=>{}))}}}}var CN={SHOWN:"product tour shown"},ZS={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},qS=Ht("[RateLimiter]");class PN{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((s=>{qS.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void qS.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var i=this.captureEventsBurstLimit,o=this.captureEventsPerSecond,l=new Date().getTime(),u=(n=(r=this.instance.persistence)==null?void 0:r.get_property(w2))!==null&&n!==void 0?n:{tokens:i,last:l};u.tokens+=(l-u.last)/1e3*o,u.last=l,u.tokens>i&&(u.tokens=i);var d=1>u.tokens;if(d||e||(u.tokens=Math.max(0,u.tokens-1)),d&&!e){var f=(ln(u.dropped)?u.dropped:0)+1;u.dropped=f,!this.lastEventRateLimited&&this.ua(f)&&(u.dropped=0)}return this.lastEventRateLimited=d,(s=this.instance.persistence)==null||s.set_property(w2,u),{isRateLimited:d,remainingTokens:u.tokens}}ha(e){var n=this.instance.config.property_denylist;return!ze(n)||!n.includes(e)}da(){var e;if(this.ha("$current_url")&&this.ha("$pathname")&&qt!=null&&qt.pathname)return""+((e=qt.origin)!==null&&e!==void 0?e:"")+qt.pathname}ua(e){var n,r,s=this.captureEventsBurstLimit,i=this.captureEventsPerSecond,o=this.da(),l=this.ha("$session_id")?(n=(r=this.instance).get_session_id)==null?void 0:n.call(r):void 0,u=[e+" event(s) dropped since the last warning",o?"triggered on "+o:void 0,l?"session "+l:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+u+". Config is set to "+i+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var ta=Ht("[RemoteConfig]");class LP{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=De._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}va(e){var n,r;(n=De.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=De.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}ca(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return ta.info("Using preloaded remote config",this.remoteConfig),void this.fa(this.remoteConfig);if(this._instance.pa())return void ta.warn("Remote config is disabled. Falling back to local config.");this.va((e=>{if(!e)return ta.info("No config found after loading remote JS config. Falling back to JSON."),void this.ca((n=>{this.fa(n.json,n)}));this.fa(e)}))}catch(e){ta.error("Error loading remote config",e),this.fa()}}fa(e,n){!e&&n&&(n.statusCode===0?n.error||ta.warn("Failed to fetch remote config from PostHog."):ta.error("Failed to fetch remote config from PostHog."));try{this._instance.fa(e?{ok:!0,config:e}:{ok:!1})}catch(s){ta.error("Error applying remote config",s)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded()}catch(s){ta.error("Error loading feature flags",s)}}}var Hs=Uint8Array,zr=Uint16Array,Iu=Uint32Array,Lw=new Hs([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]),Dw=new Hs([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]),GS=new Hs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DP=function(t,e){for(var n=new zr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new Iu(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]},NP=DP(Lw,2),O2=NP[1];NP[0][28]=258,O2[258]=28;for(var KS=DP(Dw,0)[1],jP=new zr(32768),Kt=0;32768>Kt;++Kt){var Tc=(43690&Kt)>>>1|(21845&Kt)<<1;jP[Kt]=((65280&(Tc=(61680&(Tc=(52428&Tc)>>>2|(13107&Tc)<<2))>>>4|(3855&Tc)<<4))>>>8|(255&Tc)<<8)>>>1}var lf=function(t,e,n){for(var r=t.length,s=0,i=new zr(e);r>s;++s)++i[t[s]-1];var o,l=new zr(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new zr(r),s=0;r>s;++s)o[s]=jP[l[t[s]-1]++]>>>15-t[s];return o},Ul=new Hs(288);for(Kt=0;144>Kt;++Kt)Ul[Kt]=8;for(Kt=144;256>Kt;++Kt)Ul[Kt]=9;for(Kt=256;280>Kt;++Kt)Ul[Kt]=7;for(Kt=280;288>Kt;++Kt)Ul[Kt]=8;var um=new Hs(32);for(Kt=0;32>Kt;++Kt)um[Kt]=5;var AN=lf(Ul,9),TN=lf(um,5),FP=function(t){return(t/8>>0)+(7&t&&1)},VP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof zr?zr:t instanceof Iu?Iu:Hs)(n-e);return r.set(t.subarray(e,n)),r},ro=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},Fd=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},b1=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 Hs(0),0];if(s==1){var o=new Hs(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(T,O){return T.f-O.f})),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=s-1;)l=n[n[p].f>n[d].f?d++:p++],u=n[d!=f&&n[p].f>n[d].f?d++:p++],n[f++]={s:-1,f:l.f+u.f,l,r:u};var v=i[0].s;for(r=1;s>r;++r)i[r].s>v&&(v=i[r].s);var y=new zr(v+1),w=L2(n[f-1],y,0);if(w>e){r=0;var _=0,x=w-e,b=1<<x;for(i.sort((function(T,O){return y[O.s]-y[T.s]||T.f-O.f}));s>r;++r){var k=i[r].s;if(e>=y[k])break;_+=b-(1<<w-y[k]),y[k]=e}for(_>>>=x;_>0;){var C=i[r].s;e>y[C]?_-=1<<e-y[C]++-1:++r}for(;r>=0&&_;--r){var P=i[r].s;y[P]==e&&(--y[P],++_)}w=e}return[new Hs(y),w]},L2=function(t,e,n){return t.s==-1?Math.max(L2(t.l,e,n+1),L2(t.r,e,n+1)):e[t.s]=n},YS=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new zr(++e),r=0,s=t[0],i=1,o=function(u){n[r++]=u},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]},Vd=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},D2=function(t,e,n){var r=n.length,s=FP(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)},XS=function(t,e,n,r,s,i,o,l,u,d,f){ro(e,f++,n),++s[256];for(var p=b1(s,15),v=p[0],y=p[1],w=b1(i,15),_=w[0],x=w[1],b=YS(v),k=b[0],C=b[1],P=YS(_),T=P[0],O=P[1],M=new zr(19),R=0;k.length>R;++R)M[31&k[R]]++;for(R=0;T.length>R;++R)M[31&T[R]]++;for(var L=b1(M,7),D=L[0],V=L[1],j=19;j>4&&!D[GS[j-1]];--j);var U,X,q,Z,Y=d+5<<3,H=Vd(s,Ul)+Vd(i,um)+o,Q=Vd(s,v)+Vd(i,_)+o+14+3*j+Vd(M,D)+(2*M[16]+3*M[17]+7*M[18]);if(H>=Y&&Q>=Y)return D2(e,f,t.subarray(u,u+d));if(ro(e,f,1+(H>Q)),f+=2,H>Q){U=lf(v,y),X=v,q=lf(_,x),Z=_;var z=lf(D,V);for(ro(e,f,C-257),ro(e,f+5,O-1),ro(e,f+10,j-4),f+=14,R=0;j>R;++R)ro(e,f+3*R,D[GS[R]]);f+=3*j;for(var N=[k,T],G=0;2>G;++G){var oe=N[G];for(R=0;oe.length>R;++R)ro(e,f,z[se=31&oe[R]]),f+=D[se],se>15&&(ro(e,f,oe[R]>>>5&127),f+=oe[R]>>>12)}}else U=AN,X=Ul,q=TN,Z=um;for(R=0;l>R;++R)if(r[R]>255){var se;Fd(e,f,U[257+(se=r[R]>>>18&31)]),f+=X[se+257],se>7&&(ro(e,f,r[R]>>>23&31),f+=Lw[se]);var ee=31&r[R];Fd(e,f,q[ee]),f+=Z[ee],ee>3&&(Fd(e,f,r[R]>>>5&8191),f+=Dw[ee])}else Fd(e,f,U[r[R]]),f+=X[r[R]];return Fd(e,f,U[256]),f+X[256]},RN=new Iu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),IN=(function(){for(var t=new Iu(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),S1=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function MN(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(v){for(var y=p,w=0;v.length>w;++w)y=IN[255&y^v[w]]^y>>>8;p=y},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,o,l,u,d=(l=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(p,v,y,w,_,x){var b=p.length,k=new Hs(w+b+5*(1+Math.floor(b/7e3))+_),C=k.subarray(w,k.length-_),P=0;if(!v||8>b)for(var T=0;b>=T;T+=65535){var O=T+65535;b>O?P=D2(C,P,p.subarray(T,O)):(C[T]=!0,P=D2(C,P,p.subarray(T,b)))}else{for(var M=RN[v-1],R=M>>>13,L=8191&M,D=(1<<y)-1,V=new zr(32768),j=new zr(D+1),U=Math.ceil(y/3),X=2*U,q=function(xe){return(p[xe]^p[xe+1]<<U^p[xe+2]<<X)&D},Z=new Iu(25e3),Y=new zr(288),H=new zr(32),Q=0,z=0,N=(T=0,0),G=0,oe=0;b>T;++T){var se=q(T),ee=32767&T,de=j[se];if(V[ee]=de,j[se]=ee,T>=G){var ve=b-T;if((Q>7e3||N>24576)&&ve>423){P=XS(p,C,0,Z,Y,H,z,N,oe,T-oe,P),N=Q=z=0,oe=T;for(var le=0;286>le;++le)Y[le]=0;for(le=0;30>le;++le)H[le]=0}var te=2,Pe=0,Se=L,Ne=ee-de&32767;if(ve>2&&se==q(T-Ne))for(var Xe=Math.min(R,ve)-1,Qe=Math.min(32767,T),lt=Math.min(258,ve);Qe>=Ne&&--Se&&ee!=de;){if(p[T+te]==p[T+te-Ne]){for(var ut=0;lt>ut&&p[T+ut]==p[T+ut-Ne];++ut);if(ut>te){if(te=ut,Pe=Ne,ut>Xe)break;var je=Math.min(Ne,ut-2),st=0;for(le=0;je>le;++le){var Be=T-Ne+le+32768&32767,ft=Be-V[Be]+32768&32767;ft>st&&(st=ft,de=Be)}}}Ne+=(ee=de)-(de=V[ee])+32768&32767}if(Pe){Z[N++]=268435456|O2[te]<<18|KS[Pe];var Me=31&O2[te],We=31&KS[Pe];z+=Lw[Me]+Dw[We],++Y[257+Me],++H[We],G=T+te,++Q}else Z[N++]=p[T],++Y[p[T]]}}P=XS(p,C,!0,Z,Y,H,z,N,oe,T-oe,P)}return VP(k,0,w+FP(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,u)),f=d.length;return(function(p,v){var y=v.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>v.level?4:v.level==9?2:0,p[9]=3,v.mtime!=0&&S1(p,4,Math.floor(new Date(v.mtime||Date.now())/1e3)),y){p[3]=8;for(var w=0;y.length>=w;++w)p[w+10]=y.charCodeAt(w)}})(d,e),S1(d,f-8,n.d()),S1(d,f-4,r),d}var ON=!!Qy||!!gw,$P="text/plain",g0=!1,HP=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),i=s[0],o=s[1];if(!o)return t;var l=o.split("&").filter((u=>u.split("=")[0]!==e)).join("&");return i+(l?"?"+l:"")+(r?"#"+r:"")},rh=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],o=s[1],l=ue({},e),u=(r=o==null?void 0:o.split("&").map((f=>{var p,v=f.split("="),y=v[0],w=n&&(p=l[y])!==null&&p!==void 0?p:v[1];return delete l[y],y+"="+w})))!==null&&r!==void 0?r:[],d=(function(f,p){var v,y;p===void 0&&(p="&");var w=[];return kt(f,(function(_,x){ce(_)||ce(x)||x==="undefined"||(v=encodeURIComponent((b=>b instanceof File)(_)?_.name:_.toString()),y=encodeURIComponent(x),w[w.length]=y+"="+v)})),w.join(p)})(l);return d&&u.push(d),u.length>0?i+"?"+u.join("&"):i},E1=t=>{if(t.ga)return t.ga;var e=t.data,n=t.compression;if(e){if(n===cs.GZipJS){var r=MN((function(l,u){var d=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new Hs(l.length+(l.length>>>1)),p=0,v=function(x){f[p++]=x},y=0;d>y;++y){if(p+5>f.length){var w=new Hs(p+8+(d-y<<1));w.set(f),f=w}var _=l.charCodeAt(y);128>_?v(_):2048>_?(v(192|_>>>6),v(128|63&_)):_>55295&&57344>_?(v(240|(_=65536+(1047552&_)|1023&l.charCodeAt(++y))>>>18),v(128|_>>>12&63),v(128|_>>>6&63),v(128|63&_)):(v(224|_>>>12),v(128|_>>>6&63),v(128|63&_))}return VP(f,0,p)})(Zc(e)),{mtime:0});return{contentType:$P,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===cs.Base64){var s=(function(l){return l&&btoa(encodeURIComponent(l).replace(/%([0-9A-F]{2})/g,((u,d)=>String.fromCharCode(parseInt(d,16)))))})(Zc(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Zc(l)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=Zc(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},zP=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:rh(t.url,{compression:cs.Base64}),encodedBody:E1(ue({},t,{compression:cs.Base64,ga:void 0}))}:{url:HP(t.url,"compression"),encodedBody:E1(ue({},t,{compression:void 0,ga:void 0}))};try{e=E1(t)}catch(s){if(_S(t.compression,Tu(t.url,"compression")))return ge.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&_S(t.compression,Tu(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?a2(new Uint8Array(n)):ArrayBuffer.isView(n)&&a2(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(g0=!0,r()):{url:t.url,encodedBody:e}},BP=t=>{try{return zP(t)}catch(e){return ge.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},LN=(function(){var t=Dt((function*(e){var n=Zc(e.data),r=yield(function(i,o,l){return l2.apply(this,arguments)})(n,Ot.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return ue({},e,{ga:{contentType:$P,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),DN=/Failed to fetch|NetworkError|Load failed/i,UP=t=>(t==null?void 0:t.name)==="TypeError"&&DN.test((t==null?void 0:t.message)||""),WP=t=>{var e=BP(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,o=s.body,l=s.estimatedSize,u=new Headers;kt(t.headers,(function(w,_){u.append(_,w)})),i&&u.append("Content-Type",i);var d=null,f=!1;if(oS){var p=new oS;d={signal:p.signal,timeout:setTimeout((()=>{var w;f=!0,p.abort(z3("AbortError","PostHog request timed out"+((w=t.timeout)?" after "+w+"ms":"")))}),t.timeout)}}var v=w=>{f&&(w==null?void 0:w.name)==="AbortError"||UP(w)?ge.warn(w):ge.error(w),t.callback==null||t.callback({statusCode:0,error:w})};try{var y;gw(n,ue({method:(t==null?void 0:t.method)||"GET",headers:u,keepalive:t.method==="POST"&&!t.ma&&52428.8>(l||0),body:o,signal:(y=d)==null?void 0:y.signal},t.fetchOptions)).then((w=>w.text().then((_=>{var x={statusCode:w.status,text:_};if(w.status===200)try{x.json=JSON.parse(_)}catch(b){ge.error(b)}t.callback==null||t.callback(x)})))).catch(v).finally((()=>d?clearTimeout(d.timeout):null))}catch(w){d&&clearTimeout(d.timeout),v(w)}}},N2=t=>{try{var e,n=zP(t),r=n.url,s=n.encodedBody,i=s??{},o=i.body,l=i.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:i.contentType});if(Vn.sendBeacon(r,u))return;var d=ze(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(ze(d)&&d.length>1&&(l??0)>16384){var f=Math.ceil(d.length/2),p=v=>ze(t.data)?v:ue({},t.data,{batch:v});return N2(ue({},t,{data:p(d.slice(0,f))})),void N2(ue({},t,{data:p(d.slice(f))}))}ge.warn("Beacon of ~"+(l??0)+" bytes was rejected by the browser, falling back to fetch"),WP(ue({},t,{ma:!0}))}catch(v){ge.warn("Beacon send failed",v)}},QS=(t,e,n,r)=>{var s=r==="query"?e==="POST"?"sent_at":"_":void 0;return rh(n===cs.GZipJS?HP(t,"compression"):t,ue({},s?{[s]:Date.now().toString()}:{},n===cs.GZipJS?{}:{compression:n}))},y0=[];gw&&y0.push({transport:"fetch",method:WP}),Qy&&y0.push({transport:"XHR",method(t){var e=BP(t);if(e){var n=new Qy,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,o=s.body;kt(t.headers,(function(l,u){n.setRequestHeader(u,l)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var l={statusCode:n.status,text:n.responseText};if(n.status===200)try{l.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(l)}},n.send(o)}}}),Vn!=null&&Vn.sendBeacon&&y0.push({transport:"sendBeacon",method:N2});var j2=3e3;class NN{constructor(e,n){this.ya=!0,this.ba=[],this._a=Ni((n==null?void 0:n.flush_interval_ms)||j2,250,5e3,ge.createLogger("flush interval"),j2),this.wa=e}enqueue(e){this.ba.push(e),this.ka||this.Sa()}unload(){this.xa();var e=this.ba.length>0?this.Ca():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Ta(ue({},r,{transport:"sendBeacon"}))}))}enable(){this.ya=!1,this.Sa()}Sa(){var e=this;this.ya||(this.ka=setTimeout((()=>{if(this.xa(),this.ba.length>0){var n=this.Ca(),r=function(){var i=n[s],o=new Date().getTime();i.data&&ze(i.data)&&kt(i.data,(l=>{l.offset=Math.abs(l.timestamp-o),delete l.timestamp})),e.Ta(i)};for(var s in n)r()}}),this._a))}Ta(e){try{this.wa(e)}catch(n){ge.error(n)}}xa(){clearTimeout(this.ka),this.ka=void 0}Ca(){var e={};return kt(this.ba,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;ce(e[i])&&(e[i]=ue({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.ba=[],e}}var jN=["retriesPerformedSoFar"];class FN{constructor(e){this.Ma=!1,this.Ia=3e3,this.ba=[],this._instance=e,this.ba=[],this.Ea=!0,!ce(ne)&&"onLine"in ne.navigator&&(this.Ea=ne.navigator.onLine,this.Ra=()=>{this.Ea=!0,this.Pa()},this.Aa=()=>{this.Ea=!1},Mt(ne,"online",this.Ra),Mt(ne,"offline",this.Aa))}get length(){return this.ba.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=p3(e,jN);co(n)&&(r.url=rh(r.url,{retry_count:n})),this._instance._send_request(ue({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.os(ue({retriesPerformedSoFar:n},r));s.statusCode===0&&ge.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.")}r.callback==null||r.callback(s)}}))}os(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(o){var l=3e3*Math.pow(2,o),u=l/2,d=Math.min(18e5,l),f=Math.random()-.5;return Math.ceil(d+f*(d-u))})(n),s=Date.now()+r;this.ba.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),ge.warn(i),this.Ma||(this.Ma=!0,this.Fa())}Fa(){if(this.Oa&&clearTimeout(this.Oa),this.ba.length===0)return this.Ma=!1,void(this.Oa=void 0);this.Oa=setTimeout((()=>{this.Ea&&this.ba.length>0&&this.Pa(),this.Fa()}),this.Ia)}Pa(){var e=Date.now(),n=[],r=this.ba.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.ba=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Oa&&(clearTimeout(this.Oa),this.Oa=void 0),this.Ma=!1,ce(ne)||(this.Ra&&(ne.removeEventListener("online",this.Ra),this.Ra=void 0),this.Aa&&(ne.removeEventListener("offline",this.Aa),this.Aa=void 0)),this.ba)){var n=e.requestOptions;try{this._instance._send_request(ue({},n,{transport:"sendBeacon"}))}catch(r){ge.error(r)}}this.ba=[]}}class VN{constructor(e){this.La=()=>{var n,r,s,i;this.Da||(this.Da={});var o=this.scrollElement(),l=this.scrollY(),u=o?Math.max(0,o.scrollHeight-o.clientHeight):0,d=l+((o==null?void 0:o.clientHeight)||0),f=(o==null?void 0:o.scrollHeight)||0;this.Da.lastScrollY=Math.ceil(l),this.Da.maxScrollY=Math.max(l,(n=this.Da.maxScrollY)!==null&&n!==void 0?n:0),this.Da.maxScrollHeight=Math.max(u,(r=this.Da.maxScrollHeight)!==null&&r!==void 0?r:0),this.Da.lastContentY=d,this.Da.maxContentY=Math.max(d,(s=this.Da.maxContentY)!==null&&s!==void 0?s:0),this.Da.maxContentHeight=Math.max(f,(i=this.Da.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get $a(){return this._instance.config.scroll_root_selector}getContext(){return this.Da}resetContext(){var e=this.Da;return setTimeout(this.La,0),e}startMeasuringScrollPosition(){Mt(ne,"scroll",this.La,{capture:!0}),Mt(ne,"scrollend",this.La,{capture:!0}),Mt(ne,"resize",this.La)}scrollElement(){var e;if(!this.$a)return ne==null||(e=ne.document)==null?void 0:e.documentElement;var n=ze(this.$a)?this.$a:[this.$a];for(var r of n){var s,i=ne==null||(s=ne.document)==null?void 0:s.querySelector(r);if(i)return i}}Na(e){var n,r,s=e==="y"?"scrollTop":"scrollLeft";if(this.$a){var i=this.scrollElement();return i&&i[s]||0}return ne?e==="y"?ne.scrollY||ne.pageYOffset||((n=ne.document)==null||(n=n.documentElement)==null?void 0:n.scrollTop)||0:ne.scrollX||ne.pageXOffset||((r=ne.document)==null||(r=r.documentElement)==null?void 0:r.scrollLeft)||0:0}scrollY(){return this.Na("y")}scrollX(){return this.Na("x")}}var $N=t=>IP(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);class JS{constructor(e,n,r,s){this.Te=i=>{var o=this.qa();if(!o||o.sessionId!==i){var l={sessionId:i,props:this.ja(this._instance)};this.Ba.register({[_2]:l})}},this._instance=e,this.Ha=n,this.Ba=r,this.ja=s||$N,this.Ha.onSessionId(this.Te)}qa(){return this.Ba.props[_2]}getSetOnceProps(){var e,n=(e=this.qa())==null?void 0:e.props;return n?"r"in n?MP(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return kt(Rw(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Jy(r)]=n})),e}}class dm{on(e,n){return this.za[e]||(this.za[e]=[]),this.za[e].push(n),()=>{this.za[e]=this.za[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.za[e]||[])r(n);for(var s of this.za["*"]||[])s(e,n)}constructor(){this.za={}}}var Rc=Ht("[SessionId]"),e8=864e5;class t8{on(e,n){return this.Ua.on(e,n)}constructor(e,n,r){var s;if(this.Wa=null,this.Va=null,this.Ga=[],this.Za=void 0,this.Qa=!1,this.Ua=new dm,this.Ja=(u,d)=>!(!co(u)||!co(d))&&Math.abs(u-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===_o)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.mn=e.config,this.Ba=e.persistence,this.Ie=void 0,this.Bt=void 0,this._sessionStartTimestamp=null,this.Ka=void 0,this._sessionActivityTimestamp=null,this.Ya=n||ci,this.Xa=r||ci;var i=this.mn.persistence_name||this.mn.token;if(this._sessionTimeoutMs=1e3*Ni(this.mn.session_idle_timeout_seconds||1800,60,36e3,Rc.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.tl(),this.el="ph_"+i+"_window_id",this.il="ph_"+i+"_primary_window_exists",this.rl()){var o=It.ui(this.el),l=It.ui(this.il);o&&!l?this.Ie=o:It.oi(this.el),It.ni(this.il,!0)}(s=this.mn.bootstrap)!=null&&s.sessionID&&this.setBootstrapSessionId(this.mn.bootstrap.sessionID),this.nl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ce(this.Ga)&&(this.Ga=[]),this.Ga.push(e),this.Bt&&e(this.Bt,this.Ie),()=>{this.Ga=this.Ga.filter((n=>n!==e))}}rl(){return this.mn.persistence!=="memory"&&!this.Ba.Eo&&It.ii()}sl(e){e!==this.Ie&&(this.Ie=e,this.rl()&&It.ni(this.el,e))}ol(){return this.Ie?this.Ie:this.rl()?It.ui(this.el):null}al(e){var n=this.Wa;return!sn(n)&&!sn(e)&&5e3>Math.abs(e-n)}ll(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.Bt||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Bt=e,i&&!s||i&&this.al(n)||(this.Wa=n,this.Ba.register({[Bc]:[n,e,r]}))}ul(){var e,n=(e=this.mn)==null?void 0:e.persistence_save_debounce_ms;return co(n)&&n>0}hl(){this.ul()?this.Ba.refreshKey(Bc):(this.Ba.flush(),this.Ba.load())}dl(){var e;if(!sn(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Wa){this.hl();var n=this.vl();n[1]===this.Bt&&n[2]===this._sessionStartTimestamp&&(this.Wa=this._sessionActivityTimestamp,this.Ba.register({[Bc]:[this._sessionActivityTimestamp,(e=this.Bt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Ba.flush())}}cl(){var e=this.vl()[0],n=co(e)?e:0,r=co(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}fl(e){return this.hl(),this.Ja(e,this.cl())}vl(){var e=this.Ba.props[Bc];return ze(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Wa=null,this.Ka=void 0,clearTimeout(this.pl),this.pl=void 0,this.ll(null,null,null)}setBootstrapSessionId(e,n){n===void 0&&(n=!1);var r=(function(s,i){i===void 0&&(i=new Date().getTime());try{var o=(l=>{var u=l.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})(s);return o>i+6e4?void Rc.error("Bootstrap sessionID cannot be in the future"):o}catch(l){return void Rc.error("Invalid sessionID in bootstrap",l)}})(e);return!ce(r)&&(n?this.Ka={sessionId:e,sessionStartTimestamp:r}:this.ll(e,new Date().getTime(),r),!0)}destroy(){this.Qa=!0,this.dl(),clearTimeout(this.pl),this.pl=void 0,this.Za&&ne&&(ne.removeEventListener(sm,this.Za,{capture:!1}),this.Za=void 0),this.Ga=[]}nl(){this.Za=()=>{this.dl(),this.rl()&&It.oi(this.il)},Mt(ne,sm,this.Za,{capture:!1})}checkAndGetSessionAndWindowId(e,n,r){if(e===void 0&&(e=!1),n===void 0&&(n=null),r===void 0&&(r=!1),this.mn.cookieless_mode===_o)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=n||new Date().getTime(),i=this.Bt;if(r)this.Va=s;else if(sn(this.Va)||this.Va>s||s-this.Va>=1e3){var o,l;(o=(l=this.Ba).syncCookieProperties)==null||o.call(l),this.Va=s}var u=this.vl(),d=u[1],f=u[2],p=!ce(i)&&d!==i,v=this.cl(),y=this.ol(),w=this.Ka,_=!!w&&(w.sessionStartTimestamp>s+6e4||s-w.sessionStartTimestamp>e8),x=w?_:co(f)&&Math.abs(s-f)>e8,b=!1,k=p,C=!d||!!w,P=d,T=!C&&!e&&this.Ja(s,v);if(T){(T=this.fl(s))||Rc.info("cross-tab refresh kept the session alive",{sessionId:d});var O=this.vl();d=O[1],f=O[2]}if(C||T||x){k=!1;var M=w&&!_;d=M?w.sessionId:this.Ya(),y=this.Xa(),Rc.info("new session ID assigned",{sessionId:d,windowId:y,bootstrapped:!!M,changeReason:{noSessionId:C,activityTimeout:T,sessionPastMaximumLength:x}}),f=M?w.sessionStartTimestamp:s,this.Ka=void 0,b=!0}else y||(y=this.Xa(),b=!0),(k=k||d!==P)&&(Rc.info("adopted cross-tab session id",{sessionId:d,windowId:y}),b=!0);var R=co(v)&&e&&!x?v:s,L=co(f)?f:new Date().getTime();this.sl(y),this.ll(d,R,L),e||this.tl();var D={noSessionId:C,activityTimeout:T,sessionPastMaximumLength:x,crossTabAdoption:k};return b&&this.Ga.forEach((V=>V(d,y,D))),{sessionId:d,windowId:y,sessionStartTimestamp:L,changeReason:b?D:void 0,lastActivityTimestamp:v}}tl(){this.Qa||(clearTimeout(this.pl),this.pl=setTimeout((()=>{if(!this.Qa)if(this.fl(new Date().getTime())){var e=this.Bt;this.resetSessionId(),this.Ua.emit("forcedIdleReset",{idleSessionId:e})}else this.tl()}),1.1*this.sessionTimeoutMs))}}var ZP=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&lS(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>lS(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function qP(){return(qP=Dt((function*(){var t=Vn==null?void 0:Vn.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return at(n)&&n.length>0?n:void 0}catch(r){return void ge.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}function GP(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var fm=(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}},Np=t=>t.toLowerCase(),KP={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=>fm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!fm(n,r))))),icontains:(t,e)=>e.map(Np).some((n=>t.map(Np).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Np).every((n=>t.map(Np).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r>parseFloat(s)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r<parseFloat(s)))}))};function YP(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(s==null)return!1;var i=KP[r.operator];return!!i&&i(r.values,[String(s)])}))}function k1(t,e,n){return Zc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var F2="custom",n8="i.posthog.com",HN=/^\/static\//,zN=["/s/","/e/","/i/"];class BN{constructor(e){this.gl={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+n8,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.gl[this.apiHost]||(this.gl[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":F2),this.gl[this.apiHost]}ml(e){if(HN.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}yl(e){var n=Au(e);return n?n.protocol+"//"+n.host+n.pathname:void 0}bl(e,n,r){if(e==="ui")return r;var s=r,i=this.instance.config.rewriteRequestPath;if(i){var o,l=((o=Au(r))==null?void 0:o.href)||r;s=i(new URL(l)).toString()}if(i&&e==="api"&&zN.some((v=>n.indexOf(v)===0))){var u=this.yl(s);if(u){var d,f=this.apiHost,p=this._l;((d=p)==null?void 0:d.apiHost)===f&&p.rewriteRequestPath===i||(p={apiHost:f,rewriteRequestPath:i,urls:new Set},this._l=p),p.urls.add(u)}}return s}isIngestionEndpoint(e){var n=this._l,r=this.yl(e);return(n==null?void 0:n.apiHost)===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&n.urls.has(r)}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.bl(e,n,this.uiHost+n);if(e==="flags")return this.bl(e,n,this.flagsApiHost+n);if(e==="assets"){var r=this.ml(n);if(r)return this.bl(e,n,""+r+n)}if(this.region===F2)return this.bl(e,n,this.apiHost+n);var s=n8+n;switch(e){case"assets":return this.bl(e,n,"https://"+this.region+"-assets."+s);case"api":return this.bl(e,n,"https://"+this.region+"."+s)}}}var xt=Ht("[Surveys]"),XP="seenSurvey_",QP=t=>{try{var e=(n=>((r,s)=>""+XP+(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(n){xt.error("Failed to persist survey seen state",n)}},UN=[w1.Popover,w1.Widget,w1.API],WN={ignoreConditions:!1,ignoreDelay:!1,displayType:M2.Popover},ZN=Ht("[PostHog ExternalIntegrations]"),qN={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class GN{constructor(e){this._instance=e}Ys(e,n){var r;(r=De.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return ZN.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,o,l,u=r[0],d=r[1];!d||(i=De.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[u]||e.Ys(qN[u],(()=>{var f;(f=De.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[u])==null||f.start(e._instance)})),!d&&(o=De.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[u]&&((l=De.__PosthogExtensions__)==null||(l=l.integrations)==null||(l=l[u])==null||l.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}class KN{constructor(e,n){this.A=e,this.Ns=n,this.wl=new Map,this.Os=!1}add(e){var n=this;return Dt((function*(){if(n.Os)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.wl.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');n.wl.set(e.name,e);try{var r=e.setup(n.Ns);r&&(yield r)}catch(i){var s=n.wl.get(e.name)===e;s&&n.wl.delete(e.name),n.A.error('Failed to set up browser extension "'+e.name+'"',i),s&&n.kl(e)}}))()}getExtension(e){return this.wl.get(e)}dispose(){if(!this.Os){this.Os=!0;var e=Array.from(this.wl.values()).reverse();for(var n of(this.wl.clear(),e))this.kl(n)}}kl(e){try{var n=e.dispose==null?void 0:e.dispose();n&&mr(n.then)&&n.then(void 0,(r=>{this.A.error('Failed to dispose browser extension "'+e.name+'"',r)}))}catch(r){this.A.error('Failed to dispose browser extension "'+e.name+'"',r)}}}class YN{constructor(e){this._instance=e}initialize(){}get(e){var n=this._instance.persistence;if(typeof e=="string")return n==null?void 0:n.get_property(e);var r={};for(var s of e){var i=n==null?void 0:n.get_property(s);ce(i)||(r[s]=i)}return r}set(e,n){var r;(r=this._instance.persistence)==null||r.register(typeof e=="string"?{[e]:n}:e)}remove(e){var n;(n=this._instance.persistence)==null||n.unregister(e)}}var r8="extensionsRemoteConfig";class XN{constructor(e){this.Os=!1,this.instance=e,this.A=ge,this.Sl=e.xl,this.kv=new YN(e),this.onEvent=n=>Dp(this.instance.on("eventCaptured",(r=>{try{n({event:r.event,properties:r.properties})}catch(s){this.A.error("Browser extension event listener failed",s)}}))),this.onRemoteConfig=n=>{if(this.Os)return Dp((()=>{}));var r=i=>{try{n(i)}catch(o){this.A.error("Browser extension remote config listener failed",o)}},s=this.instance.Cl.on(r8,r);return this.Sl&&r(this.Sl),Dp(s)},this.Tl=new KN(ge.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property(Ef))!==null&&e!==void 0?e:this.distinctId}get deviceId(){var e=this.instance.get_property(Ef);return typeof e=="string"?e:void 0}get library(){return{name:Ot.LIB_NAME,version:Ot.LIB_VERSION}}get initialPersonProperties(){var e,n;return(e=(n=this.instance.persistence)==null?void 0:n.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,n,r,s,i=(e=this.instance.sessionManager)==null?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=i==null?void 0:i.sessionId)!==null&&n!==void 0?n:"",windowId:(r=i==null?void 0:i.windowId)!==null&&r!==void 0?r:"",sessionStartTimestamp:(s=i==null?void 0:i.sessionStartTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.Tl.add(e)}getExtension(e){return this.Tl.getExtension(e)}capture(e,n,r){var s=this;return Dt((function*(){r?s.instance.capture(e,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):s.instance.capture(e,n)}))()}registerDynamicEventProperties(e){return Dp(this.instance.Ml(e))}handleRemoteConfig(e){this.Os||(this.Sl=e,this.instance.Cl.emit(r8,e))}sendRequest(e,n){var r=this;return Dt((function*(){var s;n===void 0&&(n={});var i=r.instance.requestRouter.endpointFor((s=n.target)!==null&&s!==void 0?s:"api",e),o={method:n.method,url:n.query?rh(i,n.query):i,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,compressionFallback:n.target==="flags"&&n.compression==="best-available"?e2.Base64:void 0,timestampMode:n.sentAt};return n.transport==="sendBeacon"?(r.instance._send_request(o),{statusCode:202}):new Promise((l=>{o.callback=l,r.instance._send_request(o)}))}))()}dispose(){this.Os||(this.Os=!0,this.Tl.dispose())}}var cf={},C1=0,uf=()=>{},s8='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',$d="Surveys module not available",i8="sanitize_properties is deprecated. Use before_send instead",JP="Invalid value for property_denylist config: ",QN=/^[A-Za-z0-9_-]{1,400}$/,P1=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,JN=["token","distinct_id",oP],Vc="posthog",e5=!ON&&(jr==null?void 0:jr.indexOf("MSIE"))===-1&&(jr==null?void 0:jr.indexOf("Mozilla"))===-1,e7=t=>{var 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},A1=t=>{var e;return ue({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:JD(fe==null?void 0:fe.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:uf,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_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:qt&&at(qt==null?void 0:qt.search)&&qt.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:(ne==null||(e=ne.location)==null?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,surveys_request_timeout_ms:1e4,on_request_error(n){ge.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:E2,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:j2},error_tracking:{},_onCapture:uf},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:uN,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:e7(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))},t7=[["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"]],o8=t=>{var e={};for(var n of t7){var r=n[0],s=n[1];ce(t[r])||(e[s]=t[r])}var i=Lt({},e,t),o=t.__preview_external_dependency_versioned_paths;return ce(o)||(ce(t.strict_script_versioning)&&(i.strict_script_versioning=!!o),at(o)&&ce(t.asset_host)&&(i.asset_host=o)),ze(t.property_blacklist)&&(ce(t.property_denylist)?i.property_denylist=t.property_blacklist:ze(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:ge.error(JP+t.property_denylist)),i};class n7{constructor(){this.__forceAllowLocalhost=!1}get Il(){return this.__forceAllowLocalhost}set Il(e){ge.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class us{El(e){if(e){var n=this.wl.indexOf(e);n!==-1&&this.wl.splice(n,1)}}Rl(e,n){return this.El(e),this.wl.push(n),n.initialize==null||n.initialize(),n}Pl(){return this.config.cookieless_mode===_o||this.config.cookieless_mode===sa&&this.consent.isRejected()}Al(){if(!(this.Fl||this.config.reuseAnonymousId||this.config.segment||this.Pl())){var e,n,r,s=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";(s||this.config.disable_persistence)&&(this.Ol||(s?(e="persistence is set to '"+this.config.persistence+"'",n=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",r="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",n="on every page load",r="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.Fl=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+n+", 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. "+r)))}}Ll(){if(!this.Pl()&&this.get_distinct_id()===kc){var e=this.persistence;if(e){this.Dl()||e.load(!0);var n=this.get_distinct_id();if(!n||n===kc){var r=this.config.get_device_id(ci());this.register({distinct_id:r,$device_id:r}),e.set_property(it,hn)}this.$l()}}}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new n7,this.Nl=!1,this.version=Ot.LIB_VERSION,this.ql=new Set,this.jl="",this.Cl=new dm,this.wl=[],this.Bl=[],this.Ol=!1,this.Fl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=A1(),this.SentryIntegration=yN,this.sentryIntegration=r=>(function(s,i){var o=EP(s,i);return{name:SP,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Hl=!1,this.zl=null,this.Ul=null,this.Wl=null,this.scrollManager=new VN(this),this.pageViewManager=new BS(this),this.rateLimiter=new PN(this),this.requestRouter=new BN(this),this.consent=new iN(this),this.externalIntegrations=new GN(this);var n=(e=us.__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)=>{var o=at(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{var o=at(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",(r=>ge.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==Vc){var s,i=(s=cf[r])!==null&&s!==void 0?s:new us;return i._init(e,n,r),cf[r]=i,cf[Vc][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i,o;n===void 0&&(n={});var l,u=at(e)?e.trim():"";if(!u)return ge.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return u!==((l=this.config)==null?void 0:l.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('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=A1(n.defaults),n.debug=this.Vl(n.debug),this.Gl=n,this.Zl=[],n.person_profiles?this.Ul=n.person_profiles:n.process_person&&(this.Ul=n.process_person);var d=A1(n.defaults),f=o8(n),p=Lt({},d,f,{name:r,token:u});ot(d.rageclick)&&ot(f.rageclick)&&(p.rageclick=Lt({},d.rageclick,f.rageclick)),ot(d.session_recording)&&ot(f.session_recording)&&(p.session_recording=Lt({},d.session_recording,f.session_recording)),this.set_config(p),this.config.on_xhr_error&&ge.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:cs.GZipJS;var v=this.Dl();if(this.persistence=new _1(this.config,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new _1(ue({},this.config,{persistence:"sessionStorage"}),v,!1),this.jl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!v&&It.ii()){var y=It.ui(this.jl);ze(y)&&y.forEach((R=>{at(R)&&this.ql.add(R)}))}else It.oi(this.jl);var w=ue({},this.persistence.props),_=ue({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Ql=new NN((R=>this.Jl(R)),this.config.request_queue_config),this.Kl=new FN(this),this.__request_queue=[];var x=this.Pl();x||(this.sessionManager=new t8(this),this.sessionPropsManager=new JS(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((R,L,D)=>{(D!=null&&D.activityTimeout||D!=null&&D.sessionPastMaximumLength||D!=null&&D.crossTabAdoption)&&this.Yl()}))),this.Xl(),this.config.__preview_deferred_init_extensions?(ge.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.tu(x)}),0)):(ge.info("Initializing extensions synchronously"),this.tu(x)),Ot.DEBUG=Ot.DEBUG||this.config.debug,Ot.DEBUG&&ge.info("Starting in debug mode",{this:this,config:n,thisC:ue({},this.config),p:w,s:_}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=ue({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var b=(i=n.bootstrap)==null?void 0:i.distinctID;if(this.Ol=!!b&&!rf(b),((o=n.bootstrap)==null?void 0:o.distinctID)!==void 0){var k=n.bootstrap.distinctID,C=this.get_distinct_id(),P=this.persistence.get_property(it);if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&P===hn)this.identify(k);else if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&P===ir)ge.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{var T=this.config.get_device_id(ci()),O=n.bootstrap.isIdentifiedID?T:k;this.persistence.set_property(it,n.bootstrap.isIdentifiedID?ir:hn),this.register({distinct_id:k,$device_id:O})}}if(x)this.register_once({distinct_id:kc,$device_id:null},"");else if(!this.get_distinct_id()){var M=this.config.get_device_id(ci());this.register_once({distinct_id:M,$device_id:M},""),this.persistence.set_property(it,hn)}return Mt(ne,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?zS(this,(()=>this.eu())):this.eu(),mr(this.config._onCapture)&&this.config._onCapture!==uf&&(ge.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(R=>this.config._onCapture(R.event,R)))),this.config.ip&&ge.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 qP.apply(this,arguments)})().then((R=>{R&&this.register({[d1]:R})})).catch(uf),this}iu(e){var n=e;return at(n.name)&&mr(n.setup)}ru(e,n){this.iu(e)?n.push((()=>{this.nu().add(e).catch((()=>e.dispose==null?void 0:e.dispose())).catch((r=>{ge.error('Failed to dispose browser extension "'+e.name+'"',r)}))})):this.wl.push(e)}Xl(){var e,n,r,s,i,o,l=(e=(n=this.config.__extensionClasses)==null?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=us.__defaultExtensionClasses)==null?void 0:r.featureFlags;l&&(this.featureFlags&&this.featureFlags instanceof l||((s=this.su)==null||s.call(this),this.su=void 0,this.featureFlags=new l(this)),mr(this.featureFlags.onReloading)&&mr(this.featureFlags.setup)?this.su||(this.su=this.featureFlags.onReloading((()=>{this.Cl.emit("featureFlagsReloading",!0)})),this.nu().add(this.featureFlags)):(i=(o=this.featureFlags).initialize)==null||i.call(o))}tu(e){var n,r,s,i,o,l,u,d=performance.now(),f=ue({},us.__defaultExtensionClasses,this.config.__extensionClasses),p=[];f.exceptions&&this.wl.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new f.exceptions(this)),f.historyAutocapture&&this.wl.push(this.historyAutocapture=new f.historyAutocapture(this)),f.tracingHeaders&&this.wl.push(this.tracingHeaders=new f.tracingHeaders(this)),f.siteApps&&this.wl.push(this.siteApps=new f.siteApps(this)),f.sessionRecording&&!e&&this.wl.push(this.sessionRecording=new f.sessionRecording(this)),this.config.disable_scroll_properties||p.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),f.autocapture&&this.ru(this.autocapture=new f.autocapture(this),p),f.surveys&&this.ru(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new f.surveys(this),p),f.logs&&this.ru(this.logs=(s=this.logs)!==null&&s!==void 0?s:new f.logs(this),p),f.metrics&&this.wl.push(this.metrics=(i=this.metrics)!==null&&i!==void 0?i:new f.metrics(this)),f.conversations&&this.wl.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new f.conversations(this)),f.productTours&&this.wl.push(this.productTours=new f.productTours(this)),f.heatmaps&&this.wl.push(this.heatmaps=new f.heatmaps(this)),f.webVitalsAutocapture&&this.wl.push(this.webVitalsAutocapture=new f.webVitalsAutocapture(this)),f.exceptionObserver&&this.wl.push(this.exceptionObserver=new f.exceptionObserver(this)),f.deadClicksAutocapture&&this.wl.push(this.deadClicksAutocapture=new f.deadClicksAutocapture(this,gN)),f.toolbar&&this.wl.push(this.toolbar=(l=this.toolbar)!==null&&l!==void 0?l:new f.toolbar(this)),f.experiments&&this.wl.push(this.experiments=(u=this.experiments)!==null&&u!==void 0?u:new f.experiments(this)),this.wl.forEach((v=>{v.initialize&&p.push((()=>{v.initialize==null||v.initialize()}))})),p.push((()=>{if(this.ou){var v=this.ou;this.ou=void 0,this.wl.forEach((y=>y.onRemoteConfig==null?void 0:y.onRemoteConfig(v)))}})),this.au(p,d)}au(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.au(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){ge.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[aP]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[lP]:s}),this.config.__preview_deferred_init_extensions&&ge.info("PostHog extensions initialized ("+s+"ms)")}fa(e){var n;if(!fe||!fe.body)return ge.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fa(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.ou=e),this.xl=e,this.compression=void 0,e.ok){var r,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=Ye(s.supportedCompression,cs.GZipJS)?cs.GZipJS:Ye(s.supportedCompression,cs.Base64)?cs.Base64:void 0),(r=s.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Ul?this.Ul:E2}),(n=this.lu)==null||n.handleRemoteConfig(e),this.wl.forEach((i=>i.onRemoteConfig==null?void 0:i.onRemoteConfig(e)))}eu(){try{this.config.loaded(this)}catch(r){ge.critical("`loaded` function failed",r)}if(this.uu(),this.config.internal_or_test_user_hostname&&qt!=null&&qt.hostname){var e=qt.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.Pl())&&this.hu()}),1),this.du=new LP(this),this.du.load()}uu(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Ql)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Tp(this.__request_queue,(e=>this.Jl(e))),this.__request_queue=[],this.uu()}_handle_unload(){var e,n,r,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.vu()&&this.capture(f1),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.Ql)==null||s.unload(),(i=this.Kl)==null||i.unload()):this.vu()&&this.capture(f1,null,{transport:"sendBeacon"})}_send_request(e){var n;this.__loaded?e5?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=ue({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?(n=this.compression)!==null&&n!==void 0?n:e.compressionFallback:e.compression,(ce(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(r=>{var s,i,o,l=ue({},r);l.timeout=l.timeout||6e4;var u,d,f,p,v,y=(s=l.transport)!==null&&s!==void 0?s:"fetch";y==="sendBeacon"&&ce(l.compression)&&l.data&&(l.compression=cs.Base64),l.method==="POST"&&l.data&&(l.timestampMode==="capture-body"?l.data={api_key:(d=(v=(p=(ze(u=l.data)?u:[u]).map((b=>ue({},b,b.timestamp instanceof Date&&!isNaN(b.timestamp.getTime())?{timestamp:b.timestamp.toISOString()}:{}))))[0])==null||(f=v.properties)==null?void 0:f.token)!==null&&d!==void 0?d:v==null?void 0:v.token,batch:p,sent_at:new Date().toISOString()}:l.timestampMode==="body"&&(l.data=(function(b,k){return k===void 0&&(k=new Date().toISOString()),ze(b)?b.map((C=>ue({},C,{sent_at:k}))):ue({},b,{sent_at:k})})(l.data))),l.url=QS(l.url,l.method,l.compression,l.timestampMode);var w=y0.filter((b=>!l.disableTransport||!b.transport||!l.disableTransport.includes(b.transport))),_=(i=(o=(function(b,k){for(var C=0;b.length>C;C++)if(b[C].transport===y)return b[C]})(w))==null?void 0:o.method)!==null&&i!==void 0?i:w[0].method;if(!_)throw new Error("No available transport method");var x=b=>{try{_(b)}catch(k){UP(k)?ge.warn(k):ge.error(k),l.callback==null||l.callback({statusCode:0,error:k})}};y!=="sendBeacon"&&l.data&&l.compression===cs.GZipJS&&GL&&typeof Promise<"u"&&!g0?LN(l).then((b=>{x(b)})).catch((b=>{if(wS(b))return g0=!0,void x(ue({},l,{compression:void 0,url:QS(r.url,r.method,void 0,r.timestampMode)}));(k=>{if(!k||typeof k!="object")return!1;var C="name"in k?String(k.name):"";return wS(k)||C===Z3})(b)&&(g0=!0),x(l)})):_(l)})(ue({},e,{callback:r=>{var s,i;this.rateLimiter.checkForLimiting(r),400>r.statusCode||(s=(i=this.config).on_request_error)==null||s.call(i,r),e.callback==null||e.callback(r)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Jl(e){this.Kl?this.Kl.retriableRequest(e):this._send_request(e)}_execute_array(e){C1++;try{var n,r=[],s=[],i=[];Tp(e,(l=>{if(l)if(ze(n=l[0]))i.push(l);else if(mr(l))try{l.call(this)}catch(u){ge.error("Error executing queued PostHog call",l,u)}else ze(l)&&n==="alias"?r.push(l):ze(l)&&n.indexOf("capture")!==-1&&mr(this[n])?i.push(l):s.push(l)}));var o=function(l,u){Tp(l,(function(d){try{if(ze(d[0])){var f=u;kt(d,(function(p){f=f[p[0]].apply(f,p.slice(1))}))}else u[d[0]].apply(u,d.slice(1))}catch(p){ge.error("Error executing queued PostHog call",d,p)}}))};o(r,this),o(s,this),o(i,this)}finally{C1--}}push(e){if(C1>0&&ze(e)&&at(e[0])){var n=us.prototype[e[0]];mr(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}cu(){var e,n=(e=this.persistence)==null?void 0:e.get_property($r);return at(n)&&P1.test(n)?{value:n,delivered:!1}:ot(n)&&at(n.value)&&P1.test(n.value)?{value:n.value,delivered:n.delivered===!0}:void 0}fu(e,n,r,s){if(this.persistence){this.persistence.refreshKey($r);var i=this.cu();if(!s){if(r)return at(n)&&P1.test(n)?(n!==(i==null?void 0:i.value)&&this.persistence.register({[$r]:{value:n,delivered:!1}}),{value:n,pending:n!==(i==null?void 0:i.value)||!i.delivered}):void this.persistence.unregister($r);if(at(e)&&QN.test(e)){if((i==null?void 0:i.value.split(".")[3])===e)return{value:i.value,pending:!i.delivered};var o="fb.1."+Date.now()+"."+e;return this.persistence.register({[$r]:{value:o,delivered:!1}}),{value:o,pending:!0}}return i?{value:i.value,pending:!i.delivered}:void 0}this.persistence.unregister($r)}}pu(e){if(this.persistence){this.persistence.refreshKey($r);var n=this.cu();(n==null?void 0:n.value)!==e||n.delivered||this.persistence.register({[$r]:{value:e,delivered:!0}})}}capture(e,n,r){var s,i,o,l,u,d,f,p,v,y;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ql){if(this.is_capturing())if(!ce(e)&&at(e)){this.Ll();var w=!this.config.opt_out_useragent_filter&&this._is_bot();if(!w||this.config.__preview_capture_bot_pageviews){var _=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(_==null||!_.isRateLimited){var x;n!=null&&n.$current_url&&!at(n==null?void 0:n.$current_url)&&(ge.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.gu||ge.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&&(x=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var b=new Date,k=(r==null?void 0:r.timestamp)||b,C=hS(r==null?void 0:r.uuid,ci),P={uuid:C,event:e,properties:this.calculateEventProperties(e,n||{},k,C)};e===Wc&&this.config.__preview_capture_bot_pageviews&&w&&(P.event="$bot_pageview",P.properties.$browser_type="bot"),_&&(P.properties.$lib_rate_limit_remaining_tokens=_.remainingTokens);var T=e==="$feature_flag_called"&&P.properties.$feature_flag_has_experiment===!1&&this.get_property(tu)===!0;r!=null&&r.$set&&!T&&(P.$set=r==null?void 0:r.$set);var O=ot(n==null?void 0:n.$set)?n.$set:void 0,M=!(r==null||!r.$set)&&no in r.$set,R=M||!!O&&no in O,L=M?r==null||(s=r.$set)==null?void 0:s[no]:O==null?void 0:O[no],D=ze(n==null?void 0:n.$unset)?n.$unset:[],V=(r==null?void 0:r.$unset)||[],j=D.indexOf(no)!==-1||V.indexOf(no)!==-1,U=this.fu((i=x)==null?void 0:i.fbclid,L,R,j);U&&P.properties.$process_person_profile===!0&&U.pending&&!R&&!T&&(P.$set=ue({[no]:U.value},P.$set));var X=r==null?void 0:r.$unset;X&&(P.$unset=X);var q,Z,Y,H=T?void 0:this.mu(r==null?void 0:r.$set_once,e!==CS,e===k2);if(H&&(P.$set_once=H),r!=null&&r._noTruncate||(f=this.config.properties_string_max_length,p=P,v=le=>at(le)?le.slice(0,f):le,y=new Set,P=(function le(te,Pe){if(te!==Object(te))return v?v(te):te;if(!y.has(te)){var Se;if(y.add(te),ze(te))Se=[],Tp(te,(Xe=>{Se.push(le(Xe))}));else{var Ne={};kt(te,((Xe,Qe)=>{y.has(Xe)||(Ne[Qe]=le(Xe))})),Se=Ne}return Se}})(p)),P.timestamp=k,ce(r==null?void 0:r.timestamp)||(P.properties.$event_time_override_provided=!0,P.properties.$event_time_override_system_time=b),T&&(P.properties=(function(le,te){te===void 0&&(te=[]);var Pe={},Se=Ne=>{le[Ne]!==void 0&&(Pe[Ne]=le[Ne])};return $D.forEach(Se),te.forEach(Se),Pe})(P.properties,JN)),e===wo.DISMISSED||e===wo.SENT){var Q=n==null?void 0:n[x1.SURVEY_ID],z=n==null?void 0:n[x1.SURVEY_ITERATION];QP({id:Q,current_iteration:z}),P.$set=ue({},P.$set,{[(q={id:Q,current_iteration:z},Z=e===wo.SENT?"responded":"dismissed",Y="$survey_"+Z+"/"+q.id,q.current_iteration&&q.current_iteration>0&&(Y="$survey_"+Z+"/"+q.id+"/"+q.current_iteration),Y)]:!0})}else e===wo.SHOWN&&(P.$set=ue({},P.$set,{[x1.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===CN.SHOWN){var N=n==null?void 0:n[ZS.TOUR_TYPE];N&&(P.$set=ue({},P.$set,{[ZS.TOUR_LAST_SEEN_DATE+"/"+N]:new Date().toISOString()}))}var G=ue({},P.properties.$set,P.$set);if(fs(G)||this.setPersonPropertiesForFlags(G),!et(this.config.before_send)){var oe=this.ns(P);if(!oe)return;(P=oe).uuid=hS(P.uuid,ci)}var se=(o=(l=P.$set)==null?void 0:l[no])!==null&&o!==void 0?o:ot((u=P.properties)==null?void 0:u.$set)?P.properties.$set[no]:void 0,ee=U!=null&&U.pending&&se===U.value?U.value:void 0;this.Cl.emit("eventCaptured",P);var de=(d=r==null?void 0:r._url)!==null&&d!==void 0?d:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),ve=ue({method:"POST",url:de,data:P,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(de)?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},r!=null&&r.transport?{transport:r.transport}:{},ee?{fireCallbackOnDrop:!0,callback:le=>{le.statusCode>=200&&300>le.statusCode&&this.pu(ee)}}:{});return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly||ee?this.Jl(ve):this.Ql.enqueue(ve),P}ge.critical("This capture call is ignored due to client rate limiting.")}}else ge.error("No event name provided to posthog.capture")}else ge.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}getExtension(e){var n;return(n=this.lu)==null?void 0:n.getExtension(e)}nu(){var e;return(e=this.lu)!==null&&e!==void 0?e:this.lu=new XN(this)}Ml(e){this.Bl.push(e);var n=!0;return()=>{if(n){n=!1;var r=this.Bl.indexOf(e);r!==-1&&this.Bl.splice(r,1)}}}yu(e){var n,r,s;return e===void 0&&(e=!0),!((n=this.persistence)==null||!n.consumeCookieIdentityChange())&&(this.Wl=null,this.persistence.get_property(it)===hn&&((s=this.sessionPersistence)==null||s.clear(),this.ql.clear(),this.bu()),(r=this.featureFlags)==null||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.yu();var o=i?void 0:this.persistence.remove_event_timer(e),l=ue({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.Pl()&&(l[oP]=!0),e==="$snapshot"){var u=ue({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!at(l.distinct_id)&&!ln(l.distinct_id)||rf(l.distinct_id))&&ge.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var d,f=(function(M,R,L,D){var V,j,U,X;if(D===void 0&&(D=!1),!jr)return{};var q,Z=M?[...Ru,...R||[]]:[],Y=$3(jr),H=Y[0],Q=Y[1],z=(q="u">typeof navigator?navigator:void 0)!=null&&q.brave?{brave:!0}:{},N={};ce(L)||(N.detectGoogleSearchApp=L);var G={},oe=(V=navigator)==null||(V=V.userAgentData)==null?void 0:V.platform,se=(j=navigator)==null?void 0:j.maxTouchPoints,ee=ne==null||(U=ne.screen)==null?void 0:U.width,de=ne==null||(X=ne.screen)==null?void 0:X.height,ve=ne==null?void 0:ne.devicePixelRatio;ce(oe)||(G.userAgentDataPlatform=oe),ce(se)||(G.maxTouchPoints=se),ce(ee)||(G.screenWidth=ee),ce(de)||(G.screenHeight=de),ce(ve)||(G.devicePixelRatio=ve);var le,te,Pe,Se,Ne,Xe,Qe,lt,ut=Lt(Rw({$os:H,$os_version:Q,$browser:V3(jr,navigator.vendor,z,N),$device:dS(jr),$device_type:(te=jr,Pe=G,lt=dS(te),lt===x3||lt===w3||lt==="Kobo"||lt==="Kindle Fire"||lt===L3?Eu:lt===bf||lt===Jc||lt===Sf||lt===n2?"Console":lt===S3?"Wearable":lt?gs:(Pe==null?void 0:Pe.userAgentDataPlatform)==="Android"&&((Se=Pe==null?void 0:Pe.maxTouchPoints)!==null&&Se!==void 0?Se:0)>0?600>Math.min((Ne=Pe==null?void 0:Pe.screenWidth)!==null&&Ne!==void 0?Ne:0,(Xe=Pe==null?void 0:Pe.screenHeight)!==null&&Xe!==void 0?Xe:0)/((Qe=Pe==null?void 0:Pe.devicePixelRatio)!==null&&Qe!==void 0?Qe:1)?gs:Eu:"Desktop"),$timezone:OP(),$timezone_offset:SN()}),{$current_url:Cf(D?Sa(qt==null?void 0:qt.href):qt==null?void 0:qt.href,Z,Pf),$host:qt==null?void 0:qt.host,$pathname:qt==null?void 0:qt.pathname,$raw_user_agent:jr.length>1e3?jr.substring(0,997)+"...":jr,$browser_version:fD(jr,navigator.vendor,z,N),$browser_language:US(),$browser_language_prefix:(le=US(),typeof le=="string"?le.split("-")[0]:void 0),$screen_height:ne==null?void 0:ne.screen.height,$screen_width:ne==null?void 0:ne.screen.width,$viewport_height:ne==null?void 0:ne.innerHeight,$viewport_width:ne==null?void 0:ne.innerWidth,$lib:Ot.LIB_NAME,$lib_version:Ot.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ot.SDK_DIST_CHANNEL&&(ut.$sdk_dist_channel=Ot.SDK_DIST_CHANNEL),ut})(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){var p=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0),v=p.windowId;l.$session_id=p.sessionId,l.$window_id=v}this.sessionPropsManager&&Lt(l,this.sessionPropsManager.getSessionProps());try{var y;this.sessionRecording&&Lt(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(y=this.Kl)==null?void 0:y.length}catch(M){l.$sdk_debug_error_capturing_properties=String(M)}if(this.requestRouter.region===F2&&(l.$lib_custom_api_host=this.config.api_host),d=e!==Wc||i?e!==f1||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),l=Lt(l,d),e===Wc&&fe&&(l.title=fe.title),!ce(o)){var w=r.getTime()-o;l.$duration=parseFloat((w/1e3).toFixed(3))}jr&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),x=this.sessionPersistence.properties(),b=l.$groups,k=_.$groups;ot(b)&&!fs(b)&&(l.$groups=ue({},ot(k)?k:{},b)),kt(["$referrer","$referring_domain"],(M=>{M in _&&delete x[M]}));var C={};if(this.Bl.length>0)for(var P of this.Bl.slice())try{Lt(C,P())}catch(M){ge.error("Failed to produce browser extension event properties",M)}(l=Lt({},f,_,x,ue({},C,l))).$is_identified=this._isIdentified(),ze(this.config.property_denylist)?kt(this.config.property_denylist,(function(M){delete l[M]})):ge.error(JP+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var T=this.config.sanitize_properties;T&&(ge.error(i8),l=T(l,e));var O=this._u();return l.$process_person_profile=O,O&&!i&&this.wu("_calculate_event_properties"),l}mu(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this._u()||this.Nl&&!r)return e;var i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),l=Lt({},i,o||{},e||{}),u=this.config.sanitize_properties;return u&&(ge.error(i8),l=u(l,"$set_once")),n&&(this.Nl=!0),fs(l)?void 0:l}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)==null||n.syncCookieProperties(),this.yu(),(r=this.sessionPersistence)==null||r.register(e),Object.keys(e).forEach((s=>this.ql.add(s))),this.bu()}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e),this.ql.delete(e),this.bu()}ku(e,n){this.register({[e]:n})}Yl(){this.ql.forEach((e=>{var n;(n=this.sessionPersistence)==null||n.unregister(e)})),this.ql.clear(),this.bu()}bu(){var e;if(this.jl)if(this.config.persistence==="memory"||(e=this.sessionPersistence)!=null&&e.Eo||!It.ii())It.oi(this.jl);else{var n=[];this.ql.forEach((r=>n.push(r))),n.length>0?It.ni(this.jl,n):It.oi(this.jl)}}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)==null?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.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Cl.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:$d}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:$d})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:$d})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=WN),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:$d}}canRenderSurveyAsync(e,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:$d})}Su(e){return!e||rf(e)?(ge.critical("Unique user id has not been set in posthog.identify"),!1):e===kc?(ge.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())||(ge.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 ge.uninitializedWarning("posthog.identify");if(ln(e)&&(e=e.toString(),ge.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Su(e)&&this.wu("posthog.identify")){this.Ll();var s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.yu(!1),l=this.persistence.Zo(),u=!1;try{var d=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ef)||this.register_once({$had_persisted_distinct_id:!0,$device_id:d},""),e!==d&&e!==this.get_property(zc)&&(this.unregister(zc),this.register({distinct_id:e}));var f=(this.persistence.get_property(it)||hn)===hn,p=e!==d,v=!p&&f;if(p&&f){var y,w=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:d};this.persistence.set_property(it,ir),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Qo(),this.capture(k2,w,{$set:n||{},$set_once:r||{}}),this.Wl=k1(e,n,r),(y=this.featureFlags)==null||y.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:d)}else if(v){this.persistence.set_property(it,ir);var _=n||{},x=r||{};this.setPersonPropertiesForFlags({$set:_,$set_once:x},!1),this.config.cookieWinsOnConflict&&this.persistence.Qo(),this.capture("$set",{$set:_,$set_once:x}),this.Wl=k1(e,n,r)}else(n||r)&&this.setPersonProperties(n,r);p||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(yo)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{l&&this.persistence.Yo(u)}}}setPersonProperties(e,n){if((e||n)&&this.wu("posthog.setPersonProperties")){var r=k1(this.get_distinct_id(),e,n);this.Wl!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Wl=r):ge.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(ze(e)?e:[e]).filter((s=>at(s)&&s.length>0));r.length!==0&&this.wu("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Wl=null)}group(e,n,r){var s;if(e&&n){(s=this.persistence)==null||s.syncCookieProperties(),this.yu();var i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ue({},i,{[e]:n})}),(o||r)&&this._u()){var l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(CS,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}else ge.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.wu("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n=Er(e)?e:e==null?void 0:e.resetDeviceID,r=Er(e)||e==null?void 0:e.bootstrap;this.xu(n,!1,r)}xu(e,n,r){var s,i,o;if(n===void 0&&(n=!1),ge.info("reset"),!this.__loaded)return ge.uninitializedWarning("posthog.reset");var l=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Gl)==null?void 0:s.bootstrap)||{},(i=this.featureFlags)==null||i.updateConfig==null||i.updateConfig(this.config,this.pa());var u=this.get_property(Ef),d=this.get_property(d1),f=this.get_property(El),p=this.is_capturing();this.consent.reset(),n||!p||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.");var v=(o=this.persistence)==null||o.Zo==null?void 0:o.Zo(),y=!1;try{var w,_,x,b,k,C,P,T,O,M,R,L,D;if((w=this.persistence)==null||w.clear(),(_=this.sessionPersistence)==null||_.clear(),this.ql.clear(),this.bu(),ce(f)||(M=this.persistence)==null||M.register({[El]:f}),(x=this.surveys)==null||x.reset(),(b=this.featureFlags)==null||b.reset(),(k=this.conversations)==null||k.reset(),(C=this.logs)==null||C.reset(),(P=this.metrics)==null||P.reset(),(T=this.persistence)==null||T.set_property(it,hn),(O=this.sessionManager)==null||O.resetSessionId(),this.Wl=null,this.config.cookieless_mode===_o)this.register_once({distinct_id:kc,$device_id:null},"");else{var V=this.config.get_device_id(ci());this.register_once({distinct_id:V,$device_id:e?V:u},""),e||ce(d)||this.register({[d1]:d})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID===void 0||this.Pl()||((D=this.persistence)==null||D.set_property(it,r.isIdentifiedID?ir:hn),this.register({distinct_id:r.distinctID})),(R=this.featureFlags)==null||R.initialize(),!(ce(l)||(L=this.sessionManager)!=null&&L.setBootstrapSessionId(l,!0)))){var j=ue({},r);delete j.sessionID,this.config.bootstrap=j}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,y=!0}finally{var U;v&&((U=this.persistence)==null||U.Yo==null||U.Yo(y))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Dt((function*(){var r,s,i,o,l,u,d;if(n.__loaded){n.nu().dispose(),(r=n.sessionRecording)==null||r.dispose(),(s=n.logs)==null||s.flushLogs("sendBeacon"),(i=n.metrics)==null||i.flush("sendBeacon"),(o=n.Ql)==null||o.unload(),(l=n.Kl)==null||l.unload();try{var f;(f=n.featureFlags)==null||f.destroy()}catch(p){ge.error("Error while destroying feature flags",p)}(u=n.persistence)==null||u.destroy(),(d=n.sessionPersistence)==null||d.destroy()}else ge.uninitializedWarning("posthog.shutdown")}))()}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.Cu()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)==null||e.Tu()}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?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&r){var i,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(J3)?(ge.critical("Attempting to create alias for existing People user - aborting."),-2):this.wu("posthog.alias")?(ce(n)&&(n=this.get_distinct_id()),e!==n?(this.ku(zc,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ge.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=ue({},this.config);if(ot(e)){var r,s,i,o,l,u,d,f,p,v,y,w;Lt(this.config,o8(e));var _=this.Dl();(r=this.persistence)==null||r.update_config(this.config,n,_),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new _1(ue({},this.config,{persistence:"sessionStorage"}),_,!1);var x,b=this.Vl(this.config.debug);Er(b)&&(this.config.debug=b),Er(this.config.debug)&&(this.config.debug?(Ot.DEBUG=!0,pt.ii()&&pt.ni("ph_debug",!0),ge.info("set_config",{config:e,oldConfig:n,newConfig:ue({},this.config)})):(Ot.DEBUG=!1,pt.ii()&&pt.oi("ph_debug"))),(s=this.featureFlags)==null||s.updateConfig==null||s.updateConfig(this.config,this.pa()),(i=this.exceptionObserver)==null||i.onConfigChange(),(o=this.exceptions)==null||o.onConfigChange(),(l=this.sessionRecording)==null||l.startIfEnabledOrStop(),(u=this.tracingHeaders)==null||u.startIfEnabledOrStop(),(d=this.autocapture)==null||d.startIfEnabled(),(f=this.heatmaps)==null||f.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((x=this.historyAutocapture)==null||x.startIfEnabledOrStop()),(p=this.exceptionObserver)==null||p.startIfEnabledOrStop(),(v=this.deadClicksAutocapture)==null||v.startIfEnabledOrStop(),(y=this.surveys)==null||y.loadIfEnabled(),this.$l(),(w=this.externalIntegrations)==null||w.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&zS(this,uf,!1)}}_overrideSDKInfo(e,n){Ot.LIB_NAME=e,Ot.LIB_VERSION=n}startSessionRecording(e){var n,r,s,i,o,l=e===!0,u={sampling:l||!(e==null||!e.sampling),linked_flag:l||!(e==null||!e.linked_flag),url_trigger:l||!(e==null||!e.url_trigger),event_trigger:l||!(e==null||!e.event_trigger)};Object.values(u).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),u.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),u.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),u.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),u.event_trigger&&((o=this.sessionRecording)==null||o.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.started)}captureException(e,n){try{if(!this.exceptions)return;var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(ue({},s,n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:us.Mu}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?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Vc;return n!==Vc&&(n=Vc+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(it))===ir||((n=this.sessionPersistence)==null?void 0:n.get_property(it))===ir}_u(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===E2&&!this._isIdentified()&&fs(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[zc])&&((n=this.persistence)==null||(n=n.props)==null||!n[rm]))}vu(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this._u()||this.wu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.wu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}wu(e){return this.config.person_profiles==="never"?(ge.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Al(),this.ku(rm,!0),!0)}Dl(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==sa)}$l(){var e,n,r,s,i,o=this.Dl();return this.is_capturing()||(r=this.logs)==null||r.Iu(),((e=this.persistence)==null?void 0:e.Eo)!==o&&((s=this.persistence)==null||s.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.Eo)!==o&&((i=this.sessionPersistence)==null||i.set_disabled(o)),o&&(this.ql.clear(),this.bu()),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==_o){if(this.Pl()){var r,s,i,o,l,u;(r=this.sessionRecording)==null||r.dispose({discardBufferedEvents:!0}),this.xu(!0,!0),(s=this.sessionManager)==null||s.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new t8(this),this.pageViewManager=new BS(this),this.persistence&&(this.sessionPropsManager=new JS(this,this.sessionManager,this.persistence));var d,f=(o=(l=this.config.__extensionClasses)==null?void 0:l.sessionRecording)!==null&&o!==void 0?o:(u=us.__defaultExtensionClasses)==null?void 0:u.sessionRecording;f&&(this.sessionRecording=this.Rl(this.sessionRecording,new f(this)),this.xl&&((d=this.sessionRecording)==null||d.onRemoteConfig==null||d.onRemoteConfig(this.xl)))}var p,v;this.consent.optInOut(!0),this.$l(),this.uu(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==sa&&((p=this.surveys)==null||p.loadIfEnabled()),(ce(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((v=e==null?void 0:e.captureEventName)!==null&&v!==void 0?v:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.hu()}else ge.warn(s8)}opt_out_capturing(){if(this.config.cookieless_mode!==_o){var e,n,r=this.config.cookieless_mode===sa?this.sessionRecording:void 0;r==null||r.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===sa&&this.consent.isOptedIn()&&this.xu(!0,!0),this.consent.optInOut(!1),this.$l(),this.config.cookieless_mode===sa&&(this.register({distinct_id:kc,$device_id:null}),this.El(r),this.sessionRecording=void 0,(e=this.sessionManager)==null||e.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.hu(),this.uu())}else ge.warn(s8)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===_o||(this.config.cookieless_mode===sa?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.$l()}_is_bot(){return Vn?ZP(Vn,this.config.custom_blocked_useragents):void 0}hu(){fe&&(fe.visibilityState==="visible"?this.Hl||(this.Hl=!0,this.capture(Wc,{title:fe.title},{send_instantly:!0}),this.zl&&(fe.removeEventListener(Pu,this.zl),this.zl=null)):this.zl||(this.zl=this.hu.bind(this),Mt(fe,Pu,this.zl)))}debug(e){e===!1?(ne==null||ne.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ne==null||ne.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}))}pa(){var e=this.Gl||{};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?(ge.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){var l=r in n&&!et(n[r]),u=s in n&&!et(n[s]);return l?n[r]:!!u&&(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,ge)}ns(e){var n;if(et(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(eD),s=ze(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var o of s)try{if(i=o(i),et(i)){var l="Event '"+e.event+"' was rejected in beforeSend function";return JL(e.event)?ge.warn(l+". This can cause unexpected behavior."):ge.info(l),null}i.properties&&!fs(i.properties)||ge.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(d){return ge.error("Error in beforeSend function for event '"+e.event+"':",d),null}for(var u of r)if(i.properties&&et(i.properties[u]))return ge.warn("Event '"+e.event+"' had its '"+u+"' 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.io)==null?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)})}Vl(e){var n=Er(e)&&!e,r=pt.ii()&&pt.ai("ph_debug")==="true";return!n&&(!!r||e)}}us.__defaultExtensionClasses={},us.Mu=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=XD(t.prototype[e[n]])})(us,["identify"]);class t5{constructor(e){this.disabled=e===!1;var n=ot(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var T1="$copy_autocapture",jp=Ht("[AutoCapture]");function R1(t,e){return e.length>t?e.slice(0,t)+"...":e}function r7(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Ea(e));return e}function s7(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,o=e.maskAllText,l=e.elementAttributeIgnoreList,u=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!Ea(t))return{props:{}};for(var f=[t],p=new Set([t]),v=t;v.parentNode&&!ps(v,"body")&&mP>f.length;)if(pP(v.parentNode)){var y=v.parentNode.host;if(p.has(y))break;p.add(y),f.push(y),v=y}else{if(!Ea(v.parentNode)||p.has(v.parentNode))break;p.add(v.parentNode),f.push(v.parentNode),v=v.parentNode}var w,_,x=[],b={},k=!1,C=!1;if(kt(f,(R=>{var L=I2(R);if(ps(R,"a")){var D=R.getAttribute("href");k=!!(L&&D&&af(D))&&(d?Sa(D):D)}Ye(am(R),"ph-no-capture")&&(C=!0),x.push((function(j,U,X,q,Z){Z===void 0&&(Z=!1);var Y=j.tagName.toLowerCase(),H={tag_name:Y};Mw.indexOf(Y)>-1&&!X&&(H.$el_text=Y.toLowerCase()==="a"||Y.toLowerCase()==="button"?R1(1024,VS(j)):R1(1024,kf(j)));var Q=am(j);Q.length>0&&(H.classes=Q.filter((function(oe){return oe!==""}))),kt(j.attributes,(function(oe){var se;if((!xP(j)||["name","id","class","aria-label"].indexOf(oe.name)!==-1)&&(q==null||!q.includes(oe.name))&&!U&&af(oe.value)&&(!at(se=oe.name)||se.substring(0,10)!=="_ngcontent"&&se.substring(0,7)!=="_nghost")){var ee=oe.value;oe.name==="class"&&(ee=Iw(ee).join(" ")),H["attr__"+oe.name]=R1(1024,oe.name==="href"&&Z?Sa(ee):ee)}}));for(var z=1,N=1,G=j;G=r7(G);)z++,G.tagName===j.tagName&&N++;return H.nth_child=z,H.nth_of_type=N,H})(R,i,o,l,d));var V=(function(j){if(!I2(j))return{};var U={};return kt(j.attributes,(function(X){if(X.name&&X.name.indexOf("data-ph-capture-attribute")===0){var q=X.name.replace("data-ph-capture-attribute-",""),Z=X.value;q&&Z&&af(Z)&&(U[q]=Z)}})),U})(R);kt(V,((j,U)=>{({}).hasOwnProperty.call(b,U)||(b[U]=j)}))})),C)return{props:{},explicitNoCapture:C};if(o||(x[0].$el_text=ps(t,"a")||ps(t,"button")?VS(t):kf(t)),k){var P,T;x[0].attr__href=k;var O=(P=Au(k))==null?void 0:P.host,M=ne==null||(T=ne.location)==null?void 0:T.host;O&&M&&O!==M&&(w=k)}return{props:Lt({$event_type:s.type,$ce_version:1},u?{}:{$elements:x},{$elements_chain:(_=x,ze(_)?(function(R){return R.map((L=>{var D,V,j="";if(L.tag_name&&(j+=L.tag_name),L.attr_class)for(var U of(L.attr_class.sort(),L.attr_class))j+="."+U.replace(/"/g,"");var X=ue({},L.text?{text:L.text}:{},{"nth-child":(D=L.nth_child)!==null&&D!==void 0?D:0,"nth-of-type":(V=L.nth_of_type)!==null&&V!==void 0?V:0},L.href?{href:L.href}:{},L.attr_id?{attr_id:L.attr_id}:{},L.attributes),q={};return v0(X).sort(((Z,Y)=>{return(Q=Y[0])>(H=Z[0])?-1:H>Q?1:0;var H,Q})).forEach((Z=>{var Y=Z[1];return q[$S(Z[0].toString())]=$S(Y.toString())})),(j+=":")+v0(q).map((Z=>Z[0]+'="'+Z[1]+'"')).join("")})).join(";")})((function(R){return R.map((L=>{var D,V,j={text:(D=L.$el_text)==null?void 0:D.slice(0,400),tag_name:L.tag_name,href:(V=L.attr__href)==null?void 0:V.slice(0,2048),attr_class:mN(L),attr_id:L.attr__id,nth_child:L.nth_child,nth_of_type:L.nth_of_type,attributes:{}};return v0(L).filter((U=>U[0].indexOf("attr__")===0)).forEach((U=>j.attributes[U[0]]=U[1])),j}))})(_)):"")},(n=x[0])!=null&&n.$el_text?{$el_text:(r=x[0])==null?void 0:r.$el_text}:{},w&&s.type==="click"?{$external_click_url:w}:{},b)}}class i7{constructor(e){this.name="autocapture",this.Rs=!1,this.Ps=null,this.As=!1,this.Fs=!1,this.mn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Os=!1,this.Ls=e,this.Ls.refresh(this.mn),this.rageclicks=new t5(this.mn.rageclick),this.Ds=null}setup(e){this.$s(),this.Ns=e;var n=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Os?n.dispose():(this.qs=n,this.startIfEnabled())}dispose(){var e;this.Os||(this.Os=!0,this.Ns=void 0,(e=this.qs)==null||e.dispose(),this.qs=void 0,this.js())}Bs(){return this.Ls.refresh(this.mn),this.mn}$s(){var e,n;return this.Bs(),this.mn.url_allowlist=(e=this.mn.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),this.mn.url_ignorelist=(n=this.mn.url_ignorelist)==null?void 0:n.map((r=>new RegExp(r))),this.mn}Hs(){if(this.isBrowserSupported()){if(ne&&fe){var e=this.zs=r=>{r=r||(ne==null?void 0:ne.event);try{this.Us(r)}catch(s){jp.error("Failed to capture event",s)}};if(Mt(fe,"submit",e,{capture:!0}),Mt(fe,"change",e,{capture:!0}),Mt(fe,"click",e,{capture:!0}),this.Bs().capture_copied_text){var n=this.Ws=r=>{r=r||(ne==null?void 0:ne.event);try{this.Us(r,T1)}catch(s){jp.error("Failed to capture clipboard event",s)}};Mt(fe,"copy",n,{capture:!0}),Mt(fe,"cut",n,{capture:!0}),Mt(fe,"paste",n,{capture:!0})}}}else jp.info("Disabling Automatic Event Collection because this browser is not supported")}js(){this.zs&&(fe==null||fe.removeEventListener("submit",this.zs,!0),fe==null||fe.removeEventListener("change",this.zs,!0),fe==null||fe.removeEventListener("click",this.zs,!0),this.zs=void 0),this.Ws&&(fe==null||fe.removeEventListener("copy",this.Ws,!0),fe==null||fe.removeEventListener("cut",this.Ws,!0),fe==null||fe.removeEventListener("paste",this.Ws,!0),this.Ws=void 0),this.Rs=!1}startIfEnabled(){!this.Os&&this.Ns&&this.isEnabled&&!this.Rs&&(this.Hs(),this.Rs=!0)}onRemoteConfig(e){if(!this.Os)if(this.As=!0,e.ok){var n=e.config;n.elementsChainAsString&&(this.Fs=n.elementsChainAsString);var r,s=n.autocapture_opt_out;Er(s)&&((r=this.Ns)==null||r.kv.set(c2,s),this.Ps=s),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.Ds=e}getElementSelectors(e){var n,r=[];return(n=this.Ds)==null||n.forEach((s=>{var i=fe==null?void 0:fe.querySelectorAll(s);i==null||i.forEach((o=>{e===o&&r.push(s)}))})),r}get isEnabled(){var e,n;if(this.Os)return!1;var r=(e=this.Ns)==null?void 0:e.kv.get(c2),s=this.Ps,i=this.Bs(),o=i.remoteRequestsDisabled&&!this.As;if(sn(s)&&!Er(r)&&!o)return!1;var l=(n=this.Ps)!==null&&n!==void 0?n:!!r;return!!i.enabled&&!l}Us(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r=T2(e);hP(r)&&(r=r.parentNode||null);var s,i=this.$s();n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&i.rageclick&&(s=this.rageclicks)!=null&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&_P(r,i.rageclick)&&this.Us(e,"$rageclick");var o=n===T1,l=o?ue({},i,{dom_event_allowlist:void 0}):i;if(r&&(function(b,k,C,P,T,O){var M;if(!ne||Ow(b)||C!=null&&C.url_allowlist&&!MS(C.url_allowlist,O)||C!=null&&C.url_ignorelist&&MS(C.url_ignorelist,O))return!1;if(C!=null&&C.dom_event_allowlist){var R=C.dom_event_allowlist;if(R&&!R.some((X=>k.type===X)))return!1}var L=wP(b,P),D=L.parentIsUsefulElement,V=L.targetElementList;if(!(function(X,q){var Z=q==null?void 0:q.element_allowlist;if(ce(Z))return!0;var Y,H=function(z){if(Z.some((N=>z.tagName.toLowerCase()===N)))return{v:!0}};for(var Q of X)if(Y=H(Q))return Y.v;return!1})(V,C)||!R2(V,C==null?void 0:C.css_selector_allowlist)||R2(V,(M=C==null?void 0:C.css_selector_ignorelist)!==null&&M!==void 0?M:cN))return!1;try{var j=ne.getComputedStyle(b);if(j&&j.getPropertyValue("cursor")==="pointer"&&k.type==="click")return!0}catch{}var U=b.tagName.toLowerCase();switch(U){case"html":return!1;case"form":return(T||["submit"]).indexOf(k.type)>=0;case"input":case"select":case"textarea":return(T||["change","click"]).indexOf(k.type)>=0;default:return D?(T||["click"]).indexOf(k.type)>=0:(T||["click"]).indexOf(k.type)>=0&&(Mw.indexOf(U)>-1||b.getAttribute("contenteditable")==="true")}})(r,e,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:i.getCurrentUrl}})){var u,d=s7(r,{e,maskAllElementAttributes:i.maskAllElementAttributes,maskAllText:i.maskAllText,elementAttributeIgnoreList:i.element_attribute_ignorelist,elementsChainAsString:this.Fs,disableCaptureUrlHashes:i.disableCaptureUrlHashes}),f=d.props;if(d.explicitNoCapture)return!1;var p=this.getElementSelectors(r);if(p&&p.length>0&&(f.$element_selectors=p),n===T1){var v=e.type||"clipboard";if(v!=="paste"){var y,w,_=ne==null||(y=ne.getSelection())==null?void 0:y.toString(),x=vP(_);if(!x)return!1;f.$selected_content=x,f.$clipboard_text_length=(w=_==null?void 0:_.length)!==null&&w!==void 0?w:0}f.$copy_type=v}return(u=this.Ns)==null||u.capture(n,f).catch((b=>jp.error("Failed to capture event",b))),!0}}}isBrowserSupported(){return mr(fe==null?void 0:fe.querySelectorAll)}}class o7{constructor(e){this._instance=e}refresh(e){var n=this._instance.config,r=ot(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance.pa(),e.url_allowlist=r==null?void 0:r.url_allowlist,e.url_ignorelist=r==null?void 0:r.url_ignorelist,e.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,e.element_allowlist=r==null?void 0:r.element_allowlist,e.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,e.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,e.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,e.capture_copied_text=r==null?void 0:r.capture_copied_text}}var Hd=Ht("[ExceptionAutocapture]"),a8=()=>{},l8=t=>{var e;if(mr(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function n5(t,e,n){try{if(!(e in t))return a8;var r={next:t[e]},s=n((function(){for(var i=arguments.length,o=new Array(i),l=0;i>l;l++)o[l]=arguments[l];return r.next.apply(this,o)}));return mr(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)for(var i=t[e],o=l8(i);o;){if(o.next===s)return void(o.next=r.next);o=l8(i=o.next)}else t[e]=r.next}}catch{return a8}}var a7=Ht("[TracingHeaders]"),al=Ht("[Web Vitals]"),c8=9e5,u8=["CLS","FCP","INP","LCP"],l7=["INP","LCP"],c7=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Fp="disabled",d8="lazy_loading",zd="awaiting_config",Vp="missing_config";Ht("[SessionRecording]"),Ht("[SessionRecording]");var V2="[SessionRecording]",so=Ht(V2),u7=Ht("[Heatmaps]");function I1(t){return ot(t)&&"clientX"in t&&"clientY"in t&&ln(t.clientX)&&ln(t.clientY)}var $p=Ht("[Product Tours]"),M1=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(Pw))},d7=["$set_once","$set"],wi=Ht("[SiteApps]"),f8="Error while initializing PostHog app with config id ",r5=(t,e)=>t!=null&&t.then?t.then(e):e(t),Ic="SDK is not enabled or survey functionality is not yet loaded",h8="Disabled. Not loading surveys.";class f7{constructor(e,n){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Eu=!1,this.Ru=[],this.Pu=null,this.Au=null,this.Os=!1,this.Fu=new Set,this.onRemoteConfig=r=>{if(!this.Os&&!this.mn.disableSurveys){if(!r.ok)return xt.warn("Remote config unavailable. Not loading surveys.");var s=r.config.surveys;if(et(s))return xt.warn("Flags not loaded yet. Not loading surveys.");this.Ou=Er(s)?s:s.length>0,xt.info("flags response received, isSurveysEnabled: "+this.Ou),this.loadIfEnabled()}},this.Ls=e,this.Lu=n}setup(e){if(!this.Os)return this.Du=e,r5(e.kv.initialize(),(()=>{if(this.Du===e&&!this.Os){this.Du=void 0,this.Ns=e;var n=e.onRemoteConfig(this.onRemoteConfig);this.Os?n.dispose():(this.qs=n,this.loadIfEnabled())}}))}dispose(){var e,n,r;this.Os||(this.Os=!0,this.Du=void 0,this.Ns=void 0,(e=this.qs)==null||e.dispose(),this.qs=void 0,(n=this._surveyEventReceiver)==null||n.dispose(),this._surveyEventReceiver=null,(r=this._surveyManager)==null||r.dispose==null||r.dispose(),this._surveyManager=null,this.Ru=[],this.Pu=null,this.Fu.forEach((s=>clearTimeout(s))),this.Fu.clear())}get mn(){return this.Ls.get()}initialize(){this.loadIfEnabled()}reset(){try{var e;(e=this._surveyEventReceiver)==null||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;r<localStorage.length;r++){var s=localStorage.key(r);(s!=null&&s.startsWith(XP)||s!=null&&s.startsWith("inProgressSurvey_"))&&n.push(s)}n.forEach((i=>localStorage.removeItem(i)))}catch{}}loadIfEnabled(){if(!this.Os&&this.Ns){var e=this.mn;if(!this._surveyManager)if(this.Eu)xt.info("Already initializing surveys, skipping...");else if(e.disableSurveys)xt.info(h8);else if(e.cookielessMode&&this.Ls.isOptedOut())xt.info("Not loading surveys in cookieless mode without consent.");else{var n=this.Ls.getExtensions();if(n){if(!ce(this.Ou)||e.advancedEnableSurveys){var r=this.Ou||e.advancedEnableSurveys;this.Eu=!0;try{var s=n.generateSurveys;if(s)return this.$u(s,r),void(this.Eu=!1);var i=n.loadExternalDependency;if(!i)return this.Nu(Tw),void(this.Eu=!1);i((o=>{try{if(this.Os)return;var l=this.Ls.getExtensions();o||l==null||!l.generateSurveys?this.Nu("Could not load surveys script",o):this.$u(l.generateSurveys,r)}finally{this.Eu=!1}}))}catch(o){throw this.Eu=!1,this.Nu("Error initializing surveys",o),o}}}else xt.error("PostHog Extensions not found.")}}}$u(e,n){this.Os||(this._surveyManager=e(n),this._surveyEventReceiver=this.Ls.createEventReceiver(),xt.info("Surveys loaded successfully"),this.qu({isLoaded:!0}))}Nu(e,n){xt.error(e,n),this.qu({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ru.push(e),this._surveyManager&&this.qu({isLoaded:!0}),()=>{this.Ru=this.Ru.filter((n=>n!==e))}}getSurveys(e,n){var r;n===void 0&&(n=!1);var s=(r=this.Ns)!==null&&r!==void 0?r:this.Lu;if(s&&!this.Os){if(this.mn.disableSurveys)return xt.info(h8),e([]);var i=s.kv.get(g2);if(i&&!n)return e(i,{isLoaded:!0}),void(this.ju()&&this.getSurveys((()=>{}),!0));if(this.Pu)this.Pu.then((u=>{this.Os||e(u.surveys,u.context)})).catch((u=>xt.error("Error in survey callback",u)));else{var o=this.Bu("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.mn.requestTimeoutMs}).then((u=>{try{return this.Hu(s,u)}catch(d){return xt.error("Error processing surveys response",d),this.Hu(s,{statusCode:0,error:d})}}),(u=>this.Hu(s,{statusCode:0,error:u})));this.Pu=o;var l=()=>{this.Pu===o&&(this.Pu=null)};o.then((u=>{l(),this.Os||e(u.surveys,u.context)}),l).catch((u=>xt.error("Error in survey callback",u)))}}}Bu(e,n){var r=this.Ns;return r?r.sendRequest(e,n):new Promise((s=>s({statusCode:0,error:new Error(Ic)})))}Hu(e,n){if(this.Os)return{surveys:[],context:{isLoaded:!1,error:Ic}};var r=n.statusCode;if(r!==200||!n.json){var s="Surveys API could not be loaded, status: "+r;return r!==0?xt.error(s):n.error||xt.warn(s),this.Au=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Au=null;var i,o=n.json.surveys||[],l=o.filter((u=>(function(d){return!(!d.start_date||d.end_date)})(u)&&(GP(u)||(function(d){var f;return!((f=d.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)})(u))));return l.length>0&&((i=this._surveyEventReceiver)==null||i.register(l)),e.kv.set({[g2]:o,[nm]:Date.now()}),{surveys:o,context:{isLoaded:!0}}}ju(){return this.zu()&&!this.Pu&&!this.Uu()}zu(){var e,n,r=(e=(n=this.Ns)!==null&&n!==void 0?n:this.Lu)==null?void 0:e.kv.get(nm);return ln(r)&&Date.now()-r>3e5}Uu(){return ln(this.Au)&&3e5>Date.now()-this.Au}markSurveyAsSeen(e,n){var r,s={id:e,current_iteration:(r=n==null?void 0:n.iteration)!==null&&r!==void 0?r:null};QP(s);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}qu(e){for(var n of this.Ru)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){xt.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!et(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);xt.warn("init was not called")}Wu(e){var n=null;return this.getSurveys((r=>{var s;n=(s=r.find((i=>i.id===e)))!==null&&s!==void 0?s:null})),n}Vu(e){if(et(this._surveyManager))return{eligible:!1,reason:Ic};var n=typeof e=="string"?this.Wu(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}Gu(e){if(et(this._surveyManager))return{eligible:!1,reason:Ic};var n=typeof e=="string"?this.Wu(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(et(this._surveyManager))return xt.warn("init was not called"),{visible:!1,disabledReason:Ic};var n=this.Gu(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return et(this._surveyManager)?(xt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Ic})):new Promise((r=>{this.getSurveys((s=>{var i,o=(i=s.find((u=>u.id===e)))!==null&&i!==void 0?i:null;if(o){var l=this.Gu(o);r({visible:l.eligible,disabledReason:l.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n,r){var s;if(et(this._surveyManager))xt.warn("init was not called");else{var i=typeof e=="string"?this.Wu(e):e;if(i!=null&&i.id)if(UN.includes(i.type)){var o=fe==null?void 0:fe.querySelector(n);if(o)if((s=i.appearance)!=null&&s.surveyPopupDelaySeconds){xt.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds");var l=setTimeout((()=>{var u,d;this.Fu.delete(l),this.Os||(xt.info("Rendering survey "+i.id+" with delay of "+((u=i.appearance)==null?void 0:u.surveyPopupDelaySeconds)+" seconds"),(d=this._surveyManager)==null||d.renderSurvey(i,o,r),xt.info("Survey "+i.id+" rendered"))}),1e3*i.appearance.surveyPopupDelaySeconds);this.Fu.add(l)}else this._surveyManager.renderSurvey(i,o,r);else xt.warn("Survey element not found")}else xt.warn("Surveys of type "+i.type+" cannot be rendered in the app");else xt.warn("Survey not found")}}displaySurvey(e,n){var r;if(et(this._surveyManager))xt.warn("init was not called");else{var s=this.Wu(e);if(s){var i=s;if((r=s.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=ue({},s,{appearance:ue({},s.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==M2.Popover&&n.initialResponses&&xt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.Vu(s);if(!o.eligible)return void xt.warn("Survey is not eligible to be displayed: ",o.reason)}n.displayType!==M2.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}else xt.warn("Survey not found")}}cancelPendingSurvey(e){et(this._surveyManager)?xt.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload==null||e.handlePageUnload()}}function Mc(t,e,n){if(et(t))return!1;switch(n){case"exact":return t===e;case"contains":var 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}}class h7{constructor(e){this.Zu=new Set,this.Qu=new Set,this.Ju=new dm,this.Ku=(n,r)=>this.Yu(n,r)&&this.Xu(n,r)&&this.th(n,r)&&this.eh(n,r),this.Yu=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e}init(){var e,n;ce((e=this._instance)==null?void 0:e._addCaptureHook)||(this.ih=(n=this._instance)==null?void 0:n._addCaptureHook(((r,s)=>{this.on(r,s)})))}dispose(){var e;(e=this.ih)==null||e.call(this),this.ih=void 0,this.Ju=new dm}register(e){var n,r;if(!ce((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((i=>{var o;this.Zu.add(i),(o=i.steps)==null||o.forEach((l=>{this.Qu.add((l==null?void 0:l.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s=new Set;this.Zu.forEach((i=>{var o;(o=i.steps)==null||o.forEach((l=>{l!=null&&l.selector&&s.add(l.selector)}))})),this._instance.autocapture.setElementSelectors(s)}}replace(e){this.Zu.clear(),this.Qu.clear(),this.register(e)}on(e,n){n!=null&&e.length!=0&&(this.Qu.has(e)||this.Qu.has(n.event))&&this.Zu.forEach((r=>{this.rh(n,r)&&this.Ju.emit("actionCaptured",r.name)}))}nh(e){this.onAction("actionCaptured",(n=>e(n)))}rh(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Ku(e,r))return!0;return!1}onAction(e,n){return this.Ju.on(e,n)}Xu(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!Mc(s,n.url,n.url_matching||"contains"))return!1}return!0}th(e,n){return!!this.sh(e,n)&&!!this.oh(e,n)&&!!this.ah(e,n)}sh(e,n){var r;if(n==null||!n.href)return!0;var s=this.lh(e);if(s.length>0)return s.some((l=>Mc(l.href,n.href,n.href_matching||"exact")));var i,o=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!o&&Mc((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}oh(e,n){var r;if(n==null||!n.text)return!0;var s=this.lh(e);if(s.length>0)return s.some((d=>Mc(d.text,n.text,n.text_matching||"exact")||Mc(d.$el_text,n.text,n.text_matching||"exact")));var i,o,l,u=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!u&&(i=(function(d){for(var f,p=[],v=/(?::|")text="(.*?)"/g;!et(f=v.exec(d));)p.includes(f[1])||p.push(f[1]);return p})(u),o=n.text,l=n.text_matching||"exact",i.some((d=>Mc(d,o,l))))}ah(e,n){var r,s;if(n==null||!n.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var o=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}lh(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}eh(e,n){return n==null||!n.properties||n.properties.length===0||YP(n.properties.reduce(((r,s)=>{var i=ze(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class p7{constructor(e){var n;this.uh=[],this._instance=e,this.hh=new Map,this.dh=new Map,this.fh=new Map,this.ph=(n=this._instance)==null||n.onSessionId==null?void 0:n.onSessionId((r=>this.gh(r)))}mh(e){return!1}yh(){return null}bh(e){}_h(){}wh(e,n){return!!e&&YP(e.propertyFilters,n==null?void 0:n.properties)}kh(e,n){var r=new Map;return e.forEach((s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((o=>{if(o!=null&&o.name){var l=r.get(o.name)||[];l.push(s.id),r.set(o.name,l)}}))})),r}Sh(e,n,r){var s=(r===jd.Activation?this.hh:this.dh).get(e),i=[];return this.xh((o=>{i=o.filter((l=>s==null?void 0:s.includes(l.id)))})),i.filter((o=>{var l,u=(l=o.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((d=>d.name===e));return this.wh(u,n)}))}register(e){this.Ch(e,!1)}replace(e){this.Ch(e,!0)}Ch(e,n){var r;ce((r=this._instance)==null?void 0:r._addCaptureHook)||(this.Th(e,n),this.Mh(e,n))}Mh(e,n){var r=e.filter((o=>{var l;return(l=o.conditions)==null||(l=l.actions)==null||(l=l.values)==null?void 0:l.length}));if(n&&this.fh.clear(),r.length!==0){this.Ih||(this.Ih=new h7(this._instance),this.Ih.init(),this.Ih.nh((o=>this.onAction(o))));var s=[];r.forEach((o=>{var l;(l=o.conditions)==null||(l=l.actions)==null||l.values.forEach((u=>{if(s.push(u),u.name){var d,f=(d=this.fh.get(u.name))!==null&&d!==void 0?d:[];f.includes(o.id)||f.push(o.id),this.fh.set(u.name,f)}}))})),n?this.Ih.replace(s):this.Ih.register(s)}else{var i;n&&((i=this.Ih)==null||i.replace([]))}}Eh(e,n){n.forEach(((r,s)=>{var i,o=(i=e.get(s))!==null&&i!==void 0?i:[];r.forEach((l=>{o.includes(l)||o.push(l)})),e.set(s,o)}))}Th(e,n){var r,s,i=e.filter((d=>{var f,p;return((f=d.conditions)==null?void 0:f.events)&&((p=d.conditions)==null||(p=p.events)==null||(p=p.values)==null?void 0:p.length)>0})),o=e.filter((d=>{var f,p;return((f=d.conditions)==null?void 0:f.cancelEvents)&&((p=d.conditions)==null||(p=p.cancelEvents)==null||(p=p.values)==null?void 0:p.length)>0})),l=this.kh(e,jd.Activation),u=this.kh(e,jd.Cancellation);n?(this.hh=l,this.dh=u):(this.Eh(this.hh,l),this.Eh(this.dh,u)),(i.length!==0||o.length!==0)&&((r=this.ih)!==null&&r!==void 0||(this.ih=(s=this._instance)==null?void 0:s._addCaptureHook(((d,f)=>{this.onEvent(d,f)}))))}onEvent(e,n){var r,s,i=this.Rh(),o=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(s=n.properties)==null?void 0:s.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){var l=this.Ph(e,o);if(l==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:o}),void this.Ah([o]);if(l==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:o}),this.Fh(o),void this.Oh([o])}if(this.dh.has(e)){var u=this.Sh(e,n,jd.Cancellation);u.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:u.map((f=>f.id))}),this.Ah(u.map((f=>f.id))),u.forEach((f=>this.Lh(f.id))))}if(this.hh.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.hh.get(e)});var d=this.Sh(e,n,jd.Activation);this.Dh(d.map((f=>f.id)))}}onAction(e){this.fh.has(e)&&this.Dh(this.fh.get(e)||[])}Dh(e){var n;if(e.length!==0){var r=!((n=this._instance)==null||n.get_session_id==null||!n.get_session_id()),s=[];for(var i of e)r&&this.mh(i)?this.Fh(i)&&this.$h(i):s.push(i);s.length>0&&(this.uh=[...new Set([...this.uh,...s])]),this.Rh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Fh(e){this.uh=this.uh.filter((r=>r!==e));var n=this.Nh();return!n.includes(e)&&(this.qh([...n,e]),this.jh(),!0)}Ah(e){var n=new Set(e);this.uh=this.uh.filter((i=>!n.has(i)));var r=this.Bh(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&(this.qh(s),s.length===0&&this.Hh()),this.Oh(e)}zh(){var e,n=this.yh();if(!n)return{};var r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r&&typeof r=="object"?r:{}}$h(e){if(this.yh()){var n=this.zh();this.bh(ue({},n,{[e]:Date.now()}))}}Oh(e){if(this.yh()){var n=this.zh(),r={},s=!1;for(var i of Object.entries(n)){var o=i[0],l=i[1];e.includes(o)?s=!0:r[o]=l}s&&(fs(r)?this._h():this.bh(r))}}Uh(){this.yh()&&this._h()}getActivationTimestamp(e){if(this.Nh().includes(e)){var n=this.zh()[e];return ln(n)?n:void 0}}Bh(){var e,n=this.Wh();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}Nh(){var e,n,r=this.Bh();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this.Vh()],i=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return i&&s===i?r:[]}jh(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.Gh(n)}Hh(){this.Zh()}gh(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this.Vh()];if(r&&r!==e){var s=this.Bh(),i=this.zh();s.length>0&&(this.qh([]),s.filter((o=>ln(i[o]))).forEach((o=>this.Lh(o)))),this.Hh(),this.Uh()}}getActivatedIds(){return[...new Set([...this.Nh(),...this.uh])].filter((e=>!this.Qh(e)))}dispose(){var e,n,r;(e=this.ph)==null||e.call(this),this.ph=void 0,(n=this.ih)==null||n.call(this),this.ih=void 0,(r=this.Ih)==null||r.dispose(),this.Ih=void 0}reset(){this.uh=[],this.Bh().length>0&&this.qh([]),this.Hh(),this.Uh()}getEventToItemsMap(){return this.hh}Jh(){return this.Ih}}class m7 extends p7{constructor(e){super(e)}Wh(){return y2}Vh(){return p0}yh(){return m0}bh(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[m0]:e})}_h(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(m0)}mh(e){var n,r;this.xh((i=>{r=i.find((o=>o.id===e))}));var s=(n=r)==null||(n=n.appearance)==null?void 0:n.surveyPopupDelaySeconds;return ln(s)&&s>0}Kh(){return wo.SHOWN}xh(e){var n;(n=this._instance)==null||n.getSurveys(e)}Lh(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Rh(){return xt}qh(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[y2]:e})}Gh(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[p0]:e})}Zh(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(p0)}Qh(){return!1}Ph(e,n){var r;this.xh((i=>{r=i.find((o=>o.id===n))}));var s=!r||(function(i){var o;return GP(i)&&!((o=i.conditions)==null||(o=o.events)==null||!o.repeatedActivation)||i.schedule==="always"})(r);return s?e===wo.SHOWN?"consume":"ignore":e===wo.SHOWN?"persist":e===wo.DISMISSED||e===wo.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class v7{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);var n={};for(var r of e){var s=this._instance.get_property(r);ce(s)||(n[r]=s)}return n}set(e,n){this._instance.register(typeof e=="string"?{[e]:n}:e)}remove(e){typeof e!="string"?e.forEach((n=>this._instance.unregister(n))):this._instance.unregister(e)}}class g7{constructor(e){this._instance=e}get(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var e=De==null?void 0:De.__PosthogExtensions__;if(e){var n=e.generateSurveys,r=e.loadExternalDependency;return{generateSurveys:n?s=>n(this._instance,s):void 0,loadExternalDependency:r?s=>r(this._instance,"surveys",s):void 0}}}createEventReceiver(){return new m7(this._instance)}}var y7=ne!=null&&ne.location?lm(ne.location.hash,"__posthog")||lm(location.hash,"state"):null,p8="_postHogToolbarParams",m8=Ht("[Toolbar]"),v8=Ht("[FeatureFlags]");class _7{constructor(e,n){n===void 0&&(n=!1),this.Yh=!1,this.update(e,n)}update(e,n){this.Xh=((r,s)=>{var i,o,l,u,d;return{bootstrap:{featureFlags:(i=r.bootstrap)==null?void 0:i.featureFlags,featureFlagPayloads:(o=r.bootstrap)==null?void 0:o.featureFlagPayloads},remoteRequestsDisabled:s,featureFlagsDisabled:!!r.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!r.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!r.advanced_feature_flags_dedup_per_session,cacheTtlMs:r.feature_flag_cache_ttl_ms,refreshIntervalMs:(l=r.remote_config_refresh_interval_ms)!==null&&l!==void 0?l:3e5,requestTimeoutMs:r.feature_flag_request_timeout_ms,compression:r.disable_compression?void 0:"best-available",evaluationContexts:(u=(d=r.evaluation_contexts)!==null&&d!==void 0?d:r.evaluation_environments)!==null&&u!==void 0?u:[],flagKeys:ze(r.flag_keys)?r.flag_keys:void 0}})(e,n),!e.evaluation_environments||e.evaluation_contexts||this.Yh||(v8.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Yh=!0),ce(e.flag_keys)||ze(e.flag_keys)||v8.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Xh}}var g8=Ht("[FeatureFlags]"),ll=Ht("[FeatureFlags]",{debugEnabled:!0}),O1=`" failed. Feature flags didn't load in time.`,y8="connection_error",_8=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},w8=t=>{var e={};for(var n of v0(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},x8=t=>yw(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),ti=Ht("[Error tracking]"),$2="webkit-masked-url:",w7=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",$2],x7=["__firefox__","__gCrWeb"],b8="Refusing to render web experiment since the viewer is a likely bot",b7={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>fm(e,t),not_regex:(t,e)=>!fm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class hr{get mn(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{hr.td("retrieved web experiments from the server"),n.ed=new Map,s.forEach((i=>{if(i.feature_flag_key){var o;n.ed&&(hr.td("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=n.ed)==null||o.set(i.feature_flag_key,i));var l=n._instance.getFeatureFlag(i.feature_flag_key);at(l)&&i.variants[l]&&n.rd(i.name,l,i.variants[l].transforms)}else if(i.variants)for(var u in i.variants){var d=i.variants[u];hr.nd(d,n._instance)&&n.rd(i.name,u,d.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())hr.td(b8);else if(!this.mn.disable_web_experiments){if(et(this.ed))return this.ed=new Map,this.loadIfEnabled(),void this.previewWebExperiment();hr.td("applying feature flags",e),e.forEach((n=>{var r;if(this.ed&&(r=this.ed)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),o=(s=this.ed)==null?void 0:s.get(n);i&&o!=null&&o.variants[i]&&this.rd(o.name,i,o.variants[i].transforms)}}))}}previewWebExperiment(){var e=hr.getWindowLocation();if(e!=null&&e.search){var n=Tu(e==null?void 0:e.search,"__experiment_id"),r=Tu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(hr.td("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.sd(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.mn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.mn.disable_web_experiments&&!r)return e([]);var 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.mn.token),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}sd(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(hr.td("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.rd(s[0].name,n,s[0].variants[n].transforms))}static nd(e,n){return!et(e.conditions)&&hr.od(e,n)&&hr.ad(e)}static od(e,n){var r;if(et(e.conditions)||et((r=e.conditions)==null?void 0:r.url))return!0;var s=hr.getWindowLocation();if(s){var i,o,l,u=dP(n,s.href);return(i=e.conditions)==null||!i.url||b7[(o=(l=e.conditions)==null?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return ne==null?void 0:ne.location}static ad(e){var n;if(et(e.conditions)||et((n=e.conditions)==null?void 0:n.utm))return!0;var r=PP();if(r.utm_source){var s,i,o,l,u,d,f,p,v=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,y=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_source)==r.utm_source,w=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_medium||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,_=(f=e.conditions)==null||(f=f.utm)==null||!f.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return v&&w&&_&&y}return!1}static td(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];ge.info("[WebExperiments] "+e,r)}rd(e,n,r){this._is_bot()?hr.td(b8):n!=="control"?r.forEach((s=>{if(s.selector){var i;hr.td("applying transform of variant "+n+" for experiment "+e+" ",s);var o=(i=document)==null?void 0:i.querySelectorAll(s.selector);o==null||o.forEach((l=>{var u=l;s.html&&(u.innerHTML=s.html),s.css&&u.setAttribute("style",s.css)}))}})):hr.td("Control variants leave the page unmodified.")}_is_bot(){return Vn&&this._instance?ZP(Vn,this.mn.custom_blocked_useragents):void 0}}var Os=Ht("[Conversations]"),cl="Conversations not available yet.";function S8(t,e){var n,r,s,i,o,l,u,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,p=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,v=ce(p)?Math.max(f,2048):Math.max(f,p),y=ue({},(function(){var w="",_="";try{var x=Vn==null?void 0:Vn.userAgent;if(x){var b=$3(x);w=b[0],_=b[1]}}catch{}return(function(k,C){var P=(function(T){if(T)return{}.hasOwnProperty.call(bS,T)?bS[T]:T})(k);return ue({},P?{"os.name":P}:{},C?{"os.version":C}:{})})(w,_)})(),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=y==null?void 0:y["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=y==null?void 0:y["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(u=y==null?void 0:y["deployment.environment"])!==null&&u!==void 0?u:t==null?void 0:t.environment,resourceAttributes:y,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:p,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var S7=["debug","log","warn","error","info"],E8="console",s5="__posthogHandledLogsRequestError",L1=(t,e)=>{var n=t instanceof Error?t:new Error(e);return n[s5]=!0,n},k8=t=>!!t&&typeof t=="object"&&t[s5]===!0,qm={featureFlags:class{constructor(t){this.name="featureFlags",this.ld=!1,this.featureFlagEventHandlers=[],this.A=g8,this.ud={},this.hd={},this.dd=[],this.vd=!1,this.fd=!1,this.pd=0,this.gd=!1,this.md=!1,this.yd=!1,this.bd=!1,this._d=0,this.We=()=>{var e=this.wd();this._d=0,e&&this.reloadFeatureFlags()},this.kd=()=>{var e,n=this.Sd;ce(n)||this.mn.remoteRequestsDisabled||!fe||fe.visibilityState==="hidden"||Date.now()-((e=this.xd)!==null&&e!==void 0?e:0)<n||(this.reloadFeatureFlags(),this.Cd())},this.Ve=()=>{(fe==null?void 0:fe.visibilityState)==="visible"&&this.kd()},"get"in t?this.Ls=t:(this._instance=t,this.Td=new _7(t.config,t.pa()),this.Ls=this.Td)}updateConfig(t,e){var n;(n=this.Td)==null||n.update(t,e),this.Ns&&this.Md()}setup(t){return this.Du=t,this.A=t.logger.createLogger("[FeatureFlags]"),r5(t.kv.initialize(),(()=>{this.Du===t&&(this.Du=void 0,this.Ns=t,this.Id(t))}))}Id(t){var e;if(this.Ns===t)return ne&&Mt(ne,"online",this.We),this.Md(),this.Ed=t.registerDynamicEventProperties((()=>this.Rd()?this.ud:this.hd)),this.Pd=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.onCrossTabFeatureFlagChange((()=>{this.Ad(),this.Fd(),this.Od()})),this.Fd(),this.initialize()}Md(){var t=this.mn.refreshIntervalMs,e=!this.mn.remoteRequestsDisabled&&fe&&!ce(t)&&t>0?t:void 0;e!==this.Sd&&(this.Ld(),ce(e)||(this.Sd=e,this.Cd(),fe!=null&&fe.addEventListener&&Mt(fe,Pu,this.Ve)))}Cd(){ce(this.Sd)||(ce(this.Dd)||clearInterval(this.Dd),this.xd=Date.now(),this.Dd=setInterval(this.kd,this.Sd))}Ld(){ce(this.Dd)||(clearInterval(this.Dd),this.Dd=void 0,fe==null||fe.removeEventListener==null||fe.removeEventListener(Pu,this.Ve)),this.Sd=void 0,this.xd=void 0}destroy(){this.$d()}dispose(){this.$d()}$d(){var t,e;this.Ld(),this.pd++,this.md=!1,this.Du=void 0,this.Ns&&(this.Nd(),(t=this.Ed)==null||t.dispose(),this.Ed=void 0,(e=this.Pd)==null||e.call(this),this.Pd=void 0,this.dd=[],ne==null||ne.removeEventListener("online",this.We),this.Ns=void 0)}get mn(){return this.Ls.get()}qd(t){var e;return this.jd&&t in this.jd?this.jd[t]:(e=this.Ns)==null?void 0:e.kv.get(t)}Ad(){return!!this.jd&&(this.jd=void 0,!0)}Bd(){var t;return!ce((t=this.Ns)==null?void 0:t.kv.get(rr))&&this.Ad()}ni(t){this.Hd((()=>{var e;return(e=this.Ns)==null?void 0:e.kv.set(t)}))}zd(t,e,n){var r;if((r=this._instance)!=null&&r.persistence&&t[rr]){var s=this.qd(rr)||{},i=t[rr]||{},o=e.flags||e.featureFlags,l=e.flags?Object.entries(e.flags).filter((b=>{var k=b[1];return!(k!=null&&k.failed)})).map((b=>b[0])):[],u=!!e.errorsWhileComputingFlags&&!!e.flags,d=u?l:n&&!ze(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(s),...Object.keys(i)])),f=this.qd(li)||{},p=t[li]||{},v=u||n?d:Array.from(new Set([...Object.keys(f),...Object.keys(p)])),y=!u&&!n,w=!!y||d,_={[Ns]:w,[rr]:w,[li]:!!y||v};for(var x of(t[ha]&&(_[ha]=w),[pa,So,tu]))ce(t[x])||(_[x]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(_)}}oi(t){this.Hd((()=>{var e;return(e=this.Ns)==null?void 0:e.kv.remove(t)}))}Hd(t){try{t()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}Fd(){var t={};for(var e of[Ns,li,pa,ki]){var n=this.qd(e);ce(n)||(t[e]=n)}this.ud=t;var r=ue({},t),s=this.qd(rr);if(s)for(var i of Object.entries(s))r["$feature/"+i[0]]=i[1];this.hd=r}Rd(){var t=this.mn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.qd(So);return typeof e!="number"||Date.now()-e>t}Ud(){return!!this.Rd()&&(this.bd||this.fd||(this.bd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Wd(){var t=this.mn.evaluationContexts;return t!=null&&t.length?t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid evaluation context found:",e,"Expected non-empty string"),n})):[]}Vd(){var t=this.mn.flagKeys;if(!ce(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid flag key found:",e,"Expected non-empty string"),n}))}initialize(){var t,e,n=this.mn,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i,o=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},l=Object.keys(r).filter((d=>!ce(r[d]))).reduce(((d,f)=>(d[f]=r[f],d)),{}),u=Object.keys(o).filter((d=>l[d])).reduce(((d,f)=>(d[f]=o[f],d)),{});return this.Gd({featureFlags:l,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.qd(rr))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.qd(li))!==null&&s!==void 0?s:{},l=ue({},i,t),u=ue({},o,e),d={};for(var f of Object.entries(l)){var p=f[0],v=f[1];d[p]={key:p,enabled:gS(v),variant:yS(v),reason:void 0,metadata:ce(u==null?void 0:u[p])?void 0:{id:0,version:void 0,description:void 0,payload:u[p]}}}this.Gd({flags:d})}get hasLoadedFlags(){return this.vd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.qd(ha),e=this.qd(ki),n=this.qd(_l);if(!n&&!e)return t||{};var r=Lt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var o,l,u=r[i],d=e==null?void 0:e[i],f=ce(d)?(o=u==null?void 0:u.enabled)!==null&&o!==void 0&&o:!!d,p=ce(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,v=n==null?void 0:n[i],y=ue({},u,{enabled:f,variant:f?p??(u==null?void 0:u.variant):void 0});f!==(u==null?void 0:u.enabled)&&(y.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(y.original_variant=u==null?void 0:u.variant),v&&(y.metadata=ue({},u==null?void 0:u.metadata,{payload:v,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),r[i]=y}return this.ld||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.ld=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:gS(r),variant:yS(r),payload:vS(e[n])}}))}getFlagVariants(){var t=this.qd(rr),e=this.qd(ki);if(!e)return t||{};for(var n=Lt({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ld||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.ld=!0),n}getFlagPayloads(){var t=this.qd(li),e=this.qd(_l);if(!e)return t||{};for(var n=Lt({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ld||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.ld=!0),n}reloadFeatureFlags(){this.gd||this.mn.featureFlagsDisabled||this.wd()||(this.fd&&(this.md=!0),this.Zd||(this.dd.slice().forEach((t=>{try{t()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}})),this.Zd=setTimeout((()=>{this.Qd()}),5)))}Nd(){clearTimeout(this.Zd),this.Zd=void 0}onReloading(t){return this.dd.push(t),()=>{this.dd=this.dd.filter((e=>e!==t))}}ensureFlagsLoaded(){this.vd||this.fd||this.Zd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.gd=t}resetFlagCallReported(){this.oi(yo)}Qd(t){this.Nd();var e=this.Ns;if(e&&!this.mn.remoteRequestsDisabled&&!this.wd())if(this.fd)this.md=!0;else{var n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:ue({},e.initialPersonProperties,this.qd(as)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.qd(Mi),timezone:OP()};ce(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.mn.featureFlagsDisabled)&&(n.disable_flags=!0);var r=this.Wd();r.length&&(n.evaluation_contexts=r);var s=this.Vd();ce(s)||(n.flag_keys=s);var i=this.mn.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(i?"&only_evaluate_survey_feature_flags=true":""),l=this.pd;this.fd=!0;var u=()=>{this.md&&(this.md=!1,this.Qd())},d=f=>{this.fd=!1,l===this.pd&&(this.ni({[nu]:[y8]}),this.A.error("Feature flag request failed",f),this.Bd()&&this.Od(!0)),u()};try{e.sendRequest(o,{target:"flags",method:"POST",body:n,compression:this.mn.compression,sentAt:"body",timeoutMs:this.mn.requestTimeoutMs}).then((f=>{var p,v,y=(p=f.json)!==null&&p!==void 0?p:{},w=f.statusCode!==200;if(this.fd=!1,l===this.pd){if(this.Jd(f.statusCode),w||this.md||(this.$anon_distinct_id=void 0),!n.disable_flags||this.md){this.yd=!w;var _=[];f.error?_.push(f.error instanceof Error&&f.error.name==="AbortError"?"timeout":f.error instanceof Error?y8:"unknown_error"):f.statusCode!==200&&_.push("api_error_"+f.statusCode),y.errorsWhileComputingFlags&&_.push("errors_while_computing_flags");var x=!((v=y.quotaLimited)==null||!v.includes("feature_flags"));x&&_.push("quota_limited"),this.ni({[nu]:_}),x?this.A.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."):n.disable_flags||this.Gd(y,w,{partialResponse:i}),u()}}else u()})).catch(d)}catch(f){d(f)}}}wd(){return kP(this._d,3)}Jd(t){this._d=CP(t,this._d,3,(()=>this.A.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===void 0&&(e={}),!e.fresh||this.yd)if(this.vd||this.getFlags()&&this.getFlags().length>0){if(!this.Ud()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else this.A.warn('getFeatureFlag for key "'+t+O1)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.yd)if(this.vd||this.getFlags()&&this.getFlags().length>0){if(!this.Ud()){var n,r=this.getFlagVariants(),s=t in r,i=r[t],o=this.getFlagPayloads()[t],l=String(i),u=this.qd(pa)||void 0,d=this.qd(So)||void 0,f=this.qd(yo)||{};if(this.mn.deduplicateCallsPerSession){var p,v=(p=this.Ns)==null?void 0:p.session.sessionId,y=this.qd(Qd);v&&v!==y&&(f={},n=v)}if(e.send_event||!("send_event"in e))if(t in f&&f[t].includes(l))n&&this.ni({[yo]:f,[Qd]:n});else{var w,_,x,b,k,C,P,T,O,M,R,L;ze(f[t])?f[t].push(l):f[t]=[l],this.ni(ue({[yo]:f},n?{[Qd]:n}:{}));var D=this.getFeatureFlagDetails(t),V=[...(w=this.qd(nu))!==null&&w!==void 0?w:[]];ce(i)&&V.push("flag_missing");var j={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:o??null,$feature_flag_request_id:u,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:(_=(x=this.mn.bootstrap)==null||(x=x.featureFlags)==null?void 0:x[t])!==null&&_!==void 0?_:null,$feature_flag_bootstrapped_payload:(b=(k=this.mn.bootstrap)==null||(k=k.featureFlagPayloads)==null?void 0:k[t])!==null&&b!==void 0?b:null,$used_bootstrap_value:!this.yd};ce(D==null||(C=D.metadata)==null?void 0:C.has_experiment)||(j.$feature_flag_has_experiment=D.metadata.has_experiment),ce(D==null||(P=D.metadata)==null?void 0:P.version)||(j.$feature_flag_version=D.metadata.version);var U,X=(T=D==null||(O=D.reason)==null?void 0:O.description)!==null&&T!==void 0?T:D==null||(M=D.reason)==null?void 0:M.code;X&&(j.$feature_flag_reason=X),D!=null&&(R=D.metadata)!=null&&R.id&&(j.$feature_flag_id=D.metadata.id),ce(D==null?void 0:D.original_variant)&&ce(D==null?void 0:D.original_enabled)||(j.$feature_flag_original_response=ce(D.original_variant)?D.original_enabled:D.original_variant),D!=null&&(L=D.metadata)!=null&&L.original_payload&&(j.$feature_flag_original_payload=D==null||(U=D.metadata)==null?void 0:U.original_payload),V.length&&(j.$feature_flag_error=V.join(",")),this.Kd(j)}else n&&this.ni({[yo]:f,[Qd]:n});if(s)return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:vS(o)}}}else this.A.warn('getFeatureFlagResult for key "'+t+O1)}Kd(t){try{var e;(e=this.Ns)==null||e.capture("$feature_flag_called",t).catch((n=>{this.A.error("Failed to capture feature flag call",n)}))}catch(n){this.A.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.Yd(t,e)}Yd(t,e){var n=this;return Dt((function*(){var r=n.Ns;if(r){var s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.Wd();i.length&&(s.evaluation_contexts=i);var o,l=n.Vd();ce(l)||(s.flag_keys=l);try{var u,d=(u=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.mn.compression,sentAt:"body",timeoutMs:n.mn.requestTimeoutMs})).json)==null?void 0:u.featureFlagPayloads;o=(d==null?void 0:d[t])||void 0}catch(f){return void n.A.error("Remote config feature flag request failed",f)}try{e(o)}catch(f){n.A.error("Remote config feature flag callback failed",f)}}}))()}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.yd)return e.defaultValue;if(!(this.vd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+O1),e.defaultValue;var n=this.getFeatureFlag(t,e);return ce(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.Gd(t,e,n)}Gd(t,e,n){if(this.Ns){this.vd=!0;var r=(function(i,o,l,u,d,f){o===void 0&&(o={}),l===void 0&&(l={}),u===void 0&&(u={}),f===void 0&&(f=g8);var p=((D,V)=>{var j=D.flags;return j?ue({},D,{featureFlags:Object.fromEntries(Object.keys(j).map((U=>{var X;return[U,(X=j[U].variant)!==null&&X!==void 0?X:j[U].enabled]}))),featureFlagPayloads:Object.fromEntries(Object.keys(j).filter((U=>j[U].enabled)).filter((U=>{var X;return!ce((X=j[U].metadata)==null?void 0:X.payload)})).map((U=>{var X;return[U,(X=j[U].metadata)==null?void 0:X.payload]})))}):(D.featureFlags&&V.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),D)})(i,f),v=p.flags,y=p.featureFlags,w=p.featureFlagPayloads;if(y){var _=i.requestId,x=i.evaluatedAt;if(ze(y)){f.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var b={};if(y)for(var k=0;y.length>k;k++)b[y[k]]=!0;return{[Ns]:y,[rr]:b,[tu]:!1}}var C=y,P=w,T=v;if(d!=null&&d.partialResponse){var O=Object.keys(C),M=P||{};C=ue({},o,C),P=ue({},l,M),O.forEach((D=>{var V;D in M||(V=P)==null||delete V[D]})),T=ue({},u,T)}else if(i.errorsWhileComputingFlags)if(v){var R=new Set(Object.keys(v).filter((D=>{var V;return!((V=v[D])!=null&&V.failed)})));C=ue({},o,Object.fromEntries(Object.entries(C).filter((D=>R.has(D[0])))));var L=Object.fromEntries(Object.entries(P||{}).filter((D=>R.has(D[0]))));P=ue({},l,L),R.forEach((D=>{var V;D in L||(V=P)==null||delete V[D]})),T=ue({},u,Object.fromEntries(Object.entries(T||{}).filter((D=>R.has(D[0])))))}else C=ue({},o,C),P=ue({},l,P),T=ue({},u,T);return ue({[Ns]:Object.keys(w8(C)),[rr]:C||{},[li]:P||{},[ha]:T||{},[tu]:i.minimalFlagCalledEvents===!0},_?{[pa]:_}:{},x?{[So]:x}:{})}})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.A);if(r)if((n==null?void 0:n.persist)===!1){var s=!ce(this.Ns.kv.get(rr));this.jd=r,s||this.ni(r)}else this.Ad(),this.zd(r,t,!(n==null||!n.partialResponse)),this.ni(r);else e&&this.Bd();e||(this.bd=!1),this.Od(e)}}override(t,e){e===void 0&&(e=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Xd(t)}Xd(t){if(this.Ns){if(t===!1)return this.oi([ki,_l]),this.Od(),void ll.info("All overrides cleared");if(ze(t))return this.ni({[ki]:_8(t)}),this.Od(),void ll.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e,n=t;this.ld=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);var r={},s=n.flags,i=n.payloads;return s&&(r[ki]=ze(s)?_8(s):s),i&&(r[_l]=i),Object.keys(r).length&&this.ni(r),s===!1&&i===!1?this.oi([ki,_l]):s===!1?this.oi(ki):i===!1&&this.oi(_l),this.Od(),s===!1?ll.info("Flag overrides cleared"):s&&ll.info("Flag overrides set",{flags:s}),void(i===!1?ll.info("Payload overrides cleared"):i&&ll.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.ni({[ki]:t}),this.Od(),void ll.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.vd){var e=this.tv(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){this.A.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.qd(h0)||[]).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);var l=ue({},this.getFlagVariants(),{[t]:e});(r=this._instance)==null||(r=r.persistence)==null||r.markCrossTabFeatureFlagChanges({[Ns]:[t],[rr]:[t],[as]:Object.keys(i)}),this.ni({[Ns]:Object.keys(w8(l)),[rr]:l,[as]:ue({},this.qd(as)||{},i)}),this.Od();try{var u;(u=this.Ns)==null||u.capture("$feature_enrollment_update",o).catch((d=>{this.A.error("Failed to capture early access feature enrollment",d)}))}catch(d){this.A.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.qd(h0);!r||e?this.ev(t,n):t(r)}ev(t,e){var n=this;return Dt((function*(){var r=n.Ns;if(r){var s,i=e?"&"+e.map((l=>"stage="+l)).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+i,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n.ni({[h0]:s=o.json.earlyAccessFeatures})}catch(l){return void n.A.error("Early access feature request failed",l)}try{t(s)}catch(l){n.A.error("Early access feature callback failed",l)}}}))()}tv(){var 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)),{})}}Od(t){this.Fd();var e=this.tv(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){this.A.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0),this.iv(t,e)}iv(t,e){e===void 0&&(e=!0);var n=this.qd(as)||{},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(var o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.ni({[as]:ue({},n,i,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=ue({},this.qd(as)||{});t.forEach((r=>{delete n[r]})),this.ni({[as]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this.oi(as),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.qd(Mi)||{},r=ue({},n);for(var s of Object.keys(t))r[s]=ue({},n[s],t[s]);this.ni({[Mi]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.qd(Mi)||{};this.ni({[Mi]:ue({},e,{[t]:{}})})}else this.oi(Mi)}reset(){this.pd++,this.md=!1,this.ud={},this.hd={},this.jd=void 0,this.vd=!1,this.gd=!1,this.yd=!1,this.$anon_distinct_id=void 0,this.Nd(),this.ld=!1,this._d=0}}},E7={sessionRecording:class{get mn(){return this._instance.config}get Ba(){return this._instance.persistence}get started(){var t;return!((t=this.rv)==null||!t.isStarted)}get status(){var t,e;return this.nv===zd||this.nv===Vp?this.nv:(t=(e=this.rv)==null?void 0:e.status)!==null&&t!==void 0?t:this.nv}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.nv=Fp,this.sv=void 0,this.ov=!1,this.je=(()=>{var e;if(fe==null||!fe.visibilityState||fe.visibilityState==="visible")return!0;var n=ne==null||(e=ne.performance)==null||e.getEntriesByType==null?void 0:e.getEntriesByType("visibility-state");return!(n!=null&&n.length)||n.some((r=>r.name==="visible"))})(),this.Ve=()=>{var e;(fe==null?void 0:fe.visibilityState)==="visible"&&(this.je=!0,(e=this.rv)==null||e.setDocumentWasEverVisible==null||e.setDocumentWasEverVisible(!0))},this._instance=t,!this._instance.sessionManager)throw so.error("started without valid sessionManager"),new Error(V2+" started without valid sessionManager. This is a bug.");if(this.mn.cookieless_mode===_o)throw new Error(V2+' cannot be used with cookieless_mode="always"');fe!=null&&fe.addEventListener&&Mt(fe,"visibilitychange",this.Ve)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(t===void 0?{}:t).discardBufferedEvents,n=e!==void 0&&e;this.ov=!0,fe==null||fe.removeEventListener==null||fe.removeEventListener("visibilitychange",this.Ve),n?this.av(!0):this.stopRecording()}get lv(){var t,e=!((t=this._instance.get_property(El))==null||!t.enabled),n=!this.mn.disable_session_recording,r=this.mn.disable_session_recording||this._instance.consent.isOptedOut();return ne&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!(this.ov||this.lv&&(e=this.rv)!=null&&e.isStarted)){var n=!ce(Object.assign)&&!ce(Array.from);this.lv&&n?(this.uv(t),so.info("starting")):(this.nv=Fp,this.stopRecording())}}uv(t){var e,n;if(this.lv)if(this.nv!==zd&&this.nv!==Vp&&(this.nv=d8),De!=null&&(e=De.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=De.__PosthogExtensions__)!=null&&n.initSessionRecording)this.hv(t);else{var r,s=this._instance.sessionManager;(r=De.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.dv,(i=>{if(!this.ov&&this.lv&&this._instance.sessionManager===s)return i?(this._instance.register_for_session({[S2]:!0}),so.error("could not load recorder",i)):void this.hv(t);this.nv=Fp}))}}stopRecording(){var t,e;(t=this.sv)==null||t.call(this),this.sv=void 0,(e=this.rv)==null||e.stop()}av(t){var e,n;t===void 0&&(t=!1),(e=this.sv)==null||e.call(this),this.sv=void 0,(n=this.rv)==null||n.discard({discardProducerEvents:t})}vv(){var t,e;(t=this.Ba)==null||t.unregister(Aw),(e=this.Ba)==null||e.unregister(eP)}fv(t,e){if(et(t))return null;var n,r=ln(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(so.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}pv(t){if(this.Ba){var e,n,r=this.Ba,s=()=>{var i,o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.fv((i=this.mn.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.fv(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??u;et(d)&&this.vv();var f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[El]:ue({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:ue({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:ce(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.sv)==null||e.call(this),this.sv=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.pv(e),void this.av()):(this.pv(e),void this.startIfEnabledOrStop()):(this.nv===zd&&(this.nv=Vp,so.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.rv)!=null&&n.log?this.rv.log(t,e):so.warn("log called before recorder was ready")}get dv(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(El);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}gv(){var t,e=this._instance.get_property(El);if(!e)return!1;try{t=typeof e=="object"?e:JSON.parse(e)}catch(n){return so.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!et(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}hv(t){var e,n,r;if(!this.ov&&this.lv&&this._instance.sessionManager){if((e=De.__PosthogExtensions__)==null||!e.initSessionRecording)return so.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[S2]:!0});var s;if(this.rv||(this.rv=(s=De.__PosthogExtensions__)==null?void 0:s.initSessionRecording(this._instance,this.je),this.rv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.gv())return this.nv===Vp||this.nv===zd?void 0:(this.nv=zd,so.info("persisted remote config is stale, requesting fresh config before starting"),void new LP(this._instance).load());this.nv=d8,(n=(r=this.rv).setDocumentWasEverVisible)==null||n.call(r,this.je),this.rv.start(t)}else this.nv=Fp}onRRwebEmit(t){var e;(e=this.rv)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.rv||(e=this.Ba)==null||e.register({[nP]:!0}),(t=this.rv)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.rv||(e=this.Ba)==null||e.register({[tP]:!0}),(t=this.rv)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.rv||(n=this.Ba)==null||n.register({[t==="url"?rP:sP]:!0}),(e=this.rv)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.rv)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.rv)==null||!n.tryAddCustomEvent(t,e))}}},k7={autocapture:class extends i7{constructor(t){super(new o7(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.mv=this.yv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.bv();return!!(t.path||t.search||this._v(t))}startIfEnabled(){this.isEnabled&&(ge.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.mv=this.yv(),this.startIfEnabled()}stop(){this.wv&&this.wv(),this.wv=void 0,this.Sv&&this.Sv(),this.Sv=void 0,ge.info("History API monitoring stopped")}monitorHistoryChanges(){ne&&ne.history&&(this.xv("pushState"),this.xv("replaceState"),this.Cv(),this._v()&&this.Tv())}xv(t){var e;if(ne&&((e=ne.history[t])==null||!e.__posthog_wrapped__)){var n=this;n5(ne.history,t,(r=>function(s,i,o){r.call(this,s,i,o),n.Mv(t)}))}}yv(){var t=ne==null?void 0:ne.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}bv(){var t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:ot(t)?t:{}}_v(t){return t===void 0&&(t=this.bv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Iv(t){var e=this.bv(),n=this.mv;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this._v(e)&&t.hash!==n.hash))}Mv(t){try{var e=this.yv();if(!e)return;this.Iv(e)&&this._instance.capture(Wc,{navigation_type:t}),this.mv=e}catch(n){ge.error("Error capturing "+t+" pageview",n)}}Cv(){if(!this.wv){var t=()=>{this.Mv("popstate")};Mt(ne,"popstate",t),this.wv=()=>{ne&&ne.removeEventListener("popstate",t)}}}Tv(){if(!this.Sv){var t=()=>{this.Mv("hashchange")};Mt(ne,"hashchange",t),this.Sv=()=>{ne&&ne.removeEventListener("hashchange",t)}}}},heatmaps:class{get mn(){return this.instance.config}constructor(t){var e;this.Ev=!1,this.Rs=!1,this.Rv=null,this.instance=t,this.Ev=!((e=this.instance.persistence)==null||!e.props[u2]),this.rageclicks=new t5(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return ot(this.mn.capture_heatmaps)&&this.mn.capture_heatmaps.flush_interval_milliseconds&&(t=this.mn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return et(this.mn.capture_heatmaps)?et(this.mn.enable_heatmaps)?this.Ev:this.mn.enable_heatmaps:this.mn.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;u7.info("starting..."),this.Pv(),this.Ve()}else{var t;clearInterval((t=this.Rv)!==null&&t!==void 0?t:void 0),this.Av(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[u2]:n}),this.Ev=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.De;return this.De=void 0,t}Fv(t){I1(t.originalEvent)&&this.Xi(t.originalEvent,"deadclick")}Ve(){this.Rv&&clearInterval(this.Rv),this.Rv=(fe==null?void 0:fe.visibilityState)==="visible"?setInterval(this.Pa.bind(this),this.flushIntervalMilliseconds):null}Pv(){ne&&fe&&(this.Ov=this.Pa.bind(this),Mt(ne,sm,this.Ov),this.Lv=t=>this.Xi(t||(ne==null?void 0:ne.event)),Mt(fe,"click",this.Lv,{capture:!0}),this.Dv=t=>this.$v(t||(ne==null?void 0:ne.event)),Mt(fe,"mousemove",this.Dv,{capture:!0}),this.Nv=new HS(this.instance,vN,this.Fv.bind(this)),this.Nv.startIfEnabledOrStop(),this.qv=this.Ve.bind(this),Mt(fe,Pu,this.qv),this.Rs=!0)}Av(){var t;ne&&fe&&(this.Ov&&ne.removeEventListener(sm,this.Ov),this.Lv&&fe.removeEventListener("click",this.Lv,{capture:!0}),this.Dv&&fe.removeEventListener("mousemove",this.Dv,{capture:!0}),this.qv&&fe.removeEventListener(Pu,this.qv),clearTimeout(this.jv),(t=this.Nv)==null||t.stop(),this.Rs=!1)}Bv(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,u){for(var d=o;d&&Ea(d)&&!ps(d,"body");){if(d===u)return!1;var f=void 0;try{var p,v,y;f=(p=(v=(y=d.ownerDocument)==null?void 0:y.defaultView)!==null&&v!==void 0?v:ne)==null?void 0:p.getComputedStyle(d).position}catch{return!1}if(Ye(l,f))return!0;d=gP(d)}return!1})(T2(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Xi(t,e){var n;if(e===void 0&&(e="click"),!IS(t.target)&&I1(t)){var r=this.Bv(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&_P(T2(t),this.instance.config.rageclick)&&this.ks(ue({},r,{type:"rageclick"})),this.ks(r)}}$v(t){!IS(t.target)&&I1(t)&&(clearTimeout(this.jv),this.jv=setTimeout((()=>{this.ks(this.Bv(t,"mousemove"))}),500))}ks(t){if(ne){var e=this.mn.disable_capture_url_hashes?Sa(ne.location.href):ne.location.href,n=this.mn.custom_personal_data_properties,r=this.mn.mask_personal_data_properties?[...Ru,...n||[]]:[],s=Cf(e,r,Pf);this.De=this.De||{},this.De[s]||(this.De[s]=[]),this.De[s].push(t)}}Pa(){this.De&&!fs(this.De)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:HS,webVitalsAutocapture:class{constructor(t){var e;this.Ev=!1,this.Rs=!1,this.De={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Hv=()=>{clearTimeout(this.zv),this.zv=void 0,this.De.metrics.length!==0&&(this._instance.capture("$web_vitals",ue({$current_url:this.De.url},this.De.metrics.reduce(((n,r)=>ue({},n,{["$web_vitals_"+r.name+"_event"]:ue({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{}))),this.De={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uv=n=>{var r;if(this.De=this.De||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},et(n==null?void 0:n.name)||et(n==null?void 0:n.value))al.error("Invalid metric received",n);else{var s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.Wv(s);if(!ce(i)){var o=ln(n.navigationId)||typeof n.navigationId=="string"?"navigation:"+n.navigationId:"url:"+i;if(!this.Vv||this.Vv>n.value){this.De.navigationKey!==o&&(this.Hv(),this.zv=setTimeout(this.Hv,this.flushToCaptureTimeoutMs)),ce(this.De.navigationKey)&&(this.De.navigationKey=o,this.De.url=i),this.De.firstMetricTimestamp=ce(this.De.firstMetricTimestamp)?Date.now():this.De.firstMetricTimestamp;var l=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),u=ue({},n,s?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,ot(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){var d={};for(var f of c7){var p=f==="url"&&typeof n.attribution[f]=="string"?this.Wv(n.attribution[f]):n.attribution[f];ce(p)||(d[f]=p)}u.attribution=d}else delete u.attribution;ce(l)||(u.$session_id=l.sessionId,u.$window_id=l.windowId),this.De.metrics.push(u),this.De.metrics.length===this.allowedMetrics.length&&this.Hv()}else al.error("Ignoring metric with value >= "+this.Vv,n)}}},this.Gv=()=>{if(!this.Rs){var n,r,s,i,o=!1,l=De.__PosthogExtensions__,u=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.Zv])||(this.Zv==="web-vitals"&&ce(u)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!ce(d)){var f=d.withoutAttribution,p=this.attributionMetrics;o=!ce(f),n=p.indexOf("LCP")>-1?d.onLCP:(f==null?void 0:f.onLCP)||d.onLCP,r=p.indexOf("CLS")>-1?d.onCLS:(f==null?void 0:f.onCLS)||d.onCLS,s=p.indexOf("FCP")>-1?d.onFCP:(f==null?void 0:f.onFCP)||d.onFCP,i=p.indexOf("INP")>-1?d.onINP:(f==null?void 0:f.onINP)||d.onINP}if(n&&r&&s&&i){var v={reportSoftNavs:this.useSoftNavs},y=o&&this.attributionMetrics.indexOf("INP")>-1?ue({},v,{includeProcessedEventEntries:!1}):v;this.allowedMetrics.indexOf("LCP")>-1&&n(this.Uv.bind(this),v),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Uv.bind(this),v),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Uv.bind(this),v),this.allowedMetrics.indexOf("INP")>-1&&i(this.Uv.bind(this),y),this.Rs=!0}else al.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Ev=!((e=this._instance.persistence)==null||!e.props[p2]),this.startIfEnabled()}get Qv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=ot(this.Qv)?(t=this.Qv)==null?void 0:t.web_vitals_allowed_metrics:void 0;return et(n)?((e=this._instance.persistence)==null?void 0:e.props[v2])||u8:n}get flushToCaptureTimeoutMs(){return(ot(this.Qv)?this.Qv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=ot(this.Qv)?this.Qv.web_vitals_attribution:void 0;return Er(t)?t?u8:[]:ze(t)?t:l7}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=ot(this.Qv)?this.Qv.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Vv(){var t=ot(this.Qv)&&ln(this.Qv.__web_vitals_max_value)?this.Qv.__web_vitals_max_value:c8;return t>0&&6e4>=t?c8:t}get isEnabled(){var t=qt==null?void 0:qt.protocol;if(t!=="http:"&&t!=="https:")return al.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=ot(this.Qv)?this.Qv.web_vitals:Er(this.Qv)?this.Qv:void 0;return Er(e)?e:this.Ev}startIfEnabled(){this.isEnabled&&!this.Rs&&(al.info("enabled, starting..."),this.Ys(this.Gv))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=ot(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ot(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[p2]:n}),this._instance.persistence.register({[v2]:r})),this.Ev=n,this.startIfEnabled()}}}get Zv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ys(t){var e=De.__PosthogExtensions__,n=this.Zv,r=e==null?void 0:e.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n==="web-vitals"&&ce(r)&&e!=null&&e.postHogWebVitalsCallbacks?t():e==null||e.loadExternalDependency==null||e.loadExternalDependency(this._instance,n,(s=>{s?al.error("failed to load script",s):t()}))}Wv(t){var e=t||(ne==null?void 0:ne.location.href);if(e){var n=this._instance.config.disable_capture_url_hashes?Sa(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Ru,...r||[]]:[];return Cf(n,s,Pf)}al.error("Could not determine current URL")}}},C7={exceptionObserver:class{constructor(t){var e;this.Gv=()=>{var n;if(ne&&this.isEnabled&&(n=De.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=De.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=De.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=De.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Jv&&this.mn.capture_unhandled_errors&&(this.Jv=r(this.captureException.bind(this))),!this.Kv&&this.mn.capture_unhandled_rejections&&(this.Kv=s(this.captureException.bind(this))),!this.Yv&&this.mn.capture_console_errors&&(this.Yv=i(this.captureException.bind(this)))}catch(o){Hd.error("failed to start",o),this.Xv()}}},this._instance=t,this.tc=!((e=this._instance.persistence)==null||!e.props[d2]),this.wt=new rD(ue({},(function(n){var r,s,i,o;return n===void 0&&(n={}),{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,A:Hd})),this.mn=this.ec(),this.startIfEnabledOrStop()}ec(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ot(t)?e=ue({},e,t):(ce(t)?this.tc:t)&&(e=ue({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.mn.capture_console_errors||this.mn.capture_unhandled_errors||this.mn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Hd.info("enabled"),this.Xv(),this.Ys(this.Gv)):this.Xv()}Ys(t){var e,n;(e=De.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=De.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Hd.error("failed to load script",r);t()}))}Xv(){var t,e,n;(t=this.Jv)==null||t.call(this),this.Jv=void 0,(e=this.Kv)==null||e.call(this),this.Kv=void 0,(n=this.Yv)==null||n.call(this),this.Yv=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.tc=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[d2]:this.tc}),this.mn=this.ec(),this.startIfEnabledOrStop())}}onConfigChange(){this.mn=this.ec()}captureException(t){try{var e,n,r,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(s))return void Hd.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.ic=[],this.rc=new _D([new PD,new ND,new TD,new AD,new LD,new OD,new ID,new DD],(function(r){for(var s=arguments.length,i=new Array(s>1?s-1:0),o=1;s>o;o++)i[o-1]=arguments[o];return function(l,u){u===void 0&&(u=0);for(var d=[],f=l.split(`
19
- `),p=u;f.length>p;p++){var v=f[p];if(1024>=v.length){var y=mS.test(v)?v.replace(mS,"$1"):v;if(!y.match(/\S*Error: /)){for(var w of i){var _=w(y,r);if(_){d.push(_);break}}if(d.length>=50)break}}}return(function(x){if(!x.length)return[];var b=Array.from(x);return b.reverse(),b.slice(0,50).map((k=>{return ue({},k,{filename:k.filename||(C=b,C[C.length-1]||{}).filename,function:k.function||Cu});var C}))})(d)}})("web:javascript",SD,CD)),this._instance=t,this.ic=(e=(n=this._instance.persistence)==null?void 0:n.get_property(f2))!==null&&e!==void 0?e:[],this.nc=J0(this.sc()),this.oc=new FD(this.nc)}onConfigChange(){this.nc=J0(this.sc()),this.oc.setConfig(this.nc)}onRemoteConfig(t){var e,n,r;if(t.ok){var s=t.config;if("errorTracking"in s){var i=(e=(n=s.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.ic=i,this._instance.persistence&&this._instance.persistence.register({[f2]:this.ic,[h2]:o})}}}get ac(){var t,e=!!this._instance.get_property(h2),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.rc.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.nc.enabled)try{if(!at(t)||t.trim().length===0)return void ti.warn("Ignoring exception step because message must be a non-empty string");var n=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var o=[];return{sanitizedProperties:Object.keys(i).reduce(((l,u)=>jD.has(u)?(o.push(u),l):(l[u]=i[u],l)),{}),droppedKeys:o}})(this.lc(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&ti.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.oc.add(ue({[X0]:t,[Q0]:new Date().toISOString()},r))}catch(i){ti.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.uc(e)){if(this.hc(e))return this.dc("Exception dropped: matched a suppression rule"),void ti.info("Skipping exception capture because a suppression rule matched");if(!this.ac&&this.vc(e))return this.dc("Exception dropped: thrown by a browser extension"),void ti.info("Skipping exception capture because it was thrown by an extension");if(!this.ac&&this.cc(e))return this.dc("Exception dropped: thrown by an injected browser script"),void ti.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.fc(e))return this.dc("Exception dropped: thrown by the PostHog SDK"),void ti.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.nc.enabled&&et(t.$exception_steps)?this.gc(t):t,r=typeof(i=globalThis._posthogReleaseId)=="string"&&i.length>0?i:void 0;r&&(n.$release_id=r);try{var s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",gu:!0});return s&&this.oc.clear(),s}catch(o){return x8(o)||ti.error("Failed to capture exception event. Dropping this exception.",o),void this.oc.clear()}}catch(o){return void(x8(o)||ti.error("Failed to process exception event. Ignoring this exception.",o))}var i}gc(t){try{var e=this.oc.getAttachable();return e.length===0?t:ue({},t,{$exception_steps:e})}catch(n){return ti.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}dc(t){this.nc.enabled&&this.oc.add({[X0]:t,[Q0]:new Date().toISOString()})}lc(t){return ot(t)?ue({},t):{}}sc(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}hc(t){if(t.length===0)return!1;try{var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return at(s)&&s.length>0&&n.$exception_types.push(s),at(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.ic.some((n=>{var r=n.values.map((s=>{var i=KP[s.operator],o=e[s.key];if(!i||!o)return!1;var l=ze(s.value)?s.value:[s.value];return l.length>0&&i(l,o)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}catch(n){return ti.warn("Failed to evaluate suppression rules. Capturing the exception.",n),!1}}vc(t){var e=t.flatMap((r=>{var s,i;return(s=(i=r.stacktrace)==null?void 0:i.frames)!==null&&s!==void 0?s:[]})),n=e.filter((r=>{var s=r.filename;return!!s&&w7.some((i=>s.startsWith(i)))}));return n.length!==0&&(!n.every((r=>{var s=r.filename;return!!s&&s.startsWith($2)}))||t.some((r=>{var s=r.value;return at(s)&&s.includes("isolatedAPI.contexts.topHostname")}))&&!e.some((r=>{var s=r.filename;return r.in_app&&!(s!=null&&s.startsWith($2))})))}cc(t){return t.some((e=>{var n=e.value;return at(n)&&x7.some((r=>n.includes(r)))}))}fc(t){if(t.length>0){var e,n,r,s,i=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}uc(t){return!et(t)&&ze(t)}}},P7=ue({productTours:class{get Ba(){return this._instance.persistence}constructor(t){this.mc=null,this.yc=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.Ba&&this.Ba.register({[Pw]:!!e.productTours}),!M1(this._instance))return!this.mc&&et((n=this.Ba)==null?void 0:n.props[Xd])||$p.info("product tours disabled; stopping and clearing cached tours"),(r=this.mc)==null||r.stop(),this.mc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.mc&&M1(this._instance)&&this.Ys((()=>this.bc()))}Ys(t){var e,n;(e=De.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=De.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?$p.error("Could not load product tours script",r):t()}))}bc(){var t;!this.mc&&(t=De.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.mc=De.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!ze(this.yc)||e){var n=this.Ba;if(n){var r=n.props[Xd];if(ze(r)&&!e)return this.yc=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:s=>{if(M1(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var o="Product Tours API could not be loaded, status: "+i;return i===0?s.error||$p.warn(o):$p.error(o),void t([],{isLoaded:!1,error:o})}var l=ze(s.json.product_tours)?s.json.product_tours:[];this.yc=l,n&&n.register({[Xd]:l}),t(l,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.yc,{isLoaded:!0})}getActiveProductTours(t){et(this.mc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.mc.getActiveProductTours(t)}showProductTour(t){var e;(e=this.mc)==null||e.showTourById(t)}previewTour(t){this.mc?this.mc.previewTour(t):this.Ys((()=>{var e;this.bc(),(e=this.mc)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.mc)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.mc)==null||t.nextStep()}previousStep(){var t;(t=this.mc)==null||t.previousStep()}clearCache(){var t;this.yc=null,(t=this.Ba)==null||t.unregister(Xd)}resetTour(t){var e;(e=this.mc)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.mc)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.mc)==null||e.cancelPendingTour(t)}}},qm),A7={siteApps:class{constructor(t){this._c=0,this._instance=t,this.wc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}kc(t,e){if(e){var n=this.globalsForEvent(e);this.wc.push(n),this.wc.length>1e3&&(this.wc=this.wc.slice(10))}}get siteAppLoaders(){var t;return(t=De._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.kc.bind(this));this.Sc=()=>{t(),this.wc=[],this.Sc=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");var u={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(f)){var v=p[0];u[v]={id:d[v],type:v,properties:p[1]}}var y=t.$set_once,w=t.$set;return{event:ue({},p3(t,d7),{properties:ue({},t.properties,w?{$set:ue({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},w)}:{},y?{$set_once:ue({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},y)}:{}),elements_chain:(i=(o=t.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}xc(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(wi.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)||(wi.error("prepare_external_dependency_script returned null"),null):t}Cc(){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()=>{};var u=fe==null?void 0:fe.defaultView,d=u==null||(t=u.Node)==null?void 0:t.prototype;if(!u||!d)return()=>{};if(this._c++,this.Tc)return this.Mc();var f=[],p=this,v=new WeakSet,y=(x,b,k)=>{if(x!=null&&x[b]){var C=x[b];x[b]=k(C),f.push((()=>{x[b]=C}))}},w=x=>{if(v.has(x))return x;var b=p.xc(x);return b&&v.add(b),b},_=x=>x.map((b=>typeof b=="string"?b:w(b))).filter((b=>!sn(b)));return y(d,"appendChild",(x=>function(b){var k=w(b);return k?x.call(this,k):b})),y(d,"insertBefore",(x=>function(b,k){var C=w(b);return C?x.call(this,C,k):b})),y(d,"replaceChild",(x=>function(b,k){var C=w(b);return C?x.call(this,C,k):k})),[(e=u.Element)==null?void 0:e.prototype,(n=u.Document)==null?void 0:n.prototype,(r=u.DocumentFragment)==null?void 0:r.prototype].forEach((x=>{y(x,"append",(b=>function(){for(var k=arguments.length,C=new Array(k),P=0;k>P;P++)C[P]=arguments[P];return b.apply(this,_(C))})),y(x,"prepend",(b=>function(){for(var k=arguments.length,C=new Array(k),P=0;k>P;P++)C[P]=arguments[P];return b.apply(this,_(C))}))})),[(s=u.Element)==null?void 0:s.prototype,(i=u.CharacterData)==null?void 0:i.prototype,(o=u.DocumentType)==null?void 0:o.prototype].forEach((x=>{y(x,"before",(b=>function(){for(var k=arguments.length,C=new Array(k),P=0;k>P;P++)C[P]=arguments[P];return b.apply(this,_(C))})),y(x,"after",(b=>function(){for(var k=arguments.length,C=new Array(k),P=0;k>P;P++)C[P]=arguments[P];return b.apply(this,_(C))})),y(x,"replaceWith",(b=>function(){for(var k=arguments.length,C=new Array(k),P=0;k>P;P++)C[P]=arguments[P];var T=_(C);return C.length&&!T.length?void 0:b.apply(this,T)}))})),y((l=u.Element)==null?void 0:l.prototype,"insertAdjacentElement",(x=>function(b,k){var C=w(k);return C?x.call(this,b,C):null})),this.Tc=()=>{f.forEach((x=>x())),this.Tc=void 0},this.Mc()}Mc(){var t=!1;return()=>{var e;t||(t=!0,this._c--,this._c===0&&((e=this.Tc)==null||e.call(this)))}}Ic(t,e){e===void 0&&(e=!0);var n=this.Cc();try{var r=t(n);return e&&n(),r}catch(s){throw n(),s}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var o;!e.errored&&this.wc.length&&(wi.info("Processing "+this.wc.length+" events for site app with id "+t.id),this.wc.forEach((l=>this.Ic((()=>e.processEvent==null?void 0:e.processEvent(l))))),e.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((o=this.Sc)==null||o.call(this))},r=!1,s=o=>{e.errored=!o,e.loaded=!0,wi.info("Site app with id "+t.id+" "+(o?"loaded":"errored")),r&&n()};try{var i=this.Ic((o=>t.init({posthog:this._instance,callback(l){o(),s(l)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(o){wi.error(f8+t.id,o),s(!1)}if(r&&e.loaded)try{n()}catch(o){wi.error("Error while processing buffered events PostHog app with config id "+t.id,o),e.errored=!0}}Ec(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}Rc(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.Ic((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(o){wi.error("Error while processing event "+t.event+" for site app "+i.id,o)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.Ec(),void this._instance.on("eventCaptured",(u=>this.Rc(u)))):void wi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Sc)==null||n.call(this),t.ok){var i=t.config;if((r=i.siteApps)!=null&&r.length)if(this.isEnabled){var o=function(){var u,d=l.id,f=l.url;De["__$$ph_site_app_"+d]=s._instance,(u=De.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,f,(p=>{if(p)return wi.error(f8+d,p)}))};for(var l of i.siteApps)o()}else wi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},T7={tracingHeaders:class{constructor(t){this.Pc=void 0,this.Ac=void 0,this.Fc=void 0,this.Gv=()=>{var e,n,r=this.Oc();r?(ce(this.Pc)&&(this.Pc=(e=De.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),ce(this.Ac)&&(this.Ac=(n=De.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Xv()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Ys(t){var e,n;(e=De.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=De.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return a7.error("failed to load script",r);t()}))}Lc(){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}Oc(){var t=this.Lc();return ze(t)?(ze(this.Fc)?this.Fc.splice(0,this.Fc.length,...t):this.Fc=[...t],t.length>0?this.Fc:void 0):(ze(this.Fc)&&this.Fc.splice(0),this.Fc=t||void 0,this.Fc)}Xv(){var t,e;(t=this.Pc)==null||t.call(this),(e=this.Ac)==null||e.call(this),this.Pc=void 0,this.Ac=void 0}startIfEnabledOrStop(){this.Oc()?this.Ys(this.Gv):this.Xv()}}},R7=ue({surveys:class extends f7{constructor(t){var e;super(new g7(t),{get projectToken(){return e.config.token},kv:new v7(e=t)}),this._instance=t}Bu(t,e){var n=e.query?rh(t,e.query):t;return new Promise((r=>{var s;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((s=e.target)!==null&&s!==void 0?s:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:r})}))}}},qm),I7={toolbar:class{constructor(t){this.instance=t}Dc(t){De.ph_toolbar_state=t}$c(){var t;return(t=De.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),C2(this.instance.config)||!ne||!fe)return!1;t=t??ne.location,n=n??ne.history;try{if(!e){try{ne.localStorage.setItem("test","test"),ne.localStorage.removeItem("test")}catch{return!1}e=ne==null?void 0:ne.localStorage}var r,s=y7||lm(t.hash,"__posthog")||lm(t.hash,"state"),i=s?PS((()=>JSON.parse(atob(decodeURIComponent(s)))))||PS((()=>JSON.parse(decodeURIComponent(s)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?t.hash=i.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(p8)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Nc(t){var e=De.ph_load_toolbar||De.ph_load_editor;!et(e)&&mr(e)?e(t,this.instance):m8.warn("No toolbar load function found")}loadToolbar(t){var e=!(fe==null||!fe.getElementById(fP));if(!ne||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=ue({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ne.localStorage.setItem(p8,JSON.stringify(ue({},r,{source:void 0}))),this.$c()===2)this.Nc(r);else if(this.$c()===0){var s;this.Dc(1),(s=De.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return m8.error("[Toolbar] Failed to load",i),void this.Dc(0);this.Dc(2),this.Nc(r)})),Mt(ne,"turbolinks:load",(()=>{this.Dc(0),this.loadToolbar(r)}))}return!0}qc(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},M7=ue({experiments:hr},qm),O7={conversations:class{constructor(t){this.jc=void 0,this._conversationsManager=null,this.Bc=!1,this.zt=null,this.Hc=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.zc=t.ok,t.ok)){var e=t.config.conversations;et(e)||(Er(e)?this.jc=e:(this.jc=e.enabled,this.zt=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.jc=void 0,this.zt=null,this.zc=void 0,this.Hc=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Bc||this._instance.config.disable_conversations||C2(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=De==null?void 0:De.__PosthogExtensions__;if(t&&!ce(this.jc)&&this.jc)if(this.zt&&this.zt.token){this.Bc=!0;try{var e=t.initConversations;if(e)return this.Uc(e),void(this.Bc=!1);var n=t.loadExternalDependency;if(!n)return void this.Wc(Tw);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.Wc("Could not load conversations script",r):this.Uc(t.initConversations),this.Bc=!1}))}catch(r){this.Wc("Error initializing conversations",r),this.Bc=!1}}else Os.error("Conversations enabled but missing token in remote config.")}}Uc(t){if(this.zt)try{this._conversationsManager=t(this.zt,this._instance),this.Hc=!1,Os.info("Conversations loaded successfully")}catch(e){this.Wc("Error completing conversations initialization",e)}else Os.error("Cannot complete initialization: remote config is null")}Wc(t,e){Os.error(t,e),this._conversationsManager=null,this.Bc=!1,this.Hc=!0}show(){this._conversationsManager?this._conversationsManager.show():Os.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.jc===!0&&!sn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":C2(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.zc===!1?"remote_config_failed":ce(this.jc)?this.zc?"disabled_in_project":"remote_config_pending":this.jc?et(this.zt)||!this.zt.token?"missing_token":De!=null&&De.__PosthogExtensions__?this.Bc?"initializing":this.Hc?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return Dt((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Os.warn(cl),null)}))()}getMessages(t,e){var n=this;return Dt((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Os.warn(cl),null)}))()}markAsRead(t){var e=this;return Dt((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Os.warn(cl),null)}))()}getTickets(t){var e=this;return Dt((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Os.warn(cl),null)}))()}requestRestoreLink(t){var e=this;return Dt((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Os.warn(cl),null)}))()}restoreFromToken(t){var e=this;return Dt((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Os.warn(cl),null)}))()}restoreFromUrlToken(){var t=this;return Dt((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Os.warn(cl),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Cu(){var t;(t=this._conversationsManager)==null||t.setIdentity()}Tu(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},L7={logs:class{constructor(t){var e,n=this;this.name="logs",this.Vc=!1,this.Gc=!1,this.Zc=!1,this.A=Ht("[logs]"),this.Qc=ue({},this.A,{error(){for(var r=arguments.length,s=new Array(r),i=0;r>i;i++)s[i]=arguments[i];s.some(k8)||n.A.error(...s)}}),this.ba=[],this.Jc=[],this._d=0,this.Os=!1,this.Kc=[],this.Yc=[],this.Xc=!1,this.tf=!1,this.ef=()=>{var r,s;this.Os||(this._d=0,(r=this.if)==null||r.onReconnect(),(s=this.rf)==null||s.onReconnect())},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Vc=!0),ne&&Mt(ne,"online",this.ef)}nf(t,e,n,r){var s,i=S8((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new GD(this.sf(t,e),i,this.Qc,(()=>this.af()),(o=>o()),void 0,r),i]}lf(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.if||this.uf!==e){var n;(n=this.if)==null||n.reset(),this.uf=e;var r=this.nf((()=>this.ba),(s=>{this.ba=s}));this.if=r[0],this.hf=r[1]}return this.if}df(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.rf||this.vf!==e){var n;(n=this.rf)==null||n.reset(),this.vf=e;var r=this.nf((()=>this.Jc),(s=>{this.Jc=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},E8);this.rf=r[0],this.cf=r[1]}return this.rf}setup(t){var e;if(!this.Os){this.Ns=t,(e=this._instance)!=null&&(e=e.config)!=null&&(e=e.logs)!=null&&e.captureConsoleLogs&&(this.Vc=!0),(this.Vc||this.ff()&&this.pf())&&this.gf();var n=!1,r=t.onRemoteConfig((s=>{var i;n=s.ok&&((i=s.config.logs)==null?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)}));this.Os?r.dispose():(this.qs=r,n||this.loadIfEnabled())}}dispose(){var t,e,n,r;this.Os||(this.Os=!0,this.mf(),(t=this.qs)==null||t.dispose(),this.qs=void 0,this.Ns=void 0,this.Zc=!1,ne==null||ne.removeEventListener("online",this.ef),(e=this.yf)==null||e.call(this),this.yf=void 0,(n=this.if)==null||n.reset(),(r=this.rf)==null||r.reset())}onRemoteConfig(t){var e,n;if(!this.Os){var r=t.ok?(e=t.config.logs)==null?void 0:e.captureConsoleLogs:void 0;et(r)?this.bf():((n=this._instance)==null||(n=n.persistence)==null||n.register({[m2]:!!r}),r?(this.Vc=!0,this.Gc||this.gf(),this.loadIfEnabled()):this.bf())}}reset(){var t,e,n,r;this.mf(),(t=this.if)==null||t.clearQueue(),this.ba=[],(e=this.if)==null||e.reset(),(n=this.rf)==null||n.clearQueue(),this.Jc=[],(r=this.rf)==null||r.reset(),this._d=0}captureLog(t){this.Os||this.lf().captureLog(t)}captureConsoleLog(t){this.Os||this.df().captureLog(t)}captureBufferedConsoleLog(t,e,n){this.Os||this.df().captureLog(t,{context:e,occurredAtMs:n})}pf(){var t;return!((t=this._instance)==null||(t=t.persistence)==null||(t=t.props)==null||!t[m2])}ff(){var t,e;return(t=this._instance)==null||t.pa==null||!t.pa()||!((e=De._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null||!e.config)}Iu(){var t;this.mf(),(t=this.rf)==null||t.clearQueue(),this.Jc=[]}bf(){this.Vc||this.mf()}gf(){var t,e=this;if(!this.Xc&&De!=null&&De.console){var n=S8((t=this._instance)==null||(t=t.config)==null?void 0:t.logs).maxBufferSize,r=function(i){var o;try{o=(l=>{for(;(u=l)!=null&&u.__rrweb_original__;){var u;l=l.__rrweb_original__}return l})(De.console[i])}catch{return 0}if(!o)return 0;e.Yc.push(n5(De.console,i,(l=>{var u=function(){for(var d=arguments.length,f=new Array(d),p=0;d>p;p++)f[p]=arguments[p];try{e._f(i,f,n)}catch{}return l.apply(De.console,f)};return u.__rrweb_original__=o,u})))};for(var s of S7)r(s);this.Xc=!0,this.wf=setTimeout((()=>{this.mf()}),3e4)}}_f(t,e,n){var r;if(this.Xc&&!this.tf&&e.length!==0)if((r=this._instance)!=null&&r.is_capturing()){if(n>this.Kc.length){this.tf=!0;try{this.Kc.push({level:t,args:e,occurredAtMs:Date.now(),context:this.af()})}finally{this.tf=!1}}}else this.mf()}mf(){if(this.Kc=[],this.Xc){for(var t of(this.Xc=!1,this.wf&&(clearTimeout(this.wf),this.wf=void 0),this.Yc))t();this.Yc=[]}}kf(){var t=this.Kc;return this.mf(),t}get logger(){return this.Sf||(this.Sf={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.Sf}flushLogs(t){t?this.xf(t):(this.if&&this.if.flush().catch((e=>this.Cf(e))),this.rf&&this.rf.flush().catch((e=>this.Cf(e))))}Cf(t){k8(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.Os&&this.Vc&&!this.Gc&&!this.Zc){var t=De==null?void 0:De.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.mf();var e=t.loadExternalDependency;if(!e)return this.A.error(Tw),void this.mf();this.Zc=!0;try{e(this._instance,"logs",(n=>{if(this.Zc=!1,!this.Os&&this.Vc){var r=t.logs;if(n||r==null||!r.initializeLogs)this.A.error("Could not load logs script",n),this.mf();else{var s,i,o=this.kf();this.yf=r.initializeLogs((s=this.Ns)!==null&&s!==void 0?s:this._instance),this.Gc=!0,o.length>0&&(r.replayConsoleBuffer==null||r.replayConsoleBuffer((i=this.Ns)!==null&&i!==void 0?i:this._instance,o))}}}))}catch(n){throw this.Zc=!1,n}}}sf(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Ci.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Ci.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},hs:r=>this.hs(r),getLibraryId:()=>Ot.LIB_NAME,getLibraryVersion:()=>Ot.LIB_VERSION}}hs(t){return new Promise((e=>{if(kP(this._d,3))e({kind:"fatal",error:L1(void 0,"logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:L1(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Tf(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var o=i.statusCode;if(this.Mf(o),o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)r({kind:"fatal",error:new Error("logs request failed with status "+o)});else{var l;o===0?(i.error||this.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:L1(i.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=i.error)!==null&&l!==void 0?l:new Error("logs request failed with status "+o)})}}})}}))}Mf(t){(t!==0||this._instance.__loaded)&&(this._d=CP(t,this._d,3,(()=>this.A.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."))))}xf(t){this.ba.length>0&&this.If(t,this.ba,this.hf,Ot.LIB_NAME,(e=>{this.ba=e})),this.Jc.length>0&&this.If(t,this.Jc,this.cf,E8,(e=>{this.Jc=e}))}If(t,e,n,r,s){if(e.length!==0){var i=e.map((l=>l.record));s([]);var o=X3(i,Y3(n,Ot.LIB_NAME,Ot.LIB_VERSION),r,Ot.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Tf(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Tf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}af(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,i=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,et(s)||(e.sessionStartTimestamp=s),et(i)||(e.lastActivityTimestamp=i)}if(De!=null&&(t=De.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Sa(De.location.href):De.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},D7={metrics:class{constructor(t){this.A=Ht("[metrics]"),this._instance=t}initialize(){}lf(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.if&&this.uf===n||((e=this.if)==null||e.reset(),this.uf=n,this.if=new KD(this.sf(),(function(r){var s,i,o,l,u,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:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(n),this.A)),this.if}count(t,e,n){e===void 0&&(e=1),this.lf().count(t,e,n)}gauge(t,e,n){this.lf().gauge(t,e,n)}histogram(t,e,n){this.lf().histogram(t,e,n)}flush(t){if(!this.if)return Promise.resolve();if(t){var e=this.if.drainWindow();return e&&this.Ms(e,t),Promise.resolve()}return this.if.flush().catch((n=>this.A.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.if)==null||t.reset()}sf(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ms:n=>e.Ms(n),getLibraryId:()=>Ot.LIB_NAME,getLibraryVersion:()=>Ot.LIB_VERSION}}Ms(t,e){return new Promise((n=>{var r=!1,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(ue({method:"POST",url:this.Ef(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(o){var 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 u;s({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error("metrics request failed with status "+l)})}}}))}))}Ef(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},N7=ue({},qm,E7,k7,C7,P7,A7,R7,T7,I7,M7,O7,L7,D7);us.__defaultExtensionClasses=ue({},N7);var ke=(function(){Ot.SDK_DIST_CHANNEL="npm";var t=cf[Vc]=new us;return(function(){function e(){e.done||(e.done=!0,e5=!1,kt(cf,(function(n){n._dom_loaded()})))}fe!=null&&fe.addEventListener?fe.readyState==="complete"?e():Mt(fe,"DOMContentLoaded",e,{capture:!1}):ne&&ge.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),j7=(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 F7=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})},Hp,i5;function V7(t){i5=t}function H2(){return i5}var Nw=m.createContext({get client(){return H2()},bootstrap:void 0});function o5(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)||!o5(t[l],e[l],n))return!1}return!0}function $7(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=m.useRef(null),u=m.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=H2();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 m.useEffect(function(){if(!(s||!i)){var d=H2(),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&&!o5(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)]),we.createElement(Nw.Provider,{value:{client:u,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 D1=function(t){return typeof t=="function"},H7=function(t){return t===void 0},sh=function(){var t=m.useContext(Nw).client;return t},_0=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]"},z7=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!_0(r.cause)){H7(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},B7=function(t,e){if(!e)return t;var n=new Error(_0(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return n.name="React ErrorBoundary ".concat(_0(t)?t.name:"Error"),n.stack=e,_0(t)?(z7(t,n),t):n},U7={componentStack:null,exceptionEvent:null,error:null},W7={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},Z7=(Hp=(function(t){j7(e,t);function e(n){var r=t.call(this,n)||this;return r.state=U7,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;D1(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(B7(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return D1(r)?r():r;var o=D1(s)?we.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return we.isValidElement(o)?o:(console.warn(W7.INVALID_FALLBACK),we.createElement(we.Fragment,null))},e})(we.Component),F7(Hp,"PostHogErrorBoundary"),(function(){Hp.contextType=Nw})(),Hp);V7(ke);var zp={},N1={exports:{}},Nr={},j1={exports:{}},F1={};/**
20
- * @license React
21
- * scheduler.production.min.js
22
- *
23
- * Copyright (c) Facebook, Inc. and its affiliates.
24
- *
25
- * This source code is licensed under the MIT license found in the
26
- * LICENSE file in the root directory of this source tree.
27
- */var C8;function q7(){return C8||(C8=1,(function(t){function e(H,Q){var z=H.length;H.push(Q);e:for(;0<z;){var N=z-1>>>1,G=H[N];if(0<s(G,Q))H[N]=Q,H[z]=G,z=N;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var Q=H[0],z=H.pop();if(z!==Q){H[0]=z;e:for(var N=0,G=H.length,oe=G>>>1;N<oe;){var se=2*(N+1)-1,ee=H[se],de=se+1,ve=H[de];if(0>s(ee,z))de<G&&0>s(ve,ee)?(H[N]=ve,H[de]=z,N=de):(H[N]=ee,H[se]=z,N=se);else if(de<G&&0>s(ve,z))H[N]=ve,H[de]=z,N=de;else break e}}return Q}function s(H,Q){var z=H.sortIndex-Q.sortIndex;return z!==0?z:H.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 u=[],d=[],f=1,p=null,v=3,y=!1,w=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,b=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(H){for(var Q=n(d);Q!==null;){if(Q.callback===null)r(d);else if(Q.startTime<=H)r(d),Q.sortIndex=Q.expirationTime,e(u,Q);else break;Q=n(d)}}function P(H){if(_=!1,C(H),!w)if(n(u)!==null)w=!0,Z(T);else{var Q=n(d);Q!==null&&Y(P,Q.startTime-H)}}function T(H,Q){w=!1,_&&(_=!1,b(R),R=-1),y=!0;var z=v;try{for(C(Q),p=n(u);p!==null&&(!(p.expirationTime>Q)||H&&!V());){var N=p.callback;if(typeof N=="function"){p.callback=null,v=p.priorityLevel;var G=N(p.expirationTime<=Q);Q=t.unstable_now(),typeof G=="function"?p.callback=G:p===n(u)&&r(u),C(Q)}else r(u);p=n(u)}if(p!==null)var oe=!0;else{var se=n(d);se!==null&&Y(P,se.startTime-Q),oe=!1}return oe}finally{p=null,v=z,y=!1}}var O=!1,M=null,R=-1,L=5,D=-1;function V(){return!(t.unstable_now()-D<L)}function j(){if(M!==null){var H=t.unstable_now();D=H;var Q=!0;try{Q=M(!0,H)}finally{Q?U():(O=!1,M=null)}}else O=!1}var U;if(typeof k=="function")U=function(){k(j)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,q=X.port2;X.port1.onmessage=j,U=function(){q.postMessage(null)}}else U=function(){x(j,0)};function Z(H){M=H,O||(O=!0,U())}function Y(H,Q){R=x(function(){H(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(H){H.callback=null},t.unstable_continueExecution=function(){w||y||(w=!0,Z(T))},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(H){switch(v){case 1:case 2:case 3:var Q=3;break;default:Q=v}var z=v;v=Q;try{return H()}finally{v=z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,Q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var z=v;v=H;try{return Q()}finally{v=z}},t.unstable_scheduleCallback=function(H,Q,z){var N=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?N+z:N):z=N,H){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=z+G,H={id:f++,callback:Q,priorityLevel:H,startTime:z,expirationTime:G,sortIndex:-1},z>N?(H.sortIndex=z,e(d,H),n(u)===null&&H===n(d)&&(_?(b(R),R=-1):_=!0,Y(P,z-N))):(H.sortIndex=G,e(u,H),w||y||(w=!0,Z(T))),H},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(H){var Q=v;return function(){var z=v;v=Q;try{return H.apply(this,arguments)}finally{v=z}}}})(F1)),F1}var P8;function G7(){return P8||(P8=1,j1.exports=q7()),j1.exports}/**
28
- * @license React
29
- * react-dom.production.min.js
30
- *
31
- * Copyright (c) Facebook, Inc. and its affiliates.
32
- *
33
- * This source code is licensed under the MIT license found in the
34
- * LICENSE file in the root directory of this source tree.
35
- */var A8;function K7(){if(A8)return Nr;A8=1;var t=dw(),e=G7();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,h=1;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+a+"; visit "+c+" 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,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(s[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=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={},p={};function v(a){return u.call(p,a)?!0:u.call(f,a)?!1:d.test(a)?p[a]=!0:(f[a]=!0,!1)}function y(a,c,h,g){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return g?!1:h!==null?!h.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function w(a,c,h,g){if(c===null||typeof c>"u"||y(a,c,h,g))return!0;if(g)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(a,c,h,g,E,A,I){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=g,this.attributeNamespace=E,this.mustUseProperty=h,this.propertyName=a,this.type=c,this.sanitizeURL=A,this.removeEmptyString=I}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){x[a]=new _(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];x[c]=new _(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){x[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){x[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){x[a]=new _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){x[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){x[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){x[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){x[a]=new _(a,5,!1,a.toLowerCase(),null,!1,!1)});var b=/[\-:]([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 c=a.replace(b,k);x[c]=new _(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(b,k);x[c]=new _(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(b,k);x[c]=new _(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,c,h,g){var E=x.hasOwnProperty(c)?x[c]:null;(E!==null?E.type!==0:g||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(w(c,h,E,g)&&(h=null),g||E===null?v(c)&&(h===null?a.removeAttribute(c):a.setAttribute(c,""+h)):E.mustUseProperty?a[E.propertyName]=h===null?E.type===3?!1:"":h:(c=E.attributeName,g=E.attributeNamespace,h===null?a.removeAttribute(c):(E=E.type,h=E===3||E===4&&h===!0?"":""+h,g?a.setAttributeNS(g,c,h):a.setAttribute(c,h))))}var P=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),O=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),V=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),H=Symbol.iterator;function Q(a){return a===null||typeof a!="object"?null:(a=H&&a[H]||a["@@iterator"],typeof a=="function"?a:null)}var z=Object.assign,N;function G(a){if(N===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);N=c&&c[1]||""}return`
36
- `+N+a}var oe=!1;function se(a,c){if(!a||oe)return"";oe=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ie){var g=ie}Reflect.construct(a,[],c)}else{try{c.call()}catch(ie){g=ie}a.call(c.prototype)}else{try{throw Error()}catch(ie){g=ie}a()}}catch(ie){if(ie&&g&&typeof ie.stack=="string"){for(var E=ie.stack.split(`
37
- `),A=g.stack.split(`
38
- `),I=E.length-1,$=A.length-1;1<=I&&0<=$&&E[I]!==A[$];)$--;for(;1<=I&&0<=$;I--,$--)if(E[I]!==A[$]){if(I!==1||$!==1)do if(I--,$--,0>$||E[I]!==A[$]){var W=`
39
- `+E[I].replace(" at new "," at ");return a.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",a.displayName)),W}while(1<=I&&0<=$);break}}}finally{oe=!1,Error.prepareStackTrace=h}return(a=a?a.displayName||a.name:"")?G(a):""}function ee(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=se(a.type,!1),a;case 11:return a=se(a.type.render,!1),a;case 1:return a=se(a.type,!0),a;default:return""}}function de(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 M:return"Fragment";case O:return"Portal";case L:return"Profiler";case R:return"StrictMode";case U:return"Suspense";case X:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case V:return(a.displayName||"Context")+".Consumer";case D:return(a._context.displayName||"Context")+".Provider";case j:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case q:return c=a.displayName||null,c!==null?c:de(a.type)||"Memo";case Z:c=a._payload,a=a._init;try{return de(a(c))}catch{}}return null}function ve(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(c);case 8:return c===R?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}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 te(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Pe(a){var c=te(a)?"checked":"value",h=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),g=""+a[c];if(!a.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var E=h.get,A=h.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return E.call(this)},set:function(I){g=""+I,A.call(this,I)}}),Object.defineProperty(a,c,{enumerable:h.enumerable}),{getValue:function(){return g},setValue:function(I){g=""+I},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Se(a){a._valueTracker||(a._valueTracker=Pe(a))}function Ne(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return a&&(g=te(a)?a.checked?"true":"false":a.value),a=g,a!==h?(c.setValue(a),!0):!1}function Xe(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 Qe(a,c){var h=c.checked;return z({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??a._wrapperState.initialChecked})}function lt(a,c){var h=c.defaultValue==null?"":c.defaultValue,g=c.checked!=null?c.checked:c.defaultChecked;h=le(c.value!=null?c.value:h),a._wrapperState={initialChecked:g,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function ut(a,c){c=c.checked,c!=null&&C(a,"checked",c,!1)}function je(a,c){ut(a,c);var h=le(c.value),g=c.type;if(h!=null)g==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+h):a.value!==""+h&&(a.value=""+h);else if(g==="submit"||g==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Be(a,c.type,h):c.hasOwnProperty("defaultValue")&&Be(a,c.type,le(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function st(a,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var g=c.type;if(!(g!=="submit"&&g!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,h||c===a.value||(a.value=c),a.defaultValue=c}h=a.name,h!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,h!==""&&(a.name=h)}function Be(a,c,h){(c!=="number"||Xe(a.ownerDocument)!==a)&&(h==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+h&&(a.defaultValue=""+h))}var ft=Array.isArray;function Me(a,c,h,g){if(a=a.options,c){c={};for(var E=0;E<h.length;E++)c["$"+h[E]]=!0;for(h=0;h<a.length;h++)E=c.hasOwnProperty("$"+a[h].value),a[h].selected!==E&&(a[h].selected=E),E&&g&&(a[h].defaultSelected=!0)}else{for(h=""+le(h),c=null,E=0;E<a.length;E++){if(a[E].value===h){a[E].selected=!0,g&&(a[E].defaultSelected=!0);return}c!==null||a[E].disabled||(c=a[E])}c!==null&&(c.selected=!0)}}function We(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return z({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function xe(a,c){var h=c.value;if(h==null){if(h=c.children,c=c.defaultValue,h!=null){if(c!=null)throw Error(n(92));if(ft(h)){if(1<h.length)throw Error(n(93));h=h[0]}c=h}c==null&&(c=""),h=c}a._wrapperState={initialValue:le(h)}}function St(a,c){var h=le(c.value),g=le(c.defaultValue);h!=null&&(h=""+h,h!==a.value&&(a.value=h),c.defaultValue==null&&a.defaultValue!==h&&(a.defaultValue=h)),g!=null&&(a.defaultValue=""+g)}function Rt(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function Ar(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 Bs(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?Ar(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var En,kn=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,h,g,E){MSApp.execUnsafeLocalFunction(function(){return a(c,h,g,E)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(En=En||document.createElement("div"),En.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=En.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Us(a,c){if(c){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=c;return}}a.textContent=c}var Hn={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},Tr=["Webkit","ms","Moz","O"];Object.keys(Hn).forEach(function(a){Tr.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),Hn[c]=Hn[a]})});function Yr(a,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||Hn.hasOwnProperty(a)&&Hn[a]?(""+c).trim():c+"px"}function Lo(a,c){a=a.style;for(var h in c)if(c.hasOwnProperty(h)){var g=h.indexOf("--")===0,E=Yr(h,c[h],g);h==="float"&&(h="cssFloat"),g?a.setProperty(h,E):a[h]=E}}var $a=z({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 Ws(a,c){if(c){if($a[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function Zi(a,c){if(a.indexOf("-")===-1)return typeof c.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 Xn=null;function qi(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _r=null,yn=null,Cn=null;function Xr(a){if(a=gd(a)){if(typeof _r!="function")throw Error(n(280));var c=a.stateNode;c&&(c=$h(c),_r(a.stateNode,a.type,c))}}function Ha(a){yn?Cn?Cn.push(a):Cn=[a]:yn=a}function za(){if(yn){var a=yn,c=Cn;if(Cn=yn=null,Xr(a),c)for(a=0;a<c.length;a++)Xr(c[a])}}function Ue(a,c){return a(c)}function Jt(){}var cn=!1;function On(a,c,h){if(cn)return a(c,h);cn=!0;try{return Ue(a,c,h)}finally{cn=!1,(yn!==null||Cn!==null)&&(Jt(),za())}}function Qr(a,c){var h=a.stateNode;if(h===null)return null;var g=$h(h);if(g===null)return null;h=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(n(231,c,typeof h));return h}var _t=!1;if(l)try{var un={};Object.defineProperty(un,"passive",{get:function(){_t=!0}}),window.addEventListener("test",un,un),window.removeEventListener("test",un,un)}catch{_t=!1}function Qn(a,c,h,g,E,A,I,$,W){var ie=Array.prototype.slice.call(arguments,3);try{c.apply(h,ie)}catch(me){this.onError(me)}}var Rr=!1,Pn=null,Jr=!1,pi=null,yh={onError:function(a){Rr=!0,Pn=a}};function Xl(a,c,h,g,E,A,I,$,W){Rr=!1,Pn=null,Qn.apply(yh,arguments)}function _h(a,c,h,g,E,A,I,$,W){if(Xl.apply(this,arguments),Rr){if(Rr){var ie=Pn;Rr=!1,Pn=null}else throw Error(n(198));Jr||(Jr=!0,pi=ie)}}function Zs(a){var c=a,h=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(h=c.return),a=c.return;while(a)}return c.tag===3?h:null}function Ql(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function Jl(a){if(Zs(a)!==a)throw Error(n(188))}function Ku(a){var c=a.alternate;if(!c){if(c=Zs(a),c===null)throw Error(n(188));return c!==a?null:a}for(var h=a,g=c;;){var E=h.return;if(E===null)break;var A=E.alternate;if(A===null){if(g=E.return,g!==null){h=g;continue}break}if(E.child===A.child){for(A=E.child;A;){if(A===h)return Jl(E),a;if(A===g)return Jl(E),c;A=A.sibling}throw Error(n(188))}if(h.return!==g.return)h=E,g=A;else{for(var I=!1,$=E.child;$;){if($===h){I=!0,h=E,g=A;break}if($===g){I=!0,g=E,h=A;break}$=$.sibling}if(!I){for($=A.child;$;){if($===h){I=!0,h=A,g=E;break}if($===g){I=!0,g=A,h=E;break}$=$.sibling}if(!I)throw Error(n(189))}}if(h.alternate!==g)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?a:c}function wh(a){return a=Ku(a),a!==null?Ba(a):null}function Ba(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Ba(a);if(c!==null)return c;a=a.sibling}return null}var xh=e.unstable_scheduleCallback,bh=e.unstable_cancelCallback,wv=e.unstable_shouldYield,Yu=e.unstable_requestPaint,zt=e.unstable_now,Sh=e.unstable_getCurrentPriorityLevel,Xu=e.unstable_ImmediatePriority,Eh=e.unstable_UserBlockingPriority,Ua=e.unstable_NormalPriority,xv=e.unstable_LowPriority,kh=e.unstable_IdlePriority,Do=null,ks=null;function bv(a){if(ks&&typeof ks.onCommitFiberRoot=="function")try{ks.onCommitFiberRoot(Do,a,void 0,(a.current.flags&128)===128)}catch{}}var es=Math.clz32?Math.clz32:Qu,Sv=Math.log,Ev=Math.LN2;function Qu(a){return a>>>=0,a===0?32:31-(Sv(a)/Ev|0)|0}var ec=64,tc=4194304;function Wa(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 No(a,c){var h=a.pendingLanes;if(h===0)return 0;var g=0,E=a.suspendedLanes,A=a.pingedLanes,I=h&268435455;if(I!==0){var $=I&~E;$!==0?g=Wa($):(A&=I,A!==0&&(g=Wa(A)))}else I=h&~E,I!==0?g=Wa(I):A!==0&&(g=Wa(A));if(g===0)return 0;if(c!==0&&c!==g&&(c&E)===0&&(E=g&-g,A=c&-c,E>=A||E===16&&(A&4194240)!==0))return c;if((g&4)!==0&&(g|=h&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=g;0<c;)h=31-es(c),E=1<<h,g|=a[h],c&=~E;return g}function Ju(a,c){switch(a){case 1:case 2:case 4:return c+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 c+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 Ch(a,c){for(var h=a.suspendedLanes,g=a.pingedLanes,E=a.expirationTimes,A=a.pendingLanes;0<A;){var I=31-es(A),$=1<<I,W=E[I];W===-1?(($&h)===0||($&g)!==0)&&(E[I]=Ju($,c)):W<=c&&(a.expiredLanes|=$),A&=~$}}function ed(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function kv(){var a=ec;return ec<<=1,(ec&4194240)===0&&(ec=64),a}function mi(a){for(var c=[],h=0;31>h;h++)c.push(a);return c}function jo(a,c,h){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-es(c),a[c]=h}function td(a,c){var h=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var g=a.eventTimes;for(a=a.expirationTimes;0<h;){var E=31-es(h),A=1<<E;c[E]=0,g[E]=-1,a[E]=-1,h&=~A}}function nd(a,c){var h=a.entangledLanes|=c;for(a=a.entanglements;h;){var g=31-es(h),E=1<<g;E&c|a[g]&c&&(a[g]|=c),h&=~E}}var Pt=0;function Ph(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var rd,sd,id,Za,nc,rc=!1,qa=[],qs=null,Gs=null,F=null,ae=new Map,Ce=new Map,he=[],_e="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 Ee(a,c){switch(a){case"focusin":case"focusout":qs=null;break;case"dragenter":case"dragleave":Gs=null;break;case"mouseover":case"mouseout":F=null;break;case"pointerover":case"pointerout":ae.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ce.delete(c.pointerId)}}function Ze(a,c,h,g,E,A){return a===null||a.nativeEvent!==A?(a={blockedOn:c,domEventName:h,eventSystemFlags:g,nativeEvent:A,targetContainers:[E]},c!==null&&(c=gd(c),c!==null&&sd(c)),a):(a.eventSystemFlags|=g,c=a.targetContainers,E!==null&&c.indexOf(E)===-1&&c.push(E),a)}function Te(a,c,h,g,E){switch(c){case"focusin":return qs=Ze(qs,a,c,h,g,E),!0;case"dragenter":return Gs=Ze(Gs,a,c,h,g,E),!0;case"mouseover":return F=Ze(F,a,c,h,g,E),!0;case"pointerover":var A=E.pointerId;return ae.set(A,Ze(ae.get(A)||null,a,c,h,g,E)),!0;case"gotpointercapture":return A=E.pointerId,Ce.set(A,Ze(Ce.get(A)||null,a,c,h,g,E)),!0}return!1}function dn(a){var c=Ga(a.target);if(c!==null){var h=Zs(c);if(h!==null){if(c=h.tag,c===13){if(c=Ql(h),c!==null){a.blockedOn=c,nc(a.priority,function(){id(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function _n(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var h=Pv(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(h===null){h=a.nativeEvent;var g=new h.constructor(h.type,h);Xn=g,h.target.dispatchEvent(g),Xn=null}else return c=gd(h),c!==null&&sd(c),a.blockedOn=h,!1;c.shift()}return!0}function ts(a,c,h){_n(a)&&h.delete(c)}function ns(){rc=!1,qs!==null&&_n(qs)&&(qs=null),Gs!==null&&_n(Gs)&&(Gs=null),F!==null&&_n(F)&&(F=null),ae.forEach(ts),Ce.forEach(ts)}function Jn(a,c){a.blockedOn===c&&(a.blockedOn=null,rc||(rc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ns)))}function nt(a){function c(E){return Jn(E,a)}if(0<qa.length){Jn(qa[0],a);for(var h=1;h<qa.length;h++){var g=qa[h];g.blockedOn===a&&(g.blockedOn=null)}}for(qs!==null&&Jn(qs,a),Gs!==null&&Jn(Gs,a),F!==null&&Jn(F,a),ae.forEach(c),Ce.forEach(c),h=0;h<he.length;h++)g=he[h],g.blockedOn===a&&(g.blockedOn=null);for(;0<he.length&&(h=he[0],h.blockedOn===null);)dn(h),h.blockedOn===null&&he.shift()}var At=P.ReactCurrentBatchConfig,Cs=!0;function TO(a,c,h,g){var E=Pt,A=At.transition;At.transition=null;try{Pt=1,Cv(a,c,h,g)}finally{Pt=E,At.transition=A}}function RO(a,c,h,g){var E=Pt,A=At.transition;At.transition=null;try{Pt=4,Cv(a,c,h,g)}finally{Pt=E,At.transition=A}}function Cv(a,c,h,g){if(Cs){var E=Pv(a,c,h,g);if(E===null)Uv(a,c,g,Ah,h),Ee(a,g);else if(Te(E,a,c,h,g))g.stopPropagation();else if(Ee(a,g),c&4&&-1<_e.indexOf(a)){for(;E!==null;){var A=gd(E);if(A!==null&&rd(A),A=Pv(a,c,h,g),A===null&&Uv(a,c,g,Ah,h),A===E)break;E=A}E!==null&&g.stopPropagation()}else Uv(a,c,g,null,h)}}var Ah=null;function Pv(a,c,h,g){if(Ah=null,a=qi(g),a=Ga(a),a!==null)if(c=Zs(a),c===null)a=null;else if(h=c.tag,h===13){if(a=Ql(c),a!==null)return a;a=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Ah=a,null}function Mb(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(Sh()){case Xu:return 1;case Eh:return 4;case Ua:case xv:return 16;case kh:return 536870912;default:return 16}default:return 16}}var Fo=null,Av=null,Th=null;function Ob(){if(Th)return Th;var a,c=Av,h=c.length,g,E="value"in Fo?Fo.value:Fo.textContent,A=E.length;for(a=0;a<h&&c[a]===E[a];a++);var I=h-a;for(g=1;g<=I&&c[h-g]===E[A-g];g++);return Th=E.slice(a,1<g?1-g:void 0)}function Rh(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Ih(){return!0}function Lb(){return!1}function rs(a){function c(h,g,E,A,I){this._reactName=h,this._targetInst=E,this.type=g,this.nativeEvent=A,this.target=I,this.currentTarget=null;for(var $ in a)a.hasOwnProperty($)&&(h=a[$],this[$]=h?h(A):A[$]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?Ih:Lb,this.isPropagationStopped=Lb,this}return z(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Ih)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Ih)},persist:function(){},isPersistent:Ih}),c}var sc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tv=rs(sc),od=z({},sc,{view:0,detail:0}),IO=rs(od),Rv,Iv,ad,Mh=z({},od,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ov,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!==ad&&(ad&&a.type==="mousemove"?(Rv=a.screenX-ad.screenX,Iv=a.screenY-ad.screenY):Iv=Rv=0,ad=a),Rv)},movementY:function(a){return"movementY"in a?a.movementY:Iv}}),Db=rs(Mh),MO=z({},Mh,{dataTransfer:0}),OO=rs(MO),LO=z({},od,{relatedTarget:0}),Mv=rs(LO),DO=z({},sc,{animationName:0,elapsedTime:0,pseudoElement:0}),NO=rs(DO),jO=z({},sc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),FO=rs(jO),VO=z({},sc,{data:0}),Nb=rs(VO),$O={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},HO={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"},zO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BO(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=zO[a])?!!c[a]:!1}function Ov(){return BO}var UO=z({},od,{key:function(a){if(a.key){var c=$O[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Rh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?HO[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ov,charCode:function(a){return a.type==="keypress"?Rh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Rh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),WO=rs(UO),ZO=z({},Mh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jb=rs(ZO),qO=z({},od,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ov}),GO=rs(qO),KO=z({},sc,{propertyName:0,elapsedTime:0,pseudoElement:0}),YO=rs(KO),XO=z({},Mh,{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}),QO=rs(XO),JO=[9,13,27,32],Lv=l&&"CompositionEvent"in window,ld=null;l&&"documentMode"in document&&(ld=document.documentMode);var e9=l&&"TextEvent"in window&&!ld,Fb=l&&(!Lv||ld&&8<ld&&11>=ld),Vb=" ",$b=!1;function Hb(a,c){switch(a){case"keyup":return JO.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ic=!1;function t9(a,c){switch(a){case"compositionend":return zb(c);case"keypress":return c.which!==32?null:($b=!0,Vb);case"textInput":return a=c.data,a===Vb&&$b?null:a;default:return null}}function n9(a,c){if(ic)return a==="compositionend"||!Lv&&Hb(a,c)?(a=Ob(),Th=Av=Fo=null,ic=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Fb&&c.locale!=="ko"?null:c.data;default:return null}}var r9={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 Bb(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!r9[a.type]:c==="textarea"}function Ub(a,c,h,g){Ha(g),c=jh(c,"onChange"),0<c.length&&(h=new Tv("onChange","change",null,h,g),a.push({event:h,listeners:c}))}var cd=null,ud=null;function s9(a){l4(a,0)}function Oh(a){var c=uc(a);if(Ne(c))return a}function i9(a,c){if(a==="change")return c}var Wb=!1;if(l){var Dv;if(l){var Nv="oninput"in document;if(!Nv){var Zb=document.createElement("div");Zb.setAttribute("oninput","return;"),Nv=typeof Zb.oninput=="function"}Dv=Nv}else Dv=!1;Wb=Dv&&(!document.documentMode||9<document.documentMode)}function qb(){cd&&(cd.detachEvent("onpropertychange",Gb),ud=cd=null)}function Gb(a){if(a.propertyName==="value"&&Oh(ud)){var c=[];Ub(c,ud,a,qi(a)),On(s9,c)}}function o9(a,c,h){a==="focusin"?(qb(),cd=c,ud=h,cd.attachEvent("onpropertychange",Gb)):a==="focusout"&&qb()}function a9(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Oh(ud)}function l9(a,c){if(a==="click")return Oh(c)}function c9(a,c){if(a==="input"||a==="change")return Oh(c)}function u9(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Ks=typeof Object.is=="function"?Object.is:u9;function dd(a,c){if(Ks(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var h=Object.keys(a),g=Object.keys(c);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var E=h[g];if(!u.call(c,E)||!Ks(a[E],c[E]))return!1}return!0}function Kb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Yb(a,c){var h=Kb(a);a=0;for(var g;h;){if(h.nodeType===3){if(g=a+h.textContent.length,a<=c&&g>=c)return{node:h,offset:c-a};a=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=Kb(h)}}function Xb(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?Xb(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function Qb(){for(var a=window,c=Xe();c instanceof a.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)a=c.contentWindow;else break;c=Xe(a.document)}return c}function jv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function d9(a){var c=Qb(),h=a.focusedElem,g=a.selectionRange;if(c!==h&&h&&h.ownerDocument&&Xb(h.ownerDocument.documentElement,h)){if(g!==null&&jv(h)){if(c=g.start,a=g.end,a===void 0&&(a=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(a,h.value.length);else if(a=(c=h.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var E=h.textContent.length,A=Math.min(g.start,E);g=g.end===void 0?A:Math.min(g.end,E),!a.extend&&A>g&&(E=g,g=A,A=E),E=Yb(h,A);var I=Yb(h,g);E&&I&&(a.rangeCount!==1||a.anchorNode!==E.node||a.anchorOffset!==E.offset||a.focusNode!==I.node||a.focusOffset!==I.offset)&&(c=c.createRange(),c.setStart(E.node,E.offset),a.removeAllRanges(),A>g?(a.addRange(c),a.extend(I.node,I.offset)):(c.setEnd(I.node,I.offset),a.addRange(c)))}}for(c=[],a=h;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<c.length;h++)a=c[h],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var f9=l&&"documentMode"in document&&11>=document.documentMode,oc=null,Fv=null,fd=null,Vv=!1;function Jb(a,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Vv||oc==null||oc!==Xe(g)||(g=oc,"selectionStart"in g&&jv(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),fd&&dd(fd,g)||(fd=g,g=jh(Fv,"onSelect"),0<g.length&&(c=new Tv("onSelect","select",null,c,h),a.push({event:c,listeners:g}),c.target=oc)))}function Lh(a,c){var h={};return h[a.toLowerCase()]=c.toLowerCase(),h["Webkit"+a]="webkit"+c,h["Moz"+a]="moz"+c,h}var ac={animationend:Lh("Animation","AnimationEnd"),animationiteration:Lh("Animation","AnimationIteration"),animationstart:Lh("Animation","AnimationStart"),transitionend:Lh("Transition","TransitionEnd")},$v={},e4={};l&&(e4=document.createElement("div").style,"AnimationEvent"in window||(delete ac.animationend.animation,delete ac.animationiteration.animation,delete ac.animationstart.animation),"TransitionEvent"in window||delete ac.transitionend.transition);function Dh(a){if($v[a])return $v[a];if(!ac[a])return a;var c=ac[a],h;for(h in c)if(c.hasOwnProperty(h)&&h in e4)return $v[a]=c[h];return a}var t4=Dh("animationend"),n4=Dh("animationiteration"),r4=Dh("animationstart"),s4=Dh("transitionend"),i4=new Map,o4="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 Vo(a,c){i4.set(a,c),i(c,[a])}for(var Hv=0;Hv<o4.length;Hv++){var zv=o4[Hv],h9=zv.toLowerCase(),p9=zv[0].toUpperCase()+zv.slice(1);Vo(h9,"on"+p9)}Vo(t4,"onAnimationEnd"),Vo(n4,"onAnimationIteration"),Vo(r4,"onAnimationStart"),Vo("dblclick","onDoubleClick"),Vo("focusin","onFocus"),Vo("focusout","onBlur"),Vo(s4,"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 hd="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(" "),m9=new Set("cancel close invalid load scroll toggle".split(" ").concat(hd));function a4(a,c,h){var g=a.type||"unknown-event";a.currentTarget=h,_h(g,c,void 0,a),a.currentTarget=null}function l4(a,c){c=(c&4)!==0;for(var h=0;h<a.length;h++){var g=a[h],E=g.event;g=g.listeners;e:{var A=void 0;if(c)for(var I=g.length-1;0<=I;I--){var $=g[I],W=$.instance,ie=$.currentTarget;if($=$.listener,W!==A&&E.isPropagationStopped())break e;a4(E,$,ie),A=W}else for(I=0;I<g.length;I++){if($=g[I],W=$.instance,ie=$.currentTarget,$=$.listener,W!==A&&E.isPropagationStopped())break e;a4(E,$,ie),A=W}}}if(Jr)throw a=pi,Jr=!1,pi=null,a}function Bt(a,c){var h=c[Yv];h===void 0&&(h=c[Yv]=new Set);var g=a+"__bubble";h.has(g)||(c4(c,a,2,!1),h.add(g))}function Bv(a,c,h){var g=0;c&&(g|=4),c4(h,a,g,c)}var Nh="_reactListening"+Math.random().toString(36).slice(2);function pd(a){if(!a[Nh]){a[Nh]=!0,r.forEach(function(h){h!=="selectionchange"&&(m9.has(h)||Bv(h,!1,a),Bv(h,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[Nh]||(c[Nh]=!0,Bv("selectionchange",!1,c))}}function c4(a,c,h,g){switch(Mb(c)){case 1:var E=TO;break;case 4:E=RO;break;default:E=Cv}h=E.bind(null,c,h,a),E=void 0,!_t||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(E=!0),g?E!==void 0?a.addEventListener(c,h,{capture:!0,passive:E}):a.addEventListener(c,h,!0):E!==void 0?a.addEventListener(c,h,{passive:E}):a.addEventListener(c,h,!1)}function Uv(a,c,h,g,E){var A=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var $=g.stateNode.containerInfo;if($===E||$.nodeType===8&&$.parentNode===E)break;if(I===4)for(I=g.return;I!==null;){var W=I.tag;if((W===3||W===4)&&(W=I.stateNode.containerInfo,W===E||W.nodeType===8&&W.parentNode===E))return;I=I.return}for(;$!==null;){if(I=Ga($),I===null)return;if(W=I.tag,W===5||W===6){g=A=I;continue e}$=$.parentNode}}g=g.return}On(function(){var ie=A,me=qi(h),ye=[];e:{var pe=i4.get(a);if(pe!==void 0){var Re=Tv,Fe=a;switch(a){case"keypress":if(Rh(h)===0)break e;case"keydown":case"keyup":Re=WO;break;case"focusin":Fe="focus",Re=Mv;break;case"focusout":Fe="blur",Re=Mv;break;case"beforeblur":case"afterblur":Re=Mv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Re=Db;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Re=OO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Re=GO;break;case t4:case n4:case r4:Re=NO;break;case s4:Re=YO;break;case"scroll":Re=IO;break;case"wheel":Re=QO;break;case"copy":case"cut":case"paste":Re=FO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Re=jb}var $e=(c&4)!==0,wn=!$e&&a==="scroll",J=$e?pe!==null?pe+"Capture":null:pe;$e=[];for(var K=ie,re;K!==null;){re=K;var be=re.stateNode;if(re.tag===5&&be!==null&&(re=be,J!==null&&(be=Qr(K,J),be!=null&&$e.push(md(K,be,re)))),wn)break;K=K.return}0<$e.length&&(pe=new Re(pe,Fe,null,h,me),ye.push({event:pe,listeners:$e}))}}if((c&7)===0){e:{if(pe=a==="mouseover"||a==="pointerover",Re=a==="mouseout"||a==="pointerout",pe&&h!==Xn&&(Fe=h.relatedTarget||h.fromElement)&&(Ga(Fe)||Fe[Gi]))break e;if((Re||pe)&&(pe=me.window===me?me:(pe=me.ownerDocument)?pe.defaultView||pe.parentWindow:window,Re?(Fe=h.relatedTarget||h.toElement,Re=ie,Fe=Fe?Ga(Fe):null,Fe!==null&&(wn=Zs(Fe),Fe!==wn||Fe.tag!==5&&Fe.tag!==6)&&(Fe=null)):(Re=null,Fe=ie),Re!==Fe)){if($e=Db,be="onMouseLeave",J="onMouseEnter",K="mouse",(a==="pointerout"||a==="pointerover")&&($e=jb,be="onPointerLeave",J="onPointerEnter",K="pointer"),wn=Re==null?pe:uc(Re),re=Fe==null?pe:uc(Fe),pe=new $e(be,K+"leave",Re,h,me),pe.target=wn,pe.relatedTarget=re,be=null,Ga(me)===ie&&($e=new $e(J,K+"enter",Fe,h,me),$e.target=re,$e.relatedTarget=wn,be=$e),wn=be,Re&&Fe)t:{for($e=Re,J=Fe,K=0,re=$e;re;re=lc(re))K++;for(re=0,be=J;be;be=lc(be))re++;for(;0<K-re;)$e=lc($e),K--;for(;0<re-K;)J=lc(J),re--;for(;K--;){if($e===J||J!==null&&$e===J.alternate)break t;$e=lc($e),J=lc(J)}$e=null}else $e=null;Re!==null&&u4(ye,pe,Re,$e,!1),Fe!==null&&wn!==null&&u4(ye,wn,Fe,$e,!0)}}e:{if(pe=ie?uc(ie):window,Re=pe.nodeName&&pe.nodeName.toLowerCase(),Re==="select"||Re==="input"&&pe.type==="file")var He=i9;else if(Bb(pe))if(Wb)He=c9;else{He=a9;var qe=o9}else(Re=pe.nodeName)&&Re.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(He=l9);if(He&&(He=He(a,ie))){Ub(ye,He,h,me);break e}qe&&qe(a,pe,ie),a==="focusout"&&(qe=pe._wrapperState)&&qe.controlled&&pe.type==="number"&&Be(pe,"number",pe.value)}switch(qe=ie?uc(ie):window,a){case"focusin":(Bb(qe)||qe.contentEditable==="true")&&(oc=qe,Fv=ie,fd=null);break;case"focusout":fd=Fv=oc=null;break;case"mousedown":Vv=!0;break;case"contextmenu":case"mouseup":case"dragend":Vv=!1,Jb(ye,h,me);break;case"selectionchange":if(f9)break;case"keydown":case"keyup":Jb(ye,h,me)}var Ge;if(Lv)e:{switch(a){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else ic?Hb(a,h)&&(Je="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(Je="onCompositionStart");Je&&(Fb&&h.locale!=="ko"&&(ic||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&ic&&(Ge=Ob()):(Fo=me,Av="value"in Fo?Fo.value:Fo.textContent,ic=!0)),qe=jh(ie,Je),0<qe.length&&(Je=new Nb(Je,a,null,h,me),ye.push({event:Je,listeners:qe}),Ge?Je.data=Ge:(Ge=zb(h),Ge!==null&&(Je.data=Ge)))),(Ge=e9?t9(a,h):n9(a,h))&&(ie=jh(ie,"onBeforeInput"),0<ie.length&&(me=new Nb("onBeforeInput","beforeinput",null,h,me),ye.push({event:me,listeners:ie}),me.data=Ge))}l4(ye,c)})}function md(a,c,h){return{instance:a,listener:c,currentTarget:h}}function jh(a,c){for(var h=c+"Capture",g=[];a!==null;){var E=a,A=E.stateNode;E.tag===5&&A!==null&&(E=A,A=Qr(a,h),A!=null&&g.unshift(md(a,A,E)),A=Qr(a,c),A!=null&&g.push(md(a,A,E))),a=a.return}return g}function lc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function u4(a,c,h,g,E){for(var A=c._reactName,I=[];h!==null&&h!==g;){var $=h,W=$.alternate,ie=$.stateNode;if(W!==null&&W===g)break;$.tag===5&&ie!==null&&($=ie,E?(W=Qr(h,A),W!=null&&I.unshift(md(h,W,$))):E||(W=Qr(h,A),W!=null&&I.push(md(h,W,$)))),h=h.return}I.length!==0&&a.push({event:c,listeners:I})}var v9=/\r\n?/g,g9=/\u0000|\uFFFD/g;function d4(a){return(typeof a=="string"?a:""+a).replace(v9,`
40
- `).replace(g9,"")}function Fh(a,c,h){if(c=d4(c),d4(a)!==c&&h)throw Error(n(425))}function Vh(){}var Wv=null,Zv=null;function qv(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Gv=typeof setTimeout=="function"?setTimeout:void 0,y9=typeof clearTimeout=="function"?clearTimeout:void 0,f4=typeof Promise=="function"?Promise:void 0,_9=typeof queueMicrotask=="function"?queueMicrotask:typeof f4<"u"?function(a){return f4.resolve(null).then(a).catch(w9)}:Gv;function w9(a){setTimeout(function(){throw a})}function Kv(a,c){var h=c,g=0;do{var E=h.nextSibling;if(a.removeChild(h),E&&E.nodeType===8)if(h=E.data,h==="/$"){if(g===0){a.removeChild(E),nt(c);return}g--}else h!=="$"&&h!=="$?"&&h!=="$!"||g++;h=E}while(h);nt(c)}function $o(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function h4(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"){if(c===0)return a;c--}else h==="/$"&&c++}a=a.previousSibling}return null}var cc=Math.random().toString(36).slice(2),vi="__reactFiber$"+cc,vd="__reactProps$"+cc,Gi="__reactContainer$"+cc,Yv="__reactEvents$"+cc,x9="__reactListeners$"+cc,b9="__reactHandles$"+cc;function Ga(a){var c=a[vi];if(c)return c;for(var h=a.parentNode;h;){if(c=h[Gi]||h[vi]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(a=h4(a);a!==null;){if(h=a[vi])return h;a=h4(a)}return c}a=h,h=a.parentNode}return null}function gd(a){return a=a[vi]||a[Gi],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function uc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function $h(a){return a[vd]||null}var Xv=[],dc=-1;function Ho(a){return{current:a}}function Ut(a){0>dc||(a.current=Xv[dc],Xv[dc]=null,dc--)}function $t(a,c){dc++,Xv[dc]=a.current,a.current=c}var zo={},cr=Ho(zo),Ir=Ho(!1),Ka=zo;function fc(a,c){var h=a.type.contextTypes;if(!h)return zo;var g=a.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===c)return g.__reactInternalMemoizedMaskedChildContext;var E={},A;for(A in h)E[A]=c[A];return g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=E),E}function Mr(a){return a=a.childContextTypes,a!=null}function Hh(){Ut(Ir),Ut(cr)}function p4(a,c,h){if(cr.current!==zo)throw Error(n(168));$t(cr,c),$t(Ir,h)}function m4(a,c,h){var g=a.stateNode;if(c=c.childContextTypes,typeof g.getChildContext!="function")return h;g=g.getChildContext();for(var E in g)if(!(E in c))throw Error(n(108,ve(a)||"Unknown",E));return z({},h,g)}function zh(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||zo,Ka=cr.current,$t(cr,a),$t(Ir,Ir.current),!0}function v4(a,c,h){var g=a.stateNode;if(!g)throw Error(n(169));h?(a=m4(a,c,Ka),g.__reactInternalMemoizedMergedChildContext=a,Ut(Ir),Ut(cr),$t(cr,a)):Ut(Ir),$t(Ir,h)}var Ki=null,Bh=!1,Qv=!1;function g4(a){Ki===null?Ki=[a]:Ki.push(a)}function S9(a){Bh=!0,g4(a)}function Bo(){if(!Qv&&Ki!==null){Qv=!0;var a=0,c=Pt;try{var h=Ki;for(Pt=1;a<h.length;a++){var g=h[a];do g=g(!0);while(g!==null)}Ki=null,Bh=!1}catch(E){throw Ki!==null&&(Ki=Ki.slice(a+1)),xh(Xu,Bo),E}finally{Pt=c,Qv=!1}}return null}var hc=[],pc=0,Uh=null,Wh=0,Ps=[],As=0,Ya=null,Yi=1,Xi="";function Xa(a,c){hc[pc++]=Wh,hc[pc++]=Uh,Uh=a,Wh=c}function y4(a,c,h){Ps[As++]=Yi,Ps[As++]=Xi,Ps[As++]=Ya,Ya=a;var g=Yi;a=Xi;var E=32-es(g)-1;g&=~(1<<E),h+=1;var A=32-es(c)+E;if(30<A){var I=E-E%5;A=(g&(1<<I)-1).toString(32),g>>=I,E-=I,Yi=1<<32-es(c)+E|h<<E|g,Xi=A+a}else Yi=1<<A|h<<E|g,Xi=a}function Jv(a){a.return!==null&&(Xa(a,1),y4(a,1,0))}function eg(a){for(;a===Uh;)Uh=hc[--pc],hc[pc]=null,Wh=hc[--pc],hc[pc]=null;for(;a===Ya;)Ya=Ps[--As],Ps[As]=null,Xi=Ps[--As],Ps[As]=null,Yi=Ps[--As],Ps[As]=null}var ss=null,is=null,Xt=!1,Ys=null;function _4(a,c){var h=Ms(5,null,null,0);h.elementType="DELETED",h.stateNode=c,h.return=a,c=a.deletions,c===null?(a.deletions=[h],a.flags|=16):c.push(h)}function w4(a,c){switch(a.tag){case 5:var h=a.type;return c=c.nodeType!==1||h.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,ss=a,is=$o(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,ss=a,is=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(h=Ya!==null?{id:Yi,overflow:Xi}:null,a.memoizedState={dehydrated:c,treeContext:h,retryLane:1073741824},h=Ms(18,null,null,0),h.stateNode=c,h.return=a,a.child=h,ss=a,is=null,!0):!1;default:return!1}}function tg(a){return(a.mode&1)!==0&&(a.flags&128)===0}function ng(a){if(Xt){var c=is;if(c){var h=c;if(!w4(a,c)){if(tg(a))throw Error(n(418));c=$o(h.nextSibling);var g=ss;c&&w4(a,c)?_4(g,h):(a.flags=a.flags&-4097|2,Xt=!1,ss=a)}}else{if(tg(a))throw Error(n(418));a.flags=a.flags&-4097|2,Xt=!1,ss=a}}}function x4(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;ss=a}function Zh(a){if(a!==ss)return!1;if(!Xt)return x4(a),Xt=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!qv(a.type,a.memoizedProps)),c&&(c=is)){if(tg(a))throw b4(),Error(n(418));for(;c;)_4(a,c),c=$o(c.nextSibling)}if(x4(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"){if(c===0){is=$o(a.nextSibling);break e}c--}else h!=="$"&&h!=="$!"&&h!=="$?"||c++}a=a.nextSibling}is=null}}else is=ss?$o(a.stateNode.nextSibling):null;return!0}function b4(){for(var a=is;a;)a=$o(a.nextSibling)}function mc(){is=ss=null,Xt=!1}function rg(a){Ys===null?Ys=[a]:Ys.push(a)}var E9=P.ReactCurrentBatchConfig;function yd(a,c,h){if(a=h.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var g=h.stateNode}if(!g)throw Error(n(147,a));var E=g,A=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===A?c.ref:(c=function(I){var $=E.refs;I===null?delete $[A]:$[A]=I},c._stringRef=A,c)}if(typeof a!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,a))}return a}function qh(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function S4(a){var c=a._init;return c(a._payload)}function E4(a){function c(J,K){if(a){var re=J.deletions;re===null?(J.deletions=[K],J.flags|=16):re.push(K)}}function h(J,K){if(!a)return null;for(;K!==null;)c(J,K),K=K.sibling;return null}function g(J,K){for(J=new Map;K!==null;)K.key!==null?J.set(K.key,K):J.set(K.index,K),K=K.sibling;return J}function E(J,K){return J=Xo(J,K),J.index=0,J.sibling=null,J}function A(J,K,re){return J.index=re,a?(re=J.alternate,re!==null?(re=re.index,re<K?(J.flags|=2,K):re):(J.flags|=2,K)):(J.flags|=1048576,K)}function I(J){return a&&J.alternate===null&&(J.flags|=2),J}function $(J,K,re,be){return K===null||K.tag!==6?(K=Gg(re,J.mode,be),K.return=J,K):(K=E(K,re),K.return=J,K)}function W(J,K,re,be){var He=re.type;return He===M?me(J,K,re.props.children,be,re.key):K!==null&&(K.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===Z&&S4(He)===K.type)?(be=E(K,re.props),be.ref=yd(J,K,re),be.return=J,be):(be=gp(re.type,re.key,re.props,null,J.mode,be),be.ref=yd(J,K,re),be.return=J,be)}function ie(J,K,re,be){return K===null||K.tag!==4||K.stateNode.containerInfo!==re.containerInfo||K.stateNode.implementation!==re.implementation?(K=Kg(re,J.mode,be),K.return=J,K):(K=E(K,re.children||[]),K.return=J,K)}function me(J,K,re,be,He){return K===null||K.tag!==7?(K=il(re,J.mode,be,He),K.return=J,K):(K=E(K,re),K.return=J,K)}function ye(J,K,re){if(typeof K=="string"&&K!==""||typeof K=="number")return K=Gg(""+K,J.mode,re),K.return=J,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case T:return re=gp(K.type,K.key,K.props,null,J.mode,re),re.ref=yd(J,null,K),re.return=J,re;case O:return K=Kg(K,J.mode,re),K.return=J,K;case Z:var be=K._init;return ye(J,be(K._payload),re)}if(ft(K)||Q(K))return K=il(K,J.mode,re,null),K.return=J,K;qh(J,K)}return null}function pe(J,K,re,be){var He=K!==null?K.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return He!==null?null:$(J,K,""+re,be);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case T:return re.key===He?W(J,K,re,be):null;case O:return re.key===He?ie(J,K,re,be):null;case Z:return He=re._init,pe(J,K,He(re._payload),be)}if(ft(re)||Q(re))return He!==null?null:me(J,K,re,be,null);qh(J,re)}return null}function Re(J,K,re,be,He){if(typeof be=="string"&&be!==""||typeof be=="number")return J=J.get(re)||null,$(K,J,""+be,He);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case T:return J=J.get(be.key===null?re:be.key)||null,W(K,J,be,He);case O:return J=J.get(be.key===null?re:be.key)||null,ie(K,J,be,He);case Z:var qe=be._init;return Re(J,K,re,qe(be._payload),He)}if(ft(be)||Q(be))return J=J.get(re)||null,me(K,J,be,He,null);qh(K,be)}return null}function Fe(J,K,re,be){for(var He=null,qe=null,Ge=K,Je=K=0,Un=null;Ge!==null&&Je<re.length;Je++){Ge.index>Je?(Un=Ge,Ge=null):Un=Ge.sibling;var Et=pe(J,Ge,re[Je],be);if(Et===null){Ge===null&&(Ge=Un);break}a&&Ge&&Et.alternate===null&&c(J,Ge),K=A(Et,K,Je),qe===null?He=Et:qe.sibling=Et,qe=Et,Ge=Un}if(Je===re.length)return h(J,Ge),Xt&&Xa(J,Je),He;if(Ge===null){for(;Je<re.length;Je++)Ge=ye(J,re[Je],be),Ge!==null&&(K=A(Ge,K,Je),qe===null?He=Ge:qe.sibling=Ge,qe=Ge);return Xt&&Xa(J,Je),He}for(Ge=g(J,Ge);Je<re.length;Je++)Un=Re(Ge,J,Je,re[Je],be),Un!==null&&(a&&Un.alternate!==null&&Ge.delete(Un.key===null?Je:Un.key),K=A(Un,K,Je),qe===null?He=Un:qe.sibling=Un,qe=Un);return a&&Ge.forEach(function(Qo){return c(J,Qo)}),Xt&&Xa(J,Je),He}function $e(J,K,re,be){var He=Q(re);if(typeof He!="function")throw Error(n(150));if(re=He.call(re),re==null)throw Error(n(151));for(var qe=He=null,Ge=K,Je=K=0,Un=null,Et=re.next();Ge!==null&&!Et.done;Je++,Et=re.next()){Ge.index>Je?(Un=Ge,Ge=null):Un=Ge.sibling;var Qo=pe(J,Ge,Et.value,be);if(Qo===null){Ge===null&&(Ge=Un);break}a&&Ge&&Qo.alternate===null&&c(J,Ge),K=A(Qo,K,Je),qe===null?He=Qo:qe.sibling=Qo,qe=Qo,Ge=Un}if(Et.done)return h(J,Ge),Xt&&Xa(J,Je),He;if(Ge===null){for(;!Et.done;Je++,Et=re.next())Et=ye(J,Et.value,be),Et!==null&&(K=A(Et,K,Je),qe===null?He=Et:qe.sibling=Et,qe=Et);return Xt&&Xa(J,Je),He}for(Ge=g(J,Ge);!Et.done;Je++,Et=re.next())Et=Re(Ge,J,Je,Et.value,be),Et!==null&&(a&&Et.alternate!==null&&Ge.delete(Et.key===null?Je:Et.key),K=A(Et,K,Je),qe===null?He=Et:qe.sibling=Et,qe=Et);return a&&Ge.forEach(function(rL){return c(J,rL)}),Xt&&Xa(J,Je),He}function wn(J,K,re,be){if(typeof re=="object"&&re!==null&&re.type===M&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case T:e:{for(var He=re.key,qe=K;qe!==null;){if(qe.key===He){if(He=re.type,He===M){if(qe.tag===7){h(J,qe.sibling),K=E(qe,re.props.children),K.return=J,J=K;break e}}else if(qe.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===Z&&S4(He)===qe.type){h(J,qe.sibling),K=E(qe,re.props),K.ref=yd(J,qe,re),K.return=J,J=K;break e}h(J,qe);break}else c(J,qe);qe=qe.sibling}re.type===M?(K=il(re.props.children,J.mode,be,re.key),K.return=J,J=K):(be=gp(re.type,re.key,re.props,null,J.mode,be),be.ref=yd(J,K,re),be.return=J,J=be)}return I(J);case O:e:{for(qe=re.key;K!==null;){if(K.key===qe)if(K.tag===4&&K.stateNode.containerInfo===re.containerInfo&&K.stateNode.implementation===re.implementation){h(J,K.sibling),K=E(K,re.children||[]),K.return=J,J=K;break e}else{h(J,K);break}else c(J,K);K=K.sibling}K=Kg(re,J.mode,be),K.return=J,J=K}return I(J);case Z:return qe=re._init,wn(J,K,qe(re._payload),be)}if(ft(re))return Fe(J,K,re,be);if(Q(re))return $e(J,K,re,be);qh(J,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,K!==null&&K.tag===6?(h(J,K.sibling),K=E(K,re),K.return=J,J=K):(h(J,K),K=Gg(re,J.mode,be),K.return=J,J=K),I(J)):h(J,K)}return wn}var vc=E4(!0),k4=E4(!1),Gh=Ho(null),Kh=null,gc=null,sg=null;function ig(){sg=gc=Kh=null}function og(a){var c=Gh.current;Ut(Gh),a._currentValue=c}function ag(a,c,h){for(;a!==null;){var g=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),a===h)break;a=a.return}}function yc(a,c){Kh=a,sg=gc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Or=!0),a.firstContext=null)}function Ts(a){var c=a._currentValue;if(sg!==a)if(a={context:a,memoizedValue:c,next:null},gc===null){if(Kh===null)throw Error(n(308));gc=a,Kh.dependencies={lanes:0,firstContext:a}}else gc=gc.next=a;return c}var Qa=null;function lg(a){Qa===null?Qa=[a]:Qa.push(a)}function C4(a,c,h,g){var E=c.interleaved;return E===null?(h.next=h,lg(c)):(h.next=E.next,E.next=h),c.interleaved=h,Qi(a,g)}function Qi(a,c){a.lanes|=c;var h=a.alternate;for(h!==null&&(h.lanes|=c),h=a,a=a.return;a!==null;)a.childLanes|=c,h=a.alternate,h!==null&&(h.childLanes|=c),h=a,a=a.return;return h.tag===3?h.stateNode:null}var Uo=!1;function cg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function P4(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Ji(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Wo(a,c,h){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(wt&2)!==0){var E=g.pending;return E===null?c.next=c:(c.next=E.next,E.next=c),g.pending=c,Qi(a,h)}return E=g.interleaved,E===null?(c.next=c,lg(g)):(c.next=E.next,E.next=c),g.interleaved=c,Qi(a,h)}function Yh(a,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194240)!==0)){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,nd(a,h)}}function A4(a,c){var h=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var E=null,A=null;if(h=h.firstBaseUpdate,h!==null){do{var I={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};A===null?E=A=I:A=A.next=I,h=h.next}while(h!==null);A===null?E=A=c:A=A.next=c}else E=A=c;h={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:A,shared:g.shared,effects:g.effects},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=c}function Xh(a,c,h,g){var E=a.updateQueue;Uo=!1;var A=E.firstBaseUpdate,I=E.lastBaseUpdate,$=E.shared.pending;if($!==null){E.shared.pending=null;var W=$,ie=W.next;W.next=null,I===null?A=ie:I.next=ie,I=W;var me=a.alternate;me!==null&&(me=me.updateQueue,$=me.lastBaseUpdate,$!==I&&($===null?me.firstBaseUpdate=ie:$.next=ie,me.lastBaseUpdate=W))}if(A!==null){var ye=E.baseState;I=0,me=ie=W=null,$=A;do{var pe=$.lane,Re=$.eventTime;if((g&pe)===pe){me!==null&&(me=me.next={eventTime:Re,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var Fe=a,$e=$;switch(pe=c,Re=h,$e.tag){case 1:if(Fe=$e.payload,typeof Fe=="function"){ye=Fe.call(Re,ye,pe);break e}ye=Fe;break e;case 3:Fe.flags=Fe.flags&-65537|128;case 0:if(Fe=$e.payload,pe=typeof Fe=="function"?Fe.call(Re,ye,pe):Fe,pe==null)break e;ye=z({},ye,pe);break e;case 2:Uo=!0}}$.callback!==null&&$.lane!==0&&(a.flags|=64,pe=E.effects,pe===null?E.effects=[$]:pe.push($))}else Re={eventTime:Re,lane:pe,tag:$.tag,payload:$.payload,callback:$.callback,next:null},me===null?(ie=me=Re,W=ye):me=me.next=Re,I|=pe;if($=$.next,$===null){if($=E.shared.pending,$===null)break;pe=$,$=pe.next,pe.next=null,E.lastBaseUpdate=pe,E.shared.pending=null}}while(!0);if(me===null&&(W=ye),E.baseState=W,E.firstBaseUpdate=ie,E.lastBaseUpdate=me,c=E.shared.interleaved,c!==null){E=c;do I|=E.lane,E=E.next;while(E!==c)}else A===null&&(E.shared.lanes=0);tl|=I,a.lanes=I,a.memoizedState=ye}}function T4(a,c,h){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var g=a[c],E=g.callback;if(E!==null){if(g.callback=null,g=h,typeof E!="function")throw Error(n(191,E));E.call(g)}}}var _d={},gi=Ho(_d),wd=Ho(_d),xd=Ho(_d);function Ja(a){if(a===_d)throw Error(n(174));return a}function ug(a,c){switch($t(xd,c),$t(wd,a),$t(gi,_d),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Bs(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=Bs(c,a)}Ut(gi),$t(gi,c)}function _c(){Ut(gi),Ut(wd),Ut(xd)}function R4(a){Ja(xd.current);var c=Ja(gi.current),h=Bs(c,a.type);c!==h&&($t(wd,a),$t(gi,h))}function dg(a){wd.current===a&&(Ut(gi),Ut(wd))}var en=Ho(0);function Qh(a){for(var c=a;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var fg=[];function hg(){for(var a=0;a<fg.length;a++)fg[a]._workInProgressVersionPrimary=null;fg.length=0}var Jh=P.ReactCurrentDispatcher,pg=P.ReactCurrentBatchConfig,el=0,tn=null,Ln=null,zn=null,ep=!1,bd=!1,Sd=0,k9=0;function ur(){throw Error(n(321))}function mg(a,c){if(c===null)return!1;for(var h=0;h<c.length&&h<a.length;h++)if(!Ks(a[h],c[h]))return!1;return!0}function vg(a,c,h,g,E,A){if(el=A,tn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Jh.current=a===null||a.memoizedState===null?T9:R9,a=h(g,E),bd){A=0;do{if(bd=!1,Sd=0,25<=A)throw Error(n(301));A+=1,zn=Ln=null,c.updateQueue=null,Jh.current=I9,a=h(g,E)}while(bd)}if(Jh.current=rp,c=Ln!==null&&Ln.next!==null,el=0,zn=Ln=tn=null,ep=!1,c)throw Error(n(300));return a}function gg(){var a=Sd!==0;return Sd=0,a}function yi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zn===null?tn.memoizedState=zn=a:zn=zn.next=a,zn}function Rs(){if(Ln===null){var a=tn.alternate;a=a!==null?a.memoizedState:null}else a=Ln.next;var c=zn===null?tn.memoizedState:zn.next;if(c!==null)zn=c,Ln=a;else{if(a===null)throw Error(n(310));Ln=a,a={memoizedState:Ln.memoizedState,baseState:Ln.baseState,baseQueue:Ln.baseQueue,queue:Ln.queue,next:null},zn===null?tn.memoizedState=zn=a:zn=zn.next=a}return zn}function Ed(a,c){return typeof c=="function"?c(a):c}function yg(a){var c=Rs(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var g=Ln,E=g.baseQueue,A=h.pending;if(A!==null){if(E!==null){var I=E.next;E.next=A.next,A.next=I}g.baseQueue=E=A,h.pending=null}if(E!==null){A=E.next,g=g.baseState;var $=I=null,W=null,ie=A;do{var me=ie.lane;if((el&me)===me)W!==null&&(W=W.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),g=ie.hasEagerState?ie.eagerState:a(g,ie.action);else{var ye={lane:me,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};W===null?($=W=ye,I=g):W=W.next=ye,tn.lanes|=me,tl|=me}ie=ie.next}while(ie!==null&&ie!==A);W===null?I=g:W.next=$,Ks(g,c.memoizedState)||(Or=!0),c.memoizedState=g,c.baseState=I,c.baseQueue=W,h.lastRenderedState=g}if(a=h.interleaved,a!==null){E=a;do A=E.lane,tn.lanes|=A,tl|=A,E=E.next;while(E!==a)}else E===null&&(h.lanes=0);return[c.memoizedState,h.dispatch]}function _g(a){var c=Rs(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var g=h.dispatch,E=h.pending,A=c.memoizedState;if(E!==null){h.pending=null;var I=E=E.next;do A=a(A,I.action),I=I.next;while(I!==E);Ks(A,c.memoizedState)||(Or=!0),c.memoizedState=A,c.baseQueue===null&&(c.baseState=A),h.lastRenderedState=A}return[A,g]}function I4(){}function M4(a,c){var h=tn,g=Rs(),E=c(),A=!Ks(g.memoizedState,E);if(A&&(g.memoizedState=E,Or=!0),g=g.queue,wg(D4.bind(null,h,g,a),[a]),g.getSnapshot!==c||A||zn!==null&&zn.memoizedState.tag&1){if(h.flags|=2048,kd(9,L4.bind(null,h,g,E,c),void 0,null),Bn===null)throw Error(n(349));(el&30)!==0||O4(h,c,E)}return E}function O4(a,c,h){a.flags|=16384,a={getSnapshot:c,value:h},c=tn.updateQueue,c===null?(c={lastEffect:null,stores:null},tn.updateQueue=c,c.stores=[a]):(h=c.stores,h===null?c.stores=[a]:h.push(a))}function L4(a,c,h,g){c.value=h,c.getSnapshot=g,N4(c)&&j4(a)}function D4(a,c,h){return h(function(){N4(c)&&j4(a)})}function N4(a){var c=a.getSnapshot;a=a.value;try{var h=c();return!Ks(a,h)}catch{return!0}}function j4(a){var c=Qi(a,1);c!==null&&ei(c,a,1,-1)}function F4(a){var c=yi();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ed,lastRenderedState:a},c.queue=a,a=a.dispatch=A9.bind(null,tn,a),[c.memoizedState,a]}function kd(a,c,h,g){return a={tag:a,create:c,destroy:h,deps:g,next:null},c=tn.updateQueue,c===null?(c={lastEffect:null,stores:null},tn.updateQueue=c,c.lastEffect=a.next=a):(h=c.lastEffect,h===null?c.lastEffect=a.next=a:(g=h.next,h.next=a,a.next=g,c.lastEffect=a)),a}function V4(){return Rs().memoizedState}function tp(a,c,h,g){var E=yi();tn.flags|=a,E.memoizedState=kd(1|c,h,void 0,g===void 0?null:g)}function np(a,c,h,g){var E=Rs();g=g===void 0?null:g;var A=void 0;if(Ln!==null){var I=Ln.memoizedState;if(A=I.destroy,g!==null&&mg(g,I.deps)){E.memoizedState=kd(c,h,A,g);return}}tn.flags|=a,E.memoizedState=kd(1|c,h,A,g)}function $4(a,c){return tp(8390656,8,a,c)}function wg(a,c){return np(2048,8,a,c)}function H4(a,c){return np(4,2,a,c)}function z4(a,c){return np(4,4,a,c)}function B4(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function U4(a,c,h){return h=h!=null?h.concat([a]):null,np(4,4,B4.bind(null,c,a),h)}function xg(){}function W4(a,c){var h=Rs();c=c===void 0?null:c;var g=h.memoizedState;return g!==null&&c!==null&&mg(c,g[1])?g[0]:(h.memoizedState=[a,c],a)}function Z4(a,c){var h=Rs();c=c===void 0?null:c;var g=h.memoizedState;return g!==null&&c!==null&&mg(c,g[1])?g[0]:(a=a(),h.memoizedState=[a,c],a)}function q4(a,c,h){return(el&21)===0?(a.baseState&&(a.baseState=!1,Or=!0),a.memoizedState=h):(Ks(h,c)||(h=kv(),tn.lanes|=h,tl|=h,a.baseState=!0),c)}function C9(a,c){var h=Pt;Pt=h!==0&&4>h?h:4,a(!0);var g=pg.transition;pg.transition={};try{a(!1),c()}finally{Pt=h,pg.transition=g}}function G4(){return Rs().memoizedState}function P9(a,c,h){var g=Ko(a);if(h={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null},K4(a))Y4(c,h);else if(h=C4(a,c,h,g),h!==null){var E=xr();ei(h,a,g,E),X4(h,c,g)}}function A9(a,c,h){var g=Ko(a),E={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null};if(K4(a))Y4(c,E);else{var A=a.alternate;if(a.lanes===0&&(A===null||A.lanes===0)&&(A=c.lastRenderedReducer,A!==null))try{var I=c.lastRenderedState,$=A(I,h);if(E.hasEagerState=!0,E.eagerState=$,Ks($,I)){var W=c.interleaved;W===null?(E.next=E,lg(c)):(E.next=W.next,W.next=E),c.interleaved=E;return}}catch{}finally{}h=C4(a,c,E,g),h!==null&&(E=xr(),ei(h,a,g,E),X4(h,c,g))}}function K4(a){var c=a.alternate;return a===tn||c!==null&&c===tn}function Y4(a,c){bd=ep=!0;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}function X4(a,c,h){if((h&4194240)!==0){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,nd(a,h)}}var rp={readContext:Ts,useCallback:ur,useContext:ur,useEffect:ur,useImperativeHandle:ur,useInsertionEffect:ur,useLayoutEffect:ur,useMemo:ur,useReducer:ur,useRef:ur,useState:ur,useDebugValue:ur,useDeferredValue:ur,useTransition:ur,useMutableSource:ur,useSyncExternalStore:ur,useId:ur,unstable_isNewReconciler:!1},T9={readContext:Ts,useCallback:function(a,c){return yi().memoizedState=[a,c===void 0?null:c],a},useContext:Ts,useEffect:$4,useImperativeHandle:function(a,c,h){return h=h!=null?h.concat([a]):null,tp(4194308,4,B4.bind(null,c,a),h)},useLayoutEffect:function(a,c){return tp(4194308,4,a,c)},useInsertionEffect:function(a,c){return tp(4,2,a,c)},useMemo:function(a,c){var h=yi();return c=c===void 0?null:c,a=a(),h.memoizedState=[a,c],a},useReducer:function(a,c,h){var g=yi();return c=h!==void 0?h(c):c,g.memoizedState=g.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},g.queue=a,a=a.dispatch=P9.bind(null,tn,a),[g.memoizedState,a]},useRef:function(a){var c=yi();return a={current:a},c.memoizedState=a},useState:F4,useDebugValue:xg,useDeferredValue:function(a){return yi().memoizedState=a},useTransition:function(){var a=F4(!1),c=a[0];return a=C9.bind(null,a[1]),yi().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,h){var g=tn,E=yi();if(Xt){if(h===void 0)throw Error(n(407));h=h()}else{if(h=c(),Bn===null)throw Error(n(349));(el&30)!==0||O4(g,c,h)}E.memoizedState=h;var A={value:h,getSnapshot:c};return E.queue=A,$4(D4.bind(null,g,A,a),[a]),g.flags|=2048,kd(9,L4.bind(null,g,A,h,c),void 0,null),h},useId:function(){var a=yi(),c=Bn.identifierPrefix;if(Xt){var h=Xi,g=Yi;h=(g&~(1<<32-es(g)-1)).toString(32)+h,c=":"+c+"R"+h,h=Sd++,0<h&&(c+="H"+h.toString(32)),c+=":"}else h=k9++,c=":"+c+"r"+h.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},R9={readContext:Ts,useCallback:W4,useContext:Ts,useEffect:wg,useImperativeHandle:U4,useInsertionEffect:H4,useLayoutEffect:z4,useMemo:Z4,useReducer:yg,useRef:V4,useState:function(){return yg(Ed)},useDebugValue:xg,useDeferredValue:function(a){var c=Rs();return q4(c,Ln.memoizedState,a)},useTransition:function(){var a=yg(Ed)[0],c=Rs().memoizedState;return[a,c]},useMutableSource:I4,useSyncExternalStore:M4,useId:G4,unstable_isNewReconciler:!1},I9={readContext:Ts,useCallback:W4,useContext:Ts,useEffect:wg,useImperativeHandle:U4,useInsertionEffect:H4,useLayoutEffect:z4,useMemo:Z4,useReducer:_g,useRef:V4,useState:function(){return _g(Ed)},useDebugValue:xg,useDeferredValue:function(a){var c=Rs();return Ln===null?c.memoizedState=a:q4(c,Ln.memoizedState,a)},useTransition:function(){var a=_g(Ed)[0],c=Rs().memoizedState;return[a,c]},useMutableSource:I4,useSyncExternalStore:M4,useId:G4,unstable_isNewReconciler:!1};function Xs(a,c){if(a&&a.defaultProps){c=z({},c),a=a.defaultProps;for(var h in a)c[h]===void 0&&(c[h]=a[h]);return c}return c}function bg(a,c,h,g){c=a.memoizedState,h=h(g,c),h=h==null?c:z({},c,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var sp={isMounted:function(a){return(a=a._reactInternals)?Zs(a)===a:!1},enqueueSetState:function(a,c,h){a=a._reactInternals;var g=xr(),E=Ko(a),A=Ji(g,E);A.payload=c,h!=null&&(A.callback=h),c=Wo(a,A,E),c!==null&&(ei(c,a,E,g),Yh(c,a,E))},enqueueReplaceState:function(a,c,h){a=a._reactInternals;var g=xr(),E=Ko(a),A=Ji(g,E);A.tag=1,A.payload=c,h!=null&&(A.callback=h),c=Wo(a,A,E),c!==null&&(ei(c,a,E,g),Yh(c,a,E))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var h=xr(),g=Ko(a),E=Ji(h,g);E.tag=2,c!=null&&(E.callback=c),c=Wo(a,E,g),c!==null&&(ei(c,a,g,h),Yh(c,a,g))}};function Q4(a,c,h,g,E,A,I){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,A,I):c.prototype&&c.prototype.isPureReactComponent?!dd(h,g)||!dd(E,A):!0}function J4(a,c,h){var g=!1,E=zo,A=c.contextType;return typeof A=="object"&&A!==null?A=Ts(A):(E=Mr(c)?Ka:cr.current,g=c.contextTypes,A=(g=g!=null)?fc(a,E):zo),c=new c(h,A),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=sp,a.stateNode=c,c._reactInternals=a,g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=E,a.__reactInternalMemoizedMaskedChildContext=A),c}function e6(a,c,h,g){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,g),c.state!==a&&sp.enqueueReplaceState(c,c.state,null)}function Sg(a,c,h,g){var E=a.stateNode;E.props=h,E.state=a.memoizedState,E.refs={},cg(a);var A=c.contextType;typeof A=="object"&&A!==null?E.context=Ts(A):(A=Mr(c)?Ka:cr.current,E.context=fc(a,A)),E.state=a.memoizedState,A=c.getDerivedStateFromProps,typeof A=="function"&&(bg(a,c,A,h),E.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(c=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),c!==E.state&&sp.enqueueReplaceState(E,E.state,null),Xh(a,h,E,g),E.state=a.memoizedState),typeof E.componentDidMount=="function"&&(a.flags|=4194308)}function wc(a,c){try{var h="",g=c;do h+=ee(g),g=g.return;while(g);var E=h}catch(A){E=`
41
- Error generating stack: `+A.message+`
42
- `+A.stack}return{value:a,source:c,stack:E,digest:null}}function Eg(a,c,h){return{value:a,source:null,stack:h??null,digest:c??null}}function kg(a,c){try{console.error(c.value)}catch(h){setTimeout(function(){throw h})}}var M9=typeof WeakMap=="function"?WeakMap:Map;function t6(a,c,h){h=Ji(-1,h),h.tag=3,h.payload={element:null};var g=c.value;return h.callback=function(){dp||(dp=!0,$g=g),kg(a,c)},h}function n6(a,c,h){h=Ji(-1,h),h.tag=3;var g=a.type.getDerivedStateFromError;if(typeof g=="function"){var E=c.value;h.payload=function(){return g(E)},h.callback=function(){kg(a,c)}}var A=a.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(h.callback=function(){kg(a,c),typeof g!="function"&&(qo===null?qo=new Set([this]):qo.add(this));var I=c.stack;this.componentDidCatch(c.value,{componentStack:I!==null?I:""})}),h}function r6(a,c,h){var g=a.pingCache;if(g===null){g=a.pingCache=new M9;var E=new Set;g.set(c,E)}else E=g.get(c),E===void 0&&(E=new Set,g.set(c,E));E.has(h)||(E.add(h),a=Z9.bind(null,a,c,h),c.then(a,a))}function s6(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function i6(a,c,h,g,E){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(c=Ji(-1,1),c.tag=2,Wo(h,c,1))),h.lanes|=1),a):(a.flags|=65536,a.lanes=E,a)}var O9=P.ReactCurrentOwner,Or=!1;function wr(a,c,h,g){c.child=a===null?k4(c,null,h,g):vc(c,a.child,h,g)}function o6(a,c,h,g,E){h=h.render;var A=c.ref;return yc(c,E),g=vg(a,c,h,g,A,E),h=gg(),a!==null&&!Or?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,eo(a,c,E)):(Xt&&h&&Jv(c),c.flags|=1,wr(a,c,g,E),c.child)}function a6(a,c,h,g,E){if(a===null){var A=h.type;return typeof A=="function"&&!qg(A)&&A.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(c.tag=15,c.type=A,l6(a,c,A,g,E)):(a=gp(h.type,null,g,c,c.mode,E),a.ref=c.ref,a.return=c,c.child=a)}if(A=a.child,(a.lanes&E)===0){var I=A.memoizedProps;if(h=h.compare,h=h!==null?h:dd,h(I,g)&&a.ref===c.ref)return eo(a,c,E)}return c.flags|=1,a=Xo(A,g),a.ref=c.ref,a.return=c,c.child=a}function l6(a,c,h,g,E){if(a!==null){var A=a.memoizedProps;if(dd(A,g)&&a.ref===c.ref)if(Or=!1,c.pendingProps=g=A,(a.lanes&E)!==0)(a.flags&131072)!==0&&(Or=!0);else return c.lanes=a.lanes,eo(a,c,E)}return Cg(a,c,h,g,E)}function c6(a,c,h){var g=c.pendingProps,E=g.children,A=a!==null?a.memoizedState:null;if(g.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},$t(bc,os),os|=h;else{if((h&1073741824)===0)return a=A!==null?A.baseLanes|h:h,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,$t(bc,os),os|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=A!==null?A.baseLanes:h,$t(bc,os),os|=g}else A!==null?(g=A.baseLanes|h,c.memoizedState=null):g=h,$t(bc,os),os|=g;return wr(a,c,E,h),c.child}function u6(a,c){var h=c.ref;(a===null&&h!==null||a!==null&&a.ref!==h)&&(c.flags|=512,c.flags|=2097152)}function Cg(a,c,h,g,E){var A=Mr(h)?Ka:cr.current;return A=fc(c,A),yc(c,E),h=vg(a,c,h,g,A,E),g=gg(),a!==null&&!Or?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,eo(a,c,E)):(Xt&&g&&Jv(c),c.flags|=1,wr(a,c,h,E),c.child)}function d6(a,c,h,g,E){if(Mr(h)){var A=!0;zh(c)}else A=!1;if(yc(c,E),c.stateNode===null)op(a,c),J4(c,h,g),Sg(c,h,g,E),g=!0;else if(a===null){var I=c.stateNode,$=c.memoizedProps;I.props=$;var W=I.context,ie=h.contextType;typeof ie=="object"&&ie!==null?ie=Ts(ie):(ie=Mr(h)?Ka:cr.current,ie=fc(c,ie));var me=h.getDerivedStateFromProps,ye=typeof me=="function"||typeof I.getSnapshotBeforeUpdate=="function";ye||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||($!==g||W!==ie)&&e6(c,I,g,ie),Uo=!1;var pe=c.memoizedState;I.state=pe,Xh(c,g,I,E),W=c.memoizedState,$!==g||pe!==W||Ir.current||Uo?(typeof me=="function"&&(bg(c,h,me,g),W=c.memoizedState),($=Uo||Q4(c,h,$,g,pe,W,ie))?(ye||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(c.flags|=4194308)):(typeof I.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=W),I.props=g,I.state=W,I.context=ie,g=$):(typeof I.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{I=c.stateNode,P4(a,c),$=c.memoizedProps,ie=c.type===c.elementType?$:Xs(c.type,$),I.props=ie,ye=c.pendingProps,pe=I.context,W=h.contextType,typeof W=="object"&&W!==null?W=Ts(W):(W=Mr(h)?Ka:cr.current,W=fc(c,W));var Re=h.getDerivedStateFromProps;(me=typeof Re=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||($!==ye||pe!==W)&&e6(c,I,g,W),Uo=!1,pe=c.memoizedState,I.state=pe,Xh(c,g,I,E);var Fe=c.memoizedState;$!==ye||pe!==Fe||Ir.current||Uo?(typeof Re=="function"&&(bg(c,h,Re,g),Fe=c.memoizedState),(ie=Uo||Q4(c,h,ie,g,pe,Fe,W)||!1)?(me||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(g,Fe,W),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(g,Fe,W)),typeof I.componentDidUpdate=="function"&&(c.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof I.componentDidUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=Fe),I.props=g,I.state=Fe,I.context=W,g=ie):(typeof I.componentDidUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),g=!1)}return Pg(a,c,h,g,A,E)}function Pg(a,c,h,g,E,A){u6(a,c);var I=(c.flags&128)!==0;if(!g&&!I)return E&&v4(c,h,!1),eo(a,c,A);g=c.stateNode,O9.current=c;var $=I&&typeof h.getDerivedStateFromError!="function"?null:g.render();return c.flags|=1,a!==null&&I?(c.child=vc(c,a.child,null,A),c.child=vc(c,null,$,A)):wr(a,c,$,A),c.memoizedState=g.state,E&&v4(c,h,!0),c.child}function f6(a){var c=a.stateNode;c.pendingContext?p4(a,c.pendingContext,c.pendingContext!==c.context):c.context&&p4(a,c.context,!1),ug(a,c.containerInfo)}function h6(a,c,h,g,E){return mc(),rg(E),c.flags|=256,wr(a,c,h,g),c.child}var Ag={dehydrated:null,treeContext:null,retryLane:0};function Tg(a){return{baseLanes:a,cachePool:null,transitions:null}}function p6(a,c,h){var g=c.pendingProps,E=en.current,A=!1,I=(c.flags&128)!==0,$;if(($=I)||($=a!==null&&a.memoizedState===null?!1:(E&2)!==0),$?(A=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(E|=1),$t(en,E&1),a===null)return ng(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(I=g.children,a=g.fallback,A?(g=c.mode,A=c.child,I={mode:"hidden",children:I},(g&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=I):A=yp(I,g,0,null),a=il(a,g,h,null),A.return=c,a.return=c,A.sibling=a,c.child=A,c.child.memoizedState=Tg(h),c.memoizedState=Ag,a):Rg(c,I));if(E=a.memoizedState,E!==null&&($=E.dehydrated,$!==null))return L9(a,c,I,g,$,E,h);if(A){A=g.fallback,I=c.mode,E=a.child,$=E.sibling;var W={mode:"hidden",children:g.children};return(I&1)===0&&c.child!==E?(g=c.child,g.childLanes=0,g.pendingProps=W,c.deletions=null):(g=Xo(E,W),g.subtreeFlags=E.subtreeFlags&14680064),$!==null?A=Xo($,A):(A=il(A,I,h,null),A.flags|=2),A.return=c,g.return=c,g.sibling=A,c.child=g,g=A,A=c.child,I=a.child.memoizedState,I=I===null?Tg(h):{baseLanes:I.baseLanes|h,cachePool:null,transitions:I.transitions},A.memoizedState=I,A.childLanes=a.childLanes&~h,c.memoizedState=Ag,g}return A=a.child,a=A.sibling,g=Xo(A,{mode:"visible",children:g.children}),(c.mode&1)===0&&(g.lanes=h),g.return=c,g.sibling=null,a!==null&&(h=c.deletions,h===null?(c.deletions=[a],c.flags|=16):h.push(a)),c.child=g,c.memoizedState=null,g}function Rg(a,c){return c=yp({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function ip(a,c,h,g){return g!==null&&rg(g),vc(c,a.child,null,h),a=Rg(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function L9(a,c,h,g,E,A,I){if(h)return c.flags&256?(c.flags&=-257,g=Eg(Error(n(422))),ip(a,c,I,g)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(A=g.fallback,E=c.mode,g=yp({mode:"visible",children:g.children},E,0,null),A=il(A,E,I,null),A.flags|=2,g.return=c,A.return=c,g.sibling=A,c.child=g,(c.mode&1)!==0&&vc(c,a.child,null,I),c.child.memoizedState=Tg(I),c.memoizedState=Ag,A);if((c.mode&1)===0)return ip(a,c,I,null);if(E.data==="$!"){if(g=E.nextSibling&&E.nextSibling.dataset,g)var $=g.dgst;return g=$,A=Error(n(419)),g=Eg(A,g,void 0),ip(a,c,I,g)}if($=(I&a.childLanes)!==0,Or||$){if(g=Bn,g!==null){switch(I&-I){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&(g.suspendedLanes|I))!==0?0:E,E!==0&&E!==A.retryLane&&(A.retryLane=E,Qi(a,E),ei(g,a,E,-1))}return Zg(),g=Eg(Error(n(421))),ip(a,c,I,g)}return E.data==="$?"?(c.flags|=128,c.child=a.child,c=q9.bind(null,a),E._reactRetry=c,null):(a=A.treeContext,is=$o(E.nextSibling),ss=c,Xt=!0,Ys=null,a!==null&&(Ps[As++]=Yi,Ps[As++]=Xi,Ps[As++]=Ya,Yi=a.id,Xi=a.overflow,Ya=c),c=Rg(c,g.children),c.flags|=4096,c)}function m6(a,c,h){a.lanes|=c;var g=a.alternate;g!==null&&(g.lanes|=c),ag(a.return,c,h)}function Ig(a,c,h,g,E){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:E}:(A.isBackwards=c,A.rendering=null,A.renderingStartTime=0,A.last=g,A.tail=h,A.tailMode=E)}function v6(a,c,h){var g=c.pendingProps,E=g.revealOrder,A=g.tail;if(wr(a,c,g.children,h),g=en.current,(g&2)!==0)g=g&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&m6(a,h,c);else if(a.tag===19)m6(a,h,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}g&=1}if($t(en,g),(c.mode&1)===0)c.memoizedState=null;else switch(E){case"forwards":for(h=c.child,E=null;h!==null;)a=h.alternate,a!==null&&Qh(a)===null&&(E=h),h=h.sibling;h=E,h===null?(E=c.child,c.child=null):(E=h.sibling,h.sibling=null),Ig(c,!1,E,h,A);break;case"backwards":for(h=null,E=c.child,c.child=null;E!==null;){if(a=E.alternate,a!==null&&Qh(a)===null){c.child=E;break}a=E.sibling,E.sibling=h,h=E,E=a}Ig(c,!0,h,null,A);break;case"together":Ig(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function op(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function eo(a,c,h){if(a!==null&&(c.dependencies=a.dependencies),tl|=c.lanes,(h&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,h=Xo(a,a.pendingProps),c.child=h,h.return=c;a.sibling!==null;)a=a.sibling,h=h.sibling=Xo(a,a.pendingProps),h.return=c;h.sibling=null}return c.child}function D9(a,c,h){switch(c.tag){case 3:f6(c),mc();break;case 5:R4(c);break;case 1:Mr(c.type)&&zh(c);break;case 4:ug(c,c.stateNode.containerInfo);break;case 10:var g=c.type._context,E=c.memoizedProps.value;$t(Gh,g._currentValue),g._currentValue=E;break;case 13:if(g=c.memoizedState,g!==null)return g.dehydrated!==null?($t(en,en.current&1),c.flags|=128,null):(h&c.child.childLanes)!==0?p6(a,c,h):($t(en,en.current&1),a=eo(a,c,h),a!==null?a.sibling:null);$t(en,en.current&1);break;case 19:if(g=(h&c.childLanes)!==0,(a.flags&128)!==0){if(g)return v6(a,c,h);c.flags|=128}if(E=c.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),$t(en,en.current),g)break;return null;case 22:case 23:return c.lanes=0,c6(a,c,h)}return eo(a,c,h)}var g6,Mg,y6,_6;g6=function(a,c){for(var h=c.child;h!==null;){if(h.tag===5||h.tag===6)a.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},Mg=function(){},y6=function(a,c,h,g){var E=a.memoizedProps;if(E!==g){a=c.stateNode,Ja(gi.current);var A=null;switch(h){case"input":E=Qe(a,E),g=Qe(a,g),A=[];break;case"select":E=z({},E,{value:void 0}),g=z({},g,{value:void 0}),A=[];break;case"textarea":E=We(a,E),g=We(a,g),A=[];break;default:typeof E.onClick!="function"&&typeof g.onClick=="function"&&(a.onclick=Vh)}Ws(h,g);var I;h=null;for(ie in E)if(!g.hasOwnProperty(ie)&&E.hasOwnProperty(ie)&&E[ie]!=null)if(ie==="style"){var $=E[ie];for(I in $)$.hasOwnProperty(I)&&(h||(h={}),h[I]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(s.hasOwnProperty(ie)?A||(A=[]):(A=A||[]).push(ie,null));for(ie in g){var W=g[ie];if($=E!=null?E[ie]:void 0,g.hasOwnProperty(ie)&&W!==$&&(W!=null||$!=null))if(ie==="style")if($){for(I in $)!$.hasOwnProperty(I)||W&&W.hasOwnProperty(I)||(h||(h={}),h[I]="");for(I in W)W.hasOwnProperty(I)&&$[I]!==W[I]&&(h||(h={}),h[I]=W[I])}else h||(A||(A=[]),A.push(ie,h)),h=W;else ie==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,$=$?$.__html:void 0,W!=null&&$!==W&&(A=A||[]).push(ie,W)):ie==="children"?typeof W!="string"&&typeof W!="number"||(A=A||[]).push(ie,""+W):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(s.hasOwnProperty(ie)?(W!=null&&ie==="onScroll"&&Bt("scroll",a),A||$===W||(A=[])):(A=A||[]).push(ie,W))}h&&(A=A||[]).push("style",h);var ie=A;(c.updateQueue=ie)&&(c.flags|=4)}},_6=function(a,c,h,g){h!==g&&(c.flags|=4)};function Cd(a,c){if(!Xt)switch(a.tailMode){case"hidden":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function dr(a){var c=a.alternate!==null&&a.alternate.child===a.child,h=0,g=0;if(c)for(var E=a.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags&14680064,g|=E.flags&14680064,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=g,a.childLanes=h,c}function N9(a,c,h){var g=c.pendingProps;switch(eg(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dr(c),null;case 1:return Mr(c.type)&&Hh(),dr(c),null;case 3:return g=c.stateNode,_c(),Ut(Ir),Ut(cr),hg(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(a===null||a.child===null)&&(Zh(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Ys!==null&&(Bg(Ys),Ys=null))),Mg(a,c),dr(c),null;case 5:dg(c);var E=Ja(xd.current);if(h=c.type,a!==null&&c.stateNode!=null)y6(a,c,h,g,E),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!g){if(c.stateNode===null)throw Error(n(166));return dr(c),null}if(a=Ja(gi.current),Zh(c)){g=c.stateNode,h=c.type;var A=c.memoizedProps;switch(g[vi]=c,g[vd]=A,a=(c.mode&1)!==0,h){case"dialog":Bt("cancel",g),Bt("close",g);break;case"iframe":case"object":case"embed":Bt("load",g);break;case"video":case"audio":for(E=0;E<hd.length;E++)Bt(hd[E],g);break;case"source":Bt("error",g);break;case"img":case"image":case"link":Bt("error",g),Bt("load",g);break;case"details":Bt("toggle",g);break;case"input":lt(g,A),Bt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!A.multiple},Bt("invalid",g);break;case"textarea":xe(g,A),Bt("invalid",g)}Ws(h,A),E=null;for(var I in A)if(A.hasOwnProperty(I)){var $=A[I];I==="children"?typeof $=="string"?g.textContent!==$&&(A.suppressHydrationWarning!==!0&&Fh(g.textContent,$,a),E=["children",$]):typeof $=="number"&&g.textContent!==""+$&&(A.suppressHydrationWarning!==!0&&Fh(g.textContent,$,a),E=["children",""+$]):s.hasOwnProperty(I)&&$!=null&&I==="onScroll"&&Bt("scroll",g)}switch(h){case"input":Se(g),st(g,A,!0);break;case"textarea":Se(g),Rt(g);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(g.onclick=Vh)}g=E,c.updateQueue=g,g!==null&&(c.flags|=4)}else{I=E.nodeType===9?E:E.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=Ar(h)),a==="http://www.w3.org/1999/xhtml"?h==="script"?(a=I.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof g.is=="string"?a=I.createElement(h,{is:g.is}):(a=I.createElement(h),h==="select"&&(I=a,g.multiple?I.multiple=!0:g.size&&(I.size=g.size))):a=I.createElementNS(a,h),a[vi]=c,a[vd]=g,g6(a,c,!1,!1),c.stateNode=a;e:{switch(I=Zi(h,g),h){case"dialog":Bt("cancel",a),Bt("close",a),E=g;break;case"iframe":case"object":case"embed":Bt("load",a),E=g;break;case"video":case"audio":for(E=0;E<hd.length;E++)Bt(hd[E],a);E=g;break;case"source":Bt("error",a),E=g;break;case"img":case"image":case"link":Bt("error",a),Bt("load",a),E=g;break;case"details":Bt("toggle",a),E=g;break;case"input":lt(a,g),E=Qe(a,g),Bt("invalid",a);break;case"option":E=g;break;case"select":a._wrapperState={wasMultiple:!!g.multiple},E=z({},g,{value:void 0}),Bt("invalid",a);break;case"textarea":xe(a,g),E=We(a,g),Bt("invalid",a);break;default:E=g}Ws(h,E),$=E;for(A in $)if($.hasOwnProperty(A)){var W=$[A];A==="style"?Lo(a,W):A==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,W!=null&&kn(a,W)):A==="children"?typeof W=="string"?(h!=="textarea"||W!=="")&&Us(a,W):typeof W=="number"&&Us(a,""+W):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(s.hasOwnProperty(A)?W!=null&&A==="onScroll"&&Bt("scroll",a):W!=null&&C(a,A,W,I))}switch(h){case"input":Se(a),st(a,g,!1);break;case"textarea":Se(a),Rt(a);break;case"option":g.value!=null&&a.setAttribute("value",""+le(g.value));break;case"select":a.multiple=!!g.multiple,A=g.value,A!=null?Me(a,!!g.multiple,A,!1):g.defaultValue!=null&&Me(a,!!g.multiple,g.defaultValue,!0);break;default:typeof E.onClick=="function"&&(a.onclick=Vh)}switch(h){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return dr(c),null;case 6:if(a&&c.stateNode!=null)_6(a,c,a.memoizedProps,g);else{if(typeof g!="string"&&c.stateNode===null)throw Error(n(166));if(h=Ja(xd.current),Ja(gi.current),Zh(c)){if(g=c.stateNode,h=c.memoizedProps,g[vi]=c,(A=g.nodeValue!==h)&&(a=ss,a!==null))switch(a.tag){case 3:Fh(g.nodeValue,h,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Fh(g.nodeValue,h,(a.mode&1)!==0)}A&&(c.flags|=4)}else g=(h.nodeType===9?h:h.ownerDocument).createTextNode(g),g[vi]=c,c.stateNode=g}return dr(c),null;case 13:if(Ut(en),g=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(Xt&&is!==null&&(c.mode&1)!==0&&(c.flags&128)===0)b4(),mc(),c.flags|=98560,A=!1;else if(A=Zh(c),g!==null&&g.dehydrated!==null){if(a===null){if(!A)throw Error(n(318));if(A=c.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[vi]=c}else mc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;dr(c),A=!1}else Ys!==null&&(Bg(Ys),Ys=null),A=!0;if(!A)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=h,c):(g=g!==null,g!==(a!==null&&a.memoizedState!==null)&&g&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(en.current&1)!==0?Dn===0&&(Dn=3):Zg())),c.updateQueue!==null&&(c.flags|=4),dr(c),null);case 4:return _c(),Mg(a,c),a===null&&pd(c.stateNode.containerInfo),dr(c),null;case 10:return og(c.type._context),dr(c),null;case 17:return Mr(c.type)&&Hh(),dr(c),null;case 19:if(Ut(en),A=c.memoizedState,A===null)return dr(c),null;if(g=(c.flags&128)!==0,I=A.rendering,I===null)if(g)Cd(A,!1);else{if(Dn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(I=Qh(a),I!==null){for(c.flags|=128,Cd(A,!1),g=I.updateQueue,g!==null&&(c.updateQueue=g,c.flags|=4),c.subtreeFlags=0,g=h,h=c.child;h!==null;)A=h,a=g,A.flags&=14680066,I=A.alternate,I===null?(A.childLanes=0,A.lanes=a,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=I.childLanes,A.lanes=I.lanes,A.child=I.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=I.memoizedProps,A.memoizedState=I.memoizedState,A.updateQueue=I.updateQueue,A.type=I.type,a=I.dependencies,A.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),h=h.sibling;return $t(en,en.current&1|2),c.child}a=a.sibling}A.tail!==null&&zt()>Sc&&(c.flags|=128,g=!0,Cd(A,!1),c.lanes=4194304)}else{if(!g)if(a=Qh(I),a!==null){if(c.flags|=128,g=!0,h=a.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),Cd(A,!0),A.tail===null&&A.tailMode==="hidden"&&!I.alternate&&!Xt)return dr(c),null}else 2*zt()-A.renderingStartTime>Sc&&h!==1073741824&&(c.flags|=128,g=!0,Cd(A,!1),c.lanes=4194304);A.isBackwards?(I.sibling=c.child,c.child=I):(h=A.last,h!==null?h.sibling=I:c.child=I,A.last=I)}return A.tail!==null?(c=A.tail,A.rendering=c,A.tail=c.sibling,A.renderingStartTime=zt(),c.sibling=null,h=en.current,$t(en,g?h&1|2:h&1),c):(dr(c),null);case 22:case 23:return Wg(),g=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==g&&(c.flags|=8192),g&&(c.mode&1)!==0?(os&1073741824)!==0&&(dr(c),c.subtreeFlags&6&&(c.flags|=8192)):dr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function j9(a,c){switch(eg(c),c.tag){case 1:return Mr(c.type)&&Hh(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return _c(),Ut(Ir),Ut(cr),hg(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return dg(c),null;case 13:if(Ut(en),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));mc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return Ut(en),null;case 4:return _c(),null;case 10:return og(c.type._context),null;case 22:case 23:return Wg(),null;case 24:return null;default:return null}}var ap=!1,fr=!1,F9=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function xc(a,c){var h=a.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(g){fn(a,c,g)}else h.current=null}function Og(a,c,h){try{h()}catch(g){fn(a,c,g)}}var w6=!1;function V9(a,c){if(Wv=Cs,a=Qb(),jv(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var E=g.anchorOffset,A=g.focusNode;g=g.focusOffset;try{h.nodeType,A.nodeType}catch{h=null;break e}var I=0,$=-1,W=-1,ie=0,me=0,ye=a,pe=null;t:for(;;){for(var Re;ye!==h||E!==0&&ye.nodeType!==3||($=I+E),ye!==A||g!==0&&ye.nodeType!==3||(W=I+g),ye.nodeType===3&&(I+=ye.nodeValue.length),(Re=ye.firstChild)!==null;)pe=ye,ye=Re;for(;;){if(ye===a)break t;if(pe===h&&++ie===E&&($=I),pe===A&&++me===g&&(W=I),(Re=ye.nextSibling)!==null)break;ye=pe,pe=ye.parentNode}ye=Re}h=$===-1||W===-1?null:{start:$,end:W}}else h=null}h=h||{start:0,end:0}}else h=null;for(Zv={focusedElem:a,selectionRange:h},Cs=!1,Oe=c;Oe!==null;)if(c=Oe,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Oe=a;else for(;Oe!==null;){c=Oe;try{var Fe=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Fe!==null){var $e=Fe.memoizedProps,wn=Fe.memoizedState,J=c.stateNode,K=J.getSnapshotBeforeUpdate(c.elementType===c.type?$e:Xs(c.type,$e),wn);J.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var re=c.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(be){fn(c,c.return,be)}if(a=c.sibling,a!==null){a.return=c.return,Oe=a;break}Oe=c.return}return Fe=w6,w6=!1,Fe}function Pd(a,c,h){var g=c.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var E=g=g.next;do{if((E.tag&a)===a){var A=E.destroy;E.destroy=void 0,A!==void 0&&Og(c,h,A)}E=E.next}while(E!==g)}}function lp(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&a)===a){var g=h.create;h.destroy=g()}h=h.next}while(h!==c)}}function Lg(a){var c=a.ref;if(c!==null){var h=a.stateNode;switch(a.tag){case 5:a=h;break;default:a=h}typeof c=="function"?c(a):c.current=a}}function x6(a){var c=a.alternate;c!==null&&(a.alternate=null,x6(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[vi],delete c[vd],delete c[Yv],delete c[x9],delete c[b9])),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 b6(a){return a.tag===5||a.tag===3||a.tag===4}function S6(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||b6(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 Dg(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(a,c):h.insertBefore(a,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(a,h)):(c=h,c.appendChild(a)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=Vh));else if(g!==4&&(a=a.child,a!==null))for(Dg(a,c,h),a=a.sibling;a!==null;)Dg(a,c,h),a=a.sibling}function Ng(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?h.insertBefore(a,c):h.appendChild(a);else if(g!==4&&(a=a.child,a!==null))for(Ng(a,c,h),a=a.sibling;a!==null;)Ng(a,c,h),a=a.sibling}var er=null,Qs=!1;function Zo(a,c,h){for(h=h.child;h!==null;)E6(a,c,h),h=h.sibling}function E6(a,c,h){if(ks&&typeof ks.onCommitFiberUnmount=="function")try{ks.onCommitFiberUnmount(Do,h)}catch{}switch(h.tag){case 5:fr||xc(h,c);case 6:var g=er,E=Qs;er=null,Zo(a,c,h),er=g,Qs=E,er!==null&&(Qs?(a=er,h=h.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)):er.removeChild(h.stateNode));break;case 18:er!==null&&(Qs?(a=er,h=h.stateNode,a.nodeType===8?Kv(a.parentNode,h):a.nodeType===1&&Kv(a,h),nt(a)):Kv(er,h.stateNode));break;case 4:g=er,E=Qs,er=h.stateNode.containerInfo,Qs=!0,Zo(a,c,h),er=g,Qs=E;break;case 0:case 11:case 14:case 15:if(!fr&&(g=h.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){E=g=g.next;do{var A=E,I=A.destroy;A=A.tag,I!==void 0&&((A&2)!==0||(A&4)!==0)&&Og(h,c,I),E=E.next}while(E!==g)}Zo(a,c,h);break;case 1:if(!fr&&(xc(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=h.memoizedProps,g.state=h.memoizedState,g.componentWillUnmount()}catch($){fn(h,c,$)}Zo(a,c,h);break;case 21:Zo(a,c,h);break;case 22:h.mode&1?(fr=(g=fr)||h.memoizedState!==null,Zo(a,c,h),fr=g):Zo(a,c,h);break;default:Zo(a,c,h)}}function k6(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var h=a.stateNode;h===null&&(h=a.stateNode=new F9),c.forEach(function(g){var E=G9.bind(null,a,g);h.has(g)||(h.add(g),g.then(E,E))})}}function Js(a,c){var h=c.deletions;if(h!==null)for(var g=0;g<h.length;g++){var E=h[g];try{var A=a,I=c,$=I;e:for(;$!==null;){switch($.tag){case 5:er=$.stateNode,Qs=!1;break e;case 3:er=$.stateNode.containerInfo,Qs=!0;break e;case 4:er=$.stateNode.containerInfo,Qs=!0;break e}$=$.return}if(er===null)throw Error(n(160));E6(A,I,E),er=null,Qs=!1;var W=E.alternate;W!==null&&(W.return=null),E.return=null}catch(ie){fn(E,c,ie)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)C6(c,a),c=c.sibling}function C6(a,c){var h=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Js(c,a),_i(a),g&4){try{Pd(3,a,a.return),lp(3,a)}catch($e){fn(a,a.return,$e)}try{Pd(5,a,a.return)}catch($e){fn(a,a.return,$e)}}break;case 1:Js(c,a),_i(a),g&512&&h!==null&&xc(h,h.return);break;case 5:if(Js(c,a),_i(a),g&512&&h!==null&&xc(h,h.return),a.flags&32){var E=a.stateNode;try{Us(E,"")}catch($e){fn(a,a.return,$e)}}if(g&4&&(E=a.stateNode,E!=null)){var A=a.memoizedProps,I=h!==null?h.memoizedProps:A,$=a.type,W=a.updateQueue;if(a.updateQueue=null,W!==null)try{$==="input"&&A.type==="radio"&&A.name!=null&&ut(E,A),Zi($,I);var ie=Zi($,A);for(I=0;I<W.length;I+=2){var me=W[I],ye=W[I+1];me==="style"?Lo(E,ye):me==="dangerouslySetInnerHTML"?kn(E,ye):me==="children"?Us(E,ye):C(E,me,ye,ie)}switch($){case"input":je(E,A);break;case"textarea":St(E,A);break;case"select":var pe=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!A.multiple;var Re=A.value;Re!=null?Me(E,!!A.multiple,Re,!1):pe!==!!A.multiple&&(A.defaultValue!=null?Me(E,!!A.multiple,A.defaultValue,!0):Me(E,!!A.multiple,A.multiple?[]:"",!1))}E[vd]=A}catch($e){fn(a,a.return,$e)}}break;case 6:if(Js(c,a),_i(a),g&4){if(a.stateNode===null)throw Error(n(162));E=a.stateNode,A=a.memoizedProps;try{E.nodeValue=A}catch($e){fn(a,a.return,$e)}}break;case 3:if(Js(c,a),_i(a),g&4&&h!==null&&h.memoizedState.isDehydrated)try{nt(c.containerInfo)}catch($e){fn(a,a.return,$e)}break;case 4:Js(c,a),_i(a);break;case 13:Js(c,a),_i(a),E=a.child,E.flags&8192&&(A=E.memoizedState!==null,E.stateNode.isHidden=A,!A||E.alternate!==null&&E.alternate.memoizedState!==null||(Vg=zt())),g&4&&k6(a);break;case 22:if(me=h!==null&&h.memoizedState!==null,a.mode&1?(fr=(ie=fr)||me,Js(c,a),fr=ie):Js(c,a),_i(a),g&8192){if(ie=a.memoizedState!==null,(a.stateNode.isHidden=ie)&&!me&&(a.mode&1)!==0)for(Oe=a,me=a.child;me!==null;){for(ye=Oe=me;Oe!==null;){switch(pe=Oe,Re=pe.child,pe.tag){case 0:case 11:case 14:case 15:Pd(4,pe,pe.return);break;case 1:xc(pe,pe.return);var Fe=pe.stateNode;if(typeof Fe.componentWillUnmount=="function"){g=pe,h=pe.return;try{c=g,Fe.props=c.memoizedProps,Fe.state=c.memoizedState,Fe.componentWillUnmount()}catch($e){fn(g,h,$e)}}break;case 5:xc(pe,pe.return);break;case 22:if(pe.memoizedState!==null){T6(ye);continue}}Re!==null?(Re.return=pe,Oe=Re):T6(ye)}me=me.sibling}e:for(me=null,ye=a;;){if(ye.tag===5){if(me===null){me=ye;try{E=ye.stateNode,ie?(A=E.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):($=ye.stateNode,W=ye.memoizedProps.style,I=W!=null&&W.hasOwnProperty("display")?W.display:null,$.style.display=Yr("display",I))}catch($e){fn(a,a.return,$e)}}}else if(ye.tag===6){if(me===null)try{ye.stateNode.nodeValue=ie?"":ye.memoizedProps}catch($e){fn(a,a.return,$e)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===a)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===a)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===a)break e;me===ye&&(me=null),ye=ye.return}me===ye&&(me=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:Js(c,a),_i(a),g&4&&k6(a);break;case 21:break;default:Js(c,a),_i(a)}}function _i(a){var c=a.flags;if(c&2){try{e:{for(var h=a.return;h!==null;){if(b6(h)){var g=h;break e}h=h.return}throw Error(n(160))}switch(g.tag){case 5:var E=g.stateNode;g.flags&32&&(Us(E,""),g.flags&=-33);var A=S6(a);Ng(a,A,E);break;case 3:case 4:var I=g.stateNode.containerInfo,$=S6(a);Dg(a,$,I);break;default:throw Error(n(161))}}catch(W){fn(a,a.return,W)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function $9(a,c,h){Oe=a,P6(a)}function P6(a,c,h){for(var g=(a.mode&1)!==0;Oe!==null;){var E=Oe,A=E.child;if(E.tag===22&&g){var I=E.memoizedState!==null||ap;if(!I){var $=E.alternate,W=$!==null&&$.memoizedState!==null||fr;$=ap;var ie=fr;if(ap=I,(fr=W)&&!ie)for(Oe=E;Oe!==null;)I=Oe,W=I.child,I.tag===22&&I.memoizedState!==null?R6(E):W!==null?(W.return=I,Oe=W):R6(E);for(;A!==null;)Oe=A,P6(A),A=A.sibling;Oe=E,ap=$,fr=ie}A6(a)}else(E.subtreeFlags&8772)!==0&&A!==null?(A.return=E,Oe=A):A6(a)}}function A6(a){for(;Oe!==null;){var c=Oe;if((c.flags&8772)!==0){var h=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:fr||lp(5,c);break;case 1:var g=c.stateNode;if(c.flags&4&&!fr)if(h===null)g.componentDidMount();else{var E=c.elementType===c.type?h.memoizedProps:Xs(c.type,h.memoizedProps);g.componentDidUpdate(E,h.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var A=c.updateQueue;A!==null&&T4(c,A,g);break;case 3:var I=c.updateQueue;if(I!==null){if(h=null,c.child!==null)switch(c.child.tag){case 5:h=c.child.stateNode;break;case 1:h=c.child.stateNode}T4(c,I,h)}break;case 5:var $=c.stateNode;if(h===null&&c.flags&4){h=$;var W=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":W.autoFocus&&h.focus();break;case"img":W.src&&(h.src=W.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ie=c.alternate;if(ie!==null){var me=ie.memoizedState;if(me!==null){var ye=me.dehydrated;ye!==null&&nt(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}fr||c.flags&512&&Lg(c)}catch(pe){fn(c,c.return,pe)}}if(c===a){Oe=null;break}if(h=c.sibling,h!==null){h.return=c.return,Oe=h;break}Oe=c.return}}function T6(a){for(;Oe!==null;){var c=Oe;if(c===a){Oe=null;break}var h=c.sibling;if(h!==null){h.return=c.return,Oe=h;break}Oe=c.return}}function R6(a){for(;Oe!==null;){var c=Oe;try{switch(c.tag){case 0:case 11:case 15:var h=c.return;try{lp(4,c)}catch(W){fn(c,h,W)}break;case 1:var g=c.stateNode;if(typeof g.componentDidMount=="function"){var E=c.return;try{g.componentDidMount()}catch(W){fn(c,E,W)}}var A=c.return;try{Lg(c)}catch(W){fn(c,A,W)}break;case 5:var I=c.return;try{Lg(c)}catch(W){fn(c,I,W)}}}catch(W){fn(c,c.return,W)}if(c===a){Oe=null;break}var $=c.sibling;if($!==null){$.return=c.return,Oe=$;break}Oe=c.return}}var H9=Math.ceil,cp=P.ReactCurrentDispatcher,jg=P.ReactCurrentOwner,Is=P.ReactCurrentBatchConfig,wt=0,Bn=null,An=null,tr=0,os=0,bc=Ho(0),Dn=0,Ad=null,tl=0,up=0,Fg=0,Td=null,Lr=null,Vg=0,Sc=1/0,to=null,dp=!1,$g=null,qo=null,fp=!1,Go=null,hp=0,Rd=0,Hg=null,pp=-1,mp=0;function xr(){return(wt&6)!==0?zt():pp!==-1?pp:pp=zt()}function Ko(a){return(a.mode&1)===0?1:(wt&2)!==0&&tr!==0?tr&-tr:E9.transition!==null?(mp===0&&(mp=kv()),mp):(a=Pt,a!==0||(a=window.event,a=a===void 0?16:Mb(a.type)),a)}function ei(a,c,h,g){if(50<Rd)throw Rd=0,Hg=null,Error(n(185));jo(a,h,g),((wt&2)===0||a!==Bn)&&(a===Bn&&((wt&2)===0&&(up|=h),Dn===4&&Yo(a,tr)),Dr(a,g),h===1&&wt===0&&(c.mode&1)===0&&(Sc=zt()+500,Bh&&Bo()))}function Dr(a,c){var h=a.callbackNode;Ch(a,c);var g=No(a,a===Bn?tr:0);if(g===0)h!==null&&bh(h),a.callbackNode=null,a.callbackPriority=0;else if(c=g&-g,a.callbackPriority!==c){if(h!=null&&bh(h),c===1)a.tag===0?S9(M6.bind(null,a)):g4(M6.bind(null,a)),_9(function(){(wt&6)===0&&Bo()}),h=null;else{switch(Ph(g)){case 1:h=Xu;break;case 4:h=Eh;break;case 16:h=Ua;break;case 536870912:h=kh;break;default:h=Ua}h=$6(h,I6.bind(null,a))}a.callbackPriority=c,a.callbackNode=h}}function I6(a,c){if(pp=-1,mp=0,(wt&6)!==0)throw Error(n(327));var h=a.callbackNode;if(Ec()&&a.callbackNode!==h)return null;var g=No(a,a===Bn?tr:0);if(g===0)return null;if((g&30)!==0||(g&a.expiredLanes)!==0||c)c=vp(a,g);else{c=g;var E=wt;wt|=2;var A=L6();(Bn!==a||tr!==c)&&(to=null,Sc=zt()+500,rl(a,c));do try{U9();break}catch($){O6(a,$)}while(!0);ig(),cp.current=A,wt=E,An!==null?c=0:(Bn=null,tr=0,c=Dn)}if(c!==0){if(c===2&&(E=ed(a),E!==0&&(g=E,c=zg(a,E))),c===1)throw h=Ad,rl(a,0),Yo(a,g),Dr(a,zt()),h;if(c===6)Yo(a,g);else{if(E=a.current.alternate,(g&30)===0&&!z9(E)&&(c=vp(a,g),c===2&&(A=ed(a),A!==0&&(g=A,c=zg(a,A))),c===1))throw h=Ad,rl(a,0),Yo(a,g),Dr(a,zt()),h;switch(a.finishedWork=E,a.finishedLanes=g,c){case 0:case 1:throw Error(n(345));case 2:sl(a,Lr,to);break;case 3:if(Yo(a,g),(g&130023424)===g&&(c=Vg+500-zt(),10<c)){if(No(a,0)!==0)break;if(E=a.suspendedLanes,(E&g)!==g){xr(),a.pingedLanes|=a.suspendedLanes&E;break}a.timeoutHandle=Gv(sl.bind(null,a,Lr,to),c);break}sl(a,Lr,to);break;case 4:if(Yo(a,g),(g&4194240)===g)break;for(c=a.eventTimes,E=-1;0<g;){var I=31-es(g);A=1<<I,I=c[I],I>E&&(E=I),g&=~A}if(g=E,g=zt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*H9(g/1960))-g,10<g){a.timeoutHandle=Gv(sl.bind(null,a,Lr,to),g);break}sl(a,Lr,to);break;case 5:sl(a,Lr,to);break;default:throw Error(n(329))}}}return Dr(a,zt()),a.callbackNode===h?I6.bind(null,a):null}function zg(a,c){var h=Td;return a.current.memoizedState.isDehydrated&&(rl(a,c).flags|=256),a=vp(a,c),a!==2&&(c=Lr,Lr=h,c!==null&&Bg(c)),a}function Bg(a){Lr===null?Lr=a:Lr.push.apply(Lr,a)}function z9(a){for(var c=a;;){if(c.flags&16384){var h=c.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var g=0;g<h.length;g++){var E=h[g],A=E.getSnapshot;E=E.value;try{if(!Ks(A(),E))return!1}catch{return!1}}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Yo(a,c){for(c&=~Fg,c&=~up,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var h=31-es(c),g=1<<h;a[h]=-1,c&=~g}}function M6(a){if((wt&6)!==0)throw Error(n(327));Ec();var c=No(a,0);if((c&1)===0)return Dr(a,zt()),null;var h=vp(a,c);if(a.tag!==0&&h===2){var g=ed(a);g!==0&&(c=g,h=zg(a,g))}if(h===1)throw h=Ad,rl(a,0),Yo(a,c),Dr(a,zt()),h;if(h===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,sl(a,Lr,to),Dr(a,zt()),null}function Ug(a,c){var h=wt;wt|=1;try{return a(c)}finally{wt=h,wt===0&&(Sc=zt()+500,Bh&&Bo())}}function nl(a){Go!==null&&Go.tag===0&&(wt&6)===0&&Ec();var c=wt;wt|=1;var h=Is.transition,g=Pt;try{if(Is.transition=null,Pt=1,a)return a()}finally{Pt=g,Is.transition=h,wt=c,(wt&6)===0&&Bo()}}function Wg(){os=bc.current,Ut(bc)}function rl(a,c){a.finishedWork=null,a.finishedLanes=0;var h=a.timeoutHandle;if(h!==-1&&(a.timeoutHandle=-1,y9(h)),An!==null)for(h=An.return;h!==null;){var g=h;switch(eg(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&Hh();break;case 3:_c(),Ut(Ir),Ut(cr),hg();break;case 5:dg(g);break;case 4:_c();break;case 13:Ut(en);break;case 19:Ut(en);break;case 10:og(g.type._context);break;case 22:case 23:Wg()}h=h.return}if(Bn=a,An=a=Xo(a.current,null),tr=os=c,Dn=0,Ad=null,Fg=up=tl=0,Lr=Td=null,Qa!==null){for(c=0;c<Qa.length;c++)if(h=Qa[c],g=h.interleaved,g!==null){h.interleaved=null;var E=g.next,A=h.pending;if(A!==null){var I=A.next;A.next=E,g.next=I}h.pending=g}Qa=null}return a}function O6(a,c){do{var h=An;try{if(ig(),Jh.current=rp,ep){for(var g=tn.memoizedState;g!==null;){var E=g.queue;E!==null&&(E.pending=null),g=g.next}ep=!1}if(el=0,zn=Ln=tn=null,bd=!1,Sd=0,jg.current=null,h===null||h.return===null){Dn=1,Ad=c,An=null;break}e:{var A=a,I=h.return,$=h,W=c;if(c=tr,$.flags|=32768,W!==null&&typeof W=="object"&&typeof W.then=="function"){var ie=W,me=$,ye=me.tag;if((me.mode&1)===0&&(ye===0||ye===11||ye===15)){var pe=me.alternate;pe?(me.updateQueue=pe.updateQueue,me.memoizedState=pe.memoizedState,me.lanes=pe.lanes):(me.updateQueue=null,me.memoizedState=null)}var Re=s6(I);if(Re!==null){Re.flags&=-257,i6(Re,I,$,A,c),Re.mode&1&&r6(A,ie,c),c=Re,W=ie;var Fe=c.updateQueue;if(Fe===null){var $e=new Set;$e.add(W),c.updateQueue=$e}else Fe.add(W);break e}else{if((c&1)===0){r6(A,ie,c),Zg();break e}W=Error(n(426))}}else if(Xt&&$.mode&1){var wn=s6(I);if(wn!==null){(wn.flags&65536)===0&&(wn.flags|=256),i6(wn,I,$,A,c),rg(wc(W,$));break e}}A=W=wc(W,$),Dn!==4&&(Dn=2),Td===null?Td=[A]:Td.push(A),A=I;do{switch(A.tag){case 3:A.flags|=65536,c&=-c,A.lanes|=c;var J=t6(A,W,c);A4(A,J);break e;case 1:$=W;var K=A.type,re=A.stateNode;if((A.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(qo===null||!qo.has(re)))){A.flags|=65536,c&=-c,A.lanes|=c;var be=n6(A,$,c);A4(A,be);break e}}A=A.return}while(A!==null)}N6(h)}catch(He){c=He,An===h&&h!==null&&(An=h=h.return);continue}break}while(!0)}function L6(){var a=cp.current;return cp.current=rp,a===null?rp:a}function Zg(){(Dn===0||Dn===3||Dn===2)&&(Dn=4),Bn===null||(tl&268435455)===0&&(up&268435455)===0||Yo(Bn,tr)}function vp(a,c){var h=wt;wt|=2;var g=L6();(Bn!==a||tr!==c)&&(to=null,rl(a,c));do try{B9();break}catch(E){O6(a,E)}while(!0);if(ig(),wt=h,cp.current=g,An!==null)throw Error(n(261));return Bn=null,tr=0,Dn}function B9(){for(;An!==null;)D6(An)}function U9(){for(;An!==null&&!wv();)D6(An)}function D6(a){var c=V6(a.alternate,a,os);a.memoizedProps=a.pendingProps,c===null?N6(a):An=c,jg.current=null}function N6(a){var c=a;do{var h=c.alternate;if(a=c.return,(c.flags&32768)===0){if(h=N9(h,c,os),h!==null){An=h;return}}else{if(h=j9(h,c),h!==null){h.flags&=32767,An=h;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Dn=6,An=null;return}}if(c=c.sibling,c!==null){An=c;return}An=c=a}while(c!==null);Dn===0&&(Dn=5)}function sl(a,c,h){var g=Pt,E=Is.transition;try{Is.transition=null,Pt=1,W9(a,c,h,g)}finally{Is.transition=E,Pt=g}return null}function W9(a,c,h,g){do Ec();while(Go!==null);if((wt&6)!==0)throw Error(n(327));h=a.finishedWork;var E=a.finishedLanes;if(h===null)return null;if(a.finishedWork=null,a.finishedLanes=0,h===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var A=h.lanes|h.childLanes;if(td(a,A),a===Bn&&(An=Bn=null,tr=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||fp||(fp=!0,$6(Ua,function(){return Ec(),null})),A=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||A){A=Is.transition,Is.transition=null;var I=Pt;Pt=1;var $=wt;wt|=4,jg.current=null,V9(a,h),C6(h,a),d9(Zv),Cs=!!Wv,Zv=Wv=null,a.current=h,$9(h),Yu(),wt=$,Pt=I,Is.transition=A}else a.current=h;if(fp&&(fp=!1,Go=a,hp=E),A=a.pendingLanes,A===0&&(qo=null),bv(h.stateNode),Dr(a,zt()),c!==null)for(g=a.onRecoverableError,h=0;h<c.length;h++)E=c[h],g(E.value,{componentStack:E.stack,digest:E.digest});if(dp)throw dp=!1,a=$g,$g=null,a;return(hp&1)!==0&&a.tag!==0&&Ec(),A=a.pendingLanes,(A&1)!==0?a===Hg?Rd++:(Rd=0,Hg=a):Rd=0,Bo(),null}function Ec(){if(Go!==null){var a=Ph(hp),c=Is.transition,h=Pt;try{if(Is.transition=null,Pt=16>a?16:a,Go===null)var g=!1;else{if(a=Go,Go=null,hp=0,(wt&6)!==0)throw Error(n(331));var E=wt;for(wt|=4,Oe=a.current;Oe!==null;){var A=Oe,I=A.child;if((Oe.flags&16)!==0){var $=A.deletions;if($!==null){for(var W=0;W<$.length;W++){var ie=$[W];for(Oe=ie;Oe!==null;){var me=Oe;switch(me.tag){case 0:case 11:case 15:Pd(8,me,A)}var ye=me.child;if(ye!==null)ye.return=me,Oe=ye;else for(;Oe!==null;){me=Oe;var pe=me.sibling,Re=me.return;if(x6(me),me===ie){Oe=null;break}if(pe!==null){pe.return=Re,Oe=pe;break}Oe=Re}}}var Fe=A.alternate;if(Fe!==null){var $e=Fe.child;if($e!==null){Fe.child=null;do{var wn=$e.sibling;$e.sibling=null,$e=wn}while($e!==null)}}Oe=A}}if((A.subtreeFlags&2064)!==0&&I!==null)I.return=A,Oe=I;else e:for(;Oe!==null;){if(A=Oe,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:Pd(9,A,A.return)}var J=A.sibling;if(J!==null){J.return=A.return,Oe=J;break e}Oe=A.return}}var K=a.current;for(Oe=K;Oe!==null;){I=Oe;var re=I.child;if((I.subtreeFlags&2064)!==0&&re!==null)re.return=I,Oe=re;else e:for(I=K;Oe!==null;){if($=Oe,($.flags&2048)!==0)try{switch($.tag){case 0:case 11:case 15:lp(9,$)}}catch(He){fn($,$.return,He)}if($===I){Oe=null;break e}var be=$.sibling;if(be!==null){be.return=$.return,Oe=be;break e}Oe=$.return}}if(wt=E,Bo(),ks&&typeof ks.onPostCommitFiberRoot=="function")try{ks.onPostCommitFiberRoot(Do,a)}catch{}g=!0}return g}finally{Pt=h,Is.transition=c}}return!1}function j6(a,c,h){c=wc(h,c),c=t6(a,c,1),a=Wo(a,c,1),c=xr(),a!==null&&(jo(a,1,c),Dr(a,c))}function fn(a,c,h){if(a.tag===3)j6(a,a,h);else for(;c!==null;){if(c.tag===3){j6(c,a,h);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(qo===null||!qo.has(g))){a=wc(h,a),a=n6(c,a,1),c=Wo(c,a,1),a=xr(),c!==null&&(jo(c,1,a),Dr(c,a));break}}c=c.return}}function Z9(a,c,h){var g=a.pingCache;g!==null&&g.delete(c),c=xr(),a.pingedLanes|=a.suspendedLanes&h,Bn===a&&(tr&h)===h&&(Dn===4||Dn===3&&(tr&130023424)===tr&&500>zt()-Vg?rl(a,0):Fg|=h),Dr(a,c)}function F6(a,c){c===0&&((a.mode&1)===0?c=1:(c=tc,tc<<=1,(tc&130023424)===0&&(tc=4194304)));var h=xr();a=Qi(a,c),a!==null&&(jo(a,c,h),Dr(a,h))}function q9(a){var c=a.memoizedState,h=0;c!==null&&(h=c.retryLane),F6(a,h)}function G9(a,c){var h=0;switch(a.tag){case 13:var g=a.stateNode,E=a.memoizedState;E!==null&&(h=E.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(c),F6(a,h)}var V6;V6=function(a,c,h){if(a!==null)if(a.memoizedProps!==c.pendingProps||Ir.current)Or=!0;else{if((a.lanes&h)===0&&(c.flags&128)===0)return Or=!1,D9(a,c,h);Or=(a.flags&131072)!==0}else Or=!1,Xt&&(c.flags&1048576)!==0&&y4(c,Wh,c.index);switch(c.lanes=0,c.tag){case 2:var g=c.type;op(a,c),a=c.pendingProps;var E=fc(c,cr.current);yc(c,h),E=vg(null,c,g,a,E,h);var A=gg();return c.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Mr(g)?(A=!0,zh(c)):A=!1,c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,cg(c),E.updater=sp,c.stateNode=E,E._reactInternals=c,Sg(c,g,a,h),c=Pg(null,c,g,!0,A,h)):(c.tag=0,Xt&&A&&Jv(c),wr(null,c,E,h),c=c.child),c;case 16:g=c.elementType;e:{switch(op(a,c),a=c.pendingProps,E=g._init,g=E(g._payload),c.type=g,E=c.tag=Y9(g),a=Xs(g,a),E){case 0:c=Cg(null,c,g,a,h);break e;case 1:c=d6(null,c,g,a,h);break e;case 11:c=o6(null,c,g,a,h);break e;case 14:c=a6(null,c,g,Xs(g.type,a),h);break e}throw Error(n(306,g,""))}return c;case 0:return g=c.type,E=c.pendingProps,E=c.elementType===g?E:Xs(g,E),Cg(a,c,g,E,h);case 1:return g=c.type,E=c.pendingProps,E=c.elementType===g?E:Xs(g,E),d6(a,c,g,E,h);case 3:e:{if(f6(c),a===null)throw Error(n(387));g=c.pendingProps,A=c.memoizedState,E=A.element,P4(a,c),Xh(c,g,null,h);var I=c.memoizedState;if(g=I.element,A.isDehydrated)if(A={element:g,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},c.updateQueue.baseState=A,c.memoizedState=A,c.flags&256){E=wc(Error(n(423)),c),c=h6(a,c,g,h,E);break e}else if(g!==E){E=wc(Error(n(424)),c),c=h6(a,c,g,h,E);break e}else for(is=$o(c.stateNode.containerInfo.firstChild),ss=c,Xt=!0,Ys=null,h=k4(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(mc(),g===E){c=eo(a,c,h);break e}wr(a,c,g,h)}c=c.child}return c;case 5:return R4(c),a===null&&ng(c),g=c.type,E=c.pendingProps,A=a!==null?a.memoizedProps:null,I=E.children,qv(g,E)?I=null:A!==null&&qv(g,A)&&(c.flags|=32),u6(a,c),wr(a,c,I,h),c.child;case 6:return a===null&&ng(c),null;case 13:return p6(a,c,h);case 4:return ug(c,c.stateNode.containerInfo),g=c.pendingProps,a===null?c.child=vc(c,null,g,h):wr(a,c,g,h),c.child;case 11:return g=c.type,E=c.pendingProps,E=c.elementType===g?E:Xs(g,E),o6(a,c,g,E,h);case 7:return wr(a,c,c.pendingProps,h),c.child;case 8:return wr(a,c,c.pendingProps.children,h),c.child;case 12:return wr(a,c,c.pendingProps.children,h),c.child;case 10:e:{if(g=c.type._context,E=c.pendingProps,A=c.memoizedProps,I=E.value,$t(Gh,g._currentValue),g._currentValue=I,A!==null)if(Ks(A.value,I)){if(A.children===E.children&&!Ir.current){c=eo(a,c,h);break e}}else for(A=c.child,A!==null&&(A.return=c);A!==null;){var $=A.dependencies;if($!==null){I=A.child;for(var W=$.firstContext;W!==null;){if(W.context===g){if(A.tag===1){W=Ji(-1,h&-h),W.tag=2;var ie=A.updateQueue;if(ie!==null){ie=ie.shared;var me=ie.pending;me===null?W.next=W:(W.next=me.next,me.next=W),ie.pending=W}}A.lanes|=h,W=A.alternate,W!==null&&(W.lanes|=h),ag(A.return,h,c),$.lanes|=h;break}W=W.next}}else if(A.tag===10)I=A.type===c.type?null:A.child;else if(A.tag===18){if(I=A.return,I===null)throw Error(n(341));I.lanes|=h,$=I.alternate,$!==null&&($.lanes|=h),ag(I,h,c),I=A.sibling}else I=A.child;if(I!==null)I.return=A;else for(I=A;I!==null;){if(I===c){I=null;break}if(A=I.sibling,A!==null){A.return=I.return,I=A;break}I=I.return}A=I}wr(a,c,E.children,h),c=c.child}return c;case 9:return E=c.type,g=c.pendingProps.children,yc(c,h),E=Ts(E),g=g(E),c.flags|=1,wr(a,c,g,h),c.child;case 14:return g=c.type,E=Xs(g,c.pendingProps),E=Xs(g.type,E),a6(a,c,g,E,h);case 15:return l6(a,c,c.type,c.pendingProps,h);case 17:return g=c.type,E=c.pendingProps,E=c.elementType===g?E:Xs(g,E),op(a,c),c.tag=1,Mr(g)?(a=!0,zh(c)):a=!1,yc(c,h),J4(c,g,E),Sg(c,g,E,h),Pg(null,c,g,!0,a,h);case 19:return v6(a,c,h);case 22:return c6(a,c,h)}throw Error(n(156,c.tag))};function $6(a,c){return xh(a,c)}function K9(a,c,h,g){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ms(a,c,h,g){return new K9(a,c,h,g)}function qg(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Y9(a){if(typeof a=="function")return qg(a)?1:0;if(a!=null){if(a=a.$$typeof,a===j)return 11;if(a===q)return 14}return 2}function Xo(a,c){var h=a.alternate;return h===null?(h=Ms(a.tag,c,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=c,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&14680064,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,c=a.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h}function gp(a,c,h,g,E,A){var I=2;if(g=a,typeof a=="function")qg(a)&&(I=1);else if(typeof a=="string")I=5;else e:switch(a){case M:return il(h.children,E,A,c);case R:I=8,E|=8;break;case L:return a=Ms(12,h,c,E|2),a.elementType=L,a.lanes=A,a;case U:return a=Ms(13,h,c,E),a.elementType=U,a.lanes=A,a;case X:return a=Ms(19,h,c,E),a.elementType=X,a.lanes=A,a;case Y:return yp(h,E,A,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case D:I=10;break e;case V:I=9;break e;case j:I=11;break e;case q:I=14;break e;case Z:I=16,g=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Ms(I,h,c,E),c.elementType=a,c.type=g,c.lanes=A,c}function il(a,c,h,g){return a=Ms(7,a,g,c),a.lanes=h,a}function yp(a,c,h,g){return a=Ms(22,a,g,c),a.elementType=Y,a.lanes=h,a.stateNode={isHidden:!1},a}function Gg(a,c,h){return a=Ms(6,a,null,c),a.lanes=h,a}function Kg(a,c,h){return c=Ms(4,a.children!==null?a.children:[],a.key,c),c.lanes=h,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function X9(a,c,h,g,E){this.tag=c,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=mi(0),this.expirationTimes=mi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mi(0),this.identifierPrefix=g,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function Yg(a,c,h,g,E,A,I,$,W){return a=new X9(a,c,h,$,W),c===1?(c=1,A===!0&&(c|=8)):c=0,A=Ms(3,null,null,c),a.current=A,A.stateNode=a,A.memoizedState={element:g,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},cg(A),a}function Q9(a,c,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:g==null?null:""+g,children:a,containerInfo:c,implementation:h}}function H6(a){if(!a)return zo;a=a._reactInternals;e:{if(Zs(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Mr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var h=a.type;if(Mr(h))return m4(a,h,c)}return c}function z6(a,c,h,g,E,A,I,$,W){return a=Yg(h,g,!0,a,E,A,I,$,W),a.context=H6(null),h=a.current,g=xr(),E=Ko(h),A=Ji(g,E),A.callback=c??null,Wo(h,A,E),a.current.lanes=E,jo(a,E,g),Dr(a,g),a}function _p(a,c,h,g){var E=c.current,A=xr(),I=Ko(E);return h=H6(h),c.context===null?c.context=h:c.pendingContext=h,c=Ji(A,I),c.payload={element:a},g=g===void 0?null:g,g!==null&&(c.callback=g),a=Wo(E,c,I),a!==null&&(ei(a,E,I,A),Yh(a,E,I)),I}function wp(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 B6(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<c?h:c}}function Xg(a,c){B6(a,c),(a=a.alternate)&&B6(a,c)}function J9(){return null}var U6=typeof reportError=="function"?reportError:function(a){console.error(a)};function Qg(a){this._internalRoot=a}xp.prototype.render=Qg.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));_p(a,c,null,null)},xp.prototype.unmount=Qg.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;nl(function(){_p(null,a,null,null)}),c[Gi]=null}};function xp(a){this._internalRoot=a}xp.prototype.unstable_scheduleHydration=function(a){if(a){var c=Za();a={blockedOn:null,target:a,priority:c};for(var h=0;h<he.length&&c!==0&&c<he[h].priority;h++);he.splice(h,0,a),h===0&&dn(a)}};function Jg(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function bp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function W6(){}function eL(a,c,h,g,E){if(E){if(typeof g=="function"){var A=g;g=function(){var ie=wp(I);A.call(ie)}}var I=z6(c,g,a,0,null,!1,!1,"",W6);return a._reactRootContainer=I,a[Gi]=I.current,pd(a.nodeType===8?a.parentNode:a),nl(),I}for(;E=a.lastChild;)a.removeChild(E);if(typeof g=="function"){var $=g;g=function(){var ie=wp(W);$.call(ie)}}var W=Yg(a,0,!1,null,null,!1,!1,"",W6);return a._reactRootContainer=W,a[Gi]=W.current,pd(a.nodeType===8?a.parentNode:a),nl(function(){_p(c,W,h,g)}),W}function Sp(a,c,h,g,E){var A=h._reactRootContainer;if(A){var I=A;if(typeof E=="function"){var $=E;E=function(){var W=wp(I);$.call(W)}}_p(c,I,a,E)}else I=eL(h,c,a,E,g);return wp(I)}rd=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var h=Wa(c.pendingLanes);h!==0&&(nd(c,h|1),Dr(c,zt()),(wt&6)===0&&(Sc=zt()+500,Bo()))}break;case 13:nl(function(){var g=Qi(a,1);if(g!==null){var E=xr();ei(g,a,1,E)}}),Xg(a,1)}},sd=function(a){if(a.tag===13){var c=Qi(a,134217728);if(c!==null){var h=xr();ei(c,a,134217728,h)}Xg(a,134217728)}},id=function(a){if(a.tag===13){var c=Ko(a),h=Qi(a,c);if(h!==null){var g=xr();ei(h,a,c,g)}Xg(a,c)}},Za=function(){return Pt},nc=function(a,c){var h=Pt;try{return Pt=a,c()}finally{Pt=h}},_r=function(a,c,h){switch(c){case"input":if(je(a,h),c=h.name,h.type==="radio"&&c!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<h.length;c++){var g=h[c];if(g!==a&&g.form===a.form){var E=$h(g);if(!E)throw Error(n(90));Ne(g),je(g,E)}}}break;case"textarea":St(a,h);break;case"select":c=h.value,c!=null&&Me(a,!!h.multiple,c,!1)}},Ue=Ug,Jt=nl;var tL={usingClientEntryPoint:!1,Events:[gd,uc,$h,Ha,za,Ug]},Id={findFiberByHostInstance:Ga,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nL={bundleType:Id.bundleType,version:Id.version,rendererPackageName:Id.rendererPackageName,rendererConfig:Id.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=wh(a),a===null?null:a.stateNode},findFiberByHostInstance:Id.findFiberByHostInstance||J9,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 Ep=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ep.isDisabled&&Ep.supportsFiber)try{Do=Ep.inject(nL),ks=Ep}catch{}}return Nr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tL,Nr.createPortal=function(a,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jg(c))throw Error(n(200));return Q9(a,c,null,h)},Nr.createRoot=function(a,c){if(!Jg(a))throw Error(n(299));var h=!1,g="",E=U6;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onRecoverableError!==void 0&&(E=c.onRecoverableError)),c=Yg(a,1,!1,null,null,h,!1,g,E),a[Gi]=c.current,pd(a.nodeType===8?a.parentNode:a),new Qg(c)},Nr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=wh(c),a=a===null?null:a.stateNode,a},Nr.flushSync=function(a){return nl(a)},Nr.hydrate=function(a,c,h){if(!bp(c))throw Error(n(200));return Sp(null,a,c,!0,h)},Nr.hydrateRoot=function(a,c,h){if(!Jg(a))throw Error(n(405));var g=h!=null&&h.hydratedSources||null,E=!1,A="",I=U6;if(h!=null&&(h.unstable_strictMode===!0&&(E=!0),h.identifierPrefix!==void 0&&(A=h.identifierPrefix),h.onRecoverableError!==void 0&&(I=h.onRecoverableError)),c=z6(c,null,a,1,h??null,E,!1,A,I),a[Gi]=c.current,pd(a),g)for(a=0;a<g.length;a++)h=g[a],E=h._getVersion,E=E(h._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[h,E]:c.mutableSourceEagerHydrationData.push(h,E);return new xp(c)},Nr.render=function(a,c,h){if(!bp(c))throw Error(n(200));return Sp(null,a,c,!1,h)},Nr.unmountComponentAtNode=function(a){if(!bp(a))throw Error(n(40));return a._reactRootContainer?(nl(function(){Sp(null,null,a,!1,function(){a._reactRootContainer=null,a[Gi]=null})}),!0):!1},Nr.unstable_batchedUpdates=Ug,Nr.unstable_renderSubtreeIntoContainer=function(a,c,h,g){if(!bp(h))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Sp(a,c,h,!1,g)},Nr.version="18.3.1-next-f1338f8080-20240426",Nr}var T8;function a5(){if(T8)return N1.exports;T8=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(),N1.exports=K7(),N1.exports}var R8;function Y7(){if(R8)return zp;R8=1;var t=a5();return zp.createRoot=t.createRoot,zp.hydrateRoot=t.hydrateRoot,zp}var X7=Y7();const Q7=Bm(X7),xo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function l5(t){return"init"in t}function z2(t){return typeof t.write=="function"}function J7(t){return!!t.onMount}function I8(t){return"v"in t||"e"in t}function hm(t){if("e"in t)throw t.e;if((xo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function pm(t){return typeof(t==null?void 0:t.then)=="function"}function ej(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 c5(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function u5(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 tj(t){return!!t.INTERNAL_onInit}const nj=(t,e,n,...r)=>n.read(...r),rj=(t,e,n,...r)=>n.write(...r),sj=(t,e,n)=>n.INTERNAL_onInit(e),ij=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},oj=(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),tj(n)&&l(t,e,n)}return i},aj=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],u=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=p=>{try{p()}catch(v){d.push(v)}};do{l.f&&f(l.f);const p=new Set;for(const v of s){const y=(n=r.get(v))==null?void 0:n.l;if(y)for(const w of y)p.add(w)}s.clear();for(const v of o)p.add(v);o.clear();for(const v of i)p.add(v);i.clear();for(const v of p)f(v);s.size&&u(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},lj=(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 u=[],d=[],f=new WeakSet,p=new WeakSet,v=[],y=[];for(const w of s)v.push(w),y.push(i(t,e,w));for(;v.length;){const w=v.length-1,_=v[w],x=y[w];if(p.has(_)){v.pop(),y.pop();continue}if(f.has(_)){if(r.get(_)===x.n)u.push(_),d.push(x);else if((xo?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),v.pop(),y.pop();continue}f.add(_);for(const b of u5(_,x,n))f.has(b)||(v.push(b),y.push(i(t,e,b)))}for(let w=u.length-1;w>=0;--w){const _=u[w],x=d[w];let b=!1;for(const k of x.d.keys())if(k!==_&&s.has(k)){b=!0;break}b&&(r.set(_,x.n),o(t,e,_),l(t,e,_)),r.delete(_)}},B2=new WeakSet,cj=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],u=t[6],d=t[7],f=t[11],p=t[12],v=t[13],y=t[14],w=t[16],_=t[17],x=t[20],b=t[26],k=t[28],C=f(t,e,n),P=k[0];if(I8(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===P)return C.m=P,C;let q=!1;for(const[Z,Y]of C.d)if(y(t,e,Z).n!==Y){q=!0;break}if(!q)return C.m=P,C}let T=!0;const O=new Set(C.d.keys()),M=()=>{for(const q of O)C.d.delete(q)},R=()=>{if(i.has(n)){const q=!l.size;_(t,e,n),q&&(v(t,e),p(t,e))}},L=q=>{var Z;if(q===n){const H=f(t,e,q);if(!I8(H))if(l5(q))x(t,e,q,q.init);else throw new Error("no atom init");return hm(H)}const Y=y(t,e,q);try{return hm(Y)}finally{O.delete(q),C.d.set(q,Y.n),pm(C.v)&&c5(n,C.v,Y),i.has(n)&&((Z=i.get(q))==null||Z.t.add(n)),T||R()}};let D,V;const j={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(xo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(xo?"production":void 0)!=="production"&&!z2(n)&&console.warn("setSelf function cannot be used with read-only atom"),!V&&z2(n)&&(V=(...q)=>{if((xo?"production":void 0)!=="production"&&T&&console.warn("setSelf function cannot be called in sync"),!T)try{return w(t,e,n,q)}finally{v(t,e),p(t,e)}}),V}},U=C.n,X=o.get(n)===U;try{(xo?"production":void 0)!=="production"&&B2.delete(e);const q=d(t,e,n,L,j);if((xo?"production":void 0)!=="production"&&B2.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),x(t,e,n,q),pm(q)){b(t,e,q,()=>D==null?void 0:D.abort());const Z=()=>{M(),R()};q.then(Z,Z)}else M();return(r=u.r)==null||r.call(u,n),C.m=P,C}catch(q){if(ej(q))throw q;return delete C.v,C.e=q,++C.n,C.m=P,C}finally{T=!1,C.n!==U&&X&&(o.set(n,C.n),l.add(n),(s=u.c)==null||s.call(u,n))}},uj=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),u=i(t,e,l);for(const d of u5(l,u,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},dj=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],u=t[12],d=t[13],f=t[14],p=t[15],v=t[16],y=t[17],w=t[20],_=t[28];let x=!0;const b=C=>hm(f(t,e,C)),k=(C,...P)=>{var T;const O=l(t,e,C);try{if(C===n){if(!l5(C))throw new Error("atom not writable");(xo?"production":void 0)!=="production"&&B2.add(e);const M=O.n,R=P[0];w(t,e,C,R),y(t,e,C),M!==O.n&&(++_[0],s.add(C),p(t,e,C),(T=i.c)==null||T.call(i,C));return}else return v(t,e,C,P)}finally{x||(d(t,e),u(t,e))}};try{return o(t,e,n,b,k,...r)}finally{x=!1}},fj=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],u=t[15],d=t[18],f=t[19],p=l(t,e,n),v=s.get(n);if(v&&p.d.size>0){for(const[y,w]of p.d)if(!v.d.has(y)){const _=l(t,e,y);d(t,e,y).t.add(n),v.d.add(y),w!==_.n&&(i.add(y),u(t,e,y),(r=o.c)==null||r.call(o,y))}for(const y of v.d)if(!p.d.has(y)){v.d.delete(y);const w=f(t,e,y);w==null||w.t.delete(n)}}},hj=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],u=t[11],d=t[12],f=t[13],p=t[14],v=t[16],y=t[18],w=u(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const x of w.d.keys())y(t,e,x).t.add(n);if(_={l:new Set,d:new Set(w.d.keys()),t:new Set},s.set(n,_),z2(n)&&J7(n)){const x=()=>{let b=!0;const k=(...C)=>{try{return v(t,e,n,C)}finally{b||(f(t,e),d(t,e))}};try{const C=l(t,e,n,k);C&&(_.u=()=>{b=!0;try{C()}finally{b=!1}})}finally{b=!1}};i.add(x)}(r=o.m)==null||r.call(o,n)}return _},pj=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],u=t[11],d=t[19],f=u(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let v=!1;for(const y of p.t)if((r=i.get(y))!=null&&r.d.has(n)){v=!0;break}if(!v){p.u&&o.add(p.u),p=void 0,i.delete(n);for(const y of f.d.keys()){const w=d(t,e,y);w==null||w.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return p},mj=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if(pm(r))for(const d of o.d.keys())c5(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,pm(u)&&i(t,e,u))},vj=(t,e,n)=>{const r=t[14];return hm(r(t,e,n))},gj=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],u=s.size;try{return l(t,e,n,r)}finally{s.size!==u&&(o(t,e),i(t,e))}},yj=(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)}},_j=(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)},wj=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},d5=new WeakMap;function xj(t){const e=d5.get(t);if((xo?"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 bj(...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,{},nj,rj,sj,ij,oj,aj,lj,cj,uj,dj,fj,hj,pj,mj,vj,gj,yj,void 0,new WeakMap,_j,wj,[0]].map((o,l)=>t[l]||o);d5.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const f5={};let Sj=0;function ct(t,e){const n=`atom${++Sj}`,r={toString(){return(f5?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=Ej,r.write=kj),e&&(r.write=e),r}function Ej(t){return t(this)}function kj(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function Cj(){return bj()}let Bd;function Pj(){return Bd||(Bd=Cj(),(f5?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Bd),globalThis.__JOTAI_DEFAULT_STORE__!==Bd&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Bd}const Aj={},Tj=m.createContext(void 0);function jw(t){return m.useContext(Tj)||Pj()}const U2=t=>typeof(t==null?void 0:t.then)=="function",W2=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},Rj=we.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(W2(t),t)}),V1=new WeakMap,M8=(t,e,n)=>{const r=xj(t),s=r[26];let i=V1.get(e);return i||(i=new Promise((o,l)=>{let u=e;const d=v=>y=>{u===v&&o(y)},f=v=>y=>{u===v&&l(y)},p=()=>{try{const v=n();U2(v)?(V1.set(v,i),u=v,v.then(d(v),f(v)),s(r,t,v,p)):o(v)}catch(v){l(v)}};e.then(d(e),f(e)),s(r,t,e,p)}),V1.set(e,i)),i};function rt(t,e){const{delay:n,unstable_promiseStatus:r=!we.use}={},s=jw(),[[i,o,l],u]=m.useReducer(f=>{const p=s.get(t);return Object.is(f[0],p)&&f[1]===s&&f[2]===t?f:[p,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(u(),d=s.get(t)),m.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const p=s.get(t);U2(p)&&W2(M8(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
43
-
44
- Migration guide:
45
-
46
- Create a custom hook like the following.
47
-
48
- function useAtomValueWithDelay<Value>(
49
- atom: Atom<Value>,
50
- options: { delay: number },
51
- ): Value {
52
- const { delay } = options
53
- const store = useStore(options)
54
- const [value, setValue] = useState(() => store.get(atom))
55
- useEffect(() => {
56
- const unsub = store.sub(atom, () => {
57
- setTimeout(() => setValue(store.get(atom)), delay)
58
- })
59
- return unsub
60
- }, [store, atom, delay])
61
- return value
62
- }
63
- `),setTimeout(u,n);return}u()});return u(),f},[s,t,n,r]),m.useDebugValue(d),U2(d)){const f=M8(s,d,()=>s.get(t));return r&&W2(f),Rj(f)}return d}function mt(t,e){const n=jw();return m.useCallback((...s)=>{if((Aj?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function h5(t,e){return[rt(t),mt(t)]}const Fw=m.createContext({});function Vw(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ij=typeof window<"u",$w=Ij?m.useLayoutEffect:m.useEffect,Gm=m.createContext(null);function Hw(t,e){t.indexOf(e)===-1&&t.push(e)}function mm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const $i=(t,e,n)=>n>e?e:n<t?t:n;let Km=()=>{};const ka={},p5=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),m5=t=>typeof t=="object"&&t!==null,v5=t=>/^0[^.\s]+$/u.test(t);function g5(t){let e;return()=>(e===void 0&&(e=t()),e)}const zs=t=>t,ih=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Af=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class zw{constructor(){this.subscriptions=[]}add(e){return Hw(this.subscriptions,e),()=>mm(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 ys=t=>t*1e3,Fs=t=>t/1e3,y5=(t,e)=>e?t*(1e3/e):0,_5=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Mj=1e-7,Oj=12;function Lj(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=_5(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>Mj&&++l<Oj);return o}function oh(t,e,n,r){if(t===e&&n===r)return zs;const s=i=>Lj(i,0,1,t,n);return i=>i===0||i===1?i:_5(s(i),e,r)}const w5=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,x5=t=>e=>1-t(1-e),b5=oh(.33,1.53,.69,.99),Bw=x5(b5),S5=w5(Bw),E5=t=>t>=1?1:(t*=2)<1?.5*Bw(t):.5*(2-Math.pow(2,-10*(t-1))),Uw=t=>1-Math.sin(Math.acos(t)),k5=x5(Uw),C5=w5(Uw),Dj=oh(.42,0,1,1),Nj=oh(0,0,.58,1),P5=oh(.42,0,.58,1),jj=t=>Array.isArray(t)&&typeof t[0]!="number",A5=t=>Array.isArray(t)&&typeof t[0]=="number",Fj={linear:zs,easeIn:Dj,easeInOut:P5,easeOut:Nj,circIn:Uw,circInOut:C5,circOut:k5,backIn:Bw,backInOut:S5,backOut:b5,anticipate:E5},Vj=t=>typeof t=="string",O8=t=>{if(A5(t)){Km(t.length===4);const[e,n,r,s]=t;return oh(e,n,r,s)}else if(Vj(t))return Fj[t];return t},Bp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function $j(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)&&(u.schedule(d),t()),d(o)}const u={schedule:(d,f=!1,p=!1)=>{const y=p&&r?e:n;return f&&i.add(d),y.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,u.process(d))}};return u}const Hj=40;function T5(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Bp.reduce((C,P)=>(C[P]=$j(i),C),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:f,update:p,preRender:v,render:y,postRender:w}=o,_=()=>{const C=ka.useManualTiming,P=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(P-s.timestamp,Hj),1)),s.timestamp=P,s.isProcessing=!0,l.process(s),u.process(s),d.process(s),f.process(s),p.process(s),v.process(s),y.process(s),w.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},x=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:Bp.reduce((C,P)=>{const T=o[P];return C[P]=(O,M=!1,R=!1)=>(n||x(),T.schedule(O,M,R)),C},{}),cancel:C=>{for(let P=0;P<Bp.length;P++)o[Bp[P]].cancel(C)},state:s,steps:o}}const{schedule:Vt,cancel:Ca,state:sr,steps:$1}=T5(typeof requestAnimationFrame<"u"?requestAnimationFrame:zs,!0);let w0;function zj(){w0=void 0}const kr={now:()=>(w0===void 0&&kr.set(sr.isProcessing||ka.useManualTiming?sr.timestamp:performance.now()),w0),set:t=>{w0=t,queueMicrotask(zj)}},R5=t=>e=>typeof e=="string"&&e.startsWith(t),I5=R5("--"),Bj=R5("var(--"),Ww=t=>Bj(t)?Uj.test(t.split("/*")[0].trim()):!1,Uj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function L8(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const zu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Tf={...zu,transform:t=>$i(0,1,t)},Up={...zu,default:1},df=t=>Math.round(t*1e5)/1e5,Zw=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Wj(t){return t==null}const Zj=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,qw=(t,e)=>n=>!!(typeof n=="string"&&Zj.test(n)&&n.startsWith(t)||e&&!Wj(n)&&Object.prototype.hasOwnProperty.call(n,e)),M5=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(Zw);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},qj=t=>$i(0,255,t),H1={...zu,transform:t=>Math.round(qj(t))},kl={test:qw("rgb","red"),parse:M5("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+H1.transform(t)+", "+H1.transform(e)+", "+H1.transform(n)+", "+df(Tf.transform(r))+")"};function Gj(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 Z2={test:qw("#"),parse:Gj,transform:kl.transform},ah=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),fo=ah("deg"),Vi=ah("%"),Ve=ah("px"),Kj=ah("vh"),Yj=ah("vw"),D8={...Vi,parse:t=>Vi.parse(t)/100,transform:t=>Vi.transform(t*100)},qc={test:qw("hsl","hue"),parse:M5("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Vi.transform(df(e))+", "+Vi.transform(df(n))+", "+df(Tf.transform(r))+")"},In={test:t=>kl.test(t)||Z2.test(t)||qc.test(t),parse:t=>kl.test(t)?kl.parse(t):qc.test(t)?qc.parse(t):Z2.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?kl.transform(t):qc.transform(t),getAnimatableNone:t=>{const e=In.parse(t);return e.alpha=0,In.transform(e)}},Xj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Qj(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Zw))==null?void 0:e.length)||0)+(((n=t.match(Xj))==null?void 0:n.length)||0)>0}const O5="number",L5="color",Jj="var",eF="var(",N8="${}",tF=/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 Mu(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(tF,u=>(In.test(u)?(r.color.push(i),s.push(L5),n.push(In.parse(u))):u.startsWith(eF)?(r.var.push(i),s.push(Jj),n.push(u)):(r.number.push(i),s.push(O5),n.push(parseFloat(u))),++i,N8)).split(N8);return{values:n,split:l,indexes:r,types:s}}function nF(t){return Mu(t).values}function D5({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===O5?s+=df(r[i]):o===L5?s+=In.transform(r[i]):s+=r[i]}return s}}function rF(t){return D5(Mu(t))}const sF=t=>typeof t=="number"?0:In.test(t)?In.getAnimatableNone(t):t,iF=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:sF(t);function oF(t){const e=Mu(t);return D5(e)(e.values.map((r,s)=>iF(r,e.split[s])))}const ui={test:Qj,parse:nF,createTransformer:rF,getAnimatableNone:oF};function z1(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 aF({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,u=2*n-l;s=z1(u,l,t+1/3),i=z1(u,l,t),o=z1(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function vm(t,e){return n=>n>0?e:t}const Ft=(t,e,n)=>t+(e-t)*n,B1=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},lF=[Z2,kl,qc],cF=t=>lF.find(e=>e.test(t));function j8(t){const e=cF(t);if(!e)return!1;let n=e.parse(t);return e===qc&&(n=aF(n)),n}const F8=(t,e)=>{const n=j8(t),r=j8(e);if(!n||!r)return vm(t,e);const s={...n};return i=>(s.red=B1(n.red,r.red,i),s.green=B1(n.green,r.green,i),s.blue=B1(n.blue,r.blue,i),s.alpha=Ft(n.alpha,r.alpha,i),kl.transform(s))},q2=new Set(["none","hidden"]);function uF(t,e){return q2.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function dF(t,e){return n=>Ft(t,e,n)}function Gw(t){return typeof t=="number"?dF:typeof t=="string"?Ww(t)?vm:In.test(t)?F8:pF:Array.isArray(t)?N5:typeof t=="object"?In.test(t)?F8:fF:vm}function N5(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Gw(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function fF(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Gw(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function hF(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 pF=(t,e)=>{const n=ui.createTransformer(e),r=Mu(t),s=Mu(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?q2.has(t)&&!s.values.length||q2.has(e)&&!r.values.length?uF(t,e):ih(N5(hF(r,s),s.values),n):vm(t,e)};function j5(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Ft(t,e,n):Gw(t)(t,e)}const mF=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Vt.update(e,n),stop:()=>Ca(e),now:()=>sr.isProcessing?sr.timestamp:kr.now()}},F5=(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)})`},gm=2e4;function Kw(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<gm;)e+=n,r=t.next(e);return e>=gm?1/0:e}function vF(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Kw(r),gm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Fs(s)}}const mn={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 G2(t,e){return t*Math.sqrt(1-e*e)}const gF=12;function yF(t,e,n){let r=n;for(let s=1;s<gF;s++)r=r-t(r)/e(r);return r}const U1=.001;function _F({duration:t=mn.duration,bounce:e=mn.bounce,velocity:n=mn.velocity,mass:r=mn.mass}){let s,i,o=1-e;o=$i(mn.minDamping,mn.maxDamping,o),t=$i(mn.minDuration,mn.maxDuration,Fs(t)),o<1?(s=d=>{const f=d*o,p=f*t,v=f-n,y=G2(d,o),w=Math.exp(-p);return U1-v/y*w},i=d=>{const p=d*o*t,v=p*n+n,y=Math.pow(o,2)*Math.pow(d,2)*t,w=Math.exp(-p),_=G2(Math.pow(d,2),o);return(-s(d)+U1>0?-1:1)*((v-y)*w)/_}):(s=d=>{const f=Math.exp(-d*t),p=(d-n)*t+1;return-U1+f*p},i=d=>{const f=Math.exp(-d*t),p=(n-d)*(t*t);return f*p});const l=5/t,u=yF(s,i,l);if(t=ys(t),isNaN(u))return{stiffness:mn.stiffness,damping:mn.damping,duration:t};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const wF=["duration","bounce"],xF=["stiffness","damping","mass"];function V8(t,e){return e.some(n=>t[n]!==void 0)}function bF(t){let e={velocity:mn.velocity,stiffness:mn.stiffness,damping:mn.damping,mass:mn.mass,isResolvedFromDuration:!1,...t};if(!V8(t,xF)&&V8(t,wF))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*$i(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:mn.mass,stiffness:s,damping:i}}else{const n=_F({...t,velocity:0});e={...e,...n,mass:mn.mass},e.isResolvedFromDuration=!0}return e}function ym(t=mn.visualDuration,e=mn.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:u,damping:d,mass:f,duration:p,velocity:v,isResolvedFromDuration:y}=bF({...n,velocity:-Fs(n.velocity||0)}),w=v||0,_=d/(2*Math.sqrt(u*f)),x=o-i,b=Fs(Math.sqrt(u/f)),k=Math.abs(x)<5;r||(r=k?mn.restSpeed.granular:mn.restSpeed.default),s||(s=k?mn.restDelta.granular:mn.restDelta.default);let C,P,T,O,M,R;if(_<1)T=G2(b,_),O=(w+_*b*x)/T,C=D=>{const V=Math.exp(-_*b*D);return o-V*(O*Math.sin(T*D)+x*Math.cos(T*D))},M=_*b*O+x*T,R=_*b*x-O*T,P=D=>Math.exp(-_*b*D)*(M*Math.sin(T*D)+R*Math.cos(T*D));else if(_===1){C=V=>o-Math.exp(-b*V)*(x+(w+b*x)*V);const D=w+b*x;P=V=>Math.exp(-b*V)*(b*D*V-w)}else{const D=b*Math.sqrt(_*_-1);C=X=>{const q=Math.exp(-_*b*X),Z=Math.min(D*X,300);return o-q*((w+_*b*x)*Math.sinh(Z)+D*x*Math.cosh(Z))/D};const V=(w+_*b*x)/D,j=_*b*V-x*D,U=_*b*x-V*D;P=X=>{const q=Math.exp(-_*b*X),Z=Math.min(D*X,300);return q*(j*Math.sinh(Z)+U*Math.cosh(Z))}}const L={calculatedDuration:y&&p||null,velocity:D=>ys(P(D)),next:D=>{if(!y&&_<1){const j=Math.exp(-_*b*D),U=Math.sin(T*D),X=Math.cos(T*D),q=o-j*(O*U+x*X),Z=ys(j*(M*U+R*X));return l.done=Math.abs(Z)<=r&&Math.abs(o-q)<=s,l.value=l.done?o:q,l}const V=C(D);if(y)l.done=D>=p;else{const j=ys(P(D));l.done=Math.abs(j)<=r&&Math.abs(o-V)<=s}return l.value=l.done?o:V,l},toString:()=>{const D=Math.min(Kw(L),gm),V=F5(j=>L.next(D*j).value,D,30);return D+"ms "+V},toTransition:()=>{}};return L}ym.applyToOptions=t=>{const e=vF(t,100,ym);return t.ease=e.ease,t.duration=ys(e.duration),t.type="keyframes",t};const SF=5;function V5(t,e,n){const r=Math.max(e-SF,0);return y5(n-t(r),e-r)}function K2({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:u,restDelta:d=.5,restSpeed:f}){const p=t[0],v={done:!1,value:p},y=R=>l!==void 0&&R<l||u!==void 0&&R>u,w=R=>l===void 0?u:u===void 0||Math.abs(l-R)<Math.abs(u-R)?l:u;let _=n*e;const x=p+_,b=o===void 0?x:o(x);b!==x&&(_=b-p);const k=R=>-_*Math.exp(-R/r),C=R=>b+k(R),P=R=>{const L=k(R),D=C(R);v.done=Math.abs(L)<=d,v.value=v.done?b:D};let T,O;const M=R=>{y(v.value)&&(T=R,O=ym({keyframes:[v.value,w(v.value)],velocity:V5(C,R,v.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return M(0),{calculatedDuration:null,next:R=>{let L=!1;return!O&&T===void 0&&(L=!0,P(R),M(R)),T!==void 0&&R>=T?O.next(R-T):(!L&&P(R),v)}}}function EF(t,e,n){const r=[],s=n||ka.mix||j5,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||zs:e;l=ih(u,l)}r.push(l)}return r}function kF(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Km(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=EF(e,r,s),u=l.length,d=f=>{if(o&&f<t[0])return e[0];let p=0;if(u>1)for(;p<t.length-2&&!(f<t[p+1]);p++);const v=Af(t[p],t[p+1],f);return l[p](v)};return n?f=>d($i(t[0],t[i-1],f)):d}function CF(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Af(0,e,r);t.push(Ft(n,1,s))}}function PF(t){const e=[0];return CF(e,t.length-1),e}function AF(t,e){return t.map(n=>n*e)}function TF(t,e){return t.map(()=>e||P5).splice(0,t.length-1)}function ff({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=jj(r)?r.map(O8):O8(r),i={done:!1,value:e[0]},o=AF(n&&n.length===e.length?n:PF(e),t),l=kF(o,e,{ease:Array.isArray(s)?s:TF(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const RF=t=>t!==null;function Ym(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(RF),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const IF={decay:K2,inertia:K2,tween:ff,keyframes:ff,spring:ym};function $5(t){typeof t.type=="string"&&(t.type=IF[t.type])}class Yw{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 MF=t=>t/100;class _m extends Yw{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!==kr.now()&&this.tick(kr.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;$5(e);const{type:n=ff,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||ff;u!==ff&&typeof l[0]!="number"&&(this.mixKeyframes=ih(MF,j5(l[0],l[1])),l=[0,100]);const d=u({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Kw(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:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:p,repeatType:v,repeatDelay:y,type:w,onUpdate:_,finalKeyframe:x}=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 b=this.currentTime-d*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,P=r;if(p){const R=Math.min(this.currentTime,s)/l;let L=Math.floor(R),D=R%1;!D&&R>=1&&(D=1),D===1&&L--,L=Math.min(L,p+1),!!(L%2)&&(v==="reverse"?(D=1-D,y&&(D-=y/l)):v==="mirror"&&(P=o)),C=$i(0,1,D)*l}let T;k?(this.delayState.value=f[0],T=this.delayState):T=P.next(C),i&&!k&&(T.value=i(T.value));let{done:O}=T;!k&&u!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return M&&w!==K2&&(T.value=Ym(f,this.options,x,this.speed)),_&&_(T.value),M&&this.finish(),T}then(e,n){return this.finished.then(e,n)}get duration(){return Fs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Fs(e)}get time(){return Fs(this.currentTime)}set time(e){e=ys(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 V5(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(kr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Fs(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=mF,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(kr.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 OF(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Cl=t=>t*180/Math.PI,Y2=t=>{const e=Cl(Math.atan2(t[1],t[0]));return X2(e)},LF={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Y2,rotateZ:Y2,skewX:t=>Cl(Math.atan(t[1])),skewY:t=>Cl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},X2=t=>(t=t%360,t<0&&(t+=360),t),$8=Y2,H8=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),z8=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),DF={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:H8,scaleY:z8,scale:t=>(H8(t)+z8(t))/2,rotateX:t=>X2(Cl(Math.atan2(t[6],t[5]))),rotateY:t=>X2(Cl(Math.atan2(-t[2],t[0]))),rotateZ:$8,rotate:$8,skewX:t=>Cl(Math.atan(t[4])),skewY:t=>Cl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Q2(t){return t.includes("scale")?1:0}function J2(t,e){if(!t||t==="none")return Q2(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=DF,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=LF,s=l}if(!s)return Q2(e);const i=r[e],o=s[1].split(",").map(jF);return typeof i=="function"?i(o):o[i]}const NF=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return J2(n,e)};function jF(t){return parseFloat(t.trim())}const Bu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Uu=new Set([...Bu,"pathRotation"]),B8=t=>t===zu||t===Ve,FF=new Set(["x","y","z"]),VF=Bu.filter(t=>!FF.has(t));function $F(t){const e=[];return VF.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const ma={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})=>J2(e,"x"),y:(t,{transform:e})=>J2(e,"y")};ma.translateX=ma.x;ma.translateY=ma.y;const Fl=new Set;let e_=!1,t_=!1,n_=!1;function H5(){if(t_){const t=Array.from(Fl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=$F(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)})}t_=!1,e_=!1,Fl.forEach(t=>t.complete(n_)),Fl.clear()}function z5(){Fl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(t_=!0)})}function HF(){n_=!0,z5(),H5(),n_=!1}class Xw{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?(Fl.add(this),e_||(e_=!0,Vt.read(z5),Vt.resolveKeyframes(H5))):(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])}OF(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Fl.delete(this)}cancel(){this.state==="scheduled"&&(Fl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zF=t=>t.startsWith("--");function B5(t,e,n){zF(e)?t.style.setProperty(e,n):t.style[e]=n}const BF={};function U5(t,e){const n=g5(t);return()=>BF[e]??n()}const UF=U5(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),W5=U5(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Jd=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,U8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jd([0,.65,.55,1]),circOut:Jd([.55,0,1,.45]),backIn:Jd([.31,.01,.66,-.59]),backOut:Jd([.33,1.53,.69,.99])};function Z5(t,e){if(t)return typeof t=="function"?W5()?F5(t,e):"ease-out":A5(t)?Jd(t):Array.isArray(t)?t.map(n=>Z5(n,e)||U8.easeOut):U8[t]}function WF(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:u}={},d=void 0){const f={[e]:n};u&&(f.offset=u);const p=Z5(l,s);Array.isArray(p)&&(f.easing=p);const v={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(v.pseudoElement=d),t.animate(f,v)}function q5(t){return typeof t=="function"&&"applyToOptions"in t}function ZF({type:t,...e}){return q5(t)&&W5()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class G5 extends Yw{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:u}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,Km(typeof e.type!="string");const d=ZF(e);this.animation=WF(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Ym(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),B5(n,r,f),this.animation.cancel()}u==null||u(),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 Fs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Fs(e)}get time(){return Fs(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ys(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&&UF()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),zs):s(this)}}const K5={anticipate:E5,backInOut:S5,circInOut:C5};function qF(t){return t in K5}function GF(t){typeof t.ease=="string"&&qF(t.ease)&&(t.ease=K5[t.ease])}const W1=10;class KF extends G5{constructor(e){GF(e),$5(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 _m({...o,autoplay:!1}),u=Math.max(W1,kr.now()-this.startTime),d=$i(0,W1,u-W1),f=l.sample(u).value,{name:p}=this.options;i&&p&&B5(i,p,f),n.setWithVelocity(l.sample(Math.max(0,u-d)).value,f,d),l.stop()}}const W8=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ui.test(t)||t==="0")&&!t.startsWith("url("));function YF(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 XF(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=W8(s,e),l=W8(i,e);return!o||!l?!1:YF(t)||(n==="spring"||q5(n))&&r}function r_(t){t.duration=0,t.type="keyframes"}const Y5=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),QF=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function JF(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&QF.test(t[e]))return!0;return!1}const eV=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),tV=g5(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function nV(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,u=(p=e==null?void 0:e.owner)==null?void 0:p.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return tV()&&n&&(Y5.has(n)||eV.has(n)&&JF(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const rV=40;class sV extends Yw{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:u,motionValue:d,element:f,...p}){var w;super(),this.stop=()=>{var _,x;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=kr.now();const v={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...p},y=(f==null?void 0:f.KeyframeResolver)||Xw;this.keyframeResolver=new y(l,(_,x,b)=>this.onKeyframesResolved(_,x,v,!b),u,d,f),(w=this.keyframeResolver)==null||w.scheduleResolve()}onKeyframesResolved(e,n,r,s){var b,k;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:u,isHandoff:d,onUpdate:f}=r;this.resolvedAt=kr.now();let p=!0;XF(e,i,o,l)||(p=!1,(ka.instantAnimations||!u)&&(f==null||f(Ym(e,r,n))),e[0]=e[e.length-1],r_(r),r.repeat=0);const y={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>rV?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},w=p&&!d&&nV(y),_=(k=(b=y.motionValue)==null?void 0:b.owner)==null?void 0:k.current;let x;if(w)try{x=new KF({...y,element:_})}catch{x=new _m(y)}else x=new _m(y);x.finished.then(()=>{this.notifyFinished()}).catch(zs),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}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(),HF()),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 X5(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 Z8=30,iV=t=>!isNaN(parseFloat(t));class oV{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=kr.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=kr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=iV(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 zw);const r=this.events[e].add(n);return e==="change"?()=>{r(),Vt.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=kr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Z8)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Z8);return y5(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 Ou(t,e){return new oV(t,e)}function Q5(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Qw(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Q5(n,t):n}const aV={type:"spring",stiffness:500,damping:25,restSpeed:10},lV=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),cV={type:"keyframes",duration:.8},uV={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dV=(t,{keyframes:e})=>e.length>2?cV:Uu.has(t)?t.startsWith("scale")?lV(e[1]):aV:uV,fV=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function hV(t){for(const e in t)if(!fV.has(e))return!0;return!1}const Jw=(t,e,n,r={},s,i)=>o=>{const l=Qw(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-ys(u);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:v=>{e.set(v),l.onUpdate&&l.onUpdate(v)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};hV(l)||Object.assign(f,dV(t,f)),f.duration&&(f.duration=ys(f.duration)),f.repeatDelay&&(f.repeatDelay=ys(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let p=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(r_(f),f.delay===0&&(p=!0)),(ka.instantAnimations||ka.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(p=!0,r_(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,p&&!i&&e.get()!==void 0){const v=Ym(f.keyframes,l);if(v!==void 0){Vt.update(()=>{f.onUpdate(v),f.onComplete()});return}}return l.isSync?new _m(f):new sV(f)},pV=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function mV(t){const e=pV.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function J5(t,e,n=1){const[r,s]=mV(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return p5(o)?parseFloat(o):o}return Ww(s)?J5(s,e,n+1):s}function q8(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function ex(t,e,n,r){if(typeof e=="function"){const[s,i]=q8(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]=q8(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function Vl(t,e,n){const r=t.getProps();return ex(r,e,n!==void 0?n:r.custom,t)}const eA=new Set(["width","height","top","left","right","bottom",...Bu]),s_=t=>Array.isArray(t);function vV(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ou(n))}function gV(t){return s_(t)?t[t.length-1]||0:t}function yV(t,e){const n=Vl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=gV(i[o]);vV(t,o,l)}}const ar=t=>!!(t&&t.getVelocity);function _V(t){return!!(ar(t)&&t.add)}function i_(t,e){const n=t.getValue("willChange");if(_V(n))return n.add(e);if(!n&&ka.WillChange){const r=new ka.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function tx(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const wV="framerAppearId",tA="data-"+tx(wV);function nA(t){return t.props[tA]}function xV({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function rA(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?Q5(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],v=s&&t.animationState&&t.animationState.getState()[s],y=i==null?void 0:i.path;y&&y.animateVisualElement(t,l,i,n,p);for(const w in l){const _=t.getValue(w,t.latestValues[w]??null),x=l[w];if(x===void 0||v&&xV(v,w))continue;const b={delay:n,...Qw(i||{},w)};f&&(b.skipAnimations=!0);const k=_.get();if(k!==void 0&&!_.isAnimating()&&!Array.isArray(x)&&x===k&&!b.velocity){Vt.update(()=>_.set(x));continue}let C=!1;if(window.MotionHandoffAnimation){const O=nA(t);if(O){const M=window.MotionHandoffAnimation(O,w,Vt);M!==null&&(b.startTime=M,C=!0)}}i_(t,w);const P=d??t.shouldReduceMotion;_.start(Jw(w,_,x,P&&eA.has(w)?{type:!1}:b,t,C));const T=_.animation;T&&p.push(T)}if(o){const w=()=>Vt.update(()=>{o&&yV(t,o)});p.length?Promise.all(p).then(w):w()}return p}function o_(t,e,n={}){var u;const r=Vl(t,e,n.type==="exit"?(u=t.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(rA(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:v}=s;return bV(t,e,d,f,p,v,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 bV(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),l.push(o_(u,e,{...o,delay:n+(typeof r=="function"?0:r)+X5(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function SV(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>o_(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=o_(t,e,n);else{const s=typeof e=="function"?Vl(t,e,n.custom):e;r=Promise.all(rA(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const EV={test:t=>t==="auto",parse:t=>t},sA=t=>e=>e.test(t),iA=[zu,Ve,Vi,fo,Yj,Kj,EV],G8=t=>iA.find(sA(t));function kV(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||v5(t):!0}const CV=new Set(["brightness","contrast","saturate","opacity"]);function PV(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Zw)||[];if(!r)return t;const s=n.replace(r,"");let i=CV.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const AV=/\b([a-z-]*)\(.*?\)/gu,a_={...ui,getAnimatableNone:t=>{const e=t.match(AV);return e?e.map(PV).join(" "):t}},l_={...ui,getAnimatableNone:t=>{const e=ui.parse(t);return ui.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},K8={...zu,transform:Math.round},TV={rotate:fo,pathRotation:fo,rotateX:fo,rotateY:fo,rotateZ:fo,scale:Up,scaleX:Up,scaleY:Up,scaleZ:Up,skew:fo,skewX:fo,skewY:fo,distance:Ve,translateX:Ve,translateY:Ve,translateZ:Ve,x:Ve,y:Ve,z:Ve,perspective:Ve,transformPerspective:Ve,opacity:Tf,originX:D8,originY:D8,originZ:Ve},wm={borderWidth:Ve,borderTopWidth:Ve,borderRightWidth:Ve,borderBottomWidth:Ve,borderLeftWidth:Ve,borderRadius:Ve,borderTopLeftRadius:Ve,borderTopRightRadius:Ve,borderBottomRightRadius:Ve,borderBottomLeftRadius:Ve,width:Ve,maxWidth:Ve,height:Ve,maxHeight:Ve,top:Ve,right:Ve,bottom:Ve,left:Ve,inset:Ve,insetBlock:Ve,insetBlockStart:Ve,insetBlockEnd:Ve,insetInline:Ve,insetInlineStart:Ve,insetInlineEnd:Ve,padding:Ve,paddingTop:Ve,paddingRight:Ve,paddingBottom:Ve,paddingLeft:Ve,paddingBlock:Ve,paddingBlockStart:Ve,paddingBlockEnd:Ve,paddingInline:Ve,paddingInlineStart:Ve,paddingInlineEnd:Ve,margin:Ve,marginTop:Ve,marginRight:Ve,marginBottom:Ve,marginLeft:Ve,marginBlock:Ve,marginBlockStart:Ve,marginBlockEnd:Ve,marginInline:Ve,marginInlineStart:Ve,marginInlineEnd:Ve,fontSize:Ve,backgroundPositionX:Ve,backgroundPositionY:Ve,...TV,zIndex:K8,fillOpacity:Tf,strokeOpacity:Tf,numOctaves:K8},RV={...wm,color:In,backgroundColor:In,outlineColor:In,fill:In,stroke:In,borderColor:In,borderTopColor:In,borderRightColor:In,borderBottomColor:In,borderLeftColor:In,filter:a_,WebkitFilter:a_,mask:l_,WebkitMask:l_},oA=t=>RV[t],IV=new Set([a_,l_]);function aA(t,e){let n=oA(t);return IV.has(n)||(n=ui),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const MV=new Set(["auto","none","0"]);function OV(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!MV.has(i)&&Mu(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=aA(n,s)}class LV extends Xw{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 p=e[f];if(typeof p=="string"&&(p=p.trim(),Ww(p))){const v=J5(p,n.current);v!==void 0&&(e[f]=v),f===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!eA.has(r)||e.length!==2)return;const[s,i]=e,o=G8(s),l=G8(i),u=L8(s),d=L8(i);if(u!==d&&ma[r]){this.needsMeasurement=!0;return}if(o!==l)if(B8(o)&&B8(l))for(let f=0;f<e.length;f++){const p=e[f];typeof p=="string"&&(e[f]=parseFloat(p))}else ma[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||kV(e[s]))&&r.push(s);r.length&&OV(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=ma[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]=ma[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(([u,d])=>{e.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const nx=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function lA(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 c_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function x0(t){return m5(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:rx}=T5(queueMicrotask,!1),si={x:!1,y:!1};function cA(){return si.x||si.y}function DV(t){return t==="x"||t==="y"?si[t]?null:(si[t]=!0,()=>{si[t]=!1}):si.x||si.y?null:(si.x=si.y=!0,()=>{si.x=si.y=!1})}function uA(t,e){const n=lA(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function NV(t){return!(t.pointerType==="touch"||cA())}function jV(t,e,n={}){const[r,s,i]=uA(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",w)},p=x=>{d&&(d(x),d=void 0),f()},v=x=>{l=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),u&&(u=!1,p(x))},y=()=>{l=!0,window.addEventListener("pointerup",v,s),window.addEventListener("pointercancel",v,s)},w=x=>{if(x.pointerType!=="touch"){if(l){u=!0;return}p(x)}},_=x=>{if(!NV(x))return;u=!1;const b=e(o,x);typeof b=="function"&&(d=b,o.addEventListener("pointerleave",w,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",y,s)}),i}const dA=(t,e)=>e?t===e?!0:dA(t,e.parentElement):!1,sx=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,FV=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function VV(t){return FV.has(t.tagName)||t.isContentEditable===!0}const $V=new Set(["INPUT","SELECT","TEXTAREA"]);function HV(t){return $V.has(t.tagName)||t.isContentEditable===!0}const b0=new WeakSet;function Y8(t){return e=>{e.key==="Enter"&&t(e)}}function Z1(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const zV=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Y8(()=>{if(b0.has(n))return;Z1(n,"down");const s=Y8(()=>{Z1(n,"up")}),i=()=>Z1(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 X8(t){return sx(t)&&!cA()}const Q8=new WeakSet;function BV(t,e,n={}){const[r,s,i]=uA(t,n),o=l=>{const u=l.currentTarget;if(!X8(l)||Q8.has(l))return;b0.add(u),n.stopPropagation&&Q8.add(l);const d=e(u,l),f={...s,capture:!0},p=(w,_)=>{window.removeEventListener("pointerup",v,f),window.removeEventListener("pointercancel",y,f),b0.has(u)&&b0.delete(u),X8(w)&&typeof d=="function"&&d(w,{success:_})},v=w=>{p(w,u===window||u===document||n.useGlobalTarget||dA(u,w.target))},y=w=>{p(w,!1)};window.addEventListener("pointerup",v,f),window.addEventListener("pointercancel",y,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),x0(l)&&(l.addEventListener("focus",d=>zV(d,s)),!VV(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function ix(t){return m5(t)&&"ownerSVGElement"in t}const S0=new WeakMap;let ia;const fA=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:ix(r)&&"getBBox"in r?r.getBBox()[e]:r[n],UV=fA("inline","width","offsetWidth"),WV=fA("block","height","offsetHeight");function ZV({target:t,borderBoxSize:e}){var n;(n=S0.get(t))==null||n.forEach(r=>{r(t,{get width(){return UV(t,e)},get height(){return WV(t,e)}})})}function qV(t){t.forEach(ZV)}function GV(){typeof ResizeObserver>"u"||(ia=new ResizeObserver(qV))}function KV(t,e){ia||GV();const n=lA(t);return n.forEach(r=>{let s=S0.get(r);s||(s=new Set,S0.set(r,s)),s.add(e),ia==null||ia.observe(r)}),()=>{n.forEach(r=>{const s=S0.get(r);s==null||s.delete(e),s!=null&&s.size||ia==null||ia.unobserve(r)})}}const E0=new Set;let Gc;function YV(){Gc=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};E0.forEach(e=>e(t))},window.addEventListener("resize",Gc)}function XV(t){return E0.add(t),Gc||YV(),()=>{E0.delete(t),!E0.size&&typeof Gc=="function"&&(window.removeEventListener("resize",Gc),Gc=void 0)}}function J8(t,e){return typeof t=="function"?XV(t):KV(t,e)}function QV(t){return ix(t)&&t.tagName==="svg"}const JV=[...iA,In,ui],e$=t=>JV.find(sA(t)),eE=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kc=()=>({x:eE(),y:eE()}),tE=()=>({min:0,max:0}),Fn=()=>({x:tE(),y:tE()}),t$=new WeakMap;function Xm(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Rf(t){return typeof t=="string"||Array.isArray(t)}const ox=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ax=["initial",...ox];function Qm(t){return Xm(t.animate)||ax.some(e=>Rf(t[e]))}function hA(t){return!!(Qm(t)||t.variants)}function n$(t,e,n){for(const r in e){const s=e[r],i=n[r];if(ar(s))t.addValue(r,s);else if(ar(i))t.addValue(r,Ou(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,Ou(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const xm={current:null},lx={current:!1},r$=typeof window<"u";function pA(){if(lx.current=!0,!!r$)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xm.current=t.matches;t.addEventListener("change",e),e()}else xm.current=!1}const nE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let bm={};function mA(t){bm=t}function s$(){return bm}class i${scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},u={}){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=Xw,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 y=kr.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Vt.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=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Qm(n),this.isVariantNode=hA(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in v){const w=v[y];d[y]!==void 0&&ar(w)&&w.set(d[y])}}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,t$.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:(lx.current||pA(),this.shouldReduceMotion=xm.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(),Ca(this.notifyUpdate),Ca(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&&Y5.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:f}=n.accelerate,p=new G5({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:ys(f)}),v=o(p);this.valueSubscriptions.set(e,()=>{v(),p.cancel()});return}const r=Uu.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Vt.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 bm){const n=bm[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):Fn()}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<nE.length;r++){const s=nE[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=n$(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=Ou(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"&&(p5(r)||v5(r))?r=parseFloat(r):!e$(r)&&ui.test(n)&&(r=aA(e,n)),this.setBaseTarget(e,ar(r)?r.get():r)),ar(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=ex(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&&!ar(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 zw),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){rx.render(this.render)}}class vA extends i${constructor(){super(...arguments),this.KeyframeResolver=LV}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;ar(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Oa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function gA({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function o$({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function a$(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 q1(t){return t===void 0||t===1}function u_({scale:t,scaleX:e,scaleY:n}){return!q1(t)||!q1(e)||!q1(n)}function xl(t){return u_(t)||yA(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function yA(t){return rE(t.x)||rE(t.y)}function rE(t){return t&&t!=="0%"}function Sm(t,e,n){const r=t-n,s=e*r;return n+s}function sE(t,e,n,r,s){return s!==void 0&&(t=Sm(t,s,r)),Sm(t,n,r)+e}function d_(t,e=0,n=1,r,s){t.min=sE(t.min,e,n,r,s),t.max=sE(t.max,e,n,r,s)}function _A(t,{x:e,y:n}){d_(t.x,e.translate,e.scale,e.originPoint),d_(t.y,n.translate,n.scale,n.originPoint)}const iE=.999999999999,oE=1.0000000000001;function l$(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let u=0;u<s;u++){i=n[u],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&&(Oi(t.x,-i.scroll.offset.x),Oi(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,_A(t,o)),r&&xl(i.latestValues)&&k0(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<oE&&e.x>iE&&(e.x=1),e.y<oE&&e.y>iE&&(e.y=1)}function Oi(t,e){t.min+=e,t.max+=e}function aE(t,e,n,r,s=.5){const i=Ft(t.min,t.max,s);d_(t,e,n,i,r)}function lE(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function k0(t,e,n){const r=n??t;aE(t.x,lE(e.x,r.x),e.scaleX,e.scale,e.originX),aE(t.y,lE(e.y,r.y),e.scaleY,e.scale,e.originY)}function wA(t,e){return gA(a$(t.getBoundingClientRect(),e))}function c$(t,e,n){const r=wA(t,n),{scroll:s}=e;return s&&(Oi(r.x,s.offset.x),Oi(r.y,s.offset.y)),r}const u$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},d$=Bu.length;function f$(t,e,n){let r="",s=!0;for(let o=0;o<d$;o++){const l=Bu[o],u=t[l];if(u===void 0)continue;let d=!0;if(typeof u=="number")d=u===(l.startsWith("scale")?1:0);else{const f=parseFloat(u);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=c_(u,wm[l]);if(!d){s=!1;const p=u$[l]||l;r+=`${p}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${c_(i,wm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function cx(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const u in e){const d=e[u];if(Uu.has(u)){o=!0;continue}else if(I5(u)){s[u]=d;continue}else{const f=c_(d,wm[u]);u.startsWith("origin")?(l=!0,i[u]=f):r[u]=f}}if(e.transform||(o||n?r.transform=f$(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${u} ${d} ${f}`}}function xA(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 cE(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ud={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ve.test(t))t=parseFloat(t);else return t;const n=cE(t,e.target.x),r=cE(t,e.target.y);return`${n}% ${r}%`}},h$={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=ui.parse(t);if(s.length>5)return r;const i=ui.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=u;const d=Ft(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},f_={borderRadius:{...Ud,applyTo:[...nx]},borderTopLeftRadius:Ud,borderTopRightRadius:Ud,borderBottomLeftRadius:Ud,borderBottomRightRadius:Ud,boxShadow:h$};function bA(t,{layout:e,layoutId:n}){return Uu.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!f_[t]||t==="opacity")}function ux(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)(ar(r[l])||s&&ar(s[l])||bA(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function p$(t){return window.getComputedStyle(t)}class m$ extends vA{constructor(){super(...arguments),this.type="html",this.renderInstance=xA}mount(e){Km(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(Uu.has(n))return(r=this.projection)!=null&&r.isProjecting?Q2(n):NF(e,n);{const s=p$(e),i=(I5(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return wA(e,n)}build(e,n,r){cx(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return ux(e,n,r)}}const v$={offset:"stroke-dashoffset",array:"stroke-dasharray"},g$={offset:"strokeDashoffset",array:"strokeDasharray"};function y$(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?v$:g$;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const _$=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function SA(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,f){if(cx(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:v}=t;p.transform&&(v.transform=p.transform,delete p.transform),(v.transform||p.transformOrigin)&&(v.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),v.transform&&(v.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete p.transformBox);for(const y of _$)p[y]!==void 0&&(v[y]=p[y],delete p[y]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&y$(p,s,i,o,!1)}const EA=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"]),kA=t=>typeof t=="string"&&t.toLowerCase()==="svg";function w$(t,e,n,r){xA(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(EA.has(s)?s:tx(s),e.attrs[s])}function CA(t,e,n){const r=ux(t,e,n);for(const s in t)if(ar(t[s])||ar(e[s])){const i=Bu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class x$ extends vA{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Fn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Uu.has(n)){const r=oA(n);return r&&r.default||0}return n=EA.has(n)?n:tx(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return CA(e,n,r)}build(e,n,r){SA(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){w$(e,n,r,s)}mount(e){this.isSVGTag=kA(e.tagName),super.mount(e)}}const b$=ax.length;function PA(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?PA(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<b$;n++){const r=ax[n],s=t.props[r];(Rf(s)||s===!1)&&(e[r]=s)}return e}function AA(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 S$=[...ox].reverse(),E$=ox.length;function k$(t){return e=>Promise.all(e.map(({animation:n,options:r})=>SV(t,n,r)))}function C$(t){let e=k$(t),n=uE(),r=!0,s=!1;const i=d=>(f,p)=>{var y;const v=Vl(t,p,d==="exit"?(y=t.presenceContext)==null?void 0:y.custom:void 0);if(v){const{transition:w,transitionEnd:_,...x}=v;f={...f,...x,..._}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,p=PA(t.parent)||{},v=[],y=new Set;let w={},_=1/0;for(let b=0;b<E$;b++){const k=S$[b],C=n[k],P=f[k]!==void 0?f[k]:p[k],T=Rf(P),O=k===d?C.isActive:null;O===!1&&(_=b);let M=P===p[k]&&P!==f[k]&&T;if(M&&(r||s)&&t.manuallyAnimateOnMount&&(M=!1),C.protectedKeys={...w},!C.isActive&&O===null||!P&&!C.prevProp||Xm(P)||typeof P=="boolean")continue;if(k==="exit"&&C.isActive&&O!==!0){C.prevResolvedValues&&(w={...w,...C.prevResolvedValues});continue}const R=P$(C.prevProp,P);let L=R||k===d&&C.isActive&&!M&&T||b>_&&T,D=!1;const V=Array.isArray(P)?P:[P];let j=V.reduce(i(k),{});O===!1&&(j={});const{prevResolvedValues:U={}}=C,X={...U,...j},q=H=>{L=!0,y.has(H)&&(D=!0,y.delete(H)),C.needsAnimating[H]=!0;const Q=t.getValue(H);Q&&(Q.liveStyle=!1)};for(const H in X){const Q=j[H],z=U[H];if(w.hasOwnProperty(H))continue;let N=!1;s_(Q)&&s_(z)?N=!AA(Q,z)||R:N=Q!==z,N?Q!=null?q(H):y.add(H):Q!==void 0&&y.has(H)?q(H):C.protectedKeys[H]=!0}C.prevProp=P,C.prevResolvedValues=j,C.isActive&&(w={...w,...j}),(r||s)&&t.blockInitialAnimation&&(L=!1);const Z=M&&R;L&&(!Z||D)&&v.push(...V.map(H=>{const Q={type:k};if(typeof H=="string"&&(r||s)&&!Z&&t.manuallyAnimateOnMount&&t.parent){const{parent:z}=t,N=Vl(z,H);if(z.enteringChildren&&N){const{delayChildren:G}=N.transition||{};Q.delay=X5(z.enteringChildren,t,G)}}return{animation:H,options:Q}}))}if(y.size){const b={};if(typeof f.initial!="boolean"){const k=Vl(t,Array.isArray(f.initial)?f.initial[0]:f.initial);k&&k.transition&&(b.transition=k.transition)}y.forEach(k=>{const C=t.getBaseTarget(k),P=t.getValue(k);P&&(P.liveStyle=!0),b[k]=C??null}),v.push({animation:b})}let x=!!v.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?e(v):Promise.resolve()}function u(d,f){var v;if(n[d].isActive===f)return Promise.resolve();(v=t.variantChildren)==null||v.forEach(y=>{var w;return(w=y.animationState)==null?void 0:w.setActive(d,f)}),n[d].isActive=f;const p=l(d);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=uE(),s=!0}}}function P$(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!AA(e,t):!1}function ul(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function uE(){return{animate:ul(!0),whileInView:ul(),whileHover:ul(),whileTap:ul(),whileDrag:ul(),whileFocus:ul(),exit:ul()}}function h_(t,e){t.min=e.min,t.max=e.max}function ni(t,e){h_(t.x,e.x),h_(t.y,e.y)}function dE(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const TA=1e-4,A$=1-TA,T$=1+TA,RA=.01,R$=0-RA,I$=0+RA;function Cr(t){return t.max-t.min}function M$(t,e,n){return Math.abs(t-e)<=n}function fE(t,e,n,r=.5){t.origin=r,t.originPoint=Ft(e.min,e.max,t.origin),t.scale=Cr(n)/Cr(e),t.translate=Ft(n.min,n.max,t.origin)-t.originPoint,(t.scale>=A$&&t.scale<=T$||isNaN(t.scale))&&(t.scale=1),(t.translate>=R$&&t.translate<=I$||isNaN(t.translate))&&(t.translate=0)}function hf(t,e,n,r){fE(t.x,e.x,n.x,r?r.originX:void 0),fE(t.y,e.y,n.y,r?r.originY:void 0)}function hE(t,e,n,r=0){const s=r?Ft(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Cr(e)}function O$(t,e,n,r){hE(t.x,e.x,n.x,r==null?void 0:r.x),hE(t.y,e.y,n.y,r==null?void 0:r.y)}function pE(t,e,n,r=0){const s=r?Ft(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Cr(e)}function Em(t,e,n,r){pE(t.x,e.x,n.x,r==null?void 0:r.x),pE(t.y,e.y,n.y,r==null?void 0:r.y)}function mE(t,e,n,r,s){return t-=e,t=Sm(t,1/n,r),s!==void 0&&(t=Sm(t,1/s,r)),t}function L$(t,e=0,n=1,r=.5,s,i=t,o=t){if(Vi.test(e)&&(e=parseFloat(e),e=Ft(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Ft(i.min,i.max,r);t===i&&(l-=e),t.min=mE(t.min,e,n,l,s),t.max=mE(t.max,e,n,l,s)}function vE(t,e,[n,r,s],i,o){L$(t,e[n],e[r],e[s],e.scale,i,o)}const D$=["x","scaleX","originX"],N$=["y","scaleY","originY"];function gE(t,e,n,r){vE(t.x,e,D$,n?n.x:void 0,r?r.x:void 0),vE(t.y,e,N$,n?n.y:void 0,r?r.y:void 0)}function yE(t){return t.translate===0&&t.scale===1}function IA(t){return yE(t.x)&&yE(t.y)}function _E(t,e){return t.min===e.min&&t.max===e.max}function j$(t,e){return _E(t.x,e.x)&&_E(t.y,e.y)}function wE(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function MA(t,e){return wE(t.x,e.x)&&wE(t.y,e.y)}function xE(t){return Cr(t.x)/Cr(t.y)}function bE(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Pi(t){return[t("x"),t("y")]}function F$(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:p,rotateX:v,rotateY:y,skewX:w,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotate(${p}deg) `),v&&(r+=`rotateX(${v}deg) `),y&&(r+=`rotateY(${y}deg) `),w&&(r+=`skewX(${w}deg) `),_&&(r+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,u=t.y.scale*e.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const V$=nx.length,SE=t=>typeof t=="string"?parseFloat(t):t,EE=t=>typeof t=="number"||Ve.test(t);function $$(t,e,n,r,s,i){s?(t.opacity=Ft(0,n.opacity??1,H$(r)),t.opacityExit=Ft(e.opacity??1,0,z$(r))):i&&(t.opacity=Ft(e.opacity??1,n.opacity??1,r));for(let o=0;o<V$;o++){const l=nx[o];let u=kE(e,l),d=kE(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||EE(u)===EE(d)?(t[l]=Math.max(Ft(SE(u),SE(d),r),0),(Vi.test(d)||Vi.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=Ft(e.rotate||0,n.rotate||0,r))}function kE(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const H$=OA(0,.5,k5),z$=OA(.5,.95,zs);function OA(t,e,n){return r=>r<t?0:r>e?1:n(Af(t,e,r))}function B$(t,e,n){const r=ar(t)?t:Ou(t);return r.start(Jw("",r,e,n)),r.animation}function If(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const U$=(t,e)=>t.depth-e.depth;class W${constructor(){this.children=[],this.isDirty=!1}add(e){Hw(this.children,e),this.isDirty=!0}remove(e){mm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(U$),this.isDirty=!1,this.children.forEach(e)}}function Z$(t,e){const n=kr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Ca(r),t(i-e))};return Vt.setup(r,!0),()=>Ca(r)}function C0(t){return ar(t)?t.get():t}class q${constructor(){this.members=[]}add(e){Hw(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&&(mm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(mm(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 P0={hasAnimatedSinceResize:!0,hasEverUpdated:!1},G1=["","X","Y","Z"],G$=1e3;let K$=0;function K1(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function LA(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=nA(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Vt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&LA(r)}function DA({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=K$++,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(Q$),this.nodes.forEach(sH),this.nodes.forEach(iH),this.nodes.forEach(J$)},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 u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new W$)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new zw),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const u=this.eventHandlers.get(o);u&&u.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=ix(o)&&!QV(o),this.instance=o;const{layoutId:l,layout:u,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&&(u||l)&&(this.isLayoutDirty=!0),t){let f,p=0;const v=()=>this.root.updateBlockedByResize=!1;Vt.read(()=>{p=window.innerWidth}),t(o,()=>{const y=window.innerWidth;y!==p&&(p=y,this.root.updateBlockedByResize=!0,f&&f(),f=Z$(v,250),P0.hasAnimatedSinceResize&&(P0.hasAnimatedSinceResize=!1,this.nodes.forEach(AE)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:v,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||uH,{onLayoutAnimationStart:_,onLayoutAnimationComplete:x}=d.getProps(),b=!this.targetLayout||!MA(this.targetLayout,y),k=!p&&v;if(this.options.layoutRoot||this.resumeFrom||k||p&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Qw(w,"layout"),onPlay:_,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,k,C.path)}else p||AE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}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(),Ca(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(oH),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&&LA(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const p=this.path[f];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)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 u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(tH),this.nodes.forEach(CE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(PE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nH),this.nodes.forEach(rH),this.nodes.forEach(Y$),this.nodes.forEach(X$)):this.nodes.forEach(PE),this.clearAllSnapshots();const l=kr.now();sr.delta=$i(0,1e3/60,l-sr.timestamp),sr.timestamp=l,sr.isProcessing=!0,$1.update.process(sr),$1.preRender.process(sr),$1.render.process(sr),sr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eH),this.sharedNodes.forEach(aH)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Vt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Vt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Cr(this.snapshot.measuredBox.x)&&!Cr(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 u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Fn()),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 u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!IA(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||xl(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return o&&(u=this.removeTransform(u)),dH(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Fn();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(fH))){const{scroll:f}=this.root;f&&(Oi(l.x,f.offset.x),Oi(l.y,f.offset.y))}return l}removeElementScroll(o){var u;const l=Fn();if(ni(l,o),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:p,options:v}=f;f!==this.root&&p&&v.layoutScroll&&(p.wasRoot&&ni(l,o),Oi(l.x,p.offset.x),Oi(l.y,p.offset.y))}return l}applyTransform(o,l=!1,u){var f,p;const d=u||Fn();ni(d,o);for(let v=0;v<this.path.length;v++){const y=this.path[v];!l&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(Oi(d.x,-y.scroll.offset.x),Oi(d.y,-y.scroll.offset.y)),xl(y.latestValues)&&k0(d,y.latestValues,(f=y.layout)==null?void 0:f.layoutBox)}return xl(this.latestValues)&&k0(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(o){var u;const l=Fn();ni(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!xl(f.latestValues))continue;let p;f.instance&&(u_(f.latestValues)&&f.updateSnapshot(),p=Fn(),ni(p,f.measurePageBox())),gE(l,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,p)}return xl(this.latestValues)&&gE(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!==sr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var y;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:p}=this.options;if(!this.layout||!(f||p))return;this.resolvedRelativeTargetAt=sr.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Fn(),this.targetWithTransforms=Fn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),O$(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ni(this.target,this.layout.layoutBox),_A(this.target,this.targetDelta)):ni(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||u_(this.parent.latestValues)||yA(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,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Fn(),this.relativeTargetOrigin=Fn(),Em(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),ni(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var w;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===sr.timestamp&&(u=!1),u)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;ni(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,v=this.treeScale.y;l$(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=Fn());const{target:y}=o;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(dE(this.prevProjectionDelta.x,this.projectionDelta.x),dE(this.prevProjectionDelta.y,this.projectionDelta.y)),hf(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==v||!bE(this.projectionDelta.x,this.prevProjectionDelta.x)||!bE(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Kc(),this.projectionDelta=Kc(),this.projectionDeltaWithTransform=Kc()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},v=Kc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const y=Fn(),w=d?d.source:void 0,_=this.layout?this.layout.source:void 0,x=w!==_,b=this.getStack(),k=!b||b.members.length<=1,C=!!(x&&!k&&this.options.crossfade===!0&&!this.path.some(cH));this.animationProgress=0;let P;const T=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=O=>{const M=O/1e3,R=T==null?void 0:T(M);R?(v.x.translate=R.x,v.x.scale=Ft(o.x.scale,1,M),v.x.origin=o.x.origin,v.x.originPoint=o.x.originPoint,v.y.translate=R.y,v.y.scale=Ft(o.y.scale,1,M),v.y.origin=o.y.origin,v.y.originPoint=o.y.originPoint):(TE(v.x,o.x,M),TE(v.y,o.y,M)),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Em(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),lH(this.relativeTarget,this.relativeTargetOrigin,y,M),P&&j$(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=Fn()),ni(P,this.relativeTarget)),x&&(this.animationValues=p,$$(p,f,this.latestValues,M,C,k)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Ca(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Vt.update(()=>{P0.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ou(0)),this.motionValue.jump(0,!1),this.currentAnimation=B$(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(G$),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:u,layout:d,latestValues:f}=o;if(!(!l||!u||!d)){if(this!==o&&this.layout&&d&&NA(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||Fn();const p=Cr(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+p;const v=Cr(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+v}ni(l,u),k0(l,f),hf(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new q$),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:u}={}){const d=this.getStack();d&&d.promote(this,u),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:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const d={};u.z&&K1("z",o,d,this.animationValues);for(let f=0;f<G1.length;f++)K1(`rotate${G1[f]}`,o,d,this.animationValues),K1(`skew${G1[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 u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=C0(l==null?void 0:l.pointerEvents)||"",o.transform=u?u(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=C0(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!xl(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=F$(this.projectionDeltaWithTransform,this.treeScale,f);u&&(p=u(f,p)),o.transform=p;const{x:v,y}=this.projectionDelta;o.transformOrigin=`${v.origin*100}% ${y.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 w in f_){if(f[w]===void 0)continue;const{correct:_,applyTo:x,isCSSVariable:b}=f_[w],k=p==="none"?f[w]:_(f[w],d);if(x){const C=x.length;for(let P=0;P<C;P++)o[x[P]]=k}else b?this.options.visualElement.renderState.vars[w]=k:o[w]=k}this.options.layoutId&&(o.pointerEvents=d===this?C0(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(CE),this.root.sharedNodes.clear()}}}function Y$(t){t.updateLayout()}function X$(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")Pi(p=>{const v=o?e.measuredBox[p]:e.layoutBox[p],y=Cr(v);v.min=r[p].min,v.max=v.min+y});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";h_(o?e.measuredBox[p]:e.layoutBox[p],r[p])}else NA(i,e.layoutBox,r)&&Pi(p=>{const v=o?e.measuredBox[p]:e.layoutBox[p],y=Cr(r[p]);v.max=v.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+y)});const l=Kc();hf(l,r,e.layoutBox);const u=Kc();o?hf(u,t.applyTransform(s,!0),e.measuredBox):hf(u,r,e.layoutBox);const d=!IA(l);let f=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:v,layout:y}=p;if(v&&y){const w=t.options.layoutAnchor||void 0,_=Fn();Em(_,e.layoutBox,v.layoutBox,w);const x=Fn();Em(x,r,y.layoutBox,w),MA(_,x)||(f=!0),p.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Q$(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 J$(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function eH(t){t.clearSnapshot()}function CE(t){t.clearMeasurements()}function tH(t){t.isLayoutDirty=!0,t.updateLayout()}function PE(t){t.isLayoutDirty=!1}function nH(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function rH(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function AE(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function sH(t){t.resolveTargetDelta()}function iH(t){t.calcProjection()}function oH(t){t.resetSkewAndRotation()}function aH(t){t.removeLeadSnapshot()}function TE(t,e,n){t.translate=Ft(e.translate,0,n),t.scale=Ft(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function RE(t,e,n,r){t.min=Ft(e.min,n.min,r),t.max=Ft(e.max,n.max,r)}function lH(t,e,n,r){RE(t.x,e.x,n.x,r),RE(t.y,e.y,n.y,r)}function cH(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const uH={duration:.45,ease:[.4,0,.1,1]},IE=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ME=IE("applewebkit/")&&!IE("chrome/")?Math.round:zs;function OE(t){t.min=ME(t.min),t.max=ME(t.max)}function dH(t){OE(t.x),OE(t.y)}function NA(t,e,n){return t==="position"||t==="preserve-aspect"&&!M$(xE(e),xE(n),.2)}function fH(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const hH=DA({attachResizeListener:(t,e)=>If(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}),Y1={current:void 0},jA=DA({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Y1.current){const t=new hH({});t.mount(window),t.setOptions({layoutScroll:!0}),Y1.current=t}return Y1.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),dx=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function LE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function pH(...t){return e=>{let n=!1;const r=t.map(s=>{const i=LE(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():LE(t[s],null)}}}}function mH(...t){return m.useCallback(pH(...t),t)}class vH extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(x0(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=x0(r)&&r.offsetWidth||0,i=x0(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 gH({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var v;const o=m.useId(),l=m.useRef(null),u=m.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=m.useContext(dx),f=i!==!1?((v=t.props)==null?void 0:v.ref)??(t==null?void 0:t.ref):void 0,p=mH(l,f);return m.useInsertionEffect(()=>{const{width:y,height:w,top:_,left:x,right:b,bottom:k,direction:C}=u.current;if(e||i===!1||!l.current||!y||!w)return;const P=C==="rtl",T=n==="left"?P?`right: ${b}`:`left: ${x}`:P?`left: ${x}`:`right: ${b}`,O=r==="bottom"?`bottom: ${k}`:`top: ${_}`;l.current.dataset.motionPopId=o;const M=document.createElement("style");d&&(M.nonce=d);const R=s??document.head;return R.appendChild(M),M.sheet&&M.sheet.insertRule(`
64
- [data-motion-pop-id="${o}"] {
65
- position: absolute !important;
66
- width: ${y}px !important;
67
- height: ${w}px !important;
68
- ${T}px !important;
69
- ${O}px !important;
70
- }
71
- `),()=>{var L;(L=l.current)==null||L.removeAttribute("data-motion-pop-id"),R.contains(M)&&R.removeChild(M)}},[e]),S.jsx(vH,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:m.cloneElement(t,{ref:p})})}const yH=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const f=Vw(_H),p=m.useId(),v=m.useRef(n),y=m.useRef(r);$w(()=>{v.current=n,y.current=r});let w=!0,_=m.useMemo(()=>(w=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:x=>{f.set(x,!0);for(const b of f.values())if(!b)return;r&&r()},register:x=>(f.set(x,!1),()=>{var b;f.delete(x),!v.current&&!f.size&&((b=y.current)==null||b.call(y))})}),[n,f,r]);return i&&w&&(_={..._}),m.useMemo(()=>{f.forEach((x,b)=>f.set(b,!1))},[n]),m.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=S.jsx(gH,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),S.jsx(Gm.Provider,{value:_,children:t})};function _H(){return new Map}function FA(t=!0){const e=m.useContext(Gm);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=m.useId();m.useEffect(()=>{if(t)return s(i)},[t]);const o=m.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const Wp=t=>t.key||"";function DE(t){const e=[];return m.Children.forEach(t,n=>{m.isValidElement(n)&&e.push(n)}),e}const _s=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:d})=>{const[f,p]=FA(o),v=m.useMemo(()=>DE(t),[t]),y=o&&!f?[]:v.map(Wp),w=m.useRef(!0),_=m.useRef(v),x=Vw(()=>new Map),b=m.useRef(new Set),[k,C]=m.useState(v),[P,T]=m.useState(v);$w(()=>{w.current=!1,_.current=v;for(let R=0;R<P.length;R++){const L=Wp(P[R]);y.includes(L)?(x.delete(L),b.current.delete(L)):x.get(L)!==!0&&x.set(L,!1)}},[P,y.length,y.join("-")]);const O=[];if(v!==k){let R=[...v];for(let L=0;L<P.length;L++){const D=P[L],V=Wp(D);y.includes(V)||(R.splice(L,0,D),O.push(D))}return i==="wait"&&O.length&&(R=O),T(DE(R)),C(v),null}const{forceRender:M}=m.useContext(Fw);return S.jsx(S.Fragment,{children:P.map(R=>{const L=Wp(R),D=o&&!f?!1:v===P||y.includes(L),V=()=>{if(b.current.has(L))return;if(x.has(L))b.current.add(L),x.set(L,!0);else return;let j=!0;x.forEach(U=>{U||(j=!1)}),j&&(M==null||M(),T(_.current),o&&(p==null||p()),r&&r())};return S.jsx(yH,{isPresent:D,initial:!w.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:D?void 0:V,anchorX:l,anchorY:u,children:R},L)})})},VA=m.createContext({strict:!1}),NE={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 jE=!1;function wH(){if(jE)return;const t={};for(const e in NE)t[e]={isEnabled:n=>NE[e].some(r=>!!n[r])};mA(t),jE=!0}function $A(){return wH(),s$()}function xH(t){const e=$A();for(const n in t)e[n]={...e[n],...t[n]};mA(e)}const bH=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 km(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||bH.has(t)}let HA=t=>!km(t);function SH(t){typeof t=="function"&&(HA=e=>e.startsWith("on")?!km(e):t(e))}try{SH(require("@emotion/is-prop-valid").default)}catch{}function EH(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||ar(t[s])||(HA(s)||n===!0&&km(s)||!e&&!km(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Jm=m.createContext({});function kH(t,e){if(Qm(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Rf(n)?n:void 0,animate:Rf(r)?r:void 0}}return t.inherit!==!1?e:{}}function CH(t){const{initial:e,animate:n}=kH(t,m.useContext(Jm));return m.useMemo(()=>({initial:e,animate:n}),[FE(e),FE(n)])}function FE(t){return Array.isArray(t)?t.join(" "):t}const fx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function zA(t,e,n){for(const r in e)!ar(e[r])&&!bA(r,n)&&(t[r]=e[r])}function PH({transformTemplate:t},e){return m.useMemo(()=>{const n=fx();return cx(n,e,t),Object.assign({},n.vars,n.style)},[e])}function AH(t,e){const n=t.style||{},r={};return zA(r,n,t),Object.assign(r,PH(t,e)),r}function TH(t,e){const n={},r=AH(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 BA=()=>({...fx(),attrs:{}});function RH(t,e,n,r){const s=m.useMemo(()=>{const i=BA();return SA(i,e,kA(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};zA(i,t.style,t),s.style={...i,...s.style}}return s}const IH=["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 hx(t){return typeof t!="string"||t.includes("-")?!1:!!(IH.indexOf(t)>-1||/[A-Z]/u.test(t))}function MH(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??hx(t)?RH:TH)(e,r,s,t),d=EH(e,typeof t=="string",i),f=t!==m.Fragment?{...d,...u,ref:n}:{},{children:p}=e,v=m.useMemo(()=>ar(p)?p.get():p,[p]);return m.createElement(t,{...f,children:v})}function OH({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:LH(n,r,s,t),renderState:e()}}function LH(t,e,n,r){const s={},i=r(t,{});for(const v in i)s[v]=C0(i[v]);let{initial:o,animate:l}=t;const u=Qm(t),d=hA(t);e&&d&&!u&&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 p=f?l:o;if(p&&typeof p!="boolean"&&!Xm(p)){const v=Array.isArray(p)?p:[p];for(let y=0;y<v.length;y++){const w=ex(t,v[y]);if(w){const{transitionEnd:_,transition:x,...b}=w;for(const k in b){let C=b[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 UA=t=>(e,n)=>{const r=m.useContext(Jm),s=m.useContext(Gm),i=()=>OH(t,e,r,s);return n?i():Vw(i)},DH=UA({scrapeMotionValuesFromProps:ux,createRenderState:fx}),NH=UA({scrapeMotionValuesFromProps:CA,createRenderState:BA}),jH=Symbol.for("motionComponentSymbol");function FH(t,e,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.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 u=o(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const WA=m.createContext({});function $c(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function VH(t,e,n,r,s,i){var C,P;const{visualElement:o}=m.useContext(Jm),l=m.useContext(VA),u=m.useContext(Gm),d=m.useContext(dx),f=d.reducedMotion,p=d.skipAnimations,v=m.useRef(null),y=m.useRef(!1);r=r||l.renderer,!v.current&&r&&(v.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:p,isSVG:i}),y.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const w=v.current,_=m.useContext(WA);w&&!w.projection&&s&&(w.type==="html"||w.type==="svg")&&$H(v.current,n,s,_);const x=m.useRef(!1);m.useInsertionEffect(()=>{w&&x.current&&w.update(n,u)});const b=n[tA],k=m.useRef(!!b&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,b))&&((P=window.MotionHasOptimisedAnimation)==null?void 0:P.call(window,b)));return $w(()=>{y.current=!0,w&&(x.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),k.current&&w.animationState&&w.animationState.animateChanges())}),m.useEffect(()=>{w&&(!k.current&&w.animationState&&w.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,b)}),k.current=!1),w.enteringChildren=void 0)}),w}function $H(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ZA(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&$c(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function ZA(t){if(t)return t.options.allowProjection!==!1?t.projection:ZA(t.parent)}function X1(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&xH(r);const i=n?n==="svg":hx(t),o=i?NH:DH;function l(d,f){let p;const v={...m.useContext(dx),...d,layoutId:HH(d)},{isStatic:y}=v,w=CH(d),_=o(d,y);if(!y&&typeof window<"u"){zH();const x=BH(v);p=x.MeasureLayout,w.visualElement=VH(t,_,v,s,x.ProjectionNode,i)}return S.jsxs(Jm.Provider,{value:w,children:[p&&w.visualElement?S.jsx(p,{visualElement:w.visualElement,...v}):null,MH(t,d,FH(_,w.visualElement,f),_,y,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=m.forwardRef(l);return u[jH]=t,u}function HH({layoutId:t}){const e=m.useContext(Fw).id;return e&&t!==void 0?e+"-"+t:t}function zH(t,e){m.useContext(VA).strict}function BH(t){const e=$A(),{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 UH(t,e){if(typeof Proxy>"u")return X1;const n=new Map,r=(i,o)=>X1(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,X1(o,void 0,t,e)),n.get(o))})}const WH=(t,e)=>e.isSVG??hx(t)?new x$(e):new m$(e,{allowProjection:t!==m.Fragment});class ZH extends Oa{constructor(e){super(e),e.animationState||(e.animationState=C$(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Xm(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 qH=0;class GH extends Oa{constructor(){super(...arguments),this.id=qH++,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 u=Vl(this.node,o,l);if(u){const{transition:d,transitionEnd:f,...p}=u;for(const v in p)(i=this.node.getValue(v))==null||i.jump(p[v])}}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 KH={animation:{Feature:ZH},exit:{Feature:GH}};function lh(t){return{point:{x:t.pageX,y:t.pageY}}}const YH=t=>e=>sx(e)&&t(e,lh(e));function pf(t,e,n,r){return If(t,e,YH(n),r)}const qA=({current:t})=>t?t.ownerDocument.defaultView:null,VE=(t,e)=>Math.abs(t-e);function XH(t,e){const n=VE(t.x,e.x),r=VE(t.y,e.y);return Math.sqrt(n**2+r**2)}const $E=new Set(["auto","scroll"]);class GA{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=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zp(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Q1(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,x=XH(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!x)return;const{point:b}=w,{timestamp:k}=sr;this.history.push({...b,timestamp:k});const{onStart:C,onMove:P}=this.handlers;_||(C&&C(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,w)},this.handlePointerMove=(w,_)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=Zp(_,this.transformPagePoint),Vt.update(this.updatePoint,!0)},this.handlePointerUp=(w,_)=>{this.end();const{onEnd:x,onSessionEnd:b,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Q1(w.type==="pointercancel"?this.lastMoveEventInfo:Zp(_,this.transformPagePoint),this.history);this.startEvent&&x&&x(w,C),b&&b(w,C)},!sx(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=lh(e),d=Zp(u,this.transformPagePoint),{point:f}=d,{timestamp:p}=sr;this.history=[{...f,timestamp:p}];const{onSessionStart:v}=n;v&&v(e,Q1(d,this.history));const y={passive:!0,capture:!0};this.removeListeners=ih(pf(this.contextWindow,"pointermove",this.handlePointerMove,y),pf(this.contextWindow,"pointerup",this.handlePointerUp,y),pf(this.contextWindow,"pointercancel",this.handlePointerUp,y)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);($E.has(r.overflowX)||$E.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),Vt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ca(this.updatePoint)}}function Zp(t,e){return e?{point:e(t.point)}:t}function HE(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Q1({point:t},e){return{point:t,delta:HE(t,KA(e)),offset:HE(t,QH(e)),velocity:JH(e,.1)}}function QH(t){return t[0]}function KA(t){return t[t.length-1]}function JH(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=KA(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>ys(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>ys(e)*2&&(r=t[1]);const i=Fs(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 ez(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Ft(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Ft(n,t,r.max):Math.min(t,n)),t}function zE(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 tz(t,{top:e,left:n,bottom:r,right:s}){return{x:zE(t.x,n,s),y:zE(t.y,e,r)}}function BE(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 nz(t,e){return{x:BE(t.x,e.x),y:BE(t.y,e.y)}}function rz(t,e){let n=.5;const r=Cr(t),s=Cr(e);return s>r?n=Af(e.min,e.max-r,t.min):r>s&&(n=Af(t.min,t.max-s,e.min)),$i(0,1,n)}function sz(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 p_=.35;function iz(t=p_){return t===!1?t=0:t===!0&&(t=p_),{x:UE(t,"left","right"),y:UE(t,"top","bottom")}}function UE(t,e,n){return{min:WE(t,e),max:WE(t,n)}}function WE(t,e){return typeof t=="number"?t:t[e]||0}const oz=new WeakMap;class az{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=Fn(),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=p=>{n&&this.snapToCursor(lh(p).point),this.stopAnimation()},o=(p,v)=>{const{drag:y,dragPropagation:w,onDragStart:_}=this.getProps();if(y&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=DV(y),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Pi(b=>{let k=this.getAxisMotionValue(b).get()||0;if(Vi.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[b];P&&(k=Cr(P)*(parseFloat(k)/100))}}this.originPoint[b]=k}),_&&Vt.update(()=>_(p,v),!1,!0),i_(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v;const{dragPropagation:y,dragDirectionLock:w,onDirectionLock:_,onDrag:x}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:b}=v;if(w&&this.currentDirection===null){this.currentDirection=cz(b),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",v.point,b),this.updateAxis("y",v.point,b),this.visualElement.render(),x&&Vt.update(()=>x(p,v),!1,!0)},u=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v,this.stop(p,v),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new GA(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:qA(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&&Vt.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||!qp(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=ez(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&&$c(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=tz(r.layoutBox,e):this.constraints=!1,this.elastic=iz(n),s!==this.constraints&&!$c(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Pi(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=sz(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!$c(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=c$(r,s.root,this.visualElement.getTransformPagePoint());let o=nz(s.layout.layoutBox,i);if(n){const l=n(o$(o));this.hasMutatedConstraints=!!l,l&&(o=gA(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=Pi(f=>{if(!qp(f,n,this.currentDirection))return;let p=u&&u[f]||{};(o===!0||o===f)&&(p={min:0,max:0});const v=s?200:1e6,y=s?40:1e7,w={type:"inertia",velocity:r?e[f]:0,bounceStiffness:v,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(f,w)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return i_(this.visualElement,e),r.start(Jw(e,r,0,n,this.visualElement,!1))}stopAnimation(){Pi(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){Pi(n=>{const{drag:r}=this.getProps();if(!qp(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],u=i.get()||0;i.set(e[n]-Ft(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!$c(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Pi(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=rz({min:u,max:u},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(),Pi(o=>{if(!qp(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(Ft(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;oz.set(this.visualElement,this);const e=this.visualElement.current,n=pf(e,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps(),v=d.target,y=v!==e&&HV(v);f&&p&&!y&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();$c(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=lz(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Vt.read(s);const l=If(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Pi(p=>{const v=this.getAxisMotionValue(p);v&&(this.originPoint[p]+=d[p].translate,v.set(v.get()+d[p].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=p_,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function ZE(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function lz(t,e,n){const r=J8(t,ZE(n)),s=J8(e,ZE(n));return()=>{r(),s()}}function qp(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function cz(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class uz extends Oa{constructor(e){super(e),this.removeGroupControls=zs,this.removeListeners=zs,this.controls=new az(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||zs}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 J1=t=>(e,n)=>{t&&Vt.update(()=>t(e,n),!1,!0)};class dz extends Oa{constructor(){super(...arguments),this.removePointerDownListener=zs}onPointerDown(e){this.session=new GA(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qA(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:J1(e),onStart:J1(n),onMove:J1(r),onEnd:(i,o)=>{delete this.session,s&&Vt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=pf(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 ey=!1;class fz extends m.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),ey&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),P0.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}),ey=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Vt.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(),rx.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;ey=!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 YA(t){const[e,n]=FA(),r=m.useContext(Fw);return S.jsx(fz,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(WA),isPresent:e,safeToRemove:n})}const hz={pan:{Feature:dz},drag:{Feature:uz,ProjectionNode:jA,MeasureLayout:YA}};function qE(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&&Vt.postRender(()=>i(e,lh(e)))}class pz extends Oa{mount(){const{current:e}=this.node;e&&(this.unmount=jV(e,(n,r)=>(qE(this.node,r,"Start"),s=>qE(this.node,s,"End"))))}unmount(){}}class mz extends Oa{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=ih(If(this.node.current,"focus",()=>this.onFocus()),If(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function GE(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&&Vt.postRender(()=>i(e,lh(e)))}class vz extends Oa{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=BV(e,(s,i)=>(GE(this.node,i,"Start"),(o,{success:l})=>GE(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const m_=new WeakMap,ty=new WeakMap,gz=t=>{const e=m_.get(t.target);e&&e(t)},yz=t=>{t.forEach(gz)};function _z({root:t,...e}){const n=t||document;ty.has(n)||ty.set(n,{});const r=ty.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(yz,{root:t,...e})),r[s]}function wz(t,e,n){const r=_z(e);return m_.set(t,n),r.observe(t),()=>{m_.delete(t),r.unobserve(t)}}const xz={some:0,all:1};class bz extends Oa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.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:xz[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:p,onViewportLeave:v}=this.node.getProps(),y=f?p:v;y&&y(d)};this.stopObserver=wz(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(Sz(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Sz({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Ez={inView:{Feature:bz},tap:{Feature:vz},focus:{Feature:mz},hover:{Feature:pz}},kz={layout:{ProjectionNode:jA,MeasureLayout:YA}},Cz={...KH,...Ez,...hz,...kz},Eo=UH(Cz,WH);function Pz(){!lx.current&&pA();const[t]=m.useState(xm.current);return t}const di=Eo;var ch=a5();const Az=Bm(ch);function Tz(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 Rz=t=>{switch(t){case"success":return Oz;case"info":return Dz;case"warning":return Lz;case"error":return Nz;default:return null}},Iz=Array(12).fill(0),Mz=({visible:t,className:e})=>we.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},we.createElement("div",{className:"sonner-spinner"},Iz.map((n,r)=>we.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Oz=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.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"})),Lz=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.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"})),Dz=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.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"})),Nz=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.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"})),jz=we.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"},we.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),we.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Fz=()=>{const[t,e]=we.useState(document.hidden);return we.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let Vz=1;const $z=100,KE=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:Vz++};class Hz{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-$z;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=KE(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],we.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(Bz(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...w})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,v=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,v=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:v,...w})}}).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,p=typeof n.description=="function"?await n.description(d):n.description,y=typeof f=="object"&&!we.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>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:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=KE(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 Fr=new Hz,zz=(t,e)=>Fr.message(t,e),Bz=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Uz=zz,Wz=()=>Fr.toasts,Zz=()=>Fr.getActiveToasts(),bt=Object.assign(Uz,{success:Fr.success,info:Fr.info,warning:Fr.warning,error:Fr.error,custom:Fr.custom,message:Fr.message,promise:Fr.promise,dismiss:Fr.dismiss,loading:Fr.loading},{getHistory:Wz,getToasts:Zz});Tz("[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 Gp(t){return t.label!==void 0}const qz=3,Gz="24px",Kz="16px",YE=4e3,Yz=356,Xz=14,Qz=45,Jz=200;function xi(...t){return t.filter(Boolean).join(" ")}function eB(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const tB=t=>{var e,n,r,s,i,o,l,u,d;const{invert:f,toast:p,unstyled:v,interacting:y,setHeights:w,visibleToasts:_,heights:x,index:b,toasts:k,expanded:C,removeToast:P,defaultRichColors:T,closeButton:O,style:M,cancelButtonStyle:R,actionButtonStyle:L,className:D="",descriptionClassName:V="",duration:j,position:U,gap:X,expandByDefault:q,classNames:Z,icons:Y,closeButtonAriaLabel:H="Close toast"}=t,[Q,z]=we.useState(null),[N,G]=we.useState(null),[oe,se]=we.useState(!1),[ee,de]=we.useState(!1),[ve,le]=we.useState(!1),[te,Pe]=we.useState(!1),[Se,Ne]=we.useState(!1),[Xe,Qe]=we.useState(0),[lt,ut]=we.useState(0),je=we.useRef(p.duration||j||YE),st=we.useRef(null),Be=we.useRef(null),ft=b===0,Me=b+1<=_,We=p.type,xe=We??"default",St=p.dismissible!==!1,Rt=p.className||"",Ar=p.descriptionClassName||"",Bs=we.useMemo(()=>x.findIndex(Ue=>Ue.toastId===p.id)||0,[x,p.id]),En=we.useMemo(()=>{var Ue;return(Ue=p.closeButton)!=null?Ue:O},[p.closeButton,O]),kn=we.useMemo(()=>p.duration||j||YE,[p.duration,j]),Us=we.useRef(0),Hn=we.useRef(0),Tr=we.useRef(0),Yr=we.useRef(null),[Lo,$a]=U.split("-"),Ws=we.useMemo(()=>x.reduce((Ue,Jt,cn)=>cn>=Bs?Ue:Ue+Jt.height,0),[x,Bs]),Zi=Fz(),Xn=we.useMemo(()=>{var Ue;return(Ue=t.swipeDirections)!=null?Ue:eB(U)},[t.swipeDirections,U]),qi=p.invert||f,_r=We==="loading";Hn.current=we.useMemo(()=>Bs*X+Ws,[Bs,Ws]),we.useEffect(()=>{je.current=kn},[kn]),we.useEffect(()=>{se(!0)},[]),we.useEffect(()=>{const Ue=Be.current;if(Ue){const Jt=Ue.getBoundingClientRect().height;return ut(Jt),w(cn=>[{toastId:p.id,height:Jt,position:p.position},...cn]),()=>w(cn=>cn.filter(On=>On.toastId!==p.id))}},[w,p.id]),we.useLayoutEffect(()=>{if(!oe)return;const Ue=Be.current,Jt=Ue.style.height;Ue.style.height="auto";const cn=Ue.getBoundingClientRect().height;Ue.style.height=Jt,ut(cn),w(On=>On.find(_t=>_t.toastId===p.id)?On.map(_t=>_t.toastId===p.id?{..._t,height:cn}:_t):[{toastId:p.id,height:cn,position:p.position},...On])},[oe,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const yn=we.useCallback(()=>{de(!0),Qe(Hn.current),w(Ue=>Ue.filter(Jt=>Jt.toastId!==p.id)),setTimeout(()=>{P(p)},Jz)},[p,P,w,Hn]);we.useEffect(()=>{if(p.promise&&We==="loading"||p.duration===1/0||p.type==="loading")return;let Ue;return C||y||Zi?(()=>{if(Tr.current<Us.current){const On=new Date().getTime()-Us.current;je.current=je.current-On}Tr.current=new Date().getTime()})():(()=>{je.current!==1/0&&(Us.current=new Date().getTime(),Ue=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),yn()},je.current))})(),()=>clearTimeout(Ue)},[C,y,p,We,Zi,yn]),we.useEffect(()=>{p.delete&&(yn(),p.onDismiss==null||p.onDismiss.call(p,p))},[yn,p.delete]);function Cn(){var Ue;if(Y!=null&&Y.loading){var Jt;return we.createElement("div",{className:xi(Z==null?void 0:Z.loader,p==null||(Jt=p.classNames)==null?void 0:Jt.loader,"sonner-loader"),"data-visible":We==="loading"},Y.loading)}return we.createElement(Mz,{className:xi(Z==null?void 0:Z.loader,p==null||(Ue=p.classNames)==null?void 0:Ue.loader),visible:We==="loading"})}const Xr=p.icon||(Y==null?void 0:Y[We])||Rz(We);var Ha,za;return we.createElement("li",{tabIndex:0,ref:Be,className:xi(D,Rt,Z==null?void 0:Z.toast,p==null||(e=p.classNames)==null?void 0:e.toast,Z==null?void 0:Z[xe],p==null||(n=p.classNames)==null?void 0:n[xe]),"data-sonner-toast":"","data-rich-colors":(Ha=p.richColors)!=null?Ha:T,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":oe,"data-promise":!!p.promise,"data-swiped":Se,"data-removed":ee,"data-visible":Me,"data-y-position":Lo,"data-x-position":$a,"data-index":b,"data-front":ft,"data-swiping":ve,"data-dismissible":St,"data-type":We,"data-invert":qi,"data-swipe-out":te,"data-swipe-direction":N,"data-expanded":!!(C||q&&oe),"data-testid":p.testId,style:{"--index":b,"--toasts-before":b,"--z-index":k.length-b,"--offset":`${ee?Xe:Hn.current}px`,"--initial-height":q?"auto":`${lt}px`,...M,...p.style},onDragEnd:()=>{le(!1),z(null),Yr.current=null},onPointerDown:Ue=>{Ue.button!==2&&(_r||!St||(st.current=new Date,Qe(Hn.current),Ue.target.setPointerCapture(Ue.pointerId),Ue.target.tagName!=="BUTTON"&&(le(!0),Yr.current={x:Ue.clientX,y:Ue.clientY})))},onPointerUp:()=>{var Ue,Jt,cn;if(te||!St)return;Yr.current=null;const On=Number(((Ue=Be.current)==null?void 0:Ue.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qr=Number(((Jt=Be.current)==null?void 0:Jt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((cn=st.current)==null?void 0:cn.getTime()),un=Q==="x"?On:Qr,Qn=Math.abs(un)/_t;if((Q==="x"?Xn.includes(On>0?"right":"left"):Xn.includes(Qr>0?"bottom":"top"))&&(Math.abs(un)>=Qz||Qn>.11)){Qe(Hn.current),p.onDismiss==null||p.onDismiss.call(p,p),G(Q==="x"?On>0?"right":"left":Qr>0?"down":"up"),yn(),Pe(!0);return}else{var Pn,Jr;(Pn=Be.current)==null||Pn.style.setProperty("--swipe-amount-x","0px"),(Jr=Be.current)==null||Jr.style.setProperty("--swipe-amount-y","0px")}Ne(!1),le(!1),z(null)},onPointerMove:Ue=>{var Jt,cn,On;if(!Yr.current||!St||((Jt=window.getSelection())==null?void 0:Jt.toString().length)>0)return;const _t=Ue.clientY-Yr.current.y,un=Ue.clientX-Yr.current.x;!Q&&(Math.abs(un)>1||Math.abs(_t)>1)&&z(Math.abs(un)>Math.abs(_t)?"x":"y");let Qn={x:0,y:0};const Rr=Pn=>1/(1.5+Math.abs(Pn)/20);if(Q==="y"){if(Xn.includes("top")||Xn.includes("bottom"))if(Xn.includes("top")&&_t<0||Xn.includes("bottom")&&_t>0)Qn.y=_t;else{const Pn=_t*Rr(_t);Qn.y=Math.abs(Pn)<Math.abs(_t)?Pn:_t}}else if(Q==="x"&&(Xn.includes("left")||Xn.includes("right")))if(Xn.includes("left")&&un<0||Xn.includes("right")&&un>0)Qn.x=un;else{const Pn=un*Rr(un);Qn.x=Math.abs(Pn)<Math.abs(un)?Pn:un}(Math.abs(Qn.x)>0||Math.abs(Qn.y)>0)&&Ne(!0),(cn=Be.current)==null||cn.style.setProperty("--swipe-amount-x",`${Qn.x}px`),(On=Be.current)==null||On.style.setProperty("--swipe-amount-y",`${Qn.y}px`)}},En&&!p.jsx&&We!=="loading"?we.createElement("button",{"aria-label":H,"data-disabled":_r,"data-close-button":!0,onClick:_r||!St?()=>{}:()=>{yn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:xi(Z==null?void 0:Z.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(za=Y==null?void 0:Y.close)!=null?za:jz):null,(We||p.icon||p.promise)&&p.icon!==null&&((Y==null?void 0:Y[We])!==null||p.icon)?we.createElement("div",{"data-icon":"",className:xi(Z==null?void 0:Z.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},We==="loading"?p.icon||Cn():p.promise?Cn():null,We!=="loading"?Xr:null):null,we.createElement("div",{"data-content":"",className:xi(Z==null?void 0:Z.content,p==null||(i=p.classNames)==null?void 0:i.content)},we.createElement("div",{"data-title":"",className:xi(Z==null?void 0:Z.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?we.createElement("div",{"data-description":"",className:xi(V,Ar,Z==null?void 0:Z.description,p==null||(l=p.classNames)==null?void 0:l.description)},typeof p.description=="function"?p.description():p.description):null),we.isValidElement(p.cancel)?p.cancel:p.cancel&&Gp(p.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:Ue=>{Gp(p.cancel)&&St&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ue),yn())},className:xi(Z==null?void 0:Z.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,we.isValidElement(p.action)?p.action:p.action&&Gp(p.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:Ue=>{Gp(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ue),!Ue.defaultPrevented&&yn())},className:xi(Z==null?void 0:Z.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function XE(){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 nB(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?Kz:Gz;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(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]}):u(l)}),n}const rB=we.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:f,mobileOffset:p,theme:v="light",richColors:y,duration:w,style:_,visibleToasts:x=qz,toastOptions:b,dir:k=XE(),gap:C=Xz,icons:P,customAriaLabel:T,containerAriaLabel:O="Notifications"}=e,[M,R]=we.useState([]),L=we.useMemo(()=>r?M.filter(se=>se.toasterId===r):M.filter(se=>!se.toasterId),[M,r]),D=we.useMemo(()=>Array.from(new Set([i].concat(L.filter(se=>se.position).map(se=>se.position)))),[L,i]),[V,j]=we.useState([]),[U,X]=we.useState(!1),[q,Z]=we.useState(!1),[Y,H]=we.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=we.useRef(null),z=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=we.useRef(null),G=we.useRef(!1),oe=we.useCallback(se=>{R(ee=>{var de;return(de=ee.find(ve=>ve.id===se.id))!=null&&de.delete||Fr.dismiss(se.id),ee.filter(({id:ve})=>ve!==se.id)})},[]);return we.useEffect(()=>Fr.subscribe(se=>{if(se.dismiss){requestAnimationFrame(()=>{R(ee=>ee.map(de=>de.id===se.id?{...de,delete:!0}:de))});return}setTimeout(()=>{Az.flushSync(()=>{R(ee=>{const de=ee.findIndex(ve=>ve.id===se.id);return de!==-1?[...ee.slice(0,de),{...ee[de],...se},...ee.slice(de+1)]:[se,...ee]})})})}),[]),we.useEffect(()=>{if(v!=="system"){H(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const se=window.matchMedia("(prefers-color-scheme: dark)");try{se.addEventListener("change",({matches:ee})=>{H(ee?"dark":"light")})}catch{se.addListener(({matches:de})=>{try{H(de?"dark":"light")}catch(ve){console.error(ve)}})}},[v]),we.useEffect(()=>{M.length<=1&&X(!1)},[M]),we.useEffect(()=>{const se=ee=>{var de;if(o.length>0&&o.every(te=>ee[te]||ee.code===te)){var le;X(!0),(le=Q.current)==null||le.focus()}ee.code==="Escape"&&(document.activeElement===Q.current||(de=Q.current)!=null&&de.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[o]),we.useEffect(()=>{if(Q.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,G.current=!1)}},[Q.current]),we.createElement("section",{ref:n,"aria-label":T??`${O} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((se,ee)=>{var de;const[ve,le]=se.split("-");return L.length?we.createElement("ol",{key:se,dir:k==="auto"?XE():k,tabIndex:-1,ref:Q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Y,"data-y-position":ve,"data-x-position":le,style:{"--front-toast-height":`${((de=V[0])==null?void 0:de.height)||0}px`,"--width":`${Yz}px`,"--gap":`${C}px`,..._,...nB(f,p)},onBlur:te=>{G.current&&!te.currentTarget.contains(te.relatedTarget)&&(G.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||G.current||(G.current=!0,N.current=te.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{q||X(!1)},onDragEnd:()=>X(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},L.filter(te=>!te.position&&ee===0||te.position===se).map((te,Pe)=>{var Se,Ne;return we.createElement(tB,{key:te.id,icons:P,index:Pe,toast:te,defaultRichColors:y,duration:(Se=b==null?void 0:b.duration)!=null?Se:w,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Ne=b==null?void 0:b.closeButton)!=null?Ne:u,interacting:q,position:se,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:oe,toasts:L.filter(Xe=>Xe.position==te.position),heights:V.filter(Xe=>Xe.position==te.position),setHeights:j,expandByDefault:l,gap:C,expanded:U,swipeDirections:e.swipeDirections})})):null}))});var sB=Object.defineProperty,Wu=(t,e)=>sB(t,"name",{value:e,configurable:!0}),XA=!!(typeof window<"u"&&window.document&&window.document.createElement);function Gt(t,e,{checkForDefaultPrevented:n=!0}={}){return Wu(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}Wu(Gt,"composeEventHandlers");function iB(t){var e;if(!XA)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Wu(iB,"getOwnerWindow");function v_(t){if(!XA)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Wu(v_,"getOwnerDocument");function QA(t,e=!1){const{activeElement:n}=v_(t);if(!(n!=null&&n.nodeName))return null;if(JA(n)&&n.contentDocument)return QA(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=v_(n).getElementById(r);if(s)return s}}return n}Wu(QA,"getActiveElement");function JA(t){return t.tagName==="IFRAME"}Wu(JA,"isFrame");var oB=Object.defineProperty,px=(t,e)=>oB(t,"name",{value:e,configurable:!0});function g_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}px(g_,"setRef");function eT(...t){return e=>{let n=!1;const r=t.map(s=>{const i=g_(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():g_(t[s],null)}}}}px(eT,"composeRefs");function Yt(...t){return m.useCallback(eT(...t),t)}px(Yt,"useComposedRefs");var aB=Object.defineProperty,js=(t,e)=>aB(t,"name",{value:e,configurable:!0});function lB(t,e){const n=m.createContext(e);n.displayName=t+"Context";const r=js(i=>{const{children:o,...l}=i,u=m.useMemo(()=>l,Object.values(l));return S.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,u=m.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return js(s,"useContext"),[r,s]}js(lB,"createContext");function Ui(t,e=[]){let n=[];function r(i,o){const l=m.createContext(o);l.displayName=i+"Context";const u=n.length;n=[...n,o];const d=js(p=>{var b;const{scope:v,children:y,...w}=p,_=((b=v==null?void 0:v[t])==null?void 0:b[u])||l,x=m.useMemo(()=>w,Object.values(w));return S.jsx(_.Provider,{value:x,children:y})},"Provider");d.displayName=i+"Provider";function f(p,v,y={}){var b;const{optional:w=!1}=y,_=((b=v==null?void 0:v[t])==null?void 0:b[u])||l,x=m.useContext(_);if(x)return x;if(o!==void 0)return o;if(!w)throw new Error(`\`${p}\` must be used within \`${i}\``)}return js(f,"useContext"),[d,f]}js(r,"createContext");const s=js(()=>{const i=n.map(o=>m.createContext(o));return js(function(l){const u=(l==null?void 0:l[t])||i;return m.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return s.scopeName=t,[r,tT(s,...e)]}js(Ui,"createContextScope");function tT(...t){const e=t[0];if(t.length===1)return e;const n=js(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return js(function(i){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const p=u(i)[`__scope${d}`];return{...l,...p}},{});return m.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}js(tT,"composeContextScopes");var Br=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},cB=Object.defineProperty,uB=(t,e)=>cB(t,"name",{value:e,configurable:!0}),dB=th[" useId ".trim().toString()]||(()=>{}),fB=0;function _a(t){const[e,n]=m.useState(dB());return Br(()=>{t||n(r=>r??String(fB++))},[t]),t||(e?`radix-${e}`:"")}uB(_a,"useId");var hB=Object.defineProperty,pB=(t,e)=>hB(t,"name",{value:e,configurable:!0}),QE=th[" useEffectEvent ".trim().toString()],JE=th[" useInsertionEffect ".trim().toString()];function nT(t){if(typeof QE=="function")return QE(t);const e=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof JE=="function"?JE(()=>{e.current=t}):Br(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}pB(nT,"useEffectEvent");var mB=Object.defineProperty,uh=(t,e)=>mB(t,"name",{value:e,configurable:!0}),vB=th[" useInsertionEffect ".trim().toString()]||Br;function La({prop:t,defaultProp:e,onChange:n=uh(()=>{},"onChange"),caller:r}){const[s,i,o]=rT({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=m.useCallback(f=>{var p;if(l){const v=sT(f)?f(t):f;v!==t&&((p=o.current)==null||p.call(o,v))}else i(f)},[l,t,i,o]);return[u,d]}uh(La,"useControllableState");function rT({defaultProp:t,onChange:e}){const[n,r]=m.useState(t),s=m.useRef(n),i=m.useRef(e);return vB(()=>{i.current=e},[e]),m.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}uh(rT,"useUncontrolledState");function sT(t){return typeof t=="function"}uh(sT,"isFunction");var ek=Symbol("RADIX:SYNC_STATE");function gB(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=nT(o),f=[{...n,state:i}];r&&f.push(r);const[p,v]=m.useReducer((x,b)=>{if(b.type===ek)return{...x,state:b.state};const k=t(x,b);return u&&!Object.is(k.state,x.state)&&d(k.state),k},...f),y=p.state,w=m.useRef(y);m.useEffect(()=>{w.current!==y&&(w.current=y,u||d(y))},[y,w,u]);const _=m.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return m.useEffect(()=>{u&&!Object.is(s,p.state)&&v({type:ek,state:s})},[s,p.state,u]),[_,v]}uh(gB,"useControllableStateReducer");var yB=Object.defineProperty,fi=(t,e)=>yB(t,"name",{value:e,configurable:!0});function Pa(t){const e=m.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const u=[];y_(s)&&typeof Kp=="function"&&(s=Kp(s._payload)),m.Children.forEach(s,v=>{var y;if(cT(v)){l=!0;const w=v;let _="child"in w.props?w.props.child:w.props.children;y_(_)&&typeof Kp=="function"&&(_=Kp(_._payload)),o=_B(w,_),u.push((y=o==null?void 0:o.props)==null?void 0:y.children)}else u.push(v)}),o?o=m.cloneElement(o,void 0,u):!l&&m.Children.count(s)===1&&m.isValidElement(s)&&(o=s);const d=o?lT(o):void 0,f=Yt(r,d);if(!o){if(s||s===0)throw new Error(l?bB(t):xB(t));return s}const p=aT(i,o.props??{});return o.type!==m.Fragment&&(p.ref=r?f:d),m.cloneElement(o,p)});return e.displayName=`${t}.Slot`,e}fi(Pa,"createSlot");var iT=Symbol.for("radix.slottable");function oT(t){const e=fi(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=iT,e}fi(oT,"createSlottable");var _B=fi((t,e)=>{if("child"in t.props){const n=t.props.child;return m.isValidElement(n)?m.cloneElement(n,void 0,t.props.children(n.props.children)):null}return m.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function aT(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 u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}fi(aT,"mergeProps");function lT(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)}fi(lT,"getElementRef");function cT(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===iT}fi(cT,"isSlottable");var wB=Symbol.for("react.lazy");function y_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===wB&&"_payload"in t&&uT(t._payload)}fi(y_,"isLazyComponent");function uT(t){return typeof t=="object"&&t!==null&&"then"in t}fi(uT,"isPromiseLike");var xB=fi(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),bB=fi(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Kp=th[" use ".trim().toString()],SB=Object.defineProperty,EB=(t,e)=>SB(t,"name",{value:e,configurable:!0}),kB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sn=kB.reduce((t,e)=>{const n=Pa(`Primitive.${e}`),r=m.forwardRef((s,i)=>{const{asChild:o,...l}=s,u=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function dT(t,e){t&&ch.flushSync(()=>t.dispatchEvent(e))}EB(dT,"dispatchDiscreteCustomEvent");var CB=Object.defineProperty,PB=(t,e)=>CB(t,"name",{value:e,configurable:!0});function Wl(t){const e=m.useRef(t);return m.useEffect(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}PB(Wl,"useCallbackRef");var AB=Object.defineProperty,qn=(t,e)=>AB(t,"name",{value:e,configurable:!0}),__="dismissableLayer.update",TB="dismissableLayer.pointerDownOutside",RB="dismissableLayer.focusOutside",tk,fT=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),mx=m.forwardRef(qn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,p=m.useContext(fT),[v,y]=m.useState(null),w=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=m.useState({}),x=Yt(n,y),b=Array.from(p.layers),[k]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=k?b.indexOf(k):-1,P=v?b.indexOf(v):-1,T=p.layersWithOutsidePointerEventsDisabled.size>0,O=P>=C,M=m.useRef(!1),R=pT(j=>{o==null||o(j),u==null||u(j),j.defaultPrevented||d==null||d()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(j=>{if(!(j instanceof Node))return!1;const U=[...p.branches].some(X=>X.contains(j));return O&&!U},[p.branches,O])}),L=mT(j=>{if(s&&M.current)return;const U=j.target;[...p.branches].some(q=>q.contains(U))||(l==null||l(j),u==null||u(j),j.defaultPrevented||d==null||d())},w),D=v?P===b.length-1:!1,V=Wl(j=>{j.key==="Escape"&&(i==null||i(j),!j.defaultPrevented&&d&&(j.preventDefault(),d()))});return m.useEffect(()=>{if(D)return w.addEventListener("keydown",V,{capture:!0}),()=>w.removeEventListener("keydown",V,{capture:!0})},[w,D,V]),m.useEffect(()=>{if(v)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(tk=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),w_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(v),p.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=tk))}},[v,w,r,p]),m.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),w_())},[v,p]),m.useEffect(()=>{const j=qn(()=>_({}),"handleUpdate");return document.addEventListener(__,j),()=>document.removeEventListener(__,j)},[]),S.jsx(Sn.div,{...f,ref:x,style:{pointerEvents:T?O?"auto":"none":void 0,...e.style},onFocusCapture:Gt(e.onFocusCapture,L.onFocusCapture),onBlurCapture:Gt(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Gt(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function hT(){const t=m.useContext(fT),[e,n]=m.useState(null);return m.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}qn(hT,"useDismissableLayerSurface");var IB=qn(()=>!0,"IS_TRUE");function pT(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=IB}=e,l=Wl(t),u=m.useRef(!1),d=m.useRef(!1),f=m.useRef(new Map),p=m.useRef(()=>{});return m.useEffect(()=>{function v(){d.current=!1,s.current=!1,f.current.clear()}qn(v,"resetOutsideInteraction");function y(){return Array.from(f.current.values()).some(Boolean)}qn(y,"isOutsideInteractionIntercepted");function w(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&&p.current()},0)}qn(w,"handleInteractionCapture");function _(C){d.current&&f.current.set(C.type,!1)}qn(_,"handleInteractionBubble");const x=qn(C=>{if(C.target&&!u.current){let P=function(){n.removeEventListener("click",p.current);const O=y();v(),O||vx(TB,l,T,{discrete:!0})};if(qn(P,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",p.current),v(),u.current=!1;return}const T={originalEvent:C};d.current=!0,s.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?P():(n.removeEventListener("click",p.current),p.current=P,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),v();u.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of b)n.addEventListener(C,w,!0),n.addEventListener(C,_);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",x),n.removeEventListener("click",p.current);for(const C of b)n.removeEventListener(C,w,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:qn(()=>u.current=!0,"onPointerDownCapture")}}qn(pT,"usePointerDownOutside");function mT(t,e=globalThis==null?void 0:globalThis.document){const n=Wl(t),r=m.useRef(!1);return m.useEffect(()=>{const s=qn(i=>{i.target&&!r.current&&vx(RB,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:qn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:qn(()=>r.current=!1,"onBlurCapture")}}qn(mT,"useFocusOutside");function w_(){const t=new CustomEvent(__);document.dispatchEvent(t)}qn(w_,"dispatchUpdate");function vx(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?dT(s,i):s.dispatchEvent(i)}qn(vx,"handleAndDispatchCustomEvent");var MB=Object.defineProperty,Pr=(t,e)=>MB(t,"name",{value:e,configurable:!0}),ny="focusScope.autoFocusOnMount",ry="focusScope.autoFocusOnUnmount",nk={bubbles:!1,cancelable:!0},vT=m.forwardRef(Pr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,d]=m.useState(null),f=Wl(i),p=Wl(o),v=m.useRef(null),y=Yt(n,d),w=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let x=function(P){if(w.paused||!u)return;const T=P.target;u.contains(T)?v.current=T:ho(v.current,{select:!0})},b=function(P){if(w.paused||!u)return;const T=P.relatedTarget;T!==null&&(u.contains(T)||ho(v.current,{select:!0}))},k=function(P){if(document.activeElement===document.body)for(const O of P)O.removedNodes.length>0&&ho(u)};Pr(x,"handleFocusIn"),Pr(b,"handleFocusOut"),Pr(k,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",b);const C=new MutationObserver(k);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",b),C.disconnect()}}},[s,u,w.paused]),m.useEffect(()=>{if(u){rk.add(w);const x=document.activeElement;if(!u.contains(x)){const k=new CustomEvent(ny,nk);u.addEventListener(ny,f),u.dispatchEvent(k),k.defaultPrevented||(gT(bT(gx(u)),{select:!0}),document.activeElement===x&&ho(u))}return()=>{u.removeEventListener(ny,f),setTimeout(()=>{const k=new CustomEvent(ry,nk);u.addEventListener(ry,p),u.dispatchEvent(k),k.defaultPrevented||ho(x??document.body,{select:!0}),u.removeEventListener(ry,p),rk.remove(w)},0)}}},[u,f,p,w]);const _=m.useCallback(x=>{if(!r&&!s||w.paused)return;const b=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(b&&k){const C=x.currentTarget,[P,T]=yT(C);P&&T?!x.shiftKey&&k===T?(x.preventDefault(),r&&ho(P,{select:!0})):x.shiftKey&&k===P&&(x.preventDefault(),r&&ho(T,{select:!0})):k===C&&x.preventDefault()}},[r,s,w.paused]);return S.jsx(Sn.div,{tabIndex:-1,...l,ref:y,onKeyDown:_})},"FocusScope"));function gT(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ho(r,{select:e}),document.activeElement!==n)return}Pr(gT,"focusFirst");function yT(t){const e=gx(t),n=x_(e,t),r=x_(e.reverse(),t);return[n,r]}Pr(yT,"getTabbableEdges");function gx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Pr(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Pr(gx,"getTabbableCandidates");function x_(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):_T(r,{upTo:e})))return r}Pr(x_,"findVisible");function _T(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}Pr(_T,"isHidden");function wT(t){return t instanceof HTMLInputElement&&"select"in t}Pr(wT,"isSelectableInput");function ho(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&wT(t)&&e&&t.select()}}Pr(ho,"focus");var rk=xT();function xT(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=b_(t,e),t.unshift(e)},remove(e){var n;t=b_(t,e),(n=t[0])==null||n.resume()}}}Pr(xT,"createFocusScopesStack");function b_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Pr(b_,"arrayRemove");function bT(t){return t.filter(e=>e.tagName!=="A")}Pr(bT,"removeLinks");var OB=Object.defineProperty,LB=(t,e)=>OB(t,"name",{value:e,configurable:!0}),yx=m.forwardRef(LB(function(e,n){var u;const{container:r,...s}=e,[i,o]=m.useState(!1);Br(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?ch.createPortal(S.jsx(Sn.div,{...s,ref:n}),l):null},"Portal")),DB=Object.defineProperty,Po=(t,e)=>DB(t,"name",{value:e,configurable:!0});function ST(t,e){return m.useReducer((n,r)=>e[n][r]??n,t)}Po(ST,"useStateMachine");var Da=Po(t=>{const{present:e,children:n}=t,r=ET(e),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=kT(r.ref,CT(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null},"Presence");function ET(t){const[e,n]=m.useState(),r=m.useRef(null),s=m.useRef(t),i=m.useRef("none"),o=m.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=ST(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{u==="mounted"?(i.current=o.current??Hc(r.current),o.current=void 0):i.current="none"},[u]),Br(()=>{const f=r.current,p=s.current;if(p!==t){const y=i.current,w=Hc(f);t?(o.current=w,d("MOUNT")):w==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&y!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Br(()=>{if(e){let f;const p=e.ownerDocument.defaultView??window,v=Po(w=>{const x=Hc(r.current).includes(CSS.escape(w.animationName));if(w.target===e&&x&&(d("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",f=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},"handleAnimationEnd"),y=Po(w=>{w.target===e&&(i.current=Hc(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{p.clearTimeout(f),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:m.useCallback(f=>{if(f){const p=getComputedStyle(f);r.current=p,o.current=Hc(p)}else r.current=null;n(f)},[])}}Po(ET,"usePresence");function S_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Po(S_,"setRef");function kT(...t){const e=m.useRef(t);return e.current=t,m.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=S_(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():S_(r[o],null)}}},[])}Po(kT,"useStableComposedRefs");function Hc(t){return(t==null?void 0:t.animationName)||"none"}Po(Hc,"getAnimationName");function CT(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)}Po(CT,"getElementRef");var NB=Object.defineProperty,_x=(t,e)=>NB(t,"name",{value:e,configurable:!0}),Yp=0,bi=null;function jB(t){return ev(),t.children}_x(jB,"FocusGuards");function ev(){m.useEffect(()=>{bi||(bi={start:E_(),end:E_()});const{start:t,end:e}=bi;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Yp++,()=>{Yp===1&&(bi==null||bi.start.remove(),bi==null||bi.end.remove(),bi=null),Yp=Math.max(0,Yp-1)}},[])}_x(ev,"useFocusGuards");function E_(){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}_x(E_,"createFocusGuard");var Li=function(){return Li=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},Li.apply(this,arguments)};function PT(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 FB(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 A0="right-scroll-bar-position",T0="width-before-scroll-bar",VB="with-scroll-bars-hidden",$B="--removed-body-scroll-bar-size";function sy(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function HB(t,e){var n=m.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 zB=typeof window<"u"?m.useLayoutEffect:m.useEffect,sk=new WeakMap;function BB(t,e){var n=HB(null,function(r){return t.forEach(function(s){return sy(s,r)})});return zB(function(){var r=sk.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||sy(l,null)}),i.forEach(function(l){s.has(l)||sy(l,o)})}sk.set(n,t)},[t]),n}function UB(t){return t}function WB(t,e){e===void 0&&(e=UB);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 u=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function ZB(t){t===void 0&&(t={});var e=WB(null);return e.options=Li({async:!0,ssr:!1},t),e}var AT=function(t){var e=t.sideCar,n=PT(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 m.createElement(r,Li({},n))};AT.isSideCarExport=!0;function qB(t,e){return t.useMedium(e),AT}var TT=ZB(),iy=function(){},tv=m.forwardRef(function(t,e){var n=m.useRef(null),r=m.useState({onScrollCapture:iy,onWheelCapture:iy,onTouchMoveCapture:iy}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,p=t.shards,v=t.sideCar,y=t.noRelative,w=t.noIsolation,_=t.inert,x=t.allowPinchZoom,b=t.as,k=b===void 0?"div":b,C=t.gapMode,P=PT(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=v,O=BB([n,e]),M=Li(Li({},P),s);return m.createElement(m.Fragment,null,f&&m.createElement(T,{sideCar:TT,removeScrollBar:d,shards:p,noRelative:y,noIsolation:w,inert:_,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:C}),o?m.cloneElement(m.Children.only(l),Li(Li({},M),{ref:O})):m.createElement(k,Li({},M,{className:u,ref:O}),l))});tv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tv.classNames={fullWidth:T0,zeroRight:A0};var GB=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function KB(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=GB();return e&&t.setAttribute("nonce",e),t}function YB(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function XB(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var QB=function(){var t=0,e=null;return{add:function(n){t==0&&(e=KB())&&(YB(e,n),XB(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},JB=function(){var t=QB();return function(e,n){m.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},RT=function(){var t=JB(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},eU={left:0,top:0,right:0,gap:0},oy=function(t){return parseInt(t||"",10)||0},tU=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[oy(n),oy(r),oy(s)]},nU=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return eU;var e=tU(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])}},rU=RT(),ru="data-scroll-locked",sU=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
72
- .`.concat(VB,` {
73
- overflow: hidden `).concat(r,`;
74
- padding-right: `).concat(l,"px ").concat(r,`;
75
- }
76
- body[`).concat(ru,`] {
77
- overflow: hidden `).concat(r,`;
78
- overscroll-behavior: contain;
79
- `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
80
- padding-left: `.concat(s,`px;
81
- padding-top: `).concat(i,`px;
82
- padding-right: `).concat(o,`px;
83
- margin-left:0;
84
- margin-top:0;
85
- margin-right: `).concat(l,"px ").concat(r,`;
86
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
87
- }
88
-
89
- .`).concat(A0,` {
90
- right: `).concat(l,"px ").concat(r,`;
91
- }
92
-
93
- .`).concat(T0,` {
94
- margin-right: `).concat(l,"px ").concat(r,`;
95
- }
96
-
97
- .`).concat(A0," .").concat(A0,` {
98
- right: 0 `).concat(r,`;
99
- }
100
-
101
- .`).concat(T0," .").concat(T0,` {
102
- margin-right: 0 `).concat(r,`;
103
- }
104
-
105
- body[`).concat(ru,`] {
106
- `).concat($B,": ").concat(l,`px;
107
- }
108
- `)},ik=function(){var t=parseInt(document.body.getAttribute(ru)||"0",10);return isFinite(t)?t:0},iU=function(){m.useEffect(function(){return document.body.setAttribute(ru,(ik()+1).toString()),function(){var t=ik()-1;t<=0?document.body.removeAttribute(ru):document.body.setAttribute(ru,t.toString())}},[])},oU=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;iU();var i=m.useMemo(function(){return nU(s)},[s]);return m.createElement(rU,{styles:sU(i,!e,s,n?"":"!important")})},k_=!1;if(typeof window<"u")try{var Xp=Object.defineProperty({},"passive",{get:function(){return k_=!0,!0}});window.addEventListener("test",Xp,Xp),window.removeEventListener("test",Xp,Xp)}catch{k_=!1}var Oc=k_?{passive:!1}:!1,aU=function(t){return t.tagName==="TEXTAREA"},IT=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!aU(t)&&n[e]==="visible")},lU=function(t){return IT(t,"overflowY")},cU=function(t){return IT(t,"overflowX")},ok=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=MT(t,r);if(s){var i=OT(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uU=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},dU=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},MT=function(t,e){return t==="v"?lU(e):cU(e)},OT=function(t,e){return t==="v"?uU(e):dU(e)},fU=function(t,e){return t==="h"&&e==="rtl"?-1:1},hU=function(t,e,n,r,s){var i=fU(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,u=e.contains(l),d=!1,f=o>0,p=0,v=0;do{if(!l)break;var y=OT(t,l),w=y[0],_=y[1],x=y[2],b=_-x-i*w;(w||b)&&MT(t,l)&&(p+=b,v+=w);var k=l.parentNode;l=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(p)<1||!f&&Math.abs(v)<1)&&(d=!0),d},Qp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},ak=function(t){return[t.deltaX,t.deltaY]},lk=function(t){return t&&"current"in t?t.current:t},pU=function(t,e){return t[0]===e[0]&&t[1]===e[1]},mU=function(t){return`
109
- .block-interactivity-`.concat(t,` {pointer-events: none;}
110
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
111
- `)},vU=0,Lc=[];function gU(t){var e=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(vU++)[0],i=m.useState(RT)[0],o=m.useRef(t);m.useEffect(function(){o.current=t},[t]),m.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=FB([t.lockRef.current],(t.shards||[]).map(lk),!0).filter(Boolean);return _.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=m.useCallback(function(_,x){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var b=Qp(_),k=n.current,C="deltaX"in _?_.deltaX:k[0]-b[0],P="deltaY"in _?_.deltaY:k[1]-b[1],T,O=_.target,M=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in _&&M==="h"&&O.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,D=L?L===O||L.contains(O):!1;if(D)return!1;var V=ok(M,O);if(!V)return!0;if(V?T=M:(T=M==="v"?"h":"v",V=ok(M,O)),!V)return!1;if(!r.current&&"changedTouches"in _&&(C||P)&&(r.current=T),!T)return!0;var j=r.current||T;return hU(j,x,_,j==="h"?C:P)},[]),u=m.useCallback(function(_){var x=_;if(!(!Lc.length||Lc[Lc.length-1]!==i)){var b="deltaY"in x?ak(x):Qp(x),k=e.current.filter(function(T){return T.name===x.type&&(T.target===x.target||x.target===T.shadowParent)&&pU(T.delta,b)})[0];if(k&&k.should){x.cancelable&&x.preventDefault();return}if(!k){var C=(o.current.shards||[]).map(lk).filter(Boolean).filter(function(T){return T.contains(x.target)}),P=C.length>0?l(x,C[0]):!o.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),d=m.useCallback(function(_,x,b,k){var C={name:_,delta:x,target:b,should:k,shadowParent:yU(b)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(P){return P!==C})},1)},[]),f=m.useCallback(function(_){n.current=Qp(_),r.current=void 0},[]),p=m.useCallback(function(_){d(_.type,ak(_),_.target,l(_,t.lockRef.current))},[]),v=m.useCallback(function(_){d(_.type,Qp(_),_.target,l(_,t.lockRef.current))},[]);m.useEffect(function(){return Lc.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",u,Oc),document.addEventListener("touchmove",u,Oc),document.addEventListener("touchstart",f,Oc),function(){Lc=Lc.filter(function(_){return _!==i}),document.removeEventListener("wheel",u,Oc),document.removeEventListener("touchmove",u,Oc),document.removeEventListener("touchstart",f,Oc)}},[]);var y=t.removeScrollBar,w=t.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:mU(s)}):null,y?m.createElement(oU,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function yU(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const _U=qB(TT,gU);var wx=m.forwardRef(function(t,e){return m.createElement(tv,Li({},t,{ref:e,sideCar:_U}))});wx.classNames=tv.classNames;var wU=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Dc=new WeakMap,Jp=new WeakMap,e0={},ay=0,LT=function(t){return t&&(t.host||LT(t.parentNode))},xU=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=LT(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})},bU=function(t,e,n,r){var s=xU(e,Array.isArray(t)?t:[t]);e0[n]||(e0[n]=new WeakMap);var i=e0[n],o=[],l=new Set,u=new Set(s),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};s.forEach(d);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(v){if(l.has(v))f(v);else try{var y=v.getAttribute(r),w=y!==null&&y!=="false",_=(Dc.get(v)||0)+1,x=(i.get(v)||0)+1;Dc.set(v,_),i.set(v,x),o.push(v),_===1&&w&&Jp.set(v,!0),x===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",v,b)}})};return f(e),l.clear(),ay++,function(){o.forEach(function(p){var v=Dc.get(p)-1,y=i.get(p)-1;Dc.set(p,v),i.set(p,y),v||(Jp.has(p)||p.removeAttribute(r),Jp.delete(p)),y||p.removeAttribute(n)}),ay--,ay||(Dc=new WeakMap,Dc=new WeakMap,Jp=new WeakMap,e0={})}},DT=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=wU(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),bU(r,s,n,"aria-hidden")):function(){return null}},SU=Object.defineProperty,hi=(t,e)=>SU(t,"name",{value:e,configurable:!0}),xx="Dialog",[NT,nne]=Ui(xx),[EU,Mo]=NT(xx),bx=hi(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=m.useRef(null),u=m.useRef(null),[d,f]=La({prop:r,defaultProp:s??!1,onChange:i,caller:xx}),[p,v]=m.useState(0),[y,w]=m.useState(0);return S.jsx(EU,{scope:e,triggerRef:l,contentRef:u,contentId:_a(),titleId:_a(),descriptionId:_a(),titlePresent:p>0,descriptionPresent:y>0,setTitleCount:v,setDescriptionCount:w,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(_=>!_),[f]),modal:o,children:n})},"Dialog"),jT="DialogPortal",[kU,FT]=NT(jT,{forceMount:void 0}),Sx=hi(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Mo(jT,e);return S.jsx(kU,{scope:e,forceMount:n,children:m.Children.map(r,o=>S.jsx(Da,{present:n||i.open,children:S.jsx(yx,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),C_="DialogOverlay",Ex=m.forwardRef(hi(function(e,n){const r=FT(C_,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Mo(C_,e.__scopeDialog);return o.modal?S.jsx(Da,{present:s||o.open,children:S.jsx(PU,{...i,ref:n})}):null},"DialogOverlay")),CU=Pa("DialogOverlay.RemoveScroll"),PU=m.forwardRef(hi(function(e,n){const{__scopeDialog:r,...s}=e,i=Mo(C_,r),o=hT(),l=Yt(n,o);return S.jsx(wx,{as:CU,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(Sn.div,{"data-state":Ax(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Mf="DialogContent",kx=m.forwardRef(hi(function(e,n){const r=FT(Mf,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Mo(Mf,e.__scopeDialog);return S.jsx(Da,{present:s||o.open,children:o.modal?S.jsx(AU,{...i,ref:n}):S.jsx(TU,{...i,ref:n})})},"DialogContent")),AU=m.forwardRef(hi(function(e,n){const r=Mo(Mf,e.__scopeDialog),s=m.useRef(null),i=Yt(n,r.contentRef,s);return m.useEffect(()=>{const o=s.current;if(o)return DT(o)},[]),S.jsx(VT,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Gt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Gt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Gt(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),TU=m.forwardRef(hi(function(e,n){const r=Mo(Mf,e.__scopeDialog),s=m.useRef(!1),i=m.useRef(!1);return S.jsx(VT,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.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")),VT=m.forwardRef(hi(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=Mo(Mf,r);return ev(),S.jsx(S.Fragment,{children:S.jsx(vT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(mx,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":Ax(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),RU="DialogTitle",Cx=m.forwardRef(hi(function(e,n){const{__scopeDialog:r,...s}=e,i=Mo(RU,r),{setTitleCount:o}=i;return Br(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(Sn.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),IU="DialogDescription",Px=m.forwardRef(hi(function(e,n){const{__scopeDialog:r,...s}=e,i=Mo(IU,r),{setDescriptionCount:o}=i;return Br(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(Sn.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function Ax(t){return t?"open":"closed"}hi(Ax,"getState");const MU=["top","right","bottom","left"],Aa=Math.min,ko=Math.max,Cm=Math.round,t0=Math.floor,Co=t=>({x:t,y:t}),OU={left:"right",right:"left",bottom:"top",top:"bottom"};function $T(t,e,n){return ko(t,Aa(e,n))}function Ao(t,e){return typeof t=="function"?t(e):t}function Ta(t){return t.split("-")[0]}function Zu(t){return t.split("-")[1]}function Tx(t){return t==="x"?"y":"x"}function Rx(t){return t==="y"?"height":"width"}function ji(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Ix(t){return Tx(ji(t))}function LU(t,e,n){n===void 0&&(n=!1);const r=Zu(t),s=Ix(t),i=Rx(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Pm(o)),[o,Pm(o)]}function DU(t){const e=Pm(t);return[P_(t),e,P_(e)]}function P_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ck=["left","right"],uk=["right","left"],NU=["top","bottom"],jU=["bottom","top"];function FU(t,e,n){switch(t){case"top":case"bottom":return n?e?uk:ck:e?ck:uk;case"left":case"right":return e?NU:jU;default:return[]}}function VU(t,e,n,r){const s=Zu(t);let i=FU(Ta(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(P_)))),i}function Pm(t){const e=Ta(t);return OU[e]+t.slice(e.length)}function $U(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 HT(t){return typeof t!="number"?$U(t):{top:t,right:t,bottom:t,left:t}}function Am(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 dk(t,e,n){let{reference:r,floating:s}=t;const i=ji(e),o=Ix(e),l=Rx(o),u=Ta(e),d=i==="y",f=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,v=r[l]/2-s[l]/2;let y;switch(u){case"top":y={x:f,y:r.y-s.height};break;case"bottom":y={x:f,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}const w=Zu(e);return w&&(y[o]+=v*(w==="end"?1:-1)*(n&&d?-1:1)),y}async function HU(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:v=!1,padding:y=0}=Ao(e,t),w=HT(y),x=l[v?p==="floating"?"reference":"floating":p],b=Am(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),k=p==="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},T=Am(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:C,strategy:u}):k);return{top:(b.top-T.top+w.top)/P.y,bottom:(T.bottom-b.bottom+w.bottom)/P.y,left:(b.left-T.left+w.left)/P.x,right:(T.right-b.right+w.right)/P.x}}const zU=50,BU=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:HU},u=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:p}=dk(d,r,u),v=r,y=0;const w={};for(let _=0;_<i.length;_++){const x=i[_];if(!x)continue;const{name:b,fn:k}=x,{x:C,y:P,data:T,reset:O}=await k({x:f,y:p,initialPlacement:r,placement:v,strategy:s,middlewareData:w,rects:d,platform:l,elements:{reference:t,floating:e}});f=C??f,p=P??p,w[b]={...w[b],...T},O&&y<zU&&(y++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(d=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:f,y:p}=dk(d,v,u)),_=-1)}return{x:f,y:p,placement:v,strategy:s,middlewareData:w}},UU=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=Ao(t,e)||{};if(d==null)return{};const p=HT(f),v={x:n,y:r},y=Ix(s),w=Rx(y),_=await o.getDimensions(d),x=y==="y",b=x?"top":"left",k=x?"bottom":"right",C=x?"clientHeight":"clientWidth",P=i.reference[w]+i.reference[y]-v[y]-i.floating[w],T=v[y]-i.reference[y],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let M=O?O[C]:0;(!M||!await(o.isElement==null?void 0:o.isElement(O)))&&(M=l.floating[C]||i.floating[w]);const R=P/2-T/2,L=M/2-_[w]/2-1,D=Aa(p[b],L),V=Aa(p[k],L),j=M-_[w]-V,U=M/2-_[w]/2+R,X=$T(D,U,j),q=!u.arrow&&Zu(s)!=null&&U!==X&&i.reference[w]/2-(U<D?D:V)-_[w]/2<0,Z=q?U<D?U-D:U-j:0;return{[y]:v[y]+Z,data:{[y]:X,centerOffset:U-X-Z,...q&&{alignmentOffset:Z}},reset:q}}}),WU=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:u,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...x}=Ao(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Ta(s),k=ji(l),C=Ta(l)===l,P=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=v||(C||!_?[Pm(l)]:DU(l)),O=w!=="none";!v&&O&&T.push(...VU(l,_,w,P));const M=[l,...T],R=await u.detectOverflow(e,x),L=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&L.push(R[b]),p){const X=LU(s,o,P);L.push(R[X[0]],R[X[1]])}if(D=[...D,{placement:s,overflows:L}],!L.every(X=>X<=0)){var V,j;const X=(((V=i.flip)==null?void 0:V.index)||0)+1,q=M[X];if(q&&(!(p==="alignment"?k!==ji(q):!1)||D.every(H=>ji(H.placement)===k?H.overflows[0]>0:!0)))return{data:{index:X,overflows:D},reset:{placement:q}};let Z=(j=D.filter(Y=>Y.overflows[0]<=0).sort((Y,H)=>Y.overflows[1]-H.overflows[1])[0])==null?void 0:j.placement;if(!Z)switch(y){case"bestFit":{var U;const Y=(U=D.filter(H=>{if(O){const Q=ji(H.placement);return Q===k||Q==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Q=>Q>0).reduce((Q,z)=>Q+z,0)]).sort((H,Q)=>H[1]-Q[1])[0])==null?void 0:U[0];Y&&(Z=Y);break}case"initialPlacement":Z=l;break}if(s!==Z)return{reset:{placement:Z}}}return{}}}};function fk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function hk(t){return MU.some(e=>t[e]>=0)}const ZU=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Ao(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=fk(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:hk(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=fk(o,n.floating);return{data:{escapedOffsets:l,escaped:hk(l)}}}default:return{}}}}},zT=new Set(["left","top"]);async function qU(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Ta(n),l=Zu(n),u=ji(n)==="y",d=zT.has(o)?-1:1,f=i&&u?-1:1,p=Ao(e,t);let{mainAxis:v,crossAxis:y,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof w=="number"&&(y=l==="end"?w*-1:w),u?{x:y*f,y:v*d}:{x:v*d,y:y*f}}const GU=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,u=await qU(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:o}}}}},KU=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:u={fn:k=>{let{x:C,y:P}=k;return{x:C,y:P}}},...d}=Ao(t,e),f={x:n,y:r},p=await i.detectOverflow(e,d),v=ji(s),y=Tx(v);let w=f[y],_=f[v];const x=(k,C)=>$T(C+p[k==="y"?"top":"left"],C,C-p[k==="y"?"bottom":"right"]);o&&(w=x(y,w)),l&&(_=x(v,_));const b=u.fn({...e,[y]:w,[v]:_});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[y]:o,[v]:l}}}}}},YU=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=Ao(t,e),v={x:s,y:i},y=ji(o),w=Tx(y);let _=v[w],x=v[y];const b=Ao(d,e),k=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(n=b.mainAxis)!=null?n:0,crossAxis:(r=b.crossAxis)!=null?r:0};if(f){const T=w==="y"?"height":"width",O=l.reference[w]-l.floating[T]+k.mainAxis,M=l.reference[w]+l.reference[T]-k.mainAxis;_<O?_=O:_>M&&(_=M)}if(p){var C,P;const T=w==="y"?"width":"height",O=zT.has(Ta(o)),M=l.reference[y]-l.floating[T]+(O&&((C=u.offset)==null?void 0:C[y])||0)+(O?0:k.crossAxis),R=l.reference[y]+l.reference[T]+(O?0:((P=u.offset)==null?void 0:P[y])||0)-(O?k.crossAxis:0);x<M?x=M:x>R&&(x=R)}return{[w]:_,[y]:x}}}},XU=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}=Ao(t,e),u=await s.detectOverflow(e,l),d=Ta(n),f=Zu(n),p=ji(n)==="y",{width:v,height:y}=r.floating;let w,_;d==="top"||d==="bottom"?(w=d,_=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,w=f==="end"?"top":"bottom");const x=y-u.top-u.bottom,b=v-u.left-u.right,k=Aa(y-u[w],x),C=Aa(v-u[_],b),P=e.middlewareData.shift,T=!P;let O=k,M=C;P!=null&&P.enabled.x&&(M=b),P!=null&&P.enabled.y&&(O=x),T&&!f&&(p?M=v-2*ko(u.left,u.right):O=y-2*ko(u.top,u.bottom)),await o({...e,availableWidth:M,availableHeight:O});const R=await s.getDimensions(i.floating);return v!==R.width||y!==R.height?{reset:{rects:!0}}:{}}}};function nv(){return typeof window<"u"}function qu(t){return BT(t)?(t.nodeName||"").toLowerCase():"#document"}function Ur(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Oo(t){var e;return(e=(BT(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function BT(t){return nv()?t instanceof Node||t instanceof Ur(t).Node:!1}function Hi(t){return nv()?t instanceof Element||t instanceof Ur(t).Element:!1}function Na(t){return nv()?t instanceof HTMLElement||t instanceof Ur(t).HTMLElement:!1}function pk(t){return!nv()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ur(t).ShadowRoot}function rv(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=zi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function QU(t){return/^(table|td|th)$/.test(qu(t))}function sv(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const JU=/transform|translate|scale|rotate|perspective|filter/,eW=/paint|layout|strict|content/,dl=t=>!!t&&t!=="none";let ly;function Mx(t){const e=Hi(t)?zi(t):t;return dl(e.transform)||dl(e.translate)||dl(e.scale)||dl(e.rotate)||dl(e.perspective)||!Ox()&&(dl(e.backdropFilter)||dl(e.filter))||JU.test(e.willChange||"")||eW.test(e.contain||"")}function tW(t){let e=Zl(t);for(;Na(e)&&!Of(e);){if(Mx(e))return e;if(sv(e))return null;e=Zl(e)}return null}function Ox(){return ly==null&&(ly=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ly}function Of(t){return/^(html|body|#document)$/.test(qu(t))}function zi(t){return Ur(t).getComputedStyle(t)}function iv(t){return Hi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Zl(t){if(qu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pk(t)&&t.host||Oo(t);return pk(e)?e.host:e}function UT(t){const e=Zl(t);return Of(e)?(t.ownerDocument||t).body:Na(e)&&rv(e)?e:UT(e)}function Lf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=UT(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Ur(s);if(i){const l=A_(o);return e.concat(o,o.visualViewport||[],rv(s)?s:[],l&&n?Lf(l):[])}else return e.concat(s,Lf(s,[],n))}function A_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function WT(t){const e=zi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Na(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=Cm(n)!==i||Cm(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function Lx(t){return Hi(t)?t:t.contextElement}function su(t){const e=Lx(t);if(!Na(e))return Co(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=WT(e);let o=(i?Cm(n.width):n.width)/r,l=(i?Cm(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const nW=Co(0);function ZT(t){const e=Ur(t);return!Ox()||!e.visualViewport?nW:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function rW(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Ur(t)}function ql(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Lx(t);let o=Co(1);e&&(r?Hi(r)&&(o=su(r)):o=su(t));const l=rW(i,n,r)?ZT(i):Co(0);let u=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,p=s.height/o.y;if(i&&r){const v=Ur(i),y=Hi(r)?Ur(r):r;let w=v,_=A_(w);for(;_&&y!==w;){const x=su(_),b=_.getBoundingClientRect(),k=zi(_),C=b.left+(_.clientLeft+parseFloat(k.paddingLeft))*x.x,P=b.top+(_.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,d*=x.y,f*=x.x,p*=x.y,u+=C,d+=P,w=Ur(_),_=A_(w)}}return Am({width:f,height:p,x:u,y:d})}function ov(t,e){const n=iv(t).scrollLeft;return e?e.left+n:ql(Oo(t)).left+n}function qT(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-ov(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function sW(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Oo(r),l=e?sv(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Co(1);const f=Co(0),p=Na(r);if((p||!i)&&((qu(r)!=="body"||rv(o))&&(u=iv(r)),p)){const y=ql(r);d=su(r),f.x=y.x+r.clientLeft,f.y=y.y+r.clientTop}const v=o&&!p&&!i?qT(o,u):Co(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+v.x,y:n.y*d.y-u.scrollTop*d.y+f.y+v.y}}function iW(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function oW(t){const e=iv(t),n=t.ownerDocument.body,r=ko(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ko(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+ov(t);const o=-e.scrollTop;return zi(n).direction==="rtl"&&(i+=ko(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const aW=25;function lW(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Ur(t),i=Oo(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const v=!Ox()||e==="fixed";r?v||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,u=o.height,v&&(d=o.offsetLeft,f=o.offsetTop))}if(ov(i)<=0){const v=i.ownerDocument,y=v.body,w=getComputedStyle(y),_=v.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(i.clientWidth-y.clientWidth-_),b=getComputedStyle(i).scrollbarGutter==="stable both-edges"?x/2:x;b<=aW&&(l-=b)}return{width:l,height:u,x:d,y:f}}function cW(t,e){const n=ql(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=su(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:o,height:l,x:u,y:d}}function mk(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=lW(t,n,e);else if(e==="document")r=oW(Oo(t));else if(Hi(e))r=cW(e,n);else{const s=ZT(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Am(r)}function uW(t,e){const n=e.get(t);if(n)return n;let r=Lf(t,[],!1).filter(l=>Hi(l)&&qu(l)!=="body"),s=null;const i=zi(t).position==="fixed";let o=i?Zl(t):t;for(;Hi(o)&&!Of(o);){const l=zi(o),u=Mx(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(p=>p!==o):s=l,o=Zl(o)}return e.set(t,r),r}function dW(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?sv(e)?[]:uW(e,this._c):[].concat(n),r],l=mk(e,o[0],s);let u=l.top,d=l.right,f=l.bottom,p=l.left;for(let v=1;v<o.length;v++){const y=mk(e,o[v],s);u=ko(y.top,u),d=Aa(y.right,d),f=Aa(y.bottom,f),p=ko(y.left,p)}return{width:d-p,height:f-u,x:p,y:u}}function fW(t){const{width:e,height:n}=WT(t);return{width:e,height:n}}function hW(t,e,n){const r=Na(e),s=Oo(e),i=n==="fixed",o=ql(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=Co(0);if((r||!i)&&((qu(e)!=="body"||rv(s))&&(l=iv(e)),r)){const v=ql(e,!0,i,e);u.x=v.x+e.clientLeft,u.y=v.y+e.clientTop}!r&&s&&(u.x=ov(s));const d=s&&!r&&!i?qT(s,l):Co(0),f=o.left+l.scrollLeft-u.x-d.x,p=o.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:o.width,height:o.height}}function cy(t){return zi(t).position==="static"}function vk(t,e){if(!Na(t)||zi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Oo(t)===n&&(n=n.ownerDocument.body),n}function GT(t,e){const n=Ur(t);if(sv(t))return n;if(!Na(t)){let s=Zl(t);for(;s&&!Of(s);){if(Hi(s)&&!cy(s))return s;s=Zl(s)}return n}let r=vk(t,e);for(;r&&QU(r)&&cy(r);)r=vk(r,e);return r&&Of(r)&&cy(r)&&!Mx(r)?n:r||tW(t)||n}const pW=async function(t){const e=this.getOffsetParent||GT,n=this.getDimensions,r=await n(t.floating);return{reference:hW(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mW(t){return zi(t).direction==="rtl"}const vW={convertOffsetParentRelativeRectToViewportRelativeRect:sW,getDocumentElement:Oo,getClippingRect:dW,getOffsetParent:GT,getElementRects:pW,getClientRects:iW,getDimensions:fW,getScale:su,isElement:Hi,isRTL:mW};function KT(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function gW(t,e,n){let r=null,s;const i=Oo(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),o();const v=t.getBoundingClientRect(),{left:y,top:w,width:_,height:x}=v;if(f||e(),!_||!x)return;const b=t0(w),k=t0(i.clientWidth-(y+_)),C=t0(i.clientHeight-(w+x)),P=t0(y),O={rootMargin:-b+"px "+-k+"px "+-C+"px "+-P+"px",threshold:ko(0,Aa(1,p))||1};let M=!0;function R(L){const D=L[0].intersectionRatio;if(!KT(v,t.getBoundingClientRect()))return l();if(D!==p){if(!M)return l();D?l(!1,D):s=setTimeout(()=>{l(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(R,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(R,O)}r.observe(t)}const u=Ur(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function yW(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:u=!1}=r,d=Lx(t),f=s||i?[...d?Lf(d):[],...e?Lf(e):[]]:[];f.forEach(b=>{s&&b.addEventListener("scroll",n),i&&b.addEventListener("resize",n)});const p=d&&l?gW(d,n,i):null;let v=-1,y=null;o&&(y=new ResizeObserver(b=>{let[k]=b;k&&k.target===d&&y&&e&&(y.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var C;(C=y)==null||C.observe(e)})),n()}),d&&!u&&y.observe(d),e&&y.observe(e));let w,_=u?ql(t):null;u&&x();function x(){const b=ql(t);_&&!KT(_,b)&&n(),_=b,w=requestAnimationFrame(x)}return n(),()=>{var b;f.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),p==null||p(),(b=y)==null||b.disconnect(),y=null,u&&cancelAnimationFrame(w)}}const _W=GU,wW=KU,xW=WU,bW=XU,SW=ZU,gk=UU,EW=YU,kW=(t,e,n)=>{const r=new Map,s=n??{},i={...vW,...s.platform,_c:r};return BU(t,e,{...s,platform:i})};var CW=typeof document<"u",PW=function(){},R0=CW?m.useLayoutEffect:PW;function Tm(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(!Tm(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)&&!Tm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function YT(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function yk(t,e){const n=YT(t);return Math.round(e*n)/n}function uy(t){const e=m.useRef(t);return R0(()=>{e.current=t}),e}function AW(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:u,open:d}=t,[f,p]=m.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,y]=m.useState(r);Tm(v,r)||y(r);const[w,_]=m.useState(null),[x,b]=m.useState(null),k=m.useCallback(H=>{H!==O.current&&(O.current=H,_(H))},[]),C=m.useCallback(H=>{H!==M.current&&(M.current=H,b(H))},[]),P=i||w,T=o||x,O=m.useRef(null),M=m.useRef(null),R=m.useRef(f),L=u!=null,D=uy(u),V=uy(s),j=uy(d),U=m.useCallback(()=>{if(!O.current||!M.current)return;const H={placement:e,strategy:n,middleware:v};V.current&&(H.platform=V.current),kW(O.current,M.current,H).then(Q=>{const z={...Q,isPositioned:j.current!==!1};X.current&&!Tm(R.current,z)&&(R.current=z,ch.flushSync(()=>{p(z)}))})},[v,e,n,V,j]);R0(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[d]);const X=m.useRef(!1);R0(()=>(X.current=!0,()=>{X.current=!1}),[]),R0(()=>{if(P&&(O.current=P),T&&(M.current=T),P&&T){if(D.current)return D.current(P,T,U);U()}},[P,T,U,D,L]);const q=m.useMemo(()=>({reference:O,floating:M,setReference:k,setFloating:C}),[k,C]),Z=m.useMemo(()=>({reference:P,floating:T}),[P,T]),Y=m.useMemo(()=>{const H={position:n,left:0,top:0};if(!Z.floating)return H;const Q=yk(Z.floating,f.x),z=yk(Z.floating,f.y);return l?{...H,transform:"translate("+Q+"px, "+z+"px)",...YT(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:z}},[n,l,Z.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:U,refs:q,elements:Z,floatingStyles:Y}),[f,U,q,Z,Y])}const TW=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?gk({element:r.current,padding:s}).fn(n):{}:r?gk({element:r,padding:s}).fn(n):{}}}},RW=(t,e)=>{const n=_W(t);return{name:n.name,fn:n.fn,options:[t,e]}},IW=(t,e)=>{const n=wW(t);return{name:n.name,fn:n.fn,options:[t,e]}},MW=(t,e)=>({fn:EW(t).fn,options:[t,e]}),OW=(t,e)=>{const n=xW(t);return{name:n.name,fn:n.fn,options:[t,e]}},LW=(t,e)=>{const n=bW(t);return{name:n.name,fn:n.fn,options:[t,e]}},DW=(t,e)=>{const n=SW(t);return{name:n.name,fn:n.fn,options:[t,e]}},NW=(t,e)=>{const n=TW(t);return{name:n.name,fn:n.fn,options:[t,e]}};var jW=Object.defineProperty,FW=(t,e)=>jW(t,"name",{value:e,configurable:!0});function Dx(t){const[e,n]=m.useState(void 0);return Br(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,l;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;o=d.inlineSize,l=d.blockSize}else o=t.offsetWidth,l=t.offsetHeight;n({width:o,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}FW(Dx,"useSize");var VW=Object.defineProperty,wa=(t,e)=>VW(t,"name",{value:e,configurable:!0}),XT="Popper",[QT,av]=Ui(XT),[$W,JT]=QT(XT),HW=wa(t=>{const{__scopePopper:e,children:n}=t,[r,s]=m.useState(null),[i,o]=m.useState(void 0);return S.jsx($W,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),zW="PopperAnchor",BW=m.forwardRef(wa(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=JT(zW,r),l=m.useRef(null),u=o.onAnchorChange,d=m.useCallback(_=>{l.current=_,_&&u(_)},[u]),f=Yt(n,d),p=m.useRef(null);m.useEffect(()=>{if(!s)return;const _=p.current;p.current=s.current,_!==p.current&&u(p.current)});const v=o.placementState&&lv(o.placementState),y=v==null?void 0:v[0],w=v==null?void 0:v[1];return s?null:S.jsx(Sn.div,{"data-radix-popper-side":y,"data-radix-popper-align":w,...i,ref:f})},"PopperAnchor")),eR="PopperContent",[UW,rne]=QT(eR),WW=m.forwardRef(wa(function(e,n){var te,Pe,Se,Ne,Xe,Qe,lt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:v="partial",hideWhenDetached:y=!1,updatePositionStrategy:w="optimized",onPlaced:_,...x}=e,b=JT(eR,r),[k,C]=m.useState(null),P=Yt(n,C),[T,O]=m.useState(null),M=Dx(T),R=(M==null?void 0:M.width)??0,L=(M==null?void 0:M.height)??0,D=s+(o!=="center"?"-"+o:""),V=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},j=Array.isArray(f)?f:[f],U=j.length>0,X={padding:V,boundary:j.filter(tR),altBoundary:U},{refs:q,floatingStyles:Z,placement:Y,isPositioned:H,middlewareData:Q}=AW({strategy:"fixed",placement:D,whileElementsMounted:wa((...ut)=>yW(...ut,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[RW({mainAxis:i+L,alignmentAxis:l}),d&&IW({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?MW():void 0,...X}),d&&OW({...X}),LW({...X,apply:wa(({elements:ut,rects:je,availableWidth:st,availableHeight:Be})=>{const{width:ft,height:Me}=je.reference,We=ut.floating.style;We.setProperty("--radix-popper-available-width",`${st}px`),We.setProperty("--radix-popper-available-height",`${Be}px`),We.setProperty("--radix-popper-anchor-width",`${ft}px`),We.setProperty("--radix-popper-anchor-height",`${Me}px`)},"apply")}),T&&NW({element:T,padding:u}),ZW({arrowWidth:R,arrowHeight:L}),y&&DW({strategy:"referenceHidden",...X,boundary:U?X.boundary:void 0})]}),z=b.setPlacementState;Br(()=>(z(Y),()=>{z(void 0)}),[Y,z]);const[N,G]=lv(Y),oe=Wl(_);Br(()=>{H&&(oe==null||oe())},[H,oe]);const se=(te=Q.arrow)==null?void 0:te.x,ee=(Pe=Q.arrow)==null?void 0:Pe.y,de=((Se=Q.arrow)==null?void 0:Se.centerOffset)!==0,[ve,le]=m.useState();return Br(()=>{k&&le(window.getComputedStyle(k).zIndex)},[k]),S.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:H?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(Ne=Q.transformOrigin)==null?void 0:Ne.x,(Xe=Q.transformOrigin)==null?void 0:Xe.y].join(" "),...((Qe=Q.hide)==null?void 0:Qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(UW,{scope:r,placedSide:N,placedAlign:G,onArrowChange:O,arrowX:se,arrowY:ee,shouldHideArrow:de,children:S.jsx(Sn.div,{"data-side":N,"data-align":G,...x,ref:P,style:{...x.style,animation:H?(lt=x.style)==null?void 0:lt.animation:"none"}})})})},"PopperContent"));function tR(t){return t!==null}wa(tR,"isNotNull");var ZW=wa(t=>({name:"transformOrigin",options:t,fn(e){var x,b,k;const{placement:n,rects:r,middlewareData:s}=e,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,f]=lv(n),p={start:"0%",center:"50%",end:"100%"}[f],v=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,y=(((k=s.arrow)==null?void 0:k.y)??0)+u/2;let w="",_="";return d==="bottom"?(w=o?p:`${v}px`,_=`${-u}px`):d==="top"?(w=o?p:`${v}px`,_=`${r.floating.height+u}px`):d==="right"?(w=`${-u}px`,_=o?p:`${y}px`):d==="left"&&(w=`${r.floating.width+u}px`,_=o?p:`${y}px`),{data:{x:w,y:_}}}}),"transformOrigin");function lv(t){const[e,n="center"]=t.split("-");return[e,n]}wa(lv,"getSideAndAlignFromPlacement");var nR=HW,rR=BW,sR=WW,qW=Object.defineProperty,ja=(t,e)=>qW(t,"name",{value:e,configurable:!0}),Nx="Popover",[iR,sne]=Ui(Nx,[av]),jx=av(),[GW,Gu]=iR(Nx),KW=ja(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=jx(e),u=m.useRef(null),[d,f]=m.useState(!1),[p,v]=La({prop:r,defaultProp:s??!1,onChange:i,caller:Nx});return S.jsx(nR,{...l,children:S.jsx(GW,{scope:e,contentId:_a(),triggerRef:u,open:p,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(y=>!y),[v]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>f(!0),[]),onCustomAnchorRemove:m.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),YW="PopoverTrigger",XW=m.forwardRef(ja(function(e,n){const{__scopePopover:r,...s}=e,i=Gu(YW,r),o=jx(r),l=Yt(n,i.triggerRef),u=S.jsx(Sn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Fx(i.open),...s,ref:l,onClick:Gt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(rR,{asChild:!0,...o,children:u})},"PopoverTrigger")),oR="PopoverPortal",[QW,JW]=iR(oR,{forceMount:void 0}),eZ=ja(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=Gu(oR,e);return S.jsx(QW,{scope:e,forceMount:n,children:S.jsx(Da,{present:n||i.open,children:S.jsx(yx,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),Df="PopoverContent",tZ=m.forwardRef(ja(function(e,n){const r=JW(Df,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=Gu(Df,e.__scopePopover);return S.jsx(Da,{present:s||o.open,children:o.modal?S.jsx(rZ,{...i,ref:n}):S.jsx(sZ,{...i,ref:n})})},"PopoverContent")),nZ=Pa("PopoverContent.RemoveScroll"),rZ=m.forwardRef(ja(function(e,n){const r=Gu(Df,e.__scopePopover),s=m.useRef(null),i=Yt(n,s),o=m.useRef(!1);return m.useEffect(()=>{const l=s.current;if(l)return DT(l)},[]),S.jsx(wx,{as:nZ,allowPinchZoom:!0,children:S.jsx(aR,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gt(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Gt(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Gt(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),sZ=m.forwardRef(ja(function(e,n){const r=Gu(Df,e.__scopePopover),s=m.useRef(!1),i=m.useRef(!1);return S.jsx(aR,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.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")),aR=m.forwardRef(ja(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,...v}=e,y=Gu(Df,r),w=jx(r);return ev(),S.jsx(vT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(mx,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(sR,{"data-state":Fx(y.open),role:"dialog",id:y.contentId,...w,...v,ref:n,style:{...v.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 Fx(t){return t?"open":"closed"}ja(Fx,"getState");var Vx=KW,$x=XW,Hx=eZ,zx=tZ;const iZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),oZ=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),m.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),aZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),lZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),cZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),uZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),dZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),fZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),hZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),pZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),mZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),vZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),gZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),yZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),_Z=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),wZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),xZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),bZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),SZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),EZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),kZ=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),CZ=m.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),gn=m.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:u,...d}=t,{color:f="currentColor",size:p,weight:v="regular",mirrored:y=!1,...w}=m.useContext(CZ);return m.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??f,viewBox:"0 0 256 256",transform:o||y?"scale(-1, 1)":void 0,...w,...d},!!n&&m.createElement("title",null,n),l,u.get(i??v))});gn.displayName="IconBase";const lR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:iZ}));lR.displayName="ArrowLeftIcon";const PZ=lR,cR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:oZ}));cR.displayName="ArrowSquareOutIcon";const AZ=cR,uR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:aZ}));uR.displayName="ArrowUpIcon";const TZ=uR,dR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:lZ}));dR.displayName="CaretDownIcon";const RZ=dR,fR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:cZ}));fR.displayName="ChatCircleIcon";const IZ=fR,hR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:uZ}));hR.displayName="CheckIcon";const pR=hR,mR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:dZ}));mR.displayName="CircleNotchIcon";const cv=mR,vR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:fZ}));vR.displayName="CopyIcon";const Nf=vR,gR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:hZ}));gR.displayName="DotsThreeIcon";const MZ=gR,yR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:pZ}));yR.displayName="FolderOpenIcon";const OZ=yR,_R=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:mZ}));_R.displayName="FolderSimpleIcon";const LZ=_R,wR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:vZ}));wR.displayName="MagnifyingGlassIcon";const DZ=wR,xR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:gZ}));xR.displayName="PencilSimpleIcon";const bR=xR,SR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:yZ}));SR.displayName="PushPinIcon";const ER=SR,kR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:_Z}));kR.displayName="SidebarSimpleIcon";const NZ=kR,CR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:wZ}));CR.displayName="SignOutIcon";const jZ=CR,PR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:xZ}));PR.displayName="SparkleIcon";const dy=PR,AR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:bZ}));AR.displayName="SquaresFourIcon";const FZ=AR,TR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:SZ}));TR.displayName="SwatchesIcon";const RR=TR,IR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:EZ}));IR.displayName="TrashIcon";const MR=IR,OR=m.forwardRef((t,e)=>m.createElement(gn,{ref:e,...t,weights:kZ}));OR.displayName="XIcon";const LR=OR;function DR(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=DR(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function VZ(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=DR(t))&&(r&&(r+=" "),r+=e);return r}const $Z=(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},HZ=(t,e)=>({classGroupId:t,validator:e}),NR=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Rm="-",_k=[],zZ="arbitrary..",BZ=t=>{const e=WZ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return UZ(o);const l=o.split(Rm),u=l[0]===""&&l.length>1?1:0;return jR(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?$Z(d,u):u:d||_k}return n[o]||_k}}},jR=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=jR(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(Rm):t.slice(e).join(Rm),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},UZ=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?zZ+r:void 0})(),WZ=t=>{const{theme:e,classGroups:n}=t;return ZZ(n,e)},ZZ=(t,e)=>{const n=NR();for(const r in t){const s=t[r];Bx(s,n,r,e)}return n},Bx=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];qZ(o,e,n,r)}},qZ=(t,e,n,r)=>{if(typeof t=="string"){GZ(t,e,n);return}if(typeof t=="function"){KZ(t,e,n,r);return}YZ(t,e,n,r)},GZ=(t,e,n)=>{const r=t===""?e:FR(e,t);r.classGroupId=n},KZ=(t,e,n,r)=>{if(XZ(t)){Bx(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(HZ(n,t))},YZ=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];Bx(u,FR(e,l),n,r)}},FR=(t,e)=>{let n=t;const r=e.split(Rm),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=NR(),n.nextPart.set(o,l)),n=l}return n},XZ=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,QZ=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)}}},T_="!",wk=":",JZ=[],xk=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),eq=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,u=0,d;const f=s.length;for(let _=0;_<f;_++){const x=s[_];if(o===0&&l===0){if(x===wk){i.push(s.slice(u,_)),u=_+1;continue}if(x==="/"){d=_;continue}}x==="["?o++:x==="]"?o--:x==="("?l++:x===")"&&l--}const p=i.length===0?s:s.slice(u);let v=p,y=!1;p.endsWith(T_)?(v=p.slice(0,-1),y=!0):p.startsWith(T_)&&(v=p.slice(1),y=!0);const w=d&&d>u?d-u:void 0;return xk(i,y,v,w)};if(e){const s=e+wk,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):xk(JZ,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},tq=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]==="[",u=e.has(o);l||u?(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}},nq=t=>({cache:QZ(t.cacheSize),parseClassName:eq(t),sortModifiers:tq(t),postfixLookupClassGroupIds:rq(t),...BZ(t)}),rq=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},sq=/\s+/,iq=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(sq);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:v,modifiers:y,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:x}=n(p);if(v){d=p+(d.length>0?" "+d:d);continue}let b=!!x,k;if(b){const M=_.substring(0,x);k=r(M);const R=k&&o[k]?r(_):void 0;R&&R!==k&&(k=R,b=!1)}else k=r(_);if(!k){if(!b){d=p+(d.length>0?" "+d:d);continue}if(k=r(_),!k){d=p+(d.length>0?" "+d:d);continue}b=!1}const C=y.length===0?"":y.length===1?y[0]:i(y).join(":"),P=w?C+T_:C,T=P+k;if(l.indexOf(T)>-1)continue;l.push(T);const O=s(k,b);for(let M=0;M<O.length;++M){const R=O[M];l.push(P+R)}d=p+(d.length>0?" "+d:d)}return d},oq=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=VR(n))&&(s&&(s+=" "),s+=r);return s},VR=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=VR(t[r]))&&(n&&(n+=" "),n+=e);return n},aq=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((f,p)=>p(f),t());return n=nq(d),r=n.cache.get,s=n.cache.set,i=l,l(u)},l=u=>{const d=r(u);if(d)return d;const f=iq(u,n);return s(u,f),f};return i=o,(...u)=>i(oq(...u))},lq=[],Nn=t=>{const e=n=>n[t]||lq;return e.isThemeGetter=!0,e},$R=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cq=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,uq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dq=/\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$/,fq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=t=>cq.test(t),dt=t=>!!t&&!Number.isNaN(Number(t)),Si=t=>!!t&&Number.isInteger(Number(t)),fy=t=>t.endsWith("%")&&dt(t.slice(0,-1)),io=t=>uq.test(t),zR=()=>!0,mq=t=>dq.test(t)&&!fq.test(t),Ux=()=>!1,vq=t=>hq.test(t),gq=t=>pq.test(t),yq=t=>!Ie(t)&&!Le(t),_q=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)),wq=t=>Fa(t,WR,Ux),Ie=t=>$R.test(t),fl=t=>Fa(t,ZR,mq),bk=t=>Fa(t,Aq,dt),xq=t=>Fa(t,GR,zR),bq=t=>Fa(t,qR,Ux),Sk=t=>Fa(t,BR,Ux),Sq=t=>Fa(t,UR,gq),n0=t=>Fa(t,KR,vq),Le=t=>HR.test(t),Wd=t=>Kl(t,ZR),Eq=t=>Kl(t,qR),Ek=t=>Kl(t,BR),kq=t=>Kl(t,WR),Cq=t=>Kl(t,UR),r0=t=>Kl(t,KR,!0),Pq=t=>Kl(t,GR,!0),Fa=(t,e,n)=>{const r=$R.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Kl=(t,e,n=!1)=>{const r=HR.exec(t);return r?r[1]?e(r[1]):n:!1},BR=t=>t==="position"||t==="percentage",UR=t=>t==="image"||t==="url",WR=t=>t==="length"||t==="size"||t==="bg-size",ZR=t=>t==="length",Aq=t=>t==="number",qR=t=>t==="family-name",GR=t=>t==="number"||t==="weight",KR=t=>t==="shadow",Tq=()=>{const t=Nn("color"),e=Nn("font"),n=Nn("text"),r=Nn("font-weight"),s=Nn("tracking"),i=Nn("leading"),o=Nn("breakpoint"),l=Nn("container"),u=Nn("spacing"),d=Nn("radius"),f=Nn("shadow"),p=Nn("inset-shadow"),v=Nn("text-shadow"),y=Nn("drop-shadow"),w=Nn("blur"),_=Nn("perspective"),x=Nn("aspect"),b=Nn("ease"),k=Nn("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"],T=()=>[...P(),Le,Ie],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],R=()=>[Le,Ie,u],L=()=>[na,"full","auto",...R()],D=()=>[Si,"none","subgrid",Le,Ie],V=()=>["auto",{span:["full",Si,Le,Ie]},Si,Le,Ie],j=()=>[Si,"auto",Le,Ie],U=()=>["auto","min","max","fr",Le,Ie],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...R()],Y=()=>[na,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],H=()=>[na,"screen","full","dvw","lvw","svw","min","max","fit",...R()],Q=()=>[na,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],z=()=>[t,Le,Ie],N=()=>[...P(),Ek,Sk,{position:[Le,Ie]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",kq,wq,{size:[Le,Ie]}],se=()=>[fy,Wd,fl],ee=()=>["","none","full",d,Le,Ie],de=()=>["",dt,Wd,fl],ve=()=>["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"],te=()=>[dt,fy,Ek,Sk],Pe=()=>["","none",w,Le,Ie],Se=()=>["none",dt,Le,Ie],Ne=()=>["none",dt,Le,Ie],Xe=()=>[dt,Le,Ie],Qe=()=>[na,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[io],breakpoint:[io],color:[zR],container:[io],"drop-shadow":[io],ease:["in","out","in-out"],font:[yq],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[io],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[io],shadow:[io],spacing:["px",dt],text:[io],"text-shadow":[io],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",na,Ie,Le,x]}],container:["container"],"container-type":[{"@container":["","normal","size",Le,Ie]}],"container-named":[_q],columns:[{columns:[dt,Ie,Le,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:T()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Si,"auto",Le,Ie]}],basis:[{basis:[na,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,na,"auto","initial","none",Ie]}],grow:[{grow:["",dt,Le,Ie]}],shrink:[{shrink:["",dt,Le,Ie]}],order:[{order:[Si,"first","last","none",Le,Ie]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mbs:[{mbs:Z()}],mbe:[{mbe:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...Y()]}],"min-w":[{"min-w":[l,"screen","none",...Y()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,Wd,fl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Pq,xq]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",fy,Ie]}],"font-family":[{font:[Eq,bq,e]}],"font-features":[{"font-features":[Ie]}],"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,Le,Ie]}],"line-clamp":[{"line-clamp":[dt,"none",Le,bk]}],leading:[{leading:[i,...R()]}],"list-image":[{"list-image":["none",Le,Ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",Le,fl]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[dt,"auto",Le,Ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[Si,Le,Ie]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Ie]}],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",Le,Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Si,Le,Ie],radial:["",Le,Ie],conic:[Si,Le,Ie]},Cq,Sq]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,Le,Ie]}],"outline-w":[{outline:["",dt,Wd,fl]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",f,r0,n0]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",p,r0,n0]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[dt,fl]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",v,r0,n0]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[dt,Le,Ie]}],"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":[dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Le,Ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":[dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Ie]}],filter:[{filter:["","none",Le,Ie]}],blur:[{blur:Pe()}],brightness:[{brightness:[dt,Le,Ie]}],contrast:[{contrast:[dt,Le,Ie]}],"drop-shadow":[{"drop-shadow":["","none",y,r0,n0]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",dt,Le,Ie]}],"hue-rotate":[{"hue-rotate":[dt,Le,Ie]}],invert:[{invert:["",dt,Le,Ie]}],saturate:[{saturate:[dt,Le,Ie]}],sepia:[{sepia:["",dt,Le,Ie]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Ie]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[dt,Le,Ie]}],"backdrop-contrast":[{"backdrop-contrast":[dt,Le,Ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,Le,Ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,Le,Ie]}],"backdrop-invert":[{"backdrop-invert":["",dt,Le,Ie]}],"backdrop-opacity":[{"backdrop-opacity":[dt,Le,Ie]}],"backdrop-saturate":[{"backdrop-saturate":[dt,Le,Ie]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,Le,Ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,Ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",Le,Ie]}],ease:[{ease:["linear","initial",b,Le,Ie]}],delay:[{delay:[dt,Le,Ie]}],animate:[{animate:["none",k,Le,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Le,Ie]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:Xe()}],"skew-x":[{"skew-x":Xe()}],"skew-y":[{"skew-y":Xe()}],transform:[{transform:[Le,Ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],zoom:[{zoom:[Si,Le,Ie]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",Le,Ie]}],"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":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",Le,Ie]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[dt,Wd,fl,bk]}],stroke:[{stroke:["none",...z()]}],"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":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["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-r","border-w-l"],"border-w-y":["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-r","border-color-l"],"border-color-y":["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-mr","scroll-ml"],"scroll-my":["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-pr","scroll-pl"],"scroll-py":["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"]}},Rq=aq(Tq);function $n(...t){return Rq(VZ(t))}const jf={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},Iq="data-hover-dead-zone";function YR(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=m.useRef(new Map),[i,o]=m.useState(null),[l,u]=m.useState([]),d=m.useRef([]),f=m.useRef(0),p=m.useRef(null),v=m.useRef(null),y=m.useCallback(()=>{const C=[];return s.current.forEach((P,T)=>{C[T]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),C},[]),w=m.useCallback(()=>{if(!t.current)return;const P=y();d.current=P,u(P)},[t,y]),_=m.useCallback((C,P)=>{P?s.current.set(C,P):s.current.delete(C),v.current!==null&&cancelAnimationFrame(v.current),v.current=requestAnimationFrame(()=>{v.current=null,w()})},[w]),x=m.useCallback(C=>{const P=C.clientX,T=C.clientY,O=C.target instanceof Element&&C.target.closest(`[${Iq}]`)!==null;p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null;const M=t.current;if(!M)return;if(O){o(null);return}const R=y(),L=d.current;(R.length!==L.length||R.some((oe,se)=>{const ee=L[se];return!ee||!oe||oe.top!==ee.top||oe.height!==ee.height||oe.left!==ee.left||oe.width!==ee.width}))&&(d.current=R,u(R));const V=M.getBoundingClientRect(),j=n==="x"?P:T;let U=null,X=1/0,q=null;const Z=d.current,Y=n==="x"?M.scrollLeft:M.scrollTop,H=n==="x"?M.clientLeft:M.clientTop,Q=n==="x"?V.left:V.top,z=n==="x"?M.offsetWidth:M.offsetHeight,N=n==="x"?V.width:V.height,G=z>0?N/z:1;for(let oe=0;oe<Z.length;oe++){const se=Z[oe];if(!se)continue;const ee=n==="x"?se.left:se.top,de=Q+(H+ee-Y)*G,ve=(n==="x"?se.width:se.height)*G,le=de+ve;j>=de&&j<=le&&(q=oe);let te=0;j<de?te=de-j:j>le&&(te=j-le),te<X&&(X=te,U=oe)}o(q??(X<=r?U:null))})},[n,t,r,y]),b=m.useCallback(()=>{f.current+=1,w()},[w]),k=m.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),o(null)},[]);return m.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current),v.current!==null&&cancelAnimationFrame(v.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:b,onMouseLeave:k},registerItem:_,measureItems:w}}function Mq(t,e,n){m.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let I0=0;const Oq=()=>{I0+=1;let t=!1;return()=>{t||(t=!0,I0=Math.max(0,I0-1))}},Lq=()=>I0>0,Dq='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',XR=({itemSelector:t=Dq,loop:e=!1}={})=>{const n=m.useRef(null),r=m.useRef(null),s=m.useCallback(o=>{var l;n.current=o,o?r.current=Oq():((l=r.current)==null||l.call(r),r.current=null)},[]),i=m.useCallback(o=>{var w;const{key:l}=o;if(l!=="ArrowDown"&&l!=="ArrowUp"&&l!=="Home"&&l!=="End")return;const u=n.current;if(!u)return;const d=Array.from(u.querySelectorAll(t));if(d.length===0)return;o.preventDefault(),o.stopPropagation();const f=d.indexOf(document.activeElement),p=d.length-1,v=_=>{if(f===-1)return _===1?0:p;const x=f+_;return e?(x+d.length)%d.length:Math.min(Math.max(x,0),p)};let y;l==="Home"?y=0:l==="End"?y=p:l==="ArrowDown"?y=v(1):y=v(-1),(w=d[y])==null||w.focus()},[t,e]);return{containerRef:s,onKeyDown:i}};var M0={exports:{}},Nq=M0.exports,kk;function jq(){return kk||(kk=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(Nq,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(_,x){var b=_[x];if(typeof b.bind=="function")return b.bind(_);try{return Function.prototype.bind.call(b,_)}catch{return function(){return Function.prototype.apply.apply(b,[_,arguments])}}}function u(){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?u:console[_]!==void 0?l(console,_):console.log!==void 0?l(console,"log"):e}function f(){for(var _=this.getLevel(),x=0;x<s.length;x++){var b=s[x];this[b]=x<_?e:this.methodFactory(b,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(f.call(this),this[_].apply(this,arguments))}}function v(_,x,b){return d(_)||p.apply(this,arguments)}function y(_,x){var b=this,k,C,P,T="loglevel";typeof _=="string"?T+=":"+_:typeof _=="symbol"&&(T=void 0);function O(V){var j=(s[V]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=j;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+j+";"}catch{}}}function M(){var V;if(!(typeof window===n||!T)){try{V=window.localStorage[T]}catch{}if(typeof V===n)try{var j=window.document.cookie,U=encodeURIComponent(T),X=j.indexOf(U+"=");X!==-1&&(V=/^([^;]+)/.exec(j.slice(X+U.length+1))[1])}catch{}return b.levels[V]===void 0&&(V=void 0),V}}function R(){if(!(typeof window===n||!T)){try{window.localStorage.removeItem(T)}catch{}try{window.document.cookie=encodeURIComponent(T)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function L(V){var j=V;if(typeof j=="string"&&b.levels[j.toUpperCase()]!==void 0&&(j=b.levels[j.toUpperCase()]),typeof j=="number"&&j>=0&&j<=b.levels.SILENT)return j;throw new TypeError("log.setLevel() called with invalid level: "+V)}b.name=_,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=x||v,b.getLevel=function(){return P??C??k},b.setLevel=function(V,j){return P=L(V),j!==!1&&O(P),f.call(b)},b.setDefaultLevel=function(V){C=L(V),M()||b.setLevel(V,!1)},b.resetLevel=function(){P=null,R(),f.call(b)},b.enableAll=function(V){b.setLevel(b.levels.TRACE,V)},b.disableAll=function(V){b.setLevel(b.levels.SILENT,V)},b.rebuild=function(){if(o!==b&&(k=L(o.getLevel())),f.call(b),o===b)for(var V in i)i[V].rebuild()},k=L(o?o.getLevel():"WARN");var D=M();D!=null&&(P=L(D)),f.call(b)}o=new y,o.getLogger=function(x){if(typeof x!="symbol"&&typeof x!="string"||x==="")throw new TypeError("You must supply a name when creating a logger.");var b=i[x];return b||(b=i[x]=new y(x,o.methodFactory)),b};var w=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=w),o},o.getLoggers=function(){return i},o.default=o,o})})(M0)),M0.exports}var Fq=jq();const ii=Bm(Fq),Vq="INFO",$q=Vq.toUpperCase();ii.setLevel(ii.levels[$q]||ii.levels.INFO);const Es=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>ii.trace(`${e}${n}`,...r),debug:(n,...r)=>ii.debug(`${e}${n}`,...r),info:(n,...r)=>ii.info(`${e}${n}`,...r),warn:(n,...r)=>ii.warn(`${e}${n}`,...r),error:(n,...r)=>{ii.error(`${e}${n}`,...r);try{const i=r.map(l=>l instanceof Error?l.message:String(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}:{}};ke.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>ii.info(`${e}API: ${n}`,...r),hook:(n,...r)=>ii.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>ii.debug(`${e}Mount: ${n}`,...r)}},Ck=Es("useVariantsUiState"),Hq={groups:[],rows:{}},s0={pinned:[],order:Hq},ef="pinned",zq="top",hy=t=>`rows:${t}`,Pk=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},Bq=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),Uq=(t,e)=>n=>{if(t===ef){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===zq?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},Wq=t=>{const e=t?`?projectPath=${encodeURIComponent(t)}`:"",[n,r]=m.useState(s0),s=m.useRef(n);s.current=n;const i=m.useRef(!1),o=m.useRef([]),l=m.useCallback(y=>{t&&fetch(`/api/variants/ui-state${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:y})}).catch(w=>{Ck.warn("persist failed — arrangement kept for this session only",w)})},[t,e]);m.useEffect(()=>{if(r(s0),s.current=s0,i.current=!1,o.current=[],!t)return;let y=!1;return(async()=>{try{const w=await fetch(`/api/variants/ui-state${e}`);if(!w.ok||y)return;const _=await w.json();if(y)return;let x=_.uiState??s0;const b=o.current;o.current=[];for(const k of b)x=k(x);i.current=!0,s.current=x,r(x),b.length>0&&l(x)}catch(w){Ck.warn("load failed — arrangement is session-local until reload",w)}})(),()=>{y=!0}},[t,e,l]);const u=m.useCallback(y=>{const w=y(s.current);s.current=w,r(w),i.current?l(w):o.current.push(y)},[l]),d=m.useCallback(y=>{const w=!s.current.pinned.includes(y);u(w?Pk(y):Bq(y))},[u]),f=m.useCallback(y=>{s.current.pinned.includes(y)||u(Pk(y))},[u]),p=m.useCallback((y,w)=>{u(Uq(y,w))},[u]),v=m.useMemo(()=>new Set(n.pinned),[n.pinned]);return{pinnedKeys:n.pinned,pinnedKeySet:v,listOrder:n.order,togglePin:d,pinItem:f,reorder:p}},Zq=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=m.useState(null),u=m.useCallback(p=>{const v=e.current;return v?Array.from(v.querySelectorAll(`[data-reorder-container="${CSS.escape(p)}"]`)):[]},[e]),d=m.useCallback(p=>{if(!n){o&&l(null);return}const v=e.current;if(!v)return;if(r){const b=v.querySelector(r);if(b){const k=b.getBoundingClientRect();if(p.clientY>=k.top&&p.clientY<=k.bottom){o&&l(null);return}}}if(s){const b=v.querySelector(s),k=b==null?void 0:b.getBoundingClientRect();if(!k||p.clientY<k.top||p.clientY>k.bottom){o&&l(null);return}}const y=u(n.container);if(y.length===0){o&&l(null);return}const w=v.getBoundingClientRect().top;let _=y.length;for(let b=0;b<y.length;b++){const k=y[b].getBoundingClientRect();if(p.clientY<k.top+k.height/2){_=b;break}}let x;_===0?x=y[0].getBoundingClientRect().top-w-1:_===y.length?x=y[y.length-1].getBoundingClientRect().bottom-w:x=(y[_-1].getBoundingClientRect().bottom+y[_].getBoundingClientRect().top)/2-w,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:x})},[e,n,o,u,r,s]),f=m.useCallback(()=>{if(!n||!o)return;l(null);const p=u(o.container).map(w=>w.dataset.reorderKey).filter(w=>!!w),v=p.indexOf(n.key);if(v===-1)return;p.splice(v,1);const y=o.index>v?o.index-1:o.index;p.splice(y,0,n.key),i(o.container,p)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},QR=(t,e)=>`style:${t}:${e}`,JR=t=>`text:${t}`,eI=t=>{const e=[t.rivetId,t.xpath,t.cssSelector].filter(n=>!!n).map(n=>n.trim()).filter(Boolean);return e.length>0?[...new Set(e)]:["unknown"]},tI=t=>eI(t)[0],i0=(t,e)=>eI(t).includes(e),qq=t=>{const e=tI(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${QR(e,t.property)}${n}`:`${JR(e)}${n}`},nr=[];for(let t=0;t<256;++t)nr.push((t+256).toString(16).slice(1));function Gq(t,e=0){return(nr[t[e+0]]+nr[t[e+1]]+nr[t[e+2]]+nr[t[e+3]]+"-"+nr[t[e+4]]+nr[t[e+5]]+"-"+nr[t[e+6]]+nr[t[e+7]]+"-"+nr[t[e+8]]+nr[t[e+9]]+"-"+nr[t[e+10]]+nr[t[e+11]]+nr[t[e+12]]+nr[t[e+13]]+nr[t[e+14]]+nr[t[e+15]]).toLowerCase()}const Kq=new Uint8Array(16);function Yq(){return crypto.getRandomValues(Kq)}function Ak(t,e,n){return crypto.randomUUID?crypto.randomUUID():Xq(t)}function Xq(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??Yq();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Gq(r)}const Qq=300;class Jq{constructor(){Jo(this,"history",{current:new Map,past:[],future:[]});Jo(this,"pendingChanges",new Map);Jo(this,"currentBatchId",null);Jo(this,"debounceTimer",null);Jo(this,"onChangeCallbacks",[]);Jo(this,"stateBeforePending",null);Jo(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=Ak(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=tI(e.elementId),r=e.type==="style"?QR(n,e.property):JR(n),s=Array.from(this.history.current.entries()).find(([o])=>o===r||o.startsWith(`${r}:`));if(s){const o=s[1];e.type==="style"&&o.type==="style"?e.oldValue=o.oldValue:e.type==="text"&&o.type==="text"&&(e.oldText=o.oldText)}const i=qq(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},Qq),this.notifyChange()}flushPending(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.commitPending()}removeChange(e){const n=this.history.current.get(e)??this.pendingChanges.get(e)??null,r=this.history.current.has(e),s=this.pendingChanges.has(e);return!r&&!s?null:(r&&this.history.current.delete(e),s&&this.pendingChanges.delete(e),n&&this.stateBeforePending&&(this.stateBeforePending=this.removeChangeFromSnapshotById(this.stateBeforePending,n.id)),s&&this.pendingChanges.size===0&&(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.stateBeforePending=null,this.currentBatchId=null),r&&(this.history.future=[]),n&&(this.history.past=this.history.past.map(i=>this.removeChangeFromSnapshotById(i,n.id)).filter(i=>i.size>0)),this.notifyChange(),n)}removeChangeById(e){const n=Array.from(this.history.current.entries()).find(([,s])=>s.id===e);if(n)return this.removeChange(n[0]);const r=Array.from(this.pendingChanges.entries()).find(([,s])=>s.id===e);return r?this.removeChange(r[0]):null}removeChangeFromSnapshotById(e,n){return new Map(Array.from(e.entries()).filter(([,r])=>r.id!==n))}commitPending(){this.pendingChanges.size===0||!this.stateBeforePending||this.transactionDepth>0||(this.history.past.push(this.stateBeforePending),this.history.future=[],this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange())}undo(){if(this.pendingChanges.size>0&&this.commitPending(),this.history.past.length===0)return null;const e=new Map(this.history.current);this.history.future.push(e),this.history.current=this.history.past.pop(),this.notifyChange();const n=[];for(const[r,s]of e)this.history.current.has(r)||n.push(s);return n}redo(){if(this.history.future.length===0)return null;const e=new Map(this.history.current);this.history.past.push(e),this.history.current=this.history.future.pop(),this.notifyChange();const n=[];for(const[r,s]of this.history.current)e.has(r)||n.push(s);return n}getChanges(){return Array.from(this.history.current.values())}getStyleChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="style")}getTextChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="text")}getChangeCount(){return this.getUniqueBatchCount(this.history.current.values())}getStyleBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="style"))}getTextBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="text"))}getUniqueBatchCount(e){const n=new Set;for(const r of e)r.batchId?n.add(r.batchId):n.add(r.id);return n.size}canUndo(){return this.history.past.length>0||this.pendingChanges.size>0}canRedo(){return this.history.future.length>0}clear(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.history={current:new Map,past:[],future:[]},this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange()}getStyleChange(e,n){return Array.from(this.history.current.values()).filter(s=>s.type==="style"&&i0(s.elementId,e)&&s.property===n).sort((s,i)=>i.timestamp-s.timestamp)[0]}getTextChange(e){return Array.from(this.history.current.values()).filter(r=>r.type==="text"&&i0(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>i0(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>i0(n.elementId,e))}onChange(e){return this.onChangeCallbacks.push(e),()=>{const n=this.onChangeCallbacks.indexOf(e);n!==-1&&this.onChangeCallbacks.splice(n,1)}}notifyChange(){this.onChangeCallbacks.forEach(e=>e())}export(){return{current:Array.from(this.history.current.entries()),past:this.history.past.map(e=>Array.from(e.entries())),future:this.history.future.map(e=>Array.from(e.entries()))}}import(e){this.history={current:new Map(e.current),past:e.past.map(n=>new Map(n)),future:e.future.map(n=>new Map(n))},this.notifyChange()}async transaction(e){const n=this.pendingChanges.size===0;n&&(this.currentBatchId=Ak(),this.stateBeforePending=new Map(this.history.current)),this.transactionDepth++;try{await e()}catch(r){throw n&&this.stateBeforePending&&(this.history.current=new Map(this.stateBeforePending),this.pendingChanges.clear(),this.currentBatchId=null,this.stateBeforePending=null),r}finally{this.transactionDepth--,n&&this.transactionDepth===0&&this.flushPending()}}}const Im={kind:"base"};function Ff(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function eG(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const tG={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},designContextViewer:{default:!1},variantReferences:{default:!1},inspectorUndoRedo:{default:!1}},nI=Object.fromEntries(Object.entries(tG).map(([t,e])=>[t,{isEnabled:e.default}]));ct("view");const rI=ct(!0),sI=ct(null),nG=ct("chat"),iI=ct(0),oI=ct({name:null,email:null}),Tk=ct(Im);ct(null);const Vf=new Map,rG=t=>{const e=Ff(t);let n=Vf.get(e);return n||(n=new Jq,Vf.set(e,n)),n};ct(t=>rG(t(Tk)),(t,e,n)=>{Vf.set(Ff(t(Tk)),n)});const sG=t=>{for(const e of[...Vf.keys()])e==="base"||t.has(e)||Vf.delete(e)},$f=ct(new Map),Rk=ct(null);ct(null);const R_=ct(0),Mm=ct(null),I_=ct(!1),M_=ct(null),aI=ct(!1),lI=ct(!1),O_=ct(null),L_=ct(null),Lu=ct(null),Wx=ct(null),To=ct(null),dh=ct({active:!1}),cI=ct([]),Ik=ct(null),iG=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,o]of t)o.target&&eG(o.target,e)&&(s.set(i,{...o,target:n}),r=!0);return r?s:t},oG=ct(null,(t,e,n)=>{const r=u=>{const d=u??Im;return d.kind==="variant"&&!n.has(Ff(d))},s=t($f);let i=null;for(const[u,d]of s)r(d.target)&&(i??(i=new Set)).add(u);if(i){const u=new Map(s);for(const d of i)u.delete(d);e($f,u)}const o=t(Rk);o&&r(o.target)&&(e(Rk,null),e(uG,!1));const l=t(Ik);l&&(i!=null&&i.has(l.commentId))&&e(Ik,null),sG(n)}),D_=ct(nI),aG=ct(!1),uI=ct(null),fh=ct(!0),dI=ct(!1),fI=ct(!1),hI=ct(null),lG=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},uv=ct(lG()),cG=ct(null),uG=ct(!1);ct(0);ct(0);function dG(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const fG=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Zx=({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:fG.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),pI=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:u})=>{const[d,f]=m.useState(!1),p=i?o??t:t,v=u.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 ${v?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),v?S.jsxs(Vx,{open:d,onOpenChange:f,children:[S.jsx($x,{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(RZ,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(Hx,{children:S.jsx(zx,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(y=>{const w=y.icon;return S.jsxs("button",{onClick:()=>{y.isDisabled||(y.onClick(),f(!1))},disabled:y.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:[w?S.jsx(w,{className:"h-3.5 w-3.5",weight:"bold"}):null,y.label]},y.label)})})})]}):null]})};var hG=Object.defineProperty,pG=(t,e)=>hG(t,"name",{value:e,configurable:!0}),mG=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"}),vG=m.forwardRef(pG(function(e,n){return S.jsx(Sn.span,{...e,ref:n,style:{...mG,...e.style}})},"VisuallyHidden")),gG=vG,yG=Object.defineProperty,Kn=(t,e)=>yG(t,"name",{value:e,configurable:!0}),[qx,ine]=Ui("Tooltip",[av]),Gx=av(),_G="TooltipProvider",wG=700,N_="tooltip.open",[xG,Kx]=qx(_G),bG=Kn(t=>{const{__scopeTooltip:e,delayDuration:n=wG,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=m.useRef(!0),l=m.useRef(!1),u=m.useRef(0);return m.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),S.jsx(xG,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),j_="Tooltip",[SG,hh]=qx(j_),EG=Kn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=Kx(j_,t.__scopeTooltip),d=Gx(e),[f,p]=m.useState(null),[v,y]=m.useState(void 0),w=_a(),_=m.useRef(0),x=o??u.disableHoverableContent,b=l??u.delayDuration,k=m.useRef(!1),[C,P]=La({prop:r,defaultProp:s??!1,onChange:Kn(D=>{D?(u.onOpen(),document.dispatchEvent(new CustomEvent(N_))):u.onClose(),i==null||i(D)},"onChange"),caller:j_}),T=m.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),O=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k.current=!1,P(!0)},[P]),M=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,P(!1)},[P]),R=m.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{k.current=!0,P(!0),_.current=0},b)},[b,P]);m.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const L=v??w;return S.jsx(nR,{...d,children:S.jsx(SG,{scope:e,contentId:L,setContentId:y,open:C,stateAttribute:T,trigger:f,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{u.isOpenDelayedRef.current?R():O()},[u.isOpenDelayedRef,R,O]),onTriggerLeave:m.useCallback(()=>{x?M():(window.clearTimeout(_.current),_.current=0)},[M,x]),onOpen:O,onClose:M,disableHoverableContent:x,children:n})})},"Tooltip"),Mk="TooltipTrigger",kG=m.forwardRef(Kn(function(e,n){const{__scopeTooltip:r,...s}=e,i=hh(Mk,r),o=Kx(Mk,r),l=Gx(r),u=m.useRef(null),d=Yt(n,u,i.onTriggerChange),f=m.useRef(!1),p=m.useRef(!1),v=m.useCallback(()=>f.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),S.jsx(rR,{asChild:!0,...l,children:S.jsx(Sn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:Gt(e.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:Gt(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:Gt(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Gt(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Gt(e.onBlur,i.onClose),onClick:Gt(e.onClick,i.onClose)})})},"TooltipTrigger")),mI="TooltipPortal",[CG,PG]=qx(mI,{forceMount:void 0}),AG=Kn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=hh(mI,e);return S.jsx(CG,{scope:e,forceMount:n,children:S.jsx(Da,{present:n||i.open,children:S.jsx(yx,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),Hf="TooltipContent",TG=m.forwardRef(Kn(function(e,n){const r=PG(Hf,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=hh(Hf,e.__scopeTooltip);return S.jsx(Da,{present:s||l.open,children:l.disableHoverableContent?S.jsx(vI,{side:i,...o,ref:n}):S.jsx(RG,{side:i,...o,ref:n})})},"TooltipContent")),RG=m.forwardRef(Kn(function(e,n){const r=hh(Hf,e.__scopeTooltip),s=Kx(Hf,e.__scopeTooltip),i=m.useRef(null),o=Yt(n,i),[l,u]=m.useState(null),{trigger:d,onClose:f}=r,p=i.current,{onPointerInTransitChange:v}=s,y=m.useCallback(()=>{u(null),v(!1)},[v]),w=m.useCallback((_,x)=>{const b=_.currentTarget,k={x:_.clientX,y:_.clientY},C=gI(k,b.getBoundingClientRect()),P=yI(k,C),T=_I(x.getBoundingClientRect()),O=xI([...P,...T]);u(O),v(!0)},[v]);return m.useEffect(()=>()=>y(),[y]),m.useEffect(()=>{if(d&&p){const _=Kn(b=>w(b,p),"handleTriggerLeave"),x=Kn(b=>w(b,d),"handleContentLeave");return d.addEventListener("pointerleave",_),p.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",_),p.removeEventListener("pointerleave",x)}}},[d,p,w,y]),m.useEffect(()=>{if(l){const _=Kn(x=>{const b=x.target,k={x:x.clientX,y:x.clientY},C=(d==null?void 0:d.contains(b))||(p==null?void 0:p.contains(b)),P=!wI(k,l);C?y():P&&(y(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,p,l,f,y]),S.jsx(vI,{...e,ref:o})},"TooltipContentHoverable")),IG=oT("TooltipContent"),vI=m.forwardRef(Kn(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=hh(Hf,r),p=Gx(r),{onClose:v}=f;m.useEffect(()=>(document.addEventListener(N_,v),()=>document.removeEventListener(N_,v)),[v]),m.useEffect(()=>{if(f.trigger){const w=Kn(_=>{_.target instanceof Node&&_.target.contains(f.trigger)&&v()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[f.trigger,v]);const{setContentId:y}=f;return Br(()=>(y(o),()=>{y(void 0)}),[o,y]),S.jsx(mx,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:w=>w.preventDefault(),onDismiss:v,children:S.jsxs(sR,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...p,...d,ref:n,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(IG,{children:s}),i?S.jsx(gG,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function gI(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")}}Kn(gI,"getExitSideFromRect");function yI(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}Kn(yI,"getPaddedExitPoints");function _I(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}]}Kn(_I,"getPointsFromRect");function wI(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],u=e[o],d=l.x,f=l.y,p=u.x,v=u.y;f>r!=v>r&&n<(p-d)*(r-f)/(v-f)+d&&(s=!s)}return s}Kn(wI,"isPointInPolygon");function xI(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),bI(e)}Kn(xI,"getHull");function bI(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)}Kn(bI,"getHullPresorted");var MG=bG,OG=EG,LG=kG,DG=AG,NG=TG;const mf={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},SI={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"}},EI=m.createContext(null);function dv(){const t=m.useContext(EI);return t?t.classes:SI.pill}function jG(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function FG({children:t,defaultShape:e="pill"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{jG(()=>r(i))},[]);return S.jsx(EI.Provider,{value:{shape:n,setShape:s,classes:SI[n]},children:t})}const kI=m.createContext(null);function CI({value:t,children:e}){return S.jsx(kI.Provider,{value:t,children:e})}function VG(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Yx({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[u,d]=m.useState(!1),f=o!==void 0?o:u,[p,v]=m.useState(!1),y=dv(),w=m.useContext(kI);m.useEffect(()=>{f&&v(!0)},[f]);const _=()=>{f||v(!1)},x=VG(n);return S.jsx(MG,{delayDuration:s,children:S.jsxs(OG,{open:f,onOpenChange:b=>{d(b),l==null||l(b)},children:[S.jsx(LG,{asChild:!0,children:e}),p&&S.jsx(DG,{forceMount:!0,container:w??void 0,children:S.jsx(NG,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(Eo.div,{className:$n("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",y.bg,i),style:{fontVariationSettings:mf.medium},initial:{opacity:0,scale:.8,...x},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 Gl=({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(Yx,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),fv="/__rivet/preview",Ok=`${fv}/variant/`,Lk=`${fv}/history/`,PI=t=>t?t.startsWith("/")?t:`/${t}`:"/",$G=t=>`${fv}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${PI(t.routePath)}`,HG=t=>`${fv}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${PI(t.routePath)}`,zG=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(Ok)||e.pathname.startsWith(Lk)}catch{return t.startsWith(Ok)||t.startsWith(Lk)}},Dk=t=>{var s,i,o,l;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?n.preview.url:e&&(((i=n.preview)==null?void 0:i.kind)==="dev_server"||typeof n.port=="number")?$G({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((o=r.executionPlan)==null?void 0:o.mode)!=="vite_app"&&((l=n.preview)==null?void 0:l.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},Nk="/rivet/",AI=t=>{if(!t.startsWith(Nk))return null;const e=t.slice(Nk.length);return!e||e==="/"?null:`/${e}`},Du=(t,e=fetch)=>{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(()=>{})},BG=(t,e=fetch)=>{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),Du(r,e))}},Om=(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}}},jk=6,TI="original",Xx="Original",RI="The original state of your app before any variants were generated.",Fk=200,F_=[.33,1,.68,1],V_=.22,xn=Es("AgentVariantsPanel"),py=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},Nc=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},UG=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function my(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const WG=(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},II=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},ZG="original",$_="pinned-section";function MI(t){return`rivet:collapsedRuns:${t}`}function o0(t){try{const e=window.localStorage.getItem(MI(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 vy(t,e){try{window.localStorage.setItem(MI(t),JSON.stringify([...e]))}catch{}}const Vk=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=WG(s,e);let o="";s.kind==="original"?o=ZG:i&&(o=II(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 Ei(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 qG=t=>{var n,r;const e=((r=(n=t.actions)==null?void 0:n.commit)==null?void 0:r.enabled)??t.status==="succeeded";return t.status==="succeeded"&&e},vf=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")},OI=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},GG=t=>t.status==="succeeded"&&!vf(t)&&(!t.previewUnavailable||OI(t)),gy=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"},$k=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},KG=t=>{var e;return qG(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},Hk=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),YG=(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&&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}),XG=()=>{var rc,qa,qs,Gs;const t=rt(dh),e=rt(cI),n=rt(uI),r=rt(fh),s=rt(D_),i=((rc=s.deployPrototype)==null?void 0:rc.isEnabled)??!1,o=((qa=s.canvasShare)==null?void 0:qa.isEnabled)??!1,l=((qs=s.variantSend)==null?void 0:qs.isEnabled)??!1,u=((Gs=s.designContextViewer)==null?void 0:Gs.isEnabled)??!1,d=rt(fI),f=rt(hI),p=mt(R_),v=mt(Mm),y=mt(I_),w=mt(M_),_=mt(aI),x=mt(lI),b=mt(Lu),k=rt(Lu),C=mt(Wx),P=mt(sI);m.useEffect(()=>(P("Directions"),()=>P(null)),[P]);const T=rt(To),O=mt(To),M=m.useCallback((F=!1)=>{if(BG(T),O(null),F&&T){const ae=Om("ended",T);ke.capture(ae.event,ae.properties)}},[O,T]),R=rt(O_),L=mt(O_),D=rt(L_),V=mt(L_),j=D?`${D.sessionId}:${D.variantId}`:null,[U,X]=m.useState(""),[q,Z]=m.useReducer(F=>F+1,0),Y=m.useMemo(()=>n!==null?o0(n):new Set,[n,q]),H=m.useCallback(F=>{if(n===null)return;const ae=new Set(o0(n));ae.delete(F)||ae.add(F),vy(n,ae),Z()},[n]),[Q,z]=m.useState(null),[N,G]=m.useState(null),[oe,se]=m.useState(!1),[ee,de]=m.useState({}),[ve,le]=m.useState(null),[te,Pe]=m.useState({}),[Se,Ne]=m.useState(null),[Xe,Qe]=m.useState([]),lt=m.useRef([]);lt.current=Xe;const[ut,je]=m.useState(!1),st=m.useRef(!1);st.current=D!==null||R!==null||ut;const Be=m.useMemo(()=>t.active?t.variants:[],[t]),ft=m.useMemo(()=>Be.filter(KG),[Be]),Me=m.useMemo(()=>Hk(ft,ee),[ft,ee]),We=(ve==null?void 0:ve.key)===Me?ve.shareUrl:null,xe=t.active?t.sessionId:null,St=m.useMemo(()=>{const F=new Set;for(const ae of Be)ae.adoptedSource&&F.add(`${ae.adoptedSource.sessionId}:${ae.adoptedSource.variantId}`);return F},[Be]),Rt=m.useMemo(()=>[...Xe.filter(ae=>ae.sessionId!==xe&&!St.has(`${ae.sessionId}:${ae.variantId}`))].sort((ae,Ce)=>{const he=new Date(ae.createdAt).getTime(),_e=new Date(Ce.createdAt).getTime();return(Number.isNaN(_e)?0:_e)-(Number.isNaN(he)?0:he)}),[St,Xe,xe]),Ar=m.useMemo(()=>D?Be.find(F=>{var ae,Ce;return((ae=F.adoptedSource)==null?void 0:ae.sessionId)===D.sessionId&&((Ce=F.adoptedSource)==null?void 0:Ce.variantId)===D.variantId})??null:null,[D,Be]),Bs=m.useMemo(()=>D?Rt.find(F=>F.sessionId===D.sessionId&&F.variantId===D.variantId)??null:null,[D,Rt]),En=t.active?t.projectContext:null,kn=(En==null?void 0:En.kind)==="fresh"?En.workspacePath:n,Us=!t.active&&Rt.length>0&&Rt.every(F=>F.projectKind==="fresh"),Hn=t.active?UG(En):!!n&&!Us,Tr=m.useMemo(()=>kn?`?projectPath=${encodeURIComponent(kn)}`:"",[kn]),{pinnedKeys:Yr,pinnedKeySet:Lo,listOrder:$a,togglePin:Ws,pinItem:Zi,reorder:Xn}=Wq(kn),qi=m.useRef(null),_r=m.useRef(null),yn=typeof window>"u"?"/":AI(window.location.pathname)??"/",Cn=m.useRef(null),Xr=m.useRef(!1),Ha=m.useCallback((F,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),py(),Cn.current={kind:"live",variantId:F,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]),za=m.useCallback((F,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),py(),Cn.current={kind:"past",entry:F,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]);m.useEffect(()=>{const F=he=>{const _e=Cn.current;if(!_e)return;const Ee=he.clientX-_e.startX,Ze=he.clientY-_e.startY;if(!_e.committed){if(Ee*Ee+Ze*Ze<jk*jk)return;if(py(),_e.kind==="live"){const Te=Be.find(_n=>_n.workItemId===_e.variantId);if(!Te||Te.status!=="succeeded"){Cn.current=null;return}const dn=Dk({sessionId:xe,variant:Te,projectContext:En,routePath:yn});b({sessionId:xe??"",variantId:Te.workItemId,label:Te.label||"Direction",url:dn,source:"live",runLabel:Te.runLabel,description:Te.description})}else{const{entry:Te}=_e,dn=Nc(Te),_n=dn?HG({sessionId:Te.sessionId,variantId:Te.variantId,routePath:yn}):`/api/variants/history/${encodeURIComponent(Te.sessionId)}/${encodeURIComponent(Te.variantId)}/preview${Tr}`;if(b({sessionId:Te.sessionId,variantId:Te.variantId,label:Te.label||"Direction",url:_n,source:dn?"history-dev-server":"history-static",runLabel:Te.runLabel,description:Te.brief}),dn){const ts=$k(`/api/variants/history/${encodeURIComponent(Te.sessionId)}/${encodeURIComponent(Te.variantId)}/run${Tr}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(ts,{method:"POST"})).ok)return;const Jn=$k(_n,"replay",String(Date.now()));b(nt=>!nt||nt.sessionId!==Te.sessionId||nt.variantId!==Te.variantId||nt.source!=="history-dev-server"?nt:{...nt,url:Jn}),O(nt=>{if(!nt)return nt;const At=Cs=>!Cs||Cs.sessionId!==Te.sessionId||Cs.variantId!==Te.variantId?Cs:{...Cs,url:Jn};return{...nt,left:At(nt.left),right:At(nt.right)}})}catch(ns){xn.warn("history replay drag boot failed",ns)}})()}}_e.committed=!0}C({x:he.clientX,y:he.clientY})},ae=()=>{const he=Cn.current;he!=null&&he.committed&&(Xr.current=!0,window.setTimeout(()=>{Xr.current=!1},0)),Cn.current=null,C(null)},Ce=he=>{if(he.key!=="Escape")return;const _e=Cn.current;_e!=null&&_e.committed&&(_e.kind==="past"&&Nc(_e.entry)&&Du({sessionId:_e.entry.sessionId,variantId:_e.entry.variantId,source:"history-dev-server"}),Cn.current=null,b(null),C(null))};return window.addEventListener("pointermove",F),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",ae),window.addEventListener("keydown",Ce),()=>{window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",ae),window.removeEventListener("keydown",Ce)}},[Be,xe,En,yn,Tr,b,C,O]);const Ue=m.useCallback(()=>{var F;(F=Cn.current)!=null&&F.committed&&(Xr.current=!0,window.setTimeout(()=>{Xr.current=!1},0)),Cn.current=null,C(null),k&&(k.source==="history-dev-server"&&Du({sessionId:k.sessionId,variantId:k.variantId,source:"history-dev-server"}),b(null))},[k,b,C]),Jt=m.useCallback(F=>{const ae=!Lo.has(F);ke.capture(ae?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:"menu"}),Ws(F)},[Lo,Ws]),cn=m.useCallback(()=>{k&&(ke.capture("variants_panel.direction_pinned",{method:"drag"}),Zi(`row:past:${k.sessionId}:${k.variantId}`),Ue())},[k,Ue,Zi]),On=m.useCallback(F=>{ke.capture("variants_panel.direction_unpinned",{method:"drag"}),Ws(F),Ue()},[Ws,Ue]),Qr=m.useCallback((F,ae)=>{Xn(F,ae),Ue()},[Xn,Ue]),_t=m.useMemo(()=>{var ae;if(ut||j)return null;const F=R?Be.find(Ce=>Ce.workItemId===R):null;return R&&!F?null:F?vf(F)?F.workItemId:null:t.active?((ae=Be.find(Ce=>{var he,_e;return vf(Ce)&&(((he=Ce.preview)==null?void 0:he.kind)==="static_artifact"||((_e=Ce.preview)==null?void 0:_e.kind)==="dev_server")}))==null?void 0:ae.workItemId)??null:null},[R,j,ut,t,Be]),un=ut||Hn&&R===null&&j===null&&_t===null,Qn=m.useCallback(async F=>{var Ce,he,_e,Ee;if(!xe)return;const ae=(F==null?void 0:F.workItemId)??null;z({kind:"switch",variantId:ae??void 0});try{if(((Ce=F==null?void 0:F.preview)==null?void 0:Ce.kind)==="static_artifact"){if(y(!1),w(null),((he=F.refinement)==null?void 0:he.status)==="succeeded"){const Te=F.preview.url.includes("?")?"&":"?";v(`${F.preview.url}${Te}refinement=${encodeURIComponent(F.refinement.workItemId)}`)}else v(F.preview.url);p(Te=>Te+1);return}if(ae&&xe&&t.active&&t.projectContext.kind==="fresh"&&((_e=t.projectContext.executionPlan)==null?void 0:_e.mode)!=="vite_app"&&((Ee=F==null?void 0:F.preview)==null?void 0:Ee.kind)!=="dev_server"){y(!1),w(null),v(`/api/variants/${xe}/static/${ae}`),p(Te=>Te+1);return}const Ze=F&&ae?Dk({sessionId:xe,variant:F,projectContext:t.active?t.projectContext:null,routePath:yn}):null;if(Ze){y(!1),w(null),v(Ze),p(Te=>Te+1);return}ke.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:ae,previewKind:F?gy(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:"No addressable dev-server preview URL"}),y(!1),w(null)}catch(Ze){xn.warn("preview display failed",Ze),ke.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:ae,previewKind:F?gy(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:Ze instanceof Error?Ze.message:String(Ze)}),y(!1),w(null)}finally{z(null)}},[xe,t,yn,p,v,y,w]),Rr=m.useRef(!1),Pn=m.useRef(null),Jr=m.useRef(0),pi=m.useCallback(()=>{if(Jr.current++,_(!1),x(!1),!Rr.current)return;const F=Pn.current;Rr.current=!1,Pn.current=null;const ae=F?new URLSearchParams({sessionId:F.sessionId,variantId:F.variantId}):null,Ce=ae?`/api/variants/history/replay/stop?${ae.toString()}`:"/api/variants/history/replay/stop";fetch(Ce,{method:"POST"}).catch(he=>xn.warn("history replay stop failed",he))},[_,x]),yh=m.useCallback(async F=>{if(xe){z({kind:"switch",variantId:F.workItemId});try{const ae=await fetch(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:F.workItemId})});if(!ae.ok){const Ce=await Ei(ae);throw new Error(Ce.message??`Preview restoration failed (${ae.status})`)}}catch(ae){xn.warn("preview restoration failed",ae),ke.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:F.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ae instanceof Error?ae.message:String(ae)})}finally{z(null)}}},[xe]),Xl=m.useCallback(F=>{var Ee,Ze,Te,dn,_n;if(Xr.current){Xr.current=!1;return}const ae=vf(F),Ce=F.status==="pending"||F.status==="running"||GG(F);pi();const he=gy(F),_e=Be.find(ts=>ts.workItemId===R);ke.capture("variants_panel.preview_requested",{sessionId:xe,fromVariantId:_e==null?void 0:_e.workItemId,toVariantId:F.workItemId,variantStatus:F.status,isPreviewReady:ae,isArmed:Ce,previewKind:he,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((Ze=(Ee=F.actions)==null?void 0:Ee.view)==null?void 0:Ze.enabled)??null,previewUnavailableReason:((Te=F.previewUnavailable)==null?void 0:Te.reason)??null}),L(F.workItemId),V(null),ae?(_r.current=F.workItemId,je(!1),M(!0),Qn(F)):(_r.current=null,je(!1),v(null),y(!1),Ce&&ke.capture("variants_panel.preview_armed",{sessionId:xe,fromVariantId:_e==null?void 0:_e.workItemId,toVariantId:F.workItemId,variantStatus:F.status,previewKind:he,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((_n=(dn=F.actions)==null?void 0:dn.view)==null?void 0:_n.enabled)??null}),OI(F)&&yh(F)),ke.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:_e==null?void 0:_e.workItemId,toVariantId:F.workItemId,armed:Ce})},[R,xe,M,L,V,pi,yh,Qn,Be,v,y]),_h=t.active?`${t.sessionId}:${t.stage}`:"inactive",Zs=m.useRef(!1);m.useEffect(()=>{if(r)return;let F=!1;return(async()=>{try{const ae=await fetch(`/api/variants/history${Tr}`,{credentials:"same-origin"});if(!ae.ok)return;const Ce=await ae.json();if(F)return;const he=(Ce.variants??[]).filter(_e=>{var Ee,Ze;return((Ee=_e.preview)==null?void 0:Ee.kind)==="static"||((Ze=_e.serve)==null?void 0:Ze.kind)==="static"||Nc(_e)});if(!Zs.current&&!st.current&&_h==="inactive"&&he.length>0&&he.every(_e=>_e.projectKind==="fresh")){const _e=[...he].sort((Ee,Ze)=>new Date(Ze.createdAt).getTime()-new Date(Ee.createdAt).getTime()).find(Ee=>!Nc(Ee));_e&&(Zs.current=!0,V({sessionId:_e.sessionId,variantId:_e.variantId,previewKind:"static"}),je(!1),v(`/api/variants/history/${encodeURIComponent(_e.sessionId)}/${encodeURIComponent(_e.variantId)}/preview${Tr}`))}if(YG(lt.current,he))return;lt.current=he,Qe(he)}catch(ae){xn.warn("Failed to load past variants",ae)}})(),()=>{F=!0}},[r,_h,Tr]);const Ql=m.useCallback(()=>{Rr.current=!1,Pn.current=null,_(!1),x(!1),V(null),L(null),je(!0),y(!1),w(null),v(null),p(F=>F+1)},[L,_,x,p,v,w,V,y]),Jl=m.useCallback(F=>{if(Xr.current){Xr.current=!1;return}if(M(!0),V({sessionId:F.sessionId,variantId:F.variantId,previewKind:Nc(F)?"dev_server":"static"}),L(null),je(!1),Nc(F)){const ae=++Jr.current;Rr.current=!0,Pn.current={sessionId:F.sessionId,variantId:F.variantId},_(!0),x(!0),(async()=>{z({kind:"switch"}),ke.capture("variants_panel.history_replay_started",{sessionId:F.sessionId,variantId:F.variantId});const Ce=he=>ke.capture("variants_panel.history_replay_failed",{sessionId:F.sessionId,variantId:F.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/run${Tr}`,{method:"POST"});if(ae!==Jr.current)return;if(!he.ok){const{errorCode:_e}=await Ei(he);xn.warn(`history replay failed: HTTP ${he.status} ${_e??""}`),Ce({httpStatus:he.status,errorCode:_e}),Ql();return}x(!1),y(!0),w(null),v(null),p(_e=>_e+1),ke.capture("variants_panel.history_replay_ready",{sessionId:F.sessionId,variantId:F.variantId})}catch(he){if(ae!==Jr.current)return;xn.warn("history replay failed",he),Ce({errorMessage:he instanceof Error?he.message:String(he)}),Ql()}finally{z(null)}})();return}pi(),y(!1),w(null),v(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/preview${Tr}`)},[Ql,z,_,x,p,V,L,v,w,M,y,pi,Tr]),Ku=m.useCallback(async()=>{pi();const F=()=>{M(!0),L(null),V(null),je(!0),_r.current=null,y(!1),w(null),v(null),p(ae=>ae+1)};if(!xe){F();return}z({kind:"switch"});try{const ae=await fetch(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ae.ok){xn.warn(`switch to original failed: HTTP ${ae.status}`);return}F(),y(!0),ke.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:R,toVariantId:null,target:"original",armed:!1})}catch(ae){xn.warn("preview-port original switch failed",ae)}finally{z(null)}},[R,xe,L,V,p,v,w,M,y,pi]),wh=m.useCallback(async F=>{var Ce,he;const ae=((he=(Ce=F.actions)==null?void 0:Ce.commit)==null?void 0:he.enabled)??F.status==="succeeded";if(!(!xe||!ae)){ke.capture("variants_panel.commit_clicked",{sessionId:xe,variantId:F.workItemId,variantLabel:F.label}),z({kind:"commit",variantId:F.workItemId});try{const _e=await fetch(`/api/variants/${xe}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:F.workItemId})});if(!_e.ok){const{message:Ze,errorCode:Te}=await Ei(_e);xn.warn(`commit failed: HTTP ${_e.status} ${Te??""} ${Ze??""}`),ke.capture("variants_panel.commit_failed",{sessionId:xe,variantId:F.workItemId,httpStatus:_e.status,errorCode:Te??null,errorMessage:Ze??null}),bt.error("Couldn't send direction",{description:Ze??`The server rejected the request (HTTP ${_e.status}). Try again, or pick a different direction.`});return}const Ee=await _e.json().catch(()=>null);ke.capture("variants_panel.commit_succeeded",{sessionId:xe,variantId:F.workItemId,payloadKind:(Ee==null?void 0:Ee.payloadKind)??null,duplicate:(Ee==null?void 0:Ee.duplicate)??!1}),bt.success(`Sent "${F.label}" to your project`,{description:(Ee==null?void 0:Ee.payloadKind)==="project-created"?`Project created at ${(Ee==null?void 0:Ee.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Ee==null?void 0:Ee.payloadKind)!=="project-created"&&(v(null),y(!1),p(Ze=>Ze+1))}catch(_e){xn.warn("commit failed",_e),ke.capture("variants_panel.commit_failed",{sessionId:xe,variantId:F.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:_e instanceof Error?_e.message:String(_e)}),bt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{z(null)}}},[xe,p,v,y]),Ba=m.useCallback(async(F,ae,Ce)=>{ke.capture("variants_panel.deploy_clicked",{sessionId:F,variantId:ae,variantLabel:Ce});try{const he=await fetch(`/api/variants/${F}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ae,...n?{projectPath:n}:{}})});if(!he.ok){const{message:Ze,errorCode:Te}=await Ei(he);return xn.warn(`deploy failed: HTTP ${he.status} ${Te??""} ${Ze??""}`),ke.capture("variants_panel.deploy_failed",{sessionId:F,variantId:ae,httpStatus:he.status,errorCode:Te??null,errorMessage:Ze??null}),bt.error("Couldn't deploy this direction",{description:Ze??`The server rejected the request (HTTP ${he.status}). Try again.`}),null}const _e=await he.json().catch(()=>null),Ee=_e==null?void 0:_e.shareUrl;return Ee?(await navigator.clipboard.writeText(Ee).catch(()=>{}),ke.capture("variants_panel.deploy_succeeded",{sessionId:F,variantId:ae}),bt.success(`"${Ce}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}}),Ee):(bt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return xn.warn("deploy failed",he),ke.capture("variants_panel.deploy_failed",{sessionId:F,variantId:ae,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),bt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),xh=m.useCallback(async F=>{if(!xe)return;const ae=ee[F.workItemId];if(ae){await navigator.clipboard.writeText(ae).catch(()=>{}),bt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ae,"_blank","noopener")}});return}z({kind:"deploy",variantId:F.workItemId});try{const Ce=await Ba(xe,F.workItemId,F.label);Ce&&de(he=>({...he,[F.workItemId]:Ce}))}finally{z(null)}},[xe,ee,Ba]),bh=m.useCallback(async()=>{if(!(!xe||ft.length===0)){if(We){await navigator.clipboard.writeText(We).catch(()=>{}),bt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(We,"_blank","noopener")}});return}ke.capture("variants_panel.deploy_clicked",{sessionId:xe,variantId:"canvas",variantLabel:"Canvas",variantCount:ft.length}),z({kind:"deploy-canvas"});try{const F=await fetch(`/api/variants/${xe}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:ft.map(Ee=>Ee.workItemId),...n?{projectPath:n}:{}})});if(!F.ok){const{message:Ee,errorCode:Ze}=await Ei(F);xn.warn(`canvas deploy failed: HTTP ${F.status} ${Ze??""} ${Ee??""}`),ke.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:F.status,errorCode:Ze??null,errorMessage:Ee??null,variantCount:ft.length}),bt.error("Couldn't share this canvas",{description:Ee??`The server rejected the request (HTTP ${F.status}). Try again.`});return}const ae=await F.json().catch(()=>null),Ce=ae==null?void 0:ae.shareUrl;if(!Ce){bt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const he=Object.fromEntries(((ae==null?void 0:ae.variants)??[]).filter(Ee=>typeof Ee.variantId=="string"&&typeof Ee.shareUrl=="string").map(Ee=>[Ee.variantId,Ee.shareUrl])),_e=Object.keys(he).length>0?{...ee,...he}:ee;_e!==ee&&de(_e),await navigator.clipboard.writeText(Ce).catch(()=>{}),le({key:Hk(ft,_e),shareUrl:Ce}),ke.capture("variants_panel.deploy_succeeded",{sessionId:xe,variantId:"canvas",variantCount:ft.length}),bt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Ce,"_blank","noopener")}})}catch(F){xn.warn("canvas deploy failed",F),ke.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:F instanceof Error?F.message:String(F),variantCount:ft.length}),bt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{z(null)}}},[We,ft,ee,n,xe]),wv=m.useCallback(async F=>{const ae=`${F.sessionId}:${F.variantId}`,Ce=te[ae];if(Ce){await navigator.clipboard.writeText(Ce).catch(()=>{}),bt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Ce,"_blank","noopener")}});return}Ne(ae);try{const he=await Ba(F.sessionId,F.variantId,F.label);he&&Pe(_e=>({..._e,[ae]:he}))}finally{Ne(null)}},[te,Ba]),Yu=m.useCallback(async F=>{if(xe){ke.capture("variants_panel.remove_clicked",{sessionId:xe,variantId:F.workItemId,variantLabelLength:F.label.length}),z({kind:"remove",variantId:F.workItemId});try{const ae=await fetch(`/api/variants/${xe}/${F.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ae.ok){const{message:Ce}=await Ei(ae);xn.warn(`remove failed: HTTP ${ae.status} ${Ce??""}`),bt.error("Couldn't remove direction",{description:Ce??`The server rejected the request (HTTP ${ae.status}). Try again.`});return}(F.workItemId===_t||F.workItemId===R)&&(L(null),v(null),y(!1),p(Ce=>Ce+1))}catch(ae){xn.warn("remove failed",ae),bt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{z(null)}}},[xe,R,_t,L,v,y,p]),zt=m.useCallback(async F=>{if(!kn){bt.error("Couldn't remove direction",{description:"No project path available."});return}ke.capture("variants_panel.remove_past_clicked",{sessionId:F.sessionId,variantId:F.variantId});const ae=`${F.sessionId}:${F.variantId}`,Ce=he=>he.sessionId===F.sessionId&&he.variantId===F.variantId;z({kind:"remove",variantId:ae}),Qe(he=>he.filter(_e=>!Ce(_e))),j===ae&&(V(null),v(null),y(!1),p(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:kn})});if(!he.ok){const{message:_e}=await Ei(he);Qe(Ee=>Ee.some(Ce)?Ee:[...Ee,F]),bt.error("Couldn't remove direction",{description:_e??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){xn.warn("remove past failed",he),Qe(_e=>_e.some(Ce)?_e:[..._e,F]),bt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{z(null)}},[kn,j,V,v,y,p]),Sh=m.useCallback(F=>{G(F)},[]),Xu=m.useCallback(F=>{if(!F.label||!F.run)return;const ae=F.rows.flatMap(he=>he.kind==="active"?[he.variant]:[]),Ce=F.rows.flatMap(he=>he.kind==="past"?[he.entry]:[]);ae.length===0&&Ce.length===0||G({kind:"run",label:F.label,variants:ae,entries:Ce})},[]),Eh=m.useCallback(async()=>{if(!(!N||oe)){se(!0);try{if(N.kind==="active")await Yu(N.variant);else if(N.kind==="past")await zt(N.entry);else{for(const F of N.variants)await Yu(F);for(const F of N.entries)await zt(F)}}finally{se(!1),G(null)}}},[N,oe,Yu,zt]),[Ua,xv]=m.useState(null),[kh,Do]=m.useState(null),ks=m.useCallback(F=>{Do(F)},[]),bv=m.useCallback(()=>{Do(null)},[]),es=m.useCallback(async F=>{const ae=F.trim();if(ae)try{await navigator.clipboard.writeText(ae),bt.success("Copied")}catch{bt.error("Couldn't copy")}},[]),Sv=m.useCallback(async(F,ae)=>{Do(null);const Ce=ae.trim();if(!Ce||F.kind==="original")return;if(F.kind==="active"){if(!xe||Ce===F.variant.label)return;ke.capture("variants_panel.rename",{sessionId:xe,variantId:F.variant.workItemId,labelLength:Ce.length,past:!1});try{const Ee=await fetch(`/api/variants/${xe}/${F.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ce})});if(!Ee.ok){const{message:Ze}=await Ei(Ee);bt.error("Couldn't rename direction",{description:Ze??`The server rejected the request (HTTP ${Ee.status}). Try again.`})}}catch(Ee){xn.warn("rename failed",Ee),bt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=F;if(Ce===he.label.trim())return;if(!kn){bt.error("Couldn't rename direction",{description:"No project path available."});return}ke.capture("variants_panel.rename",{sessionId:he.sessionId,variantId:he.variantId,labelLength:Ce.length,past:!0});const _e=Ee=>Ee.sessionId===he.sessionId&&Ee.variantId===he.variantId;Qe(Ee=>Ee.map(Ze=>_e(Ze)?{...Ze,label:Ce}:Ze));try{const Ee=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ce,projectPath:kn})});if(!Ee.ok){const{message:Ze}=await Ei(Ee);Qe(Te=>Te.map(dn=>_e(dn)?{...dn,label:he.label}:dn)),bt.error("Couldn't rename direction",{description:Ze??`The server rejected the request (HTTP ${Ee.status}). Try again.`})}}catch(Ee){xn.warn("rename failed",Ee),Qe(Ze=>Ze.map(Te=>_e(Te)?{...Te,label:he.label}:Te)),bt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[xe,kn]),[Ev,Qu]=m.useState(null),ec=m.useCallback(F=>{Qu(F)},[]),tc=m.useCallback(()=>{Qu(null)},[]),Wa=m.useCallback(async(F,ae)=>{if(Qu(null),!F.label||!F.run)return;const Ce=F.label,he=ae.trim();if(!he||he===Ce)return;ke.capture("variants_panel.rename_run",{runLabelLength:he.length});const _e="requestId"in F.run?F.run.requestId:void 0,Ee=_e?F.key:II({sessionId:F.run.sessionId,runLabel:he}),Ze=Ee!==F.key;let Te=!1,dn=!1;if(n!==null&&Ze){const nt=o0(n);Te=nt.has(F.key),dn=nt.has(Ee),Te&&(nt.add(Ee),vy(n,nt),Z())}const _n=nt=>{if(n===null||!Ze)return;const At=o0(n);nt?At.delete(F.key):(Te?At.add(F.key):At.delete(F.key),dn?At.add(Ee):At.delete(Ee)),vy(n,At),Z()},ts=new Set(F.rows.flatMap(nt=>nt.kind==="past"?[`${nt.entry.sessionId}:${nt.entry.variantId}`]:[])),ns=nt=>ts.has(`${nt.sessionId}:${nt.variantId}`);Qe(nt=>nt.map(At=>ns(At)?{...At,runLabel:he}:At));const Jn=()=>Qe(nt=>nt.map(At=>ns(At)?{...At,runLabel:Ce}:At));try{const nt=await fetch("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:F.run.sessionId,..._e?{requestId:_e}:{},runLabel:Ce,label:he,...kn?{projectPath:kn}:{}})});if(nt.ok)_n(!0);else{const{message:At}=await Ei(nt);Jn(),_n(!1),bt.error("Couldn't rename run",{description:At??`The server rejected the request (HTTP ${nt.status}). Try again.`})}}catch(nt){xn.warn("run rename failed",nt),Jn(),_n(!1),bt.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[kn,n,Qe]);m.useEffect(()=>{if(qi.current!==xe){const ae=qi.current===null;if(qi.current=xe,_r.current=null,le(null),v(null),y(!1),w(null),M(),L(null),V(null),je(!1),Zs.current=!1,!ae)return}if(j||ut||!_t||t.active!==!0||_r.current===_t)return;const F=Be.find(ae=>ae.workItemId===_t);F&&(_r.current=_t,M(),Qn(F))},[xe,j,ut,_t,t,Be,Qn,M,L,V,v,w,y]),m.useEffect(()=>{!D||!Ar||(_r.current=null,V(null),L(Ar.workItemId),je(!1))},[Ar,D,xe,L,V]),m.useEffect(()=>{!D||Ar||Bs||V(null)},[Ar,D,Bs,xe,V,Rt]),m.useEffect(()=>{const F=U.trim().toLowerCase(),ae=[...Be.map(Te=>({kind:"active",variant:Te})),...Rt.map(Te=>({kind:"past",entry:Te})),...Hn?[{kind:"original"}]:[]],Ce=F?ae.filter(Te=>zk(Te,F)):ae,{pinned:he,unpinned:_e}=Bk(Wk(Vk(Ce,xe),$a),Yr,xe),Ee=[...Y.has($_)?[]:he,..._e.flatMap(Te=>Te.key!==""&&Y.has(Te.key)?[]:Te.rows)];if(Ee.length===0)return;const Ze=Te=>{if(Lq())return;if(Te.key==="Enter"){const At=Be.find(Cs=>Cs.workItemId===Ua);At&&(Te.preventDefault(),Xl(At));return}if(Te.key!=="ArrowUp"&&Te.key!=="ArrowDown")return;Te.preventDefault();const dn=R??_t;let _n=dn?`live:${dn}`:null;j?_n=`past:${j}`:un&&(_n=TI);const ts=_n?Ee.findIndex(At=>Nu(At)===_n):-1;let ns;if(ts===-1?ns=Te.key==="ArrowDown"?0:Ee.length-1:Te.key==="ArrowDown"?ns=Math.min(ts+1,Ee.length-1):ns=Math.max(ts-1,0),ns===ts)return;const Jn=Ee[ns];Jn.kind==="active"?Xl(Jn.variant):Jn.kind==="past"?Jl(Jn.entry):Ku();const nt=document.querySelector(`[data-variant-key="${Nu(Jn)}"]`);nt instanceof HTMLElement&&nt.focus({preventScroll:!0})};return window.addEventListener("keydown",Ze),()=>window.removeEventListener("keydown",Ze)},[Be,Rt,U,Hn,Y,Yr,$a,xe,R,j,un,_t,Ua,Xl,Jl,Ku]);const No=Be.find(F=>F.workItemId===_t)??null,Ju=j?Rt.find(F=>`${F.sessionId}:${F.variantId}`===j)??null:null,Ch=!!Ju,ed=t.active?t.artifacts??[]:[],mi=[...(t.active?Be:[]).map(F=>({kind:"active",variant:F})),...Rt.map(F=>({kind:"past",entry:F})),...Hn?[{kind:"original"}]:[]],jo=U.trim().toLowerCase(),td=jo?mi.filter(F=>zk(F,jo)):mi,nd=Wk(Vk(td,xe),$a),{pinned:Pt,unpinned:Ph}=Bk(nd,Yr,xe);let rd=null;k&&(rd=k.source==="live"?`live:${k.variantId}`:`past:${k.sessionId}:${k.variantId}`);const sd=new Set(Be.map(F=>F.requestId).filter(Boolean)),id=e.filter(F=>!sd.has(F.requestId)),Za=id.length>0,nc=r&&!Za&&mi.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[mi.length>0?S.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:S.jsxs("div",{className:"relative",children:[S.jsx(DZ,{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:U,onChange:F=>X(F.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:[Za?S.jsx(hK,{groups:id}):null,nc?S.jsx(pK,{}):null,t.active&&mi.length===0&&!Za&&!nc?S.jsx(mK,{}):null,!t.active&&!Za&&!nc&&Rt.length===0&&!Hn?S.jsx(vK,{isMCPSession:d,mcpEditor:f}):null,mi.length>0&&td.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",U.trim(),"”."]}):null,td.length>0?S.jsx(rK,{groups:Ph,pinned:Pt,pinnedKeys:Lo,draggedRowKey:rd,onDropPin:cn,onDropUnpin:On,onTogglePin:Jt,onReorder:Qr,collapsedRuns:Y,onToggleRun:H,activeVariantId:R??_t,activePastKey:j,isOriginalSelected:un,busy:Q,editingKey:kh,onSelectActive:Xl,onSelectPast:Jl,onSelectOriginal:Ku,onActivePointerDown:Ha,onPastPointerDown:za,onHover:xv,onRemove:F=>Sh({kind:"active",variant:F}),onRemovePast:F=>Sh({kind:"past",entry:F}),onStartRename:ks,onCommitRename:Sv,onCancelRename:bv,editingRunKey:Ev,onStartRunRename:ec,onCommitRunRename:Wa,onCancelRunRename:tc,onRemoveRun:Xu,onCopyVariantContext:es,activeSessionId:t.active?t.sessionId:null,projectPath:kn}):null,t.active&&u?S.jsx(cK,{artifacts:ed}):null]}),Ch&&Ju?S.jsx(oK,{entry:Ju,deploying:Se===j,deployedUrl:j?te[j]??null:null,onDeploy:wv,isDeployDisabled:!i}):null,!Ch&&t.active?S.jsx(fK,{selectedVariant:No,busy:Q,onSend:wh,onDeploy:xh,onDeployCanvas:bh,canDeploy:i&&(En==null?void 0:En.kind)==="fresh",canDeployCanvas:i&&o&&(En==null?void 0:En.kind)==="fresh",canSendToAgent:l,canvasVariantCount:ft.length,canvasDeployedUrl:We,deployedUrl:No?ee[No.workItemId]??null:null}):null,S.jsx(JG,{target:N,isConfirming:oe,onCancel:()=>G(null),onConfirm:Eh})]})},QG=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",JG=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=QG(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return S.jsx(bx,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:S.jsxs(Sx,{children:[S.jsx(Ex,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(kx,{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(Cx,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),S.jsx(Px,{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})]})]})})]})})},Nu=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:TI,zk=(t,e)=>t.kind==="active"?my(e,t.variant.label,t.variant.runLabel):t.kind==="past"?my(e,t.entry.label,t.entry.runLabel,t.entry.brief):my(e,Xx,RI),LI=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,DI=(t,e)=>LI(Nu(t),e),Bk=(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 u=[];for(const d of l.rows){const f=DI(d,n);r.has(f)?s.set(f,d):u.push(d)}u.length>0&&i.push(u.length===l.rows.length?l:{...l,rows:u})}return{pinned:e.flatMap(l=>{const u=s.get(l);return u?[u]:[]}),unpinned:i}},Uk=(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.filter(o=>r.has(n(o))).sort((o,l)=>r.get(n(o))-r.get(n(l)));return[...s,...i]},Wk=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:Uk(r.rows,s,Nu)}});return Uk(n,e.groups,r=>r.key)},eK=t=>t.length<=Fk?t:`${t.slice(0,Fk-1)}…`,tK=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,nK=t=>{var i,o;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(l=>!!l).join(`
112
- `);if(!t.reference)return e;const n=((o=t.projectPath)==null?void 0:o.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"",s=[`Rivet variant: ${t.reference}`,"To inspect the full variant context, run:",`rivet variants get ${t.reference}${r}`].join(`
113
- `);return e?`${e}
114
-
115
- ${s}`:s},rK=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:u,onToggleRun:d,activeVariantId:f,activePastKey:p,isOriginalSelected:v,busy:y,editingKey:w,onSelectActive:_,onSelectPast:x,onSelectOriginal:b,onActivePointerDown:k,onPastPointerDown:C,onHover:P,onRemove:T,onRemovePast:O,onStartRename:M,onCommitRename:R,onCancelRename:L,editingRunKey:D,onStartRunRename:V,onCommitRunRename:j,onCancelRunRename:U,onRemoveRun:X,onCopyVariantContext:q,activeSessionId:Z,projectPath:Y})=>{const H=m.useRef(null),{activeIndex:Q,itemRects:z,sessionRef:N,handlers:G,registerItem:oe}=YR(H,{snapTolerancePx:5}),[se,ee]=m.useState(!1),[de,ve]=m.useState(!1),le=u.has($_),te=r!==null,Pe=m.useMemo(()=>{if(!r)return null;const Me=LI(r,Z);if(n.has(Me))return{container:ef,key:Me};const We=t.find(xe=>xe.rows.some(St=>Nu(St)===r));return We?{container:hy(We.key),key:r}:null},[r,n,t,Z]),Se=(Pe==null?void 0:Pe.container)===ef,{dropTarget:Ne,onPointerMove:Xe,onPointerUp:Qe}=Zq({containerRef:H,dragged:Pe,yieldToSelector:Se?void 0:"[data-pinned-drop-zone]",restrictToSelector:Se?"[data-pinned-drop-zone]":void 0,onReorder:l}),lt=Q!==null?z[Q]:null,ut=Me=>Me.kind==="active"?Me.variant.workItemId===f:Me.kind==="past"?`${Me.entry.sessionId}:${Me.entry.variantId}`===p:v,je=(Me,We,xe,St)=>{const Rt=Nu(Me),Ar=DI(Me,Z);return S.jsx(iK,{rowKey:Rt,row:Me,index:We,isSelected:ut(Me),isEditing:w===Rt,isPinned:n.has(Ar),onTogglePin:()=>o(Ar),reorderContainer:xe,reorderKey:xe===ef?Ar:Rt,isNested:St,busy:y,registerItem:oe,onSelectActive:_,onSelectPast:x,onSelectOriginal:b,onActivePointerDown:k,onPastPointerDown:C,onHover:P,onRemove:T,onRemovePast:O,onStartRename:M,onCommitRename:R,onCancelRename:L,onCopyVariantContext:q,activeSessionId:Z,projectPath:Y},Rt)};let st=0;const Be=Me=>{if(Me.key==="")return Me.rows.map(Rt=>je(Rt,st++,hy(Me.key),!1));const We=u.has(Me.key),xe=We?null:Me.rows.map(Rt=>je(Rt,st++,hy(Me.key),!0)),St=Me.label;return S.jsx(sK,{label:St??Xx,collapsed:We,onToggle:()=>d(Me.key),directionCount:Me.rows.length,isEditing:St!==null&&D===Me.key,onStartRename:St!==null?()=>V(Me.key):void 0,onCommitRename:St!==null?Rt=>j(Me,Rt):void 0,onCancelRename:U,onRemove:St!==null?()=>X(Me):void 0,children:xe},Me.key)},ft=e.length>0||te;return S.jsxs("div",{ref:H,className:"relative",onMouseEnter:G.onMouseEnter,onMouseMove:G.onMouseMove,onMouseLeave:G.onMouseLeave,onPointerMove:Xe,onPointerUp:Me=>{var We;if(Se&&Pe){const xe=(We=H.current)==null?void 0:We.querySelector("[data-pinned-drop-zone]"),St=xe==null?void 0:xe.getBoundingClientRect();if(!(St!==void 0&&Me.clientY>=St.top&&Me.clientY<=St.bottom)){i(Pe.key);return}}Qe()},children:[Pe&&Ne?S.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:Ne.top}}):null,S.jsx(_s,{children:lt&&S.jsx(di.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:lt.top,left:lt.left,width:lt.width,height:lt.height},animate:{opacity:1,top:lt.top,left:lt.left,width:lt.width,height:lt.height},exit:{opacity:0,transition:{duration:.06}},transition:{...jf.fast,opacity:{duration:.08}}},N.current)}),S.jsxs("ul",{className:"relative flex flex-col gap-2",children:[S.jsx(_s,{initial:!1,children:ft?S.jsxs(di.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:V_,ease:F_},"data-pinned-drop-zone":"",className:$n("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",te&&"ring-content-muted/30 ring-1",te&&se&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:te?()=>ee(!0):void 0,onPointerLeave:te?()=>ee(!1):void 0,onPointerUp:te?()=>{ee(!1),s()}:void 0,children:[S.jsx("div",{"data-hover-dead-zone":"",children:S.jsxs("button",{type:"button",onClick:()=>d($_),"aria-expanded":!le,"aria-label":`${le?"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(ER,{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(_s,{initial:!1,children:!le&&S.jsx(di.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:V_,ease:F_},className:"overflow-hidden",children:e.length>0?S.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Me=>je(Me,st++,ef,!1))}):null},"body")})]},"pinned-section"):null}),ft&&t.length>0?S.jsxs("li",{className:$n("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",Se&&"ring-content-muted/30 ring-1",Se&&de&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:Se?()=>ve(!0):void 0,onPointerLeave:Se?()=>ve(!1):void 0,onPointerUp:Se?()=>ve(!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(FZ,{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(Me=>Be(Me))})]}):t.map(Me=>Be(Me))]})]})},NI=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=XR();return S.jsxs(Vx,{open:t,onOpenChange:e,children:[S.jsx(Gl,{label:n,children:S.jsx($x,{asChild:!0,children:S.jsx("button",{type:"button","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(MZ,{size:15,weight:"bold"})})})}),S.jsx(Hx,{children:S.jsx(zx,{ref:s,onKeyDown:i,role:"menu",side:"bottom",align:"end",sideOffset:4,onCloseAutoFocus:o=>o.preventDefault(),className:"bg-surface-2 z-[60] min-w-[160px] rounded-lg p-1 shadow-lg",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.key))})})]})},sK=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const f=sh(),[p,v]=m.useState(!1),y=[...i?[{key:"rename",label:"Rename",icon:S.jsx(bR,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:S.jsx(MR,{size:13,weight:"bold"}),onSelect:u}]:[]],w=e?S.jsx(LZ,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):S.jsx(OZ,{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:[w,S.jsx("span",{className:"min-w-0 flex-1",children:S.jsx(jI,{initial:t,onCommit:o,onCancel:l})})]}),S.jsx(_s,{initial:!1,children:!e&&S.jsx(di.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)&&y.length>0){v(!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:[w,S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),y.length>0&&S.jsx("div",{className:$n("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",p&&"pointer-events-auto opacity-100"),children:S.jsx(NI,{open:p,onOpenChange:v,triggerLabel:`${t} run actions`,actions:y})})]}),S.jsx(_s,{initial:!1,children:!e&&S.jsx(di.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:V_,ease:F_},className:"overflow-hidden",children:d},"body")})]})},iK=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:u,isNested:d,busy:f,registerItem:p,onSelectActive:v,onSelectPast:y,onSelectOriginal:w,onActivePointerDown:_,onPastPointerDown:x,onHover:b,onRemove:k,onRemovePast:C,onStartRename:P,onCommitRename:T,onCancelRename:O,onCopyVariantContext:M,activeSessionId:R,projectPath:L})=>{var te,Pe;const D=m.useRef(null);Mq(p,n,D);const[V,j]=m.useState(!1),U=e.kind==="active",X=e.kind==="original",q=e.kind==="active"?e.variant:null,Z=e.kind==="past"?e.entry:null,Y=U?q.status==="succeeded":!0,H=U?vf(q):!0,Q=U&&(q.status==="pending"||q.status==="running"),z=U&&q.status==="failed",N=U&&q.status==="cancelled",G=U&&(f==null?void 0:f.kind)==="remove"&&f.variantId===q.workItemId,oe=U&&(((te=q.refinement)==null?void 0:te.status)==="pending"||((Pe=q.refinement)==null?void 0:Pe.status)==="running");let se=Xx;U?se=q.label||`Direction ${n+1}`:Z&&(se=Z.label.trim()||"Untitled direction");let ee=RI;U?ee=q.description:Z&&(ee=Z.brief);const de=ee?eK(ee):null,ve=tK(e,R),le=ve?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:D,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:S.jsx("div",{className:$n("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(jI,{initial:se,onCommit:Se=>T(e,Se),onCancel:O}),de&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:de})]})})}):S.jsxs("li",{ref:D,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:[S.jsx("div",{role:"button",tabIndex:0,"data-variant-id":U?q.workItemId:void 0,"data-variant-key":t,onClick:Se=>{if(Se.metaKey||Se.ctrlKey){j(!0);return}const Ne=window.getSelection();Ne&&!Ne.isCollapsed||(e.kind==="active"?v(e.variant):e.kind==="past"?y(e.entry):w())},onKeyDown:Se=>{(Se.key==="Enter"||Se.key===" ")&&(Se.preventDefault(),Se.stopPropagation(),e.kind==="active"?v(e.variant):e.kind==="past"?y(e.entry):w())},onPointerDown:Se=>{Se.metaKey||Se.ctrlKey||(e.kind==="active"?H&&_(e.variant.workItemId,Se):e.kind==="past"&&x(e.entry,Se))},"aria-pressed":r,"aria-disabled":U?!1:void 0,"aria-busy":Q||oe,onMouseEnter:U?()=>b(q.workItemId):void 0,onMouseLeave:U?()=>b(null):void 0,className:$n("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",r&&"bg-main-input",H&&"cursor-grab active:cursor-grabbing",!H&&"cursor-pointer"),style:H?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[(Q||oe)&&S.jsx(Zx,{className:"text-content-muted shrink-0 text-sm","data-testid":oe&&!Q?"variant-refining":void 0}),S.jsx(Gl,{label:"Double-click to rename",disabled:X,children:S.jsx("span",{onDoubleClick:Se=>{Se.stopPropagation(),X||P(t)},className:$n("min-w-0 flex-1 truncate text-sm font-medium select-text",X?"cursor-default":"cursor-text",Y||r?"text-content":"text-content-muted"),children:se})}),z&&S.jsx(Gl,{label:q.errorMessage??q.errorCode??"Failed",disabled:!q.errorMessage&&!q.errorCode,children:S.jsx("span",{className:"shrink-0",children:S.jsx(Zk,{label:"Failed"})})}),N&&S.jsx(Zk,{label:"Cancelled"})]}),de&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:de})]})}),S.jsx("div",{className:$n("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",V&&"pointer-events-auto opacity-100"),children:S.jsx(NI,{open:V,onOpenChange:j,triggerLabel:"Direction actions",actions:[...ee||ve?[{key:"copy",label:le,icon:S.jsx(Nf,{size:13,weight:"bold"}),onSelect:()=>M(nK({label:se,description:ee,reference:ve,projectPath:L}))}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:S.jsx(ER,{size:13,weight:"bold"}),onSelect:o},...X?[]:[{key:"rename",label:"Rename",icon:S.jsx(bR,{size:13,weight:"bold"}),onSelect:()=>P(t)},{key:"remove",label:"Remove",icon:S.jsx(MR,{size:13,weight:"bold"}),disabled:G,onSelect:()=>{e.kind==="active"?k(e.variant):e.kind==="past"&&C(e.entry)}}]]})})]})},jI=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=m.useState(t),i=m.useRef(!1),o=m.useCallback(u=>{u&&(u.focus(),u.select())},[]),l=u=>{i.current||(i.current=!0,u?e(r):n())};return S.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:u=>s(u.target.value),onKeyDown:u=>{u.stopPropagation(),u.key==="Enter"?(u.preventDefault(),l(!0)):u.key==="Escape"&&(u.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.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"})},Zk=({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}),oK=({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(Nf,{size:12,weight:"bold"}):null,o]})]})},aK={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},lK={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},cK=({artifacts:t})=>{const[e,n]=m.useState(null),r=m.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(o=>o===i?null:i)};return S.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[S.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),S.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>S.jsx(uK,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},uK=({artifact:t,isExpanded:e,onToggle:n})=>{const r=lK[t.kind],s=t.source?aK[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),o=t.kind==="design_context"&&!!t.viewUrl,l=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return o?S.jsx("li",{className:"border-main-border rounded-md border",children:S.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{ke.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:S.jsx(AZ,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):S.jsxs("li",{className:"border-main-border rounded-md border",children:[S.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":l,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?S.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:S.jsx(dK,{artifact:t})}):null]})},dK=({artifact:t})=>S.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?S.jsx("p",{children:t.summary}):null,t.path?S.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?S.jsx("p",{children:"No inline content available for this artifact."}):null]}),fK=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:o,canSendToAgent:l,canvasVariantCount:u,canvasDeployedUrl:d,deployedUrl:f})=>{var M,R,L,D;const p=t?((R=(M=t.actions)==null?void 0:M.commit)==null?void 0:R.enabled)??t.status==="succeeded":!1,v=p&&e===null,y=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),w=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",x=!i||!p||e!==null,b=o&&u>0,C=w?"Deploying…":f?"Copy link":"Share",T=_?"Sharing…":d?"Copy canvas link":"Share canvas",O=y?"Applying…":"Apply to project";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"}),f?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[S.jsx(pI,{primaryLabel:C,primaryIcon:f&&!w?Nf:void 0,primaryAction:()=>{t&&r(t)},isDisabled:x,isDropdownDisabled:e!==null,isLoading:w,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:b?[{label:T,icon:d&&!_?Nf:void 0,onClick:s,isDisabled:e!==null}]:[]}),l?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!v,title:(D=(L=t==null?void 0:t.actions)==null?void 0:L.commit)==null?void 0:D.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:O}):null]})]})},FI=()=>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(Zx,{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"})})]})}),hK=({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(FI,{},`${e.requestId}-${r}`)))}),pK=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(FI,{},e))}),mK=()=>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."})]}),qk="Try different ways to create a dropdown that feels fluid and dynamic",vK=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=m.useState(!1),s=dG(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(qk).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:["“",qk,"”"]}),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(pR,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(Nf,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},gK=({onClose:t})=>{const e=rt(sI);return t?S.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):S.jsx("span",{}),S.jsx(Gl,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:S.jsx(NZ,{className:"h-4 w-4",weight:"bold"})})})]}):null},Gk="/assets/arena-Db0j1set.png",yK=Es("useIntegrations"),yy=["integrations"],_K="rivet:connect-result",wK=t=>typeof t=="object"&&t!==null&&t.type===_K,xK=ct(null),Kk=async()=>{const t=await fetch("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},bK=()=>{const t=n3(),[e,n]=h5(xK),r=Xy({queryKey:yy,queryFn:Kk,staleTime:1e4}),s=m.useCallback(async()=>(await t.invalidateQueries({queryKey:yy,refetchType:"none"}),t.fetchQuery({queryKey:yy,queryFn:Kk})),[t]),i=m.useCallback(async l=>{const u=window.open("","_blank","width=560,height=720");if(!u)throw new Error("Popup blocked. Allow popups to connect.");n(l);try{const d=await fetch(`/api/integrations/${l}/connect`,{method:"POST"}),f=await d.json().catch(()=>({}));if(!d.ok||!f.authUrl)throw u.close(),new Error(f.error||`Could not connect ${l}`);return u.location.href=f.authUrl,await new Promise(p=>{let v=!1,y=null;const w=async(x,b=!1)=>{if(!v){v=!0,window.removeEventListener("message",_),y&&clearInterval(y);try{const C=(await s()).some(P=>P.provider===l&&P.status==="connected");p(b&&C?"connected":x)}catch{p(x)}}},_=x=>{if(wK(x.data)&&x.data.provider===l){if(x.data.status==="error"){yK.warn(`Connect failed for ${l}:`,x.data.message),w("failed");return}w("connected")}};window.addEventListener("message",_),y=setInterval(()=>{u.closed&&w("closed",!0)},500)})}finally{n(null)}},[s,n]),o=m.useCallback(async l=>{n(l);try{const u=await fetch(`/api/integrations/${l}`,{method:"DELETE"});if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d.error||`Could not disconnect ${l}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:o,refetch:s}},iu=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:o="button","data-cy":l})=>{const u=S.jsx("button",{onClick:t,disabled:s,className:i,type:o,"data-cy":l,children:r});return e?S.jsx(Yx,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:e}),n?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:u}):u},hl=({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}:{}}}),Yk=Es("ConnectorsModal"),SK=()=>S.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","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"})}),EK=()=>S.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${Gk})`,maskImage:`url(${Gk})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),kK=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(SK,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(EK,{})}],CK=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const o=(e==null?void 0:e.status)==="connected",l=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return S.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[S.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"mt-4 flex-1",children:[S.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,o?S.jsx(pR,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),S.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),o&&l?S.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:l}):null]}),o?S.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):S.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},H_=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:u,disconnect:d}=bK(),f=sh(),[p,v]=m.useState(null),y=b=>s.find(k=>k.provider===b),w=m.useCallback(b=>{const k=Date.now(),C=hl({action:"connect",outcome:"started",provider:b,entryPoint:n});f==null||f.capture(C.event,C.properties),u(b).then(P=>{const T=Date.now()-k;if(P==="connected"){const M=hl({action:"connect",outcome:"completed",provider:b,entryPoint:n,durationMs:T});f==null||f.capture(M.event,M.properties);return}const O=hl({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:T,failureReason:P==="closed"?"popup_closed":"provider_failed"});f==null||f.capture(O.event,O.properties)}).catch(P=>{const T=P instanceof Error?P.message:"Could not connect.",O=hl({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-k,failureReason:T.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture(O.event,O.properties),Yk.warn(`Connect error for ${b}:`,T),bt.error(T)})},[u,n,f]),_=m.useCallback(b=>{const k=Date.now(),C=hl({action:"disconnect",outcome:"started",provider:b,entryPoint:n});f==null||f.capture(C.event,C.properties),d(b).then(()=>{const P=hl({action:"disconnect",outcome:"completed",provider:b,entryPoint:n,durationMs:Date.now()-k});f==null||f.capture(P.event,P.properties)}).catch(P=>{const T=P instanceof Error?P.message:"Could not disconnect.",O=hl({action:"disconnect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-k,failureReason:"request_failed"});f==null||f.capture(O.event,O.properties),Yk.warn(`Disconnect error for ${b}:`,T),bt.error(T)})},[n,d,f]),x=n==="onboarding";return S.jsx(bx,{open:t,onOpenChange:b=>!b&&e(),children:S.jsxs(Sx,{children:[S.jsx(Ex,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(kx,{ref:v,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(CI,{value:p,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(Cx,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(iu,{onClick:e,title:"Close",className:"text-content-subtle hover:bg-main-hover hover:text-content rounded p-1 transition-colors",children:S.jsx(LR,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(Px,{className:"text-content-subtle text-sm",children:"Connect your design references to use them with Rivet’s MCP."}),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.jsx("div",{className:"grid grid-cols-2 gap-4",children:kK.map(b=>S.jsx(CK,{meta:b,integration:y(b.provider),isPending:i||l===b.provider,isHighlighted:r===b.provider,onConnect:()=>w(b.provider),onDisconnect:()=>_(b.provider)},b.provider))}),x?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]})]})})]})})},Xk=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),PK=Es("SupportTicketModal"),Qk=5e3,_y="feedback",AK=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},TK=async t=>{let e;try{e=await t.json()}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=AK(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}`},RK=({isOpen:t,onClose:e,contactEmail:n})=>{const r=sh(),[s,i]=m.useState(""),[o,l]=m.useState(!1),[u,d]=m.useState(null),f=m.useCallback(()=>{i("")},[]),p=m.useCallback(()=>{o||(f(),e())},[o,e,f]),v=m.useCallback(async()=>{const x=s.trim();if(!(!x||o)){l(!0);try{const b=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 fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:_y,message:x,contactEmail:C||void 0,metadata:{posthogSessionId:b??void 0,posthogDistinctId:k??void 0,appVersion:"0.16.2",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!P.ok){const T=await TK(P);throw new Error(T)}r==null||r.capture("support_ticket_submitted",{ticket_type:_y,has_posthog_session_id:!!b}),bt.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(b){const k=b instanceof Error?b.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:_y,error:k}),PK.error("Failed to submit support ticket:",k),bt.error("Could not send feedback",{description:k})}finally{l(!1)}}},[n,o,s,e,r,f]),y=m.useCallback(x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),v())},[v]),w=Qk-s.length,_=o||s.trim().length===0;return S.jsx(bx,{open:t,onOpenChange:x=>!x&&p(),children:S.jsxs(Sx,{children:[S.jsx(Ex,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(kx,{ref:d,className:"fixed left-1/2 top-1/2 z-max w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(CI,{value:u,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(Cx,{className:"text-base font-medium text-content",children:"Send feedback"}),S.jsx(iu,{onClick:p,disabled:o,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(LR,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(Px,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"rounded-lg bg-main-input 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:x=>i(x.target.value),onKeyDown:y,maxLength:Qk,rows:6,disabled:o,placeholder:"What happened?",className:"max-h-64 w-full resize-none overflow-y-auto bg-transparent pb-1 pl-3 pr-3 pt-3 text-sm text-content placeholder-content-subtle focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[S.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[w<=500&&S.jsx("span",{className:"text-xs text-content-subtle",children:w}),S.jsx(iu,{onClick:v,disabled:_,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:o?S.jsx(cv,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(TZ,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},IK=Es("ProfileAvatar"),VI=(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):""},MK=(t,e)=>VI(t,e).charAt(0).toUpperCase(),OK=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=rt(oI),i=rt(dI),[o,l]=m.useState(!1),[u,d]=m.useState(!1),[f,p]=m.useState(!1),[v,y]=m.useState(!1),{containerRef:w,onKeyDown:_}=XR(),x=rt(fh),b=MK(r,s);if(!b)return x?S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(Xk,{className:"h-7 w-7 rounded-full"}),S.jsx(Xk,{className:"h-3 w-16"})]}):null;const k=VI(r,s),C=(r==null?void 0:r.trim())||null,P=(s==null?void 0:s.trim())||null,T=async()=>{y(!0);try{const O=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!O.ok)throw new Error(`Logout failed: ${O.status}`)}catch(O){IK.warn("Logout request failed",O),bt.error("Could not log out. Please try again."),y(!1);return}window.location.reload()};return S.jsxs(S.Fragment,{children:[S.jsxs(Vx,{open:o,onOpenChange:l,children:[S.jsx($x,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account",className:`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-7 w-7 items-center justify-center rounded-full border text-[11px] leading-none font-semibold",children:b}),k?S.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:k}):null]})}),S.jsx(Hx,{children:S.jsxs(zx,{ref:w,onKeyDown:_,role:"menu",className:"bg-surface-2 z-[60] min-w-[180px] rounded-lg p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[C||P?S.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[C?S.jsx("div",{className:"text-content truncate text-xs font-medium",children:C}):null,P?S.jsx("div",{className:"text-content-muted truncate text-[11px]",children:P}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{l(!1),d(!0)},disabled:!i,className:"text-content hover:bg-hover focus:bg-hover mt-1 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:[S.jsx(RR,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{l(!1),p(!0)},className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none",children:[S.jsx(IZ,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:T,disabled:v,className:"text-content hover:bg-hover focus:bg-hover mt-1 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:[S.jsx(jZ,{className:"h-3.5 w-3.5",weight:"bold"}),v?"Logging out…":"Log out"]})]})})]}),S.jsx(H_,{isOpen:u,onClose:()=>d(!1)}),S.jsx(RK,{isOpen:f,onClose:()=>p(!1),contactEmail:s??void 0})]})},LK=({onClose:t})=>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(gK,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(XG,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:S.jsx(OK,{side:"top",align:"start"})})]});async function DK(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(o){const l=n[i-1];if(l===void 0||r&&!r(o))throw o;s==null||s(o,i,l),await new Promise(u=>setTimeout(u,l))}}const Jk=Es("useServerConfig"),$I=[250,500,1e3,2e3,4e3],eC=$I.length+1,NK=async()=>{var n;const t=await fetch("/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}},jK=()=>{const[t,e]=m.useState(null),[n,r]=m.useState(!0),[s,i]=m.useState(null),o=m.useCallback(async()=>{try{r(!0),i(null);const l=await DK(NK,{delaysMs:$I,onRetry:(u,d,f)=>{Jk.warn(`Server config fetch failed (attempt ${d}); retrying in ${f}ms`,u)}});return e(l),l}catch(l){const u=l instanceof Error?l.message:"Failed to fetch server config";throw i(u),Jk.warn("Error fetching server config:",l),l}finally{r(!1)}},[]);return{config:t,fetchConfig:o,isLoading:n,error:s}},FK="#1C1C20",oo=[118,118,124],tC=.85,VK=3,$K=.15,a0=36,HK=4.4,zK=.7,BK=3.5,UK=.8,nC=9,WK=11,ZK=[1.35,1.12,.95,.85],qK=[0,1.1,2.3,3.1],GK=[0,.35,.16,.13],KK=[.9,.5,.4,.35],pl=3,wy=[[{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}]],l0=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},O0=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},ml=(t,e)=>(Math.round(t/e-.5)+.5)*e,YK=Math.sin(Math.PI/3),rC=(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*YK;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()},XK=(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)-nC}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)-nC}return O0(.5-r/(2*WK))},HI=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=mt(iI),r=m.useRef(null),s=m.useCallback(i=>{var D;if((D=r.current)==null||D.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(V=>V+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,p=a0,v=a0,y=null,w=null,_=0,x=-1;const b=new Array(33),k=V=>{const j=Math.round(V*32);let U=b[j];if(!U){const X=j/32,q=Math.round(oo[0]+(255-oo[0])*X),Z=Math.round(oo[1]+(255-oo[1])*X),Y=Math.round(oo[2]+(255-oo[2])*X);U=`rgba(${q}, ${Z}, ${Y}, ${tC})`,b[j]=U}return U},C=V=>{const j=1-.35*V,U=Math.round(oo[0]*j),X=Math.round(oo[1]*j),q=Math.round(oo[2]*j);return`rgba(${U}, ${X}, ${q}, ${tC})`},P=V=>{let j=Math.floor(Math.random()*wy.length);j===x&&(j=(j+1)%wy.length),x=j;const U=[0,0,0,0],X=wy[j].map((N,G)=>{const oe=N.level,se=U[oe]++,ee=qK[oe]+se*GK[oe],de=KK[oe]+l0(j*131+G*17+5)*.2;if(N.hline){const te=ml((N.y??0)*f,v);return{hline:!0,x1:ml(N.x1*d,p),x2:ml(N.x2*d,p),y1:te,y2:te,level:oe,start:ee,dur:de}}const ve=ml(N.x1*d,p),le=ml((N.y1??0)*f,v);return{hline:!1,x1:ve,y1:le,x2:Math.max(ml(N.x2*d,p),ve+p),y2:Math.max(ml((N.y2??0)*f,v),le+v),level:oe,start:ee,dur:de}}),q=X.reduce((N,G)=>Math.max(N,G.start+G.dur),0),Z=u.length,Y=new Float32Array(Z*pl),H=new Int16Array(Z*pl).fill(-1),Q=new Uint8Array(Z),z=X[0];for(let N=0;N<Z;N++){const G=u[N];G.x>z.x1&&G.x<z.x2&&G.y>z.y1&&G.y<z.y2&&(Q[N]=1);const oe=N*pl;for(let se=0;se<X.length;se++){const ee=XK(G.x,G.y,X[se]);if(ee<=.02)continue;let de=oe;for(let ve=oe;ve<oe+pl;ve++){if(H[ve]===-1){de=ve;break}Y[ve]<Y[de]&&(de=ve)}(H[de]===-1||ee>Y[de])&&(Y[de]=ee,H[de]=se)}}return{startT:V,buildEnd:q,els:X,frame:z,cellQ:Y,cellEl:H,inFrame:Q}},T=()=>{const V=i.getBoundingClientRect();d=Math.max(1,V.width),f=Math.max(1,V.height);const j=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*j),i.height=Math.round(f*j),o.setTransform(j,0,0,j,0,0);const U=Math.max(8,Math.round(d/a0)),X=Math.max(6,Math.round(f/a0));p=d/U,v=f/X,u=[];for(let q=0;q<X;q++){const Z=X>1?q/(X-1):.5,Y=HK*(1+zK*.4*(Z*2-1));for(let H=0;H<U;H++){const Q=q*8191+H*131+1,z={x:(H+.5)*p,y:(q+.5)*v,size:Y,seed:Q,phase:l0(Q),kind:0};z.kind=Math.floor(l0(Q*97)*3),u.push(z)}}w=null,y=null},O=new Float32Array(32),M=V=>{o.fillStyle=FK,o.fillRect(0,0,d,f),y||(y=P(V+.2)),V>=y.startT+y.buildEnd+BK&&(w=y,_=V,y=P(V+.2));let j=0;w&&(j=1-O0((V-_)/UK),j<=0&&(w=null));const U=y;for(let z=0;z<U.els.length;z++){const N=U.els[z];O[z]=O0(Math.min(1,Math.max(0,(V-U.startT-N.start)/N.dur)))}const X=O[0],q=C(0),Z=C(X),Y=j>0?C(j):q,H=j>0?C(Math.max(X,j)):Z,Q=u.length;for(let z=0;z<Q;z++){const N=u[z];let G=0,oe=0;const se=z*pl;for(let Se=se;Se<se+pl;Se++){const Ne=U.cellEl[Se];if(Ne<0)break;const Xe=U.cellQ[Se]*O[Ne];Xe>G&&(G=Xe,oe=U.els[Ne].level)}if(w)for(let Se=se;Se<se+pl;Se++){const Ne=w.cellEl[Se];if(Ne<0)break;const Xe=w.cellQ[Se]*j;Xe>G&&(G=Xe,oe=w.els[Ne].level)}const ee=V/VK+N.phase,de=Math.floor(ee),ve=ee-de,le=O0(Math.min(ve,1-ve)/$K),te=Math.floor(l0(N.seed*97+de*7919)*3);te!==N.kind&&G<.02&&le<.05&&(N.kind=te);const Pe=Math.max(le*(1-G),G);if(!(Pe<.01))if(G<.02){const Se=U.inFrame[z]===1,Ne=w?w.inFrame[z]===1:!1;Se?o.fillStyle=Ne?H:Z:o.fillStyle=Ne?Y:q;const Xe=Math.max(Se?X:0,Ne?j:0);rC(o,N.kind,N.x,N.y,N.size*Pe*(1-.2*Xe))}else{o.fillStyle=k(G);const Se=1+(ZK[oe]-1)*G;rC(o,N.kind,N.x,N.y,N.size*Pe*Se)}}};T();let R=0;if(l)y=P(-100),M(0);else{const V=performance.now(),j=U=>{M((U-V)/1e3),R=requestAnimationFrame(j)};R=requestAnimationFrame(j)}const L=new ResizeObserver(()=>{T(),l&&(y=P(-100),M(0))});L.observe(i),r.current=()=>{cancelAnimationFrame(R),L.disconnect(),e&&n(V=>V-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},QK=async(t=null)=>{if(t)return JK(t);let e;try{e=await fetch("/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 c0();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return c0()}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}:c0()},zI=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}}},JK=t=>zI(t),c0=()=>zI("/"),xy=Es("usePreviewUpstreamHealth"),eY=500,tY=4e3,nY=15e3,rY=3,sY=(t,e={})=>{const n=m.useRef(null),r=m.useRef(null),s=e.probeMsWhileDown??eY,i=e.probeMsWhileUp??tY,o=e.firstUnreachableCaptureAfterMs??nY,l=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,d=e.skip??!1,f=m.useRef(e.onPersistentUpstreamServerErrors);f.current=e.onPersistentUpstreamServerErrors;const[p,v]=m.useState(t==="static"),[y,w]=m.useState(0),[_,x]=m.useState(null),[b,k]=m.useState(0),[C,P]=m.useState(!1),[T,O]=m.useState(!1),[M,R]=m.useState(t==="static"?null:"upstream_unreachable");return m.useEffect(()=>{if(t==="static"){v(!0),x(null),k(0),P(!1),O(!0),R(null);return}if(d){v(!1),x(null),k(0),P(!1),O(!0),R("upstream_unreachable"),n.current=null;return}let L=!0;const D=Date.now();x(D),k(0),P(!1),v(!1),O(!1),R("upstream_unreachable");const V={current:!1},j={current:!1},U={current:!1},X={current:null},q={current:!1},Z={current:!1},Y={current:0},H={current:!1},Q={current:null};let z=null;const N=()=>{U.current||(U.current=!0,L&&O(!0))},G=()=>{z!==null&&(clearTimeout(z),z=null)},oe=(ee,de)=>{G(),z=setTimeout(de,ee)},se=async()=>{var Xe;if(!L)return;k(Qe=>Qe+1);const{isOk:ee,unavailableReason:de,upstreamStatus:ve}=await QK(u);if(!L)return;N(),Q.current=ve;const le=ee&&ve!==null&&ve>=500;le&&Z.current?Y.current+=1:ee&&!le&&(Y.current=0);const te=Y.current>=rY;if(te&&!H.current&&ve!==null&&(H.current=!0,ke==null||ke.capture("preview_upstream_error_responses",{framework:t,upstream_status:ve,consecutive_count:Y.current}),xy.warn(`Preview upstream is listening but has served ${Y.current} consecutive ${ve} responses`),(Xe=f.current)==null||Xe.call(f,{upstreamStatus:ve,consecutiveCount:Y.current})),ee&&!te){le||(Z.current=!0,H.current=!1);const Qe=!q.current;q.current=!0,v(!0),R(null),X.current=null,j.current=!1,P(!1),V.current?Qe&&(ke==null||ke.capture("preview_upstream_restored",{framework:t})):(V.current=!0,ke==null||ke.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-D})),oe(i,se);return}const Se=q.current;q.current=!1,v(!1),R(de),X.current===null&&(X.current=Date.now(),j.current=!1,P(!1)),Se&&(ke==null||ke.capture("preview_upstream_lost",{framework:t,upstream_status:ve}),w(Qe=>Qe+1),xy.warn("Preview upstream became unavailable after it was ready"));const Ne=Date.now()-X.current;Ne>=o&&!j.current&&(j.current=!0,P(!0),ke==null||ke.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Ne,upstream_status:Q.current}),xy.warn("Dev server did not become ready within timeout window")),oe(s,se)};return n.current=()=>oe(0,se),oe(0,se),()=>{L=!1,n.current=null,G()}},[t,s,i,o,u,d]),m.useEffect(()=>{var D;if(t==="static"||l===void 0)return;const L=r.current;r.current=l,L!==null&&L!==l&&((D=n.current)==null||D.call(n))},[t,l]),{isUpstreamReady:p,iframeRemountKey:y,probeStartedAt:_,probeAttemptCount:b,isFirstUnreachableWindowExceeded:C,initialProbeComplete:T,unavailableReason:M}};function iY(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const BI=t=>{var e;return t!=="embedded"||typeof window>"u"?"":((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.previewOrigin)??`${window.location.protocol}//localhost:${window.location.port}`},UI=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${BI(t)}${e}`:e,oY="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",aY=t=>oY,lY=Es("PreviewSurface"),sC=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",WI=({target:t,src:e,framework:n,remountKey:r})=>(rt(uv),S.jsx("div",{className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:aY(),onLoad:()=>{ke==null||ke.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(ke==null||ke.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:sC(e,t),framework:n}))},onError:()=>{ke==null||ke.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(ke==null||ke.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:sC(e,t),framework:n})),lY.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),cY="modulepreload",uY=function(t){return"/"+t},iC={},dY=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(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=uY(d),d in iC)return;iC[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const v=document.createElement("link");if(v.rel=f?"stylesheet":cY,f||(v.as="script"),v.crossOrigin="",v.href=d,u&&v.setAttribute("nonce",u),document.head.appendChild(v),f)return new Promise((y,w)=>{v.addEventListener("load",y),v.addEventListener("error",()=>w(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)})},fY=m.lazy(()=>dY(()=>Promise.resolve().then(()=>qX),void 0)),hY={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"},pY={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},mY={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"},ou=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:u,state:d,role:f="status",busy:p=!1,className:v=""})=>{const y=m.useCallback(_=>{_&&d&&(ke==null||ke.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),w=!!(e||n||r||u||s!=null&&s.length);return S.jsxs("div",{ref:y,className:`${hY[o]} ${v}`.trim(),role:f,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,w?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:pY[l],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,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:mY[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},z_=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(ou,{...r,size:n,busy:!0,backdrop:S.jsx(HI,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(ou,{...r,size:n,busy:!0,backdrop:S.jsx(m.Suspense,{fallback:null,children:S.jsx(fY,{className:"absolute inset-0"})})}):S.jsx(ou,{...r,size:n,busy:!0,media:S.jsx(cv,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),ZI=({icon:t,...e})=>S.jsx(ou,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Qx=t=>S.jsx(ou,{...t,tone:"error",role:"alert"}),oC="/static/",vY=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(oC)}catch{return t.endsWith(oC)}},gY=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==="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.",yY=t=>t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE"?{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}:t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED"?{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}:t.status==="failed"?{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}:t.status==="cancelled"?{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1}:t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"?{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:gY(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,_Y=({issue:t})=>S.jsx(ou,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,children:t.detail?S.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null}),wY=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{const r=rt(R_),s=mt(R_),i=rt(Mm),o=mt(Mm),l=rt(dh),u=rt(uv),d=rt(I_),f=rt(M_),p=rt(aI),v=rt(lI),y=mt(M_),w=rt(To),_=rt(L_),x=mt(I_),b=l.active&&l.projectContext.kind==="fresh",k=rt(O_),C=l.active?l.variants.find(je=>je.workItemId===k&&(je.status==="pending"||je.status==="running"||je.status==="succeeded"&&!je.preview&&typeof je.port!="number"&&(!je.previewUnavailable||je.previewUnavailable.reason==="idle_timeout")))??null:null,P=l.active&&l.variants.some(je=>je.status==="pending"||je.status==="running"),T=b||P,O=l.active?l.variants.find(je=>je.workItemId===k)??null:null,M=O?yY(O):null,R=e==="static"&&i!==null&&vY(i);m.useEffect(()=>{l.active||x(!1)},[l.active,x]);const L=m.useRef(!1);m.useEffect(()=>{const je=!!(w!=null&&w.left||w!=null&&w.right),st=je&&!L.current;L.current=je;const Be=l.active?l.sessionId:null;!Be||!iY({enteringSplit:st,isExistingSession:l.active&&l.projectContext.kind==="existing",hasActiveVariantProxy:d&&f!==null})||(x(!1),y(null),s(ft=>ft+1),fetch(`/api/variants/${encodeURIComponent(Be)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,l,d,f,x,y,s]);const V=m.useMemo(()=>{var We;if(d||i&&!R||!l.active)return null;const{stage:je,variants:st}=l,Be=je==="ready"||je==="degraded",ft=st.some(xe=>{var St,Rt;return((St=xe.refinement)==null?void 0:St.status)==="pending"||((Rt=xe.refinement)==null?void 0:Rt.status)==="running"});if(!Be&&!ft)return null;const Me=st.find(xe=>{var St;return xe.status==="succeeded"&&((St=xe.preview)==null?void 0:St.kind)==="static_artifact"});return((We=Me==null?void 0:Me.preview)==null?void 0:We.kind)==="static_artifact"?Me.preview.url:null},[R,i,d,l])??i,j=m.useMemo(()=>!l.active||!V?null:l.variants.find(je=>{var st;return((st=je.preview)==null?void 0:st.kind)==="static_artifact"&&V.startsWith(je.preview.url)})??null,[V,l]),U=m.useMemo(()=>{if((_==null?void 0:_.previewKind)==="static")return{kind:"variant",sessionId:_.sessionId,variantId:_.variantId};if(!l.active)return Im;if(j)return{kind:"variant",sessionId:l.sessionId,variantId:j.workItemId};if(V){const st=V.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Be=st!=null&&st[1]?decodeURIComponent(st[1]):null,ft=st!=null&&st[2]?decodeURIComponent(st[2]):null;if(Be===l.sessionId&&ft&&l.variants.some(xe=>xe.workItemId===ft))return{kind:"variant",sessionId:l.sessionId,variantId:ft};const Me=V.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),We=Me!=null&&Me[1]?decodeURIComponent(Me[1]):null;if(We&&l.variants.some(xe=>xe.workItemId===We))return{kind:"variant",sessionId:l.sessionId,variantId:We}}const je=!!(w!=null&&w.left||w!=null&&w.right);return(!je||b)&&!V&&d&&f&&l.variants.some(st=>st.workItemId===f)?{kind:"variant",sessionId:l.sessionId,variantId:f}:(!je||b)&&!V&&k&&l.variants.some(st=>st.workItemId===k)?{kind:"variant",sessionId:l.sessionId,variantId:k}:Im},[_,j,l,d,f,V,w,b,k]),X=m.useRef(null);m.useEffect(()=>{var ft,Me;if(!j||((ft=j.preview)==null?void 0:ft.kind)!=="static_artifact"||((Me=j.refinement)==null?void 0:Me.status)!=="succeeded")return;const je=`${j.workItemId}:${j.refinement.workItemId}`;if(X.current===je)return;X.current=je;const st=j.preview.url.includes("?")?"&":"?",Be=`${j.preview.url}${st}refinement=${encodeURIComponent(j.refinement.workItemId)}`;V!==Be&&(o(Be),s(We=>We+1))},[V,j,s,o,l]);const q=V!==null&&zG(V),Z=V!==null&&!q||b&&!d&&!q,{isUpstreamReady:Y,iframeRemountKey:H,probeAttemptCount:Q,initialProbeComplete:z}=sY(e,{rerunProbeImmediatelyOnVersion:r,probePath:q?V:null,skip:Z}),[N,G]=m.useState(()=>p&&Y?r:null),oe=m.useRef(null);m.useEffect(()=>{if(!p){oe.current=null,G(null);return}if(N===r){oe.current=null;return}const je=oe.current;if(!je||je.remountKey!==r){oe.current={remountKey:r,probeAttemptCount:Q};return}Y&&Q>je.probeAttemptCount&&(oe.current=null,G(r))},[N,r,p,Q,Y]);const ee=V!==null&&!q||Y,ve=v||p&&N!==r||p&&!ee,le=`${H}:${r}`,te=AI(window.location.pathname),Pe=e==="static"?`/static${te??"/"}`:te??"/",Se=BI(u);let Ne=null;V&&(Ne=UI({agentApplyMode:u,url:V}));const Qe=C||M||ve?"about:blank":(q&&!ee?"about:blank":Ne)??(ee?`${Se}${Pe}`:"about:blank"),lt=!!C||!!M||!ee&&z;let ut=null;return ve?ut=S.jsx(z_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):C?ut=S.jsx(z_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})}):M?ut=S.jsx(_Y,{issue:M}):lt&&(ut=T?S.jsx(ZI,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Qx,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),S.jsxs("div",{className:"relative h-full w-full",children:[ut,S.jsx(WI,{target:U,src:Qe,framework:e,remountKey:le})]})};function aC({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=rt(To),u=mt(To),d=sh(),f=rt(dh),p=rt(uv),v=m.useRef(!1),y=m.useCallback(()=>{v.current||(v.current=!0,Du({source:i,sessionId:e,variantId:n}))},[i,e,n]),w=m.useCallback(()=>{if(o){u(null);const M=Om("ended",l);d==null||d.capture(M.event,M.properties);return}y();const P={...l};delete P[t];const T=P.left||P.right?P:null;u(T);const O=Om(T?"updated":"ended",T??l);d==null||d.capture(O.event,O.properties)},[o,d,u,t,l,y]),_=m.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=m.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(P=>P.workItemId===n)??null,[e,n,f]),b=m.useMemo(()=>{var T,O;let P=r;if(((T=x==null?void 0:x.preview)==null?void 0:T.kind)==="static_artifact"&&((O=x.refinement)==null?void 0:O.status)==="succeeded"){const M=x.preview.url.includes("?")?"&":"?";P=`${x.preview.url}${M}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return UI({agentApplyMode:p,url:P})},[p,x,r]),k=((C=x==null?void 0:x.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${x.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(Gl,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:w,"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(WI,{target:_,src:b,framework:"static",remountKey:k})})]})}function xY(){const t=rt(Lu),e=rt(Wx);return!t||!e?null:ch.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)}function bY(){const t=rt(Lu),e=rt(Wx),n=rt(To),r=mt(Lu),s=mt(To),i=sh(),o=m.useRef(null),[l,u]=m.useState(null),[d,f]=m.useState("hidden");m.useEffect(()=>{t||(f("hidden"),u(null))},[t]);const p=m.useCallback((y,w)=>{const _=o.current;if(!_)return null;const x=_.getBoundingClientRect();return y<x.left||y>x.right||w<x.top||w>x.bottom?null:y<(x.left+x.right)/2?"left":"right"},[]);if(m.useEffect(()=>{if(!t||!e)return;const y=p(e.x,e.y);u(w=>w===y?w:y),f(w=>{if(w==="exiting")return w;const _=y!==null?"visible":"hidden";return w===_?w:_})},[t,e,p]),m.useEffect(()=>{if(!t)return;const y=w=>{const _=p(w.clientX,w.clientY);if(_&&t.url){const x={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[_];b&&(b.sessionId!==x.sessionId||b.variantId!==x.variantId)&&Du(b);const k={...n??{},[_]:x};s(k);const C=Om(n?"updated":"started",k);i==null||i.capture(C.event,C.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else Du(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y),()=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y)}},[t,p,i,r,s,n]),!t)return null;const v=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:o,className:v,"aria-hidden":"true",children:[S.jsx(lC,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),S.jsx(lC,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function lC({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 qI=(t,e,n)=>{var i,o;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(l=>l.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((o=r.refinement)==null?void 0:o.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},cC=(t,e)=>{if(!t)return;const n=qI(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},SY=()=>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(HI,{trackGlobalLoaderCount:!1})})}),EY=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=jK();return m.useEffect(()=>{r().catch(o=>{ke==null||ke.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:eC})})},[r]),s?S.jsx(SY,{}):i||!n?S.jsx(Qx,{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:()=>{ke==null||ke.capture("preview_config_retry_clicked"),r().catch(o=>{ke==null||ke.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:eC})})}}]}):S.jsx(kY,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function kY(t){const e=rt(To),n=rt(Lu),r=rt(dh),s=rt(Mm),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=m.useMemo(()=>{var T,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(T=i??o)==null?void 0:T.variantId,x=r.variants.filter(M=>{var R;return M.status==="succeeded"&&((R=M.preview)==null?void 0:R.kind)==="static_artifact"&&M.workItemId!==_}),b=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=x.find(M=>{var R;return((R=M.preview)==null?void 0:R.kind)==="static_artifact"&&M.preview.url===b})??x[0];if(((O=C==null?void 0:C.preview)==null?void 0:O.kind)!=="static_artifact")return;const P=qI(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]),u=cC(i,r)??(o?l:void 0),d=cC(o,r)??(i?l:void 0),f=!i&&!!u,p=!o&&!!d,v=!!(u||d),y=S.jsx(wY,{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":""} ${v?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&S.jsx(aC,{side:"left",sessionId:u.sessionId,variantId:u.variantId,url:u.url,label:u.label,source:u.source,isFallback:f},`left-${u.sessionId}:${u.variantId}:${u.url}`),!(u&&d)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:y}),d&&S.jsx(aC,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(bY,{}),S.jsx(xY,{})]})})}function po(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function GI(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
116
- * GSAP 3.15.0
117
- * https://gsap.com
118
- *
119
- * @license Copyright 2008-2026, GreenSock. All rights reserved.
120
- * Subject to the terms at https://gsap.com/standard-license
121
- * @author: Jack Doyle, jack@greensock.com
122
- */var ws={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},zf={duration:.5,overwrite:!1,delay:0},Jx,lr,Qt,Vs=1e8,jt=1/Vs,B_=Math.PI*2,CY=B_/4,PY=0,KI=Math.sqrt,AY=Math.cos,TY=Math.sin,Yn=function(e){return typeof e=="string"},vn=function(e){return typeof e=="function"},Ro=function(e){return typeof e=="number"},eb=function(e){return typeof e>"u"},Bi=function(e){return typeof e=="object"},Wr=function(e){return e!==!1},tb=function(){return typeof window<"u"},u0=function(e){return vn(e)||Yn(e)},YI=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},yr=Array.isArray,RY=/random\([^)]+\)/g,IY=/,\s*/g,uC=/(?:-?\.?\d|\.)+/gi,XI=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Yc=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,by=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,QI=/[+-]=-?[.\d]+/,MY=/[^,'"\[\]\s]+/gi,OY=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,on,Ai,U_,nb,bs={},Lm={},JI,eM=function(e){return(Lm=ju(e,bs))&&Kr},rb=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Bf=function(e,n){return!n&&console.warn(e)},tM=function(e,n){return e&&(bs[e]=n)&&Lm&&(Lm[e]=n)||bs},Uf=function(){return 0},LY={suppressEvents:!0,isStart:!0,kill:!1},L0={suppressEvents:!0,kill:!1},DY={suppressEvents:!0},sb={},xa=[],W_={},nM,ds={},Sy={},dC=30,D0=[],ib="",ob=function(e){var n=e[0],r,s;if(Bi(n)||vn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=D0.length;s--&&!D0[s].targetTest(n););r=D0[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new EM(e[s],r)))||e.splice(s,1);return e},$l=function(e){return e._gsap||ob($s(e))[0]._gsap},rM=function(e,n,r){return(r=e[n])&&vn(r)?e[n]():eb(r)&&e.getAttribute&&e.getAttribute(n)||r},Zr=function(e,n){return(e=e.split(",")).forEach(n)||e},bn=function(e){return Math.round(e*1e5)/1e5||0},rn=function(e){return Math.round(e*1e7)/1e7||0},au=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},NY=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Dm=function(){var e=xa.length,n=xa.slice(0),r,s;for(W_={},xa.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},ab=function(e){return!!(e._initted||e._startAt||e.add)},sM=function(e,n,r,s){xa.length&&!lr&&Dm(),e.render(n,r,!!(lr&&n<0&&ab(e))),xa.length&&!lr&&Dm()},iM=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(MY).length<2?n:Yn(e)?e.trim():e},oM=function(e){return e},Ss=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},jY=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},ju=function(e,n){for(var r in n)e[r]=n[r];return e},fC=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=Bi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Nm=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},gf=function(e){var n=e.parent||on,r=e.keyframes?jY(yr(e.keyframes)):Ss;if(Wr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},FY=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},aM=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},hv=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},Ra=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Hl=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},VY=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},Z_=function(e,n,r,s){return e._startAt&&(lr?e._startAt.revert(L0):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},$Y=function t(e){return!e||e._ts&&t(e.parent)},hC=function(e){return e._repeat?Fu(e._tTime,e=e.duration()+e._rDelay)*e:0},Fu=function(e,n){var r=Math.floor(e=rn(e/n));return e&&r===e?r-1:r},jm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},pv=function(e){return e._end=rn(e._start+(e._tDur/Math.abs(e._ts||e._rts||jt)||0))},mv=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=rn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),pv(e),r._dirty||Hl(r,e)),e},lM=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=jm(e.rawTime(),n),(!n._dur||ph(0,n.totalDuration(),r)-n._tTime>jt)&&n.render(r,!0)),Hl(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=-jt}},Di=function(e,n,r,s){return n.parent&&Ra(n),n._start=rn((Ro(r)?r:r||e!==on?Ls(e,r,n):e._time)+n._delay),n._end=rn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),aM(e,n,"_first","_last",e._sort?"_start":0),q_(n)||(e._recent=n),s||lM(e,n),e._ts<0&&mv(e,e._tTime),e},cM=function(e,n){return(bs.ScrollTrigger||rb("scrollTrigger",n))&&bs.ScrollTrigger.create(n,e)},uM=function(e,n,r,s,i){if(cb(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!lr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&nM!==hs.frame)return xa.push(e),e._lazy=[i,s],1},HY=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},q_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},zY=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&HY(e)&&!(!e._initted&&q_(e))||(e._ts<0||e._dp._ts<0)&&!q_(e))?0:1,l=e._rDelay,u=0,d,f,p;if(l&&e._repeat&&(u=ph(0,e._tDur,n),f=Fu(u,l),e._yoyo&&f&1&&(o=1-o),f!==Fu(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||lr||s||e._zTime===jt||!n&&e._zTime){if(!e._initted&&uM(e,n,s,r,u))return;for(p=e._zTime,e._zTime=n||(r?jt:0),r||(r=n&&!p),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=u,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&Z_(e,n,r,!0),e._onUpdate&&!r&&ms(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&ms(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&Ra(e,1),!r&&!lr&&(ms(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},BY=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}},Vu=function(e,n,r,s){var i=e._repeat,o=rn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:rn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&mv(e,e._tTime=e._tDur*l),e.parent&&pv(e),r||Hl(e.parent,e),e},pC=function(e){return e instanceof Hr?Hl(e):Vu(e,e._dur)},UY={_start:0,endTime:Uf,totalDuration:Uf},Ls=function t(e,n,r){var s=e.labels,i=e._recent||UY,o=e.duration()>=Vs?i.endTime(!1):e._dur,l,u,d;return Yn(n)&&(isNaN(n)||n in s)?(u=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),u==="<"||u===">"?(l>=0&&(n=n.replace(/=/,"")),(u==="<"?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]):(u=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(u=u/100*(yr(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},yf=function(e,n,r){var s=Ro(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,u;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,u=r;u&&!("immediateRender"in l);)l=u.vars.defaults||{},u=Wr(u.vars.inherit)&&u.parent;o.immediateRender=Wr(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new Mn(n[0],o,n[i+1])},Va=function(e,n){return e||e===0?n(e):n},ph=function(e,n,r){return r<e?e:r>n?n:r},vr=function(e,n){return!Yn(e)||!(n=OY.exec(e))?"":n[1]},WY=function(e,n,r){return Va(r,function(s){return ph(e,n,s)})},G_=[].slice,dM=function(e,n){return e&&Bi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&Bi(e[0]))&&!e.nodeType&&e!==Ai},ZY=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Yn(s)&&!n||dM(s,1)?(i=r).push.apply(i,$s(s)):r.push(s)})||r},$s=function(e,n,r){return Qt&&!n&&Qt.selector?Qt.selector(e):Yn(e)&&!r&&(U_||!$u())?G_.call((n||nb).querySelectorAll(e),0):yr(e)?ZY(e,r):dM(e)?G_.call(e,0):e?[e]:[]},K_=function(e){return e=$s(e)[0]||Bf("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return $s(n,r.querySelectorAll?r:r===e?Bf("Invalid scope")||nb.createElement("div"):e)}},fM=function(e){return e.sort(function(){return .5-Math.random()})},hM=function(e){if(vn(e))return e;var n=Bi(e)?e:{each:e},r=zl(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,u=isNaN(s)||l,d=n.axis,f=s,p=s;return Yn(s)?f=p={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],p=s[1]),function(v,y,w){var _=(w||n).length,x=o[_],b,k,C,P,T,O,M,R,L;if(!x){if(L=n.grid==="auto"?0:(n.grid||[1,Vs])[1],!L){for(M=-Vs;M<(M=w[L++].getBoundingClientRect().left)&&L<_;);L<_&&L--}for(x=o[_]=[],b=u?Math.min(L,_)*f-.5:s%L,k=L===Vs?0:u?_*p/L-.5:s/L|0,M=0,R=Vs,O=0;O<_;O++)C=O%L-b,P=k-(O/L|0),x[O]=T=d?Math.abs(d==="y"?P:C):KI(C*C+P*P),T>M&&(M=T),T<R&&(R=T);s==="random"&&fM(x),x.max=M-R,x.min=R,x.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(L>_?_-1:d?d==="y"?_/L:L:Math.max(L,_/L))||0)*(s==="edges"?-1:1),x.b=_<0?i-_:i,x.u=vr(n.amount||n.each)||0,r=r&&_<0?iX(r):r}return _=(x[v]-x.min)/x.max||0,rn(x.b+(r?r(_):_)*x.v)+x.u}},Y_=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=rn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(Ro(r)?0:vr(r))}},pM=function(e,n){var r=yr(e),s,i;return!r&&Bi(e)&&(s=r=e.radius||Vs,e.values?(e=$s(e.values),(i=!Ro(e[0]))&&(s*=s)):e=Y_(e.increment)),Va(n,r?vn(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),u=parseFloat(i?o.y:0),d=Vs,f=0,p=e.length,v,y;p--;)i?(v=e[p].x-l,y=e[p].y-u,v=v*v+y*y):v=Math.abs(e[p]-l),v<d&&(d=v,f=p);return f=!s||d<=s?e[f]:o,i||f===o||Ro(o)?f:f+vr(o)}:Y_(e))},mM=function(e,n,r,s){return Va(yr(e)?!n:r===!0?!!(r=0):!s,function(){return yr(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})},qY=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)}},GY=function(e,n){return function(r){return e(parseFloat(r))+(n||vr(r))}},KY=function(e,n,r){return gM(e,n,0,1,r)},vM=function(e,n,r){return Va(r,function(s){return e[~~n(s)]})},YY=function t(e,n,r){var s=n-e;return yr(e)?vM(e,t(0,e.length),n):Va(r,function(i){return(s+(i-e)%s)%s+e})},XY=function t(e,n,r){var s=n-e,i=s*2;return yr(e)?vM(e,t(0,e.length-1),n):Va(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},Wf=function(e){return e.replace(RY,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(IY);return mM(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},gM=function(e,n,r,s,i){var o=n-e,l=s-r;return Va(i,function(u){return r+((u-e)/o*l||0)})},QY=function t(e,n,r,s){var i=isNaN(e+n)?0:function(y){return(1-y)*e+y*n};if(!i){var o=Yn(e),l={},u,d,f,p,v;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(yr(e)&&!yr(n)){for(f=[],p=e.length,v=p-2,d=1;d<p;d++)f.push(t(e[d-1],e[d]));p--,i=function(w){w*=p;var _=Math.min(v,~~w);return f[_](w-_)},r=n}else s||(e=ju(yr(e)?[]:{},e));if(!f){for(u in n)lb.call(l,e,u,"get",n[u]);i=function(w){return fb(w,l)||(o?e.p:e)}}}return Va(r,i)},mC=function(e,n,r){var s=e.labels,i=Vs,o,l,u;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(u=o,i=l);return u},ms=function(e,n,r){var s=e.vars,i=s[n],o=Qt,l=e._ctx,u,d,f;if(i)return u=s[n+"Params"],d=s.callbackScope||e,r&&xa.length&&Dm(),l&&(Qt=l),f=u?i.apply(d,u):i.call(d),Qt=o,f},tf=function(e){return Ra(e),e.scrollTrigger&&e.scrollTrigger.kill(!!lr),e.progress()<1&&ms(e,"onInterrupt"),e},Xc,yM=[],_M=function(e){if(e)if(e=!e.name&&e.default||e,tb()||e.headless){var n=e.name,r=vn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Uf,render:fb,add:lb,kill:mX,modifier:pX,rawVars:0},o={targetTest:0,get:0,getSetter:db,aliases:{},register:0};if($u(),e!==s){if(ds[n])return;Ss(s,Ss(Nm(e,i),o)),ju(s.prototype,ju(i,Nm(e,o))),ds[s.prop=n]=s,e.targetTest&&(D0.push(s),sb[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}tM(n,s),e.register&&e.register(Kr,s,qr)}else yM.push(e)},Nt=255,nf={aqua:[0,Nt,Nt],lime:[0,Nt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Nt],navy:[0,0,128],white:[Nt,Nt,Nt],olive:[128,128,0],yellow:[Nt,Nt,0],orange:[Nt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Nt,0,0],pink:[Nt,192,203],cyan:[0,Nt,Nt],transparent:[Nt,Nt,Nt,0]},Ey=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)*Nt+.5|0},wM=function(e,n,r){var s=e?Ro(e)?[e>>16,e>>8&Nt,e&Nt]:0:nf.black,i,o,l,u,d,f,p,v,y,w;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),nf[e])s=nf[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&Nt,s&Nt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Nt,e&Nt]}else if(e.substr(0,3)==="hsl"){if(s=w=e.match(uC),!n)u=+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]=Ey(u+1/3,i,o),s[1]=Ey(u,i,o),s[2]=Ey(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(XI),r&&s.length<4&&(s[3]=1),s}else s=e.match(uC)||nf.transparent;s=s.map(Number)}return n&&!w&&(i=s[0]/Nt,o=s[1]/Nt,l=s[2]/Nt,p=Math.max(i,o,l),v=Math.min(i,o,l),f=(p+v)/2,p===v?u=d=0:(y=p-v,d=f>.5?y/(2-p-v):y/(p+v),u=p===i?(o-l)/y+(o<l?6:0):p===o?(l-i)/y+2:(i-o)/y+4,u*=60),s[0]=~~(u+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},xM=function(e){var n=[],r=[],s=-1;return e.split(ba).forEach(function(i){var o=i.match(Yc)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},vC=function(e,n,r){var s="",i=(e+s).match(ba),o=n?"hsla(":"rgba(",l=0,u,d,f,p;if(!i)return e;if(i=i.map(function(v){return(v=wM(v,n,1))&&o+(n?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),r&&(f=xM(e),u=r.c,u.join(s)!==f.c.join(s)))for(d=e.replace(ba,"1").split(Yc),p=d.length-1;l<p;l++)s+=d[l]+(~u.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(ba),p=d.length-1;l<p;l++)s+=d[l]+i[l];return s+d[p]},ba=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in nf)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),JY=/hsl[a]?\(/,bM=function(e){var n=e.join(" "),r;if(ba.lastIndex=0,ba.test(n))return r=JY.test(n),e[1]=vC(e[1],r),e[0]=vC(e[0],r,xM(e[1])),!0},Zf,hs=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],u,d,f,p,v,y,w=function _(x){var b=t()-s,k=x===!0,C,P,T,O;if((b>e||b<0)&&(r+=b-n),s+=b,T=s-r,C=T-o,(C>0||k)&&(O=++p.frame,v=T-p.time*1e3,p.time=T=T/1e3,o+=C+(C>=i?4:i-C),P=1),k||(u=d(_)),P)for(y=0;y<l.length;y++)l[y](T,v,O,x)};return p={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(x){return v/(1e3/(x||60))},wake:function(){JI&&(!U_&&tb()&&(Ai=U_=window,nb=Ai.document||{},bs.gsap=Kr,(Ai.gsapVersions||(Ai.gsapVersions=[])).push(Kr.version),eM(Lm||Ai.GreenSockGlobals||!Ai.gsap&&Ai||{}),yM.forEach(_M)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&p.sleep(),d=f||function(x){return setTimeout(x,o-p.time*1e3+1|0)},Zf=1,w(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(u),Zf=0,d=Uf},lagSmoothing:function(x,b){e=x||1/0,n=Math.min(b||33,e)},fps:function(x){i=1e3/(x||240),o=p.time*1e3+i},add:function(x,b,k){var C=b?function(P,T,O,M){x(P,T,O,M),p.remove(C)}:x;return p.remove(x),l[k?"unshift":"push"](C),$u(),C},remove:function(x,b){~(b=l.indexOf(x))&&l.splice(b,1)&&y>=b&&y--},_listeners:l},p})(),$u=function(){return!Zf&&hs.wake()},yt={},eX=/^[\d.\-M][\d.\-,\s]/,tX=/["']/g,nX=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,u,d;i<o;i++)u=r[i],l=i!==o-1?u.lastIndexOf(","):u.length,d=u.substr(0,l),n[s]=isNaN(d)?d.replace(tX,"").trim():+d,s=u.substr(l+1).trim();return n},rX=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)},sX=function(e){var n=(e+"").split("("),r=yt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[nX(n[1])]:rX(e).split(",").map(iM)):yt._CE&&eX.test(e)?yt._CE("",e):r},iX=function(e){return function(n){return 1-e(1-n)}},zl=function(e,n){return e&&(vn(e)?e:yt[e]||sX(e))||n},Yl=function(e,n,r,s){r===void 0&&(r=function(u){return 1-n(1-u)}),s===void 0&&(s=function(u){return u<.5?n(u*2)/2:1-n((1-u)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return Zr(e,function(l){yt[l]=bs[l]=i,yt[o=l.toLowerCase()]=r;for(var u in i)yt[o+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=yt[l+"."+u]=i[u]}),i},SM=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},ky=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/B_*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*TY((f-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:SM(l);return i=B_/i,u.config=function(d,f){return t(e,d,f)},u},Cy=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)}:SM(r);return s.config=function(i){return t(e,i)},s};Zr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Yl(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})});yt.Linear.easeNone=yt.none=yt.Linear.easeIn;Yl("Elastic",ky("in"),ky("out"),ky());(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};Yl("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Yl("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Yl("Circ",function(t){return-(KI(1-t*t)-1)});Yl("Sine",function(t){return t===1?1:-AY(t*CY)+1});Yl("Back",Cy("in"),Cy("out"),Cy());yt.SteppedEase=yt.steps=bs.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-jt;return function(l){return((s*ph(0,o,l)|0)+i)*r}}};zf.ease=yt["quad.out"];Zr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return ib+=t+","+t+"Params,"});var EM=function(e,n){this.id=PY++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:rM,this.set=n?n.getSetter:db},qf=(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,Vu(this,+n.duration,1,1),this.data=n.data,Qt&&(this._ctx=Qt,Qt.data.push(this)),Zf||hs.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,Vu(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if($u(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(mv(this,r),!i._dp||i.parent||lM(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)&&Di(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===jt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),sM(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+hC(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)+hC(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?Fu(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-jt?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?jm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-jt?0:this._rts,this.totalTime(ph(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),pv(this),VY(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):($u(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==jt&&(this._tTime-=jt)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=rn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Di(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Wr(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?jm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=DY);var s=lr;return lr=r,ab(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),lr=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,pC(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,pC(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(Ls(this,r),Wr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Wr(s)),this._dur||(this._zTime=-jt),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?-jt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-jt,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)-jt)},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=vn(r)?r:oM,u=function(){var f=s.then;s.then=null,i&&i(),vn(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?u():s._prom=u})},e.kill=function(){tf(this)},t})();Ss(qf.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:-jt,_prom:0,_ps:!1,_rts:1});var Hr=(function(t){GI(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=Wr(r.sortChildren),on&&Di(r.parent||on,po(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&cM(po(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return yf(0,arguments,this),this},n.from=function(s,i,o){return yf(1,arguments,this),this},n.fromTo=function(s,i,o,l){return yf(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,gf(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Mn(s,i,Ls(this,o),1),this},n.call=function(s,i,o){return Di(this,Mn.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,u,d,f){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=f,o.parent=this,new Mn(s,o,Ls(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,f){return o.runBackwards=1,gf(o).immediateRender=Wr(o.immediateRender),this.staggerTo(s,i,o,l,u,d,f)},n.staggerFromTo=function(s,i,o,l,u,d,f,p){return l.startAt=o,gf(l).immediateRender=Wr(l.immediateRender),this.staggerTo(s,i,l,u,d,f,p)},n.render=function(s,i,o){var l=this._time,u=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:rn(s),p=this._zTime<0!=s<0&&(this._initted||!d),v,y,w,_,x,b,k,C,P,T,O,M;if(this!==on&&f>u&&s>=0&&(f=u),f!==this._tTime||o||p){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),v=f,P=this._start,C=this._ts,b=!C,p&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(O=this._yoyo,x=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(x*100+s,i,o);if(v=rn(f%x),f===u?(_=this._repeat,v=d):(T=rn(f/x),_=~~T,_&&_===T&&(v=d,_--),v>d&&(v=d)),T=Fu(this._tTime,x),!l&&this._tTime&&T!==_&&this._tTime-T*x-this._dur<=0&&(T=_),O&&_&1&&(v=d-v,M=1),_!==T&&!this._lock){var R=O&&T&1,L=R===(O&&_&1);if(_<T&&(R=!R),l=R?0:f%d?d:f,this._lock=1,this.render(l||(M?0:rn(_*x)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&ms(this,"onRepeat"),this.vars.repeatRefresh&&!M&&(this.invalidate()._lock=1,T=_),l&&l!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,u=this._tDur,L&&(this._lock=2,l=R?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!M&&this.invalidate()),this._lock=0,!this._ts&&!b)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=BY(this,rn(l),rn(v)),k&&(f-=v-(v=k._start))),this._tTime=f,this._time=v,this._act=!!C,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!T&&(ms(this,"onStart"),this._tTime!==f))return this;if(v>=l&&s>=0)for(y=this._first;y;){if(w=y._next,(y._act||v>=y._start)&&y._ts&&k!==y){if(y.parent!==this)return this.render(s,i,o);if(y.render(y._ts>0?(v-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(v-y._start)*y._ts,i,o),v!==this._time||!this._ts&&!b){k=0,w&&(f+=this._zTime=-jt);break}}y=w}else{y=this._last;for(var D=s<0?s:v;y;){if(w=y._prev,(y._act||D<=y._end)&&y._ts&&k!==y){if(y.parent!==this)return this.render(s,i,o);if(y.render(y._ts>0?(D-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(D-y._start)*y._ts,i,o||lr&&ab(y)),v!==this._time||!this._ts&&!b){k=0,w&&(f+=this._zTime=D?-jt:jt);break}}y=w}}if(k&&!i&&(this.pause(),k.render(v>=l?0:-jt)._zTime=v>=l?1:-1,this._ts))return this._start=P,pv(this),this.render(s,i,o);this._onUpdate&&!i&&ms(this,"onUpdate",!0),(f===u&&this._tTime>=this.totalDuration()||!f&&l)&&(P===this._start||Math.abs(C)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===u&&this._ts>0||!f&&this._ts<0)&&Ra(this,1),!i&&!(s<0&&!l)&&(f||l||!u)&&(ms(this,f===u&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<u&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(Ro(i)||(i=Ls(this,i,s)),!(s instanceof qf)){if(yr(s))return s.forEach(function(l){return o.add(l,i)}),this;if(Yn(s))return this.addLabel(s,i);if(vn(s))s=Mn.delayedCall(0,s);else return this}return this!==s?Di(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=-Vs);for(var u=[],d=this._first;d;)d._start>=l&&(d instanceof Mn?i&&u.push(d):(o&&u.push(d),s&&u.push.apply(u,d.getChildren(!0,i,o)))),d=d._next;return u},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 Yn(s)?this.removeLabel(s):vn(s)?this.killTweensOf(s):(s.parent===this&&hv(this,s),s===this._recent&&(this._recent=this._last),Hl(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=rn(hs.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]=Ls(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=Mn.delayedCall(0,i||Uf,o);return l.data="isPause",this._hasPause=1,Di(this,l,Ls(this,s))},n.removePause=function(s){var i=this._first;for(s=Ls(this,s);i;)i._start===s&&i.data==="isPause"&&Ra(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)va!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=$s(s),u=this._first,d=Ro(i),f;u;)u instanceof Mn?NY(u._targets,l)&&(d?(!va||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&o.push(u):(f=u.getTweensOf(l,i)).length&&o.push.apply(o,f),u=u._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=Ls(o,s),u=i,d=u.startAt,f=u.onStart,p=u.onStartParams,v=u.immediateRender,y,w=Mn.to(o,Ss({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())||jt,onStart:function(){if(o.pause(),!y){var x=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());w._dur!==x&&Vu(w,x,0,1).render(w._time,!0,!0),y=1}f&&f.apply(w,p||[])}},i));return v?w.render(0):w},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Ss({startAt:{time:Ls(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),mC(this,Ls(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),mC(this,Ls(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+jt)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,u=this.labels,d;for(s=rn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in u)u[d]>=o&&(u[d]+=s);return Hl(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={}),Hl(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=Vs,d,f,p;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(p=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),f=l._start,f>u&&o._sort&&l._ts&&!o._lock?(o._lock=1,Di(o,l,f-l._delay,1)._lock=0):u=f,f<0&&l._ts&&(i-=f,(!p&&!o._dp||p&&p.smoothChildTiming)&&(o._start+=rn(f/o._ts),o._time-=f,o._tTime-=f),o.shiftChildren(-f,!1,-1/0),u=0),l._end>i&&l._ts&&(i=l._end),l=d;Vu(o,o===on&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(on._ts&&(sM(on,jm(s,on)),nM=hs.frame),hs.frame>=dC){dC+=ws.autoSleep||120;var i=on._first;if((!i||!i._ts)&&ws.autoSleep&&hs._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||hs.sleep()}}},e})(qf);Ss(Hr.prototype,{_lock:0,_hasPause:0,_forcing:0});var oX=function(e,n,r,s,i,o,l){var u=new qr(this._pt,e,n,0,1,RM,null,i),d=0,f=0,p,v,y,w,_,x,b,k;for(u.b=r,u.e=s,r+="",s+="",(b=~s.indexOf("random("))&&(s=Wf(s)),o&&(k=[r,s],o(k,e,n),r=k[0],s=k[1]),v=r.match(by)||[];p=by.exec(s);)w=p[0],_=s.substring(d,p.index),y?y=(y+1)%5:_.substr(-5)==="rgba("&&(y=1),w!==v[f++]&&(x=parseFloat(v[f-1])||0,u._pt={_next:u._pt,p:_||f===1?_:",",s:x,c:w.charAt(1)==="="?au(x,w)-x:parseFloat(w)-x,m:y&&y<4?Math.round:0},d=by.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,(QI.test(s)||b)&&(u.e=0),this._pt=u,u},lb=function(e,n,r,s,i,o,l,u,d,f){vn(s)&&(s=s(i||0,e,o));var p=e[n],v=r!=="get"?r:vn(p)?d?e[n.indexOf("set")||!vn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,y=vn(p)?d?dX:AM:ub,w;if(Yn(s)&&(~s.indexOf("random(")&&(s=Wf(s)),s.charAt(1)==="="&&(w=au(v,s)+(vr(v)||0),(w||w===0)&&(s=w))),!f||v!==s||X_)return!isNaN(v*s)&&s!==""?(w=new qr(this._pt,e,n,+v||0,s-(v||0),typeof p=="boolean"?hX:TM,0,y),d&&(w.fp=d),l&&w.modifier(l,this,e),this._pt=w):(!p&&!(n in e)&&rb(n,s),oX.call(this,e,n,v,s,y,u||ws.stringFilter,d))},aX=function(e,n,r,s,i){if(vn(e)&&(e=_f(e,i,n,r,s)),!Bi(e)||e.style&&e.nodeType||yr(e)||YI(e))return Yn(e)?_f(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=_f(e[l],i,n,r,s);return o},kM=function(e,n,r,s,i,o){var l,u,d,f;if(ds[e]&&(l=new ds[e]).init(i,l.rawVars?n[e]:aX(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new qr(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Xc))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=u;return l},va,X_,cb=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,u=s.lazy,d=s.onUpdate,f=s.runBackwards,p=s.yoyoEase,v=s.keyframes,y=s.autoRevert,w=e._dur,_=e._startAt,x=e._targets,b=e.parent,k=b&&b.data==="nested"?b.vars.targets:x,C=e._overwrite==="auto"&&!Jx,P=e.timeline,T=s.easeReverse||p,O,M,R,L,D,V,j,U,X,q,Z,Y,H;if(P&&(!v||!i)&&(i="none"),e._ease=zl(i,zf.ease),e._rEase=T&&(zl(T)||e._ease),e._from=!P&&!!s.runBackwards,e._from&&(e.ratio=1),!P||v&&!s.stagger){if(U=x[0]?$l(x[0]).harness:0,Y=U&&s[U.prop],O=Nm(s,sb),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!y?_.render(-1,!0):_.revert(f&&w?L0:LY),_._lazy=0),o){if(Ra(e._startAt=Mn.set(x,Ss({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!_&&Wr(u),startAt:null,delay:0,onUpdate:d&&function(){return ms(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(lr||!l&&!y)&&e._startAt.revert(L0),l&&w&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&w&&!_){if(n&&(l=!1),R=Ss({overwrite:!1,data:"isFromStart",lazy:l&&!_&&Wr(u),immediateRender:l,stagger:0,parent:b},O),Y&&(R[U.prop]=Y),Ra(e._startAt=Mn.set(x,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(lr?e._startAt.revert(L0):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,jt,jt);else if(!n)return}for(e._pt=e._ptCache=0,u=w&&Wr(u)||u&&!w,M=0;M<x.length;M++){if(D=x[M],j=D._gsap||ob(x)[M]._gsap,e._ptLookup[M]=q={},W_[j.id]&&xa.length&&Dm(),Z=k===x?M:k.indexOf(D),U&&(X=new U).init(D,Y||O,e,Z,k)!==!1&&(e._pt=L=new qr(e._pt,D,X.name,0,1,X.render,X,0,X.priority),X._props.forEach(function(Q){q[Q]=L}),X.priority&&(V=1)),!U||Y)for(R in O)ds[R]&&(X=kM(R,O,e,Z,D,k))?X.priority&&(V=1):q[R]=L=lb.call(e,D,R,"get",O[R],Z,k,0,s.stringFilter);e._op&&e._op[M]&&e.kill(D,e._op[M]),C&&e._pt&&(va=e,on.killTweensOf(D,q,e.globalTime(n)),H=!e.parent,va=0),e._pt&&u&&(W_[j.id]=1)}V&&IM(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!H,v&&n<=0&&P.render(Vs,!0,!0)},lX=function(e,n,r,s,i,o,l,u){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,p,v,y;if(!d)for(d=e._ptCache[n]=[],v=e._ptLookup,y=e._targets.length;y--;){if(f=v[y][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 X_=1,e.vars[n]="+=0",cb(e,l),X_=0,u?Bf(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(y=d.length;y--;)p=d[y],f=p._pt||p,f.s=(s||s===0)&&!i?s:f.s+(s||0)+o*f.c,f.c=r-f.s,p.e&&(p.e=bn(r)+vr(p.e)),p.b&&(p.b=f.s+vr(p.b))},cX=function(e,n){var r=e[0]?$l(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=ju({},n);for(o in s)if(o in i)for(u=s[o].split(","),l=u.length;l--;)i[u[l]]=i[o];return i},uX=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(yr(n))l=r[e]||(r[e]=[]),n.forEach(function(u,d){return l.push({t:d/(n.length-1)*100,v:u,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},_f=function(e,n,r,s,i){return vn(e)?e.call(n,r,s,i):Yn(e)&&~e.indexOf("random(")?Wf(e):e},CM=ib+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",PM={};Zr(CM+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return PM[t]=1});var Mn=(function(t){GI(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:gf(s))||this;var u=l.vars,d=u.duration,f=u.delay,p=u.immediateRender,v=u.stagger,y=u.overwrite,w=u.keyframes,_=u.defaults,x=u.scrollTrigger,b=s.parent||on,k=(yr(r)||YI(r)?Ro(r[0]):"length"in s)?[r]:$s(r),C,P,T,O,M,R,L,D;if(l._targets=k.length?ob(k):Bf("GSAP target "+r+" not found. https://gsap.com",!ws.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=y,w||v||u0(d)||u0(f)){s=l.vars;var V=s.easeReverse||s.yoyoEase;if(C=l.timeline=new Hr({data:"nested",defaults:_||{},targets:b&&b.data==="nested"?b.vars.targets:k}),C.kill(),C.parent=C._dp=po(l),C._start=0,v||u0(d)||u0(f)){if(O=k.length,L=v&&hM(v),Bi(v))for(M in v)~CM.indexOf(M)&&(D||(D={}),D[M]=v[M]);for(P=0;P<O;P++)T=Nm(s,PM),T.stagger=0,V&&(T.easeReverse=V),D&&ju(T,D),R=k[P],T.duration=+_f(d,po(l),P,R,k),T.delay=(+_f(f,po(l),P,R,k)||0)-l._delay,!v&&O===1&&T.delay&&(l._delay=f=T.delay,l._start+=f,T.delay=0),C.to(R,T,L?L(P,R,k):0),C._ease=yt.none;C.duration()?d=f=0:l.timeline=0}else if(w){gf(Ss(C.vars.defaults,{ease:"none"})),C._ease=zl(w.ease||s.ease||"none");var j=0,U,X,q;if(yr(w))w.forEach(function(Z){return C.to(k,Z,">")}),C.duration();else{T={};for(M in w)M==="ease"||M==="easeEach"||uX(M,w[M],T,w.easeEach);for(M in T)for(U=T[M].sort(function(Z,Y){return Z.t-Y.t}),j=0,P=0;P<U.length;P++)X=U[P],q={ease:X.e,duration:(X.t-(P?U[P-1].t:0))/100*d},q[M]=X.v,C.to(k,q,j),j+=q.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return y===!0&&!Jx&&(va=po(l),on.killTweensOf(k),va=0),Di(b,po(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(p||!d&&!w&&l._start===rn(b._time)&&Wr(p)&&$Y(po(l))&&b.data!=="nested")&&(l._tTime=-jt,l.render(Math.max(0,-f)||0)),x&&cM(po(l),x),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,u=this._tDur,d=this._dur,f=s<0,p=s>u-jt&&!f?u:s<jt?0:s,v,y,w,_,x,b,k,C;if(!d)zY(this,s,i,o);else if(p!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(v=p,C=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(_*100+s,i,o);if(v=rn(p%_),p===u?(w=this._repeat,v=d):(x=rn(p/_),w=~~x,w&&w===x?(v=d,w--):v>d&&(v=d)),b=this._yoyo&&w&1,b&&(v=d-v),x=Fu(this._tTime,_),v===l&&!o&&this._initted&&w===x)return this._tTime=p,this;w!==x&&this.vars.repeatRefresh&&!b&&!this._lock&&v!==_&&this._initted&&(this._lock=o=1,this.render(rn(_*w),!0).invalidate()._lock=0)}if(!this._initted){if(uM(this,f?s:v,o,i,p))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&w!==x))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var P=v<l;if(P!==this._inv){var T=P?l:d-l;this._inv=P,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=T?(P?-1:1)/T: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((v-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(v/d);if(this._from&&(this.ratio=k=1-k),this._tTime=p,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&p&&!i&&!x&&(ms(this,"onStart"),this._tTime!==p))return this;for(y=this._pt;y;)y.r(k,y.d),y=y._next;C&&C.render(s<0?s:C._dur*C._ease(v/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&Z_(this,s,i,o),ms(this,"onUpdate")),this._repeat&&w!==x&&this.vars.onRepeat&&!i&&this.parent&&ms(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(f&&!this._onUpdate&&Z_(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&Ra(this,1),!i&&!(f&&!l)&&(p||l||b)&&(ms(this,p===u?"onComplete":"onReverseComplete",!0),this._prom&&!(p<u&&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,u){Zf||hs.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||cb(this,d),f=this._ease(d/this._dur),lX(this,s,i,o,l,f,d,u)?this.resetTo(s,i,o,l,1):(mv(this,0),this.parent||aM(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?tf(this):this.scrollTrigger&&this.scrollTrigger.kill(!!lr),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,va&&va.vars.overwrite!==!0)._first||tf(this),this.parent&&o!==this.timeline.totalDuration()&&Vu(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?$s(s):l,d=this._ptLookup,f=this._pt,p,v,y,w,_,x,b;if((!i||i==="all")&&FY(l,u))return i==="all"&&(this._pt=0),tf(this);for(p=this._op=this._op||[],i!=="all"&&(Yn(i)&&(_={},Zr(i,function(k){return _[k]=1}),i=_),i=cX(l,i)),b=l.length;b--;)if(~u.indexOf(l[b])){v=d[b],i==="all"?(p[b]=i,w=v,y={}):(y=p[b]=p[b]||{},w=i);for(_ in w)x=v&&v[_],x&&((!("kill"in x.d)||x.d.kill(_)===!0)&&hv(this,x,"_pt"),delete v[_]),y!=="all"&&(y[_]=1)}return this._initted&&!this._pt&&f&&tf(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return yf(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 yf(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 on.killTweensOf(s,i,o)},e})(qf);Ss(Mn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Zr("staggerTo,staggerFrom,staggerFromTo",function(t){Mn[t]=function(){var e=new Hr,n=G_.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var ub=function(e,n,r){return e[n]=r},AM=function(e,n,r){return e[n](r)},dX=function(e,n,r,s){return e[n](s.fp,r)},fX=function(e,n,r){return e.setAttribute(n,r)},db=function(e,n){return vn(e[n])?AM:eb(e[n])&&e.setAttribute?fX:ub},TM=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},hX=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},RM=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)},fb=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},pX=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},mX=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?hv(this,n,"_pt"):n.dep||(r=1),n=s;return!r},vX=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},IM=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},qr=(function(){function t(n,r,s,i,o,l,u,d,f){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||TM,this.d=u||this,this.set=d||ub,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=vX,this.m=r,this.mt=i,this.tween=s},t})();Zr(ib+"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 sb[t]=1});bs.TweenMax=bs.TweenLite=Mn;bs.TimelineLite=bs.TimelineMax=Hr;on=new Hr({sortChildren:!1,defaults:zf,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ws.stringFilter=bM;var Bl=[],N0={},gX=[],gC=0,yX=0,Py=function(e){return(N0[e]||gX).map(function(n){return n()})},Q_=function(){var e=Date.now(),n=[];e-gC>2&&(Py("matchMediaInit"),Bl.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=Ai.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),Py("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),gC=e,Py("matchMedia"))},MM=(function(){function t(n,r){this.selector=r&&K_(r),this.data=[],this._r=[],this.isReverted=!1,this.id=yX++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){vn(r)&&(i=s,s=r,r=vn);var o=this,l=function(){var d=Qt,f=o.selector,p;return d&&d!==o&&d.data.push(o),i&&(o.selector=K_(i)),Qt=o,p=s.apply(o,arguments),vn(p)&&o._r.push(p),Qt=d,o.selector=f,o.isReverted=!1,p};return o.last=l,r===vn?l(o,function(u){return o.add(null,u)}):r?o[r]=l:l},e.ignore=function(r){var s=Qt;Qt=null,r(this),Qt=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof Mn&&!(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(),u=i.data.length,d;u--;)d=i.data[u],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,p){return p.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),u=i.data.length;u--;)d=i.data[u],d instanceof Hr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof Mn)&&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=Bl.length;o--;)Bl[o].id===this.id&&Bl.splice(o,1)},e.revert=function(r){this.kill(r||{})},t})(),_X=(function(){function t(n){this.contexts=[],this.scope=n,Qt&&Qt.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){Bi(r)||(r={matches:r});var o=new MM(0,i||this.scope),l=o.conditions={},u,d,f;Qt&&!o.selector&&(o.selector=Qt.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(u=Ai.matchMedia(r[d]),u&&(Bl.indexOf(o)<0&&Bl.push(o),(l[d]=u.matches)&&(f=1),u.addListener?u.addListener(Q_):u.addEventListener("change",Q_)));return f&&s(o,function(p){return o.add(null,p)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),Fm={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 _M(s)})},timeline:function(e){return new Hr(e)},getTweensOf:function(e,n){return on.getTweensOf(e,n)},getProperty:function(e,n,r,s){Yn(e)&&(e=$s(e)[0]);var i=$l(e||{}).get,o=r?oM:iM;return r==="native"&&(r=""),e&&(n?o((ds[n]&&ds[n].get||i)(e,n,r,s)):function(l,u,d){return o((ds[l]&&ds[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=$s(e),e.length>1){var s=e.map(function(f){return Kr.quickSetter(f,n,r)}),i=s.length;return function(f){for(var p=i;p--;)s[p](f)}}e=e[0]||{};var o=ds[n],l=$l(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var p=new o;Xc._pt=0,p.init(e,r?f+r:f,Xc,0,[e]),p.render(1,p),Xc._pt&&fb(1,Xc)}:l.set(e,u);return o?d:function(f){return d(e,u,r?f+r:f,l,1)}},quickTo:function(e,n,r){var s,i=Kr.to(e,Ss((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(u,d,f){return i.resetTo(n,u,d,f)};return o.tween=i,o},isTweening:function(e){return on.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=zl(e.ease,zf.ease)),fC(zf,e||{})},config:function(e){return fC(ws,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&&!ds[l]&&!bs[l]&&Bf(n+" effect requires "+l+" plugin.")}),Sy[n]=function(l,u,d){return r($s(l),Ss(u||{},i),d)},o&&(Hr.prototype[n]=function(l,u,d){return this.add(Sy[n](l,Bi(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){yt[e]=zl(n)},parseEase:function(e,n){return arguments.length?zl(e,n):yt},getById:function(e){return on.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Hr(e),s,i;for(r.smoothChildTiming=Wr(e.smoothChildTiming),on.remove(r),r._dp=0,r._time=r._tTime=on._time,s=on._first;s;)i=s._next,(n||!(!s._dur&&s instanceof Mn&&s.vars.onComplete===s._targets[0]))&&Di(r,s,s._start-s._delay),s=i;return Di(on,r,0),r},context:function(e,n){return e?new MM(e,n):Qt},matchMedia:function(e){return new _X(e)},matchMediaRefresh:function(){return Bl.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||Q_()},addEventListener:function(e,n){var r=N0[e]||(N0[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=N0[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:YY,wrapYoyo:XY,distribute:hM,random:mM,snap:pM,normalize:KY,getUnit:vr,clamp:WY,splitColor:wM,toArray:$s,selector:K_,mapRange:gM,pipe:qY,unitize:GY,interpolate:QY,shuffle:fM},install:eM,effects:Sy,ticker:hs,updateRoot:Hr.updateRoot,plugins:ds,globalTimeline:on,core:{PropTween:qr,globals:tM,Tween:Mn,Timeline:Hr,Animation:qf,getCache:$l,_removeLinkedListItem:hv,reverting:function(){return lr},context:function(e){return e&&Qt&&(Qt.data.push(e),e._ctx=Qt),Qt},suppressOverwrites:function(e){return Jx=e}}};Zr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Fm[t]=Mn[t]});hs.add(Hr.updateRoot);Xc=Fm.to({},{duration:0});var wX=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},xX=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=wX(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},Ay=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(Yn(i)&&(u={},Zr(i,function(f){return u[f]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}xX(l,i)}}}},Kr=Fm.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,u;this.tween=r;for(o in n)u=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(u||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=u,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)lr?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)}},Ay("roundProps",Y_),Ay("modifiers"),Ay("snap",pM))||Fm;Mn.version=Hr.version=Kr.version="3.15.0";JI=1;tb()&&$u();yt.Power0;yt.Power1;yt.Power2;yt.Power3;yt.Power4;yt.Linear;yt.Quad;yt.Cubic;yt.Quart;yt.Quint;yt.Strong;yt.Elastic;yt.Back;yt.SteppedEase;yt.Bounce;yt.Sine;yt.Expo;yt.Circ;/*!
123
- * CSSPlugin 3.15.0
124
- * https://gsap.com
125
- *
126
- * Copyright 2008-2026, GreenSock. All rights reserved.
127
- * Subject to the terms at https://gsap.com/standard-license
128
- * @author: Jack Doyle, jack@greensock.com
129
- */var yC,ga,lu,hb,Pl,_C,pb,bX=function(){return typeof window<"u"},Io={},bl=180/Math.PI,cu=Math.PI/180,jc=Math.atan2,wC=1e8,mb=/([A-Z])/g,SX=/(left|right|width|margin|padding|x)/i,EX=/[\s,\(]\S/,Fi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},J_=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},kX=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)},CX=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)},PX=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)},AX=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},OM=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},LM=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},TX=function(e,n,r){return e.style[n]=r},RX=function(e,n,r){return e.style.setProperty(n,r)},IX=function(e,n,r){return e._gsap[n]=r},MX=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},OX=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},LX=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},an="transform",Gr=an+"Origin",DX=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in Io&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Fi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=mo(s,l)}):this.tfm[e]=o.x?o[e]:mo(s,e),e===Gr&&(this.tfm.zOrigin=o.zOrigin);else return Fi.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(an)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Gr,n,"")),e=an}(i||n)&&this.props.push(e,n,i[e])},DM=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},NX=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(mb,"-$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=pb(),(!i||!i.isStart)&&!r[an]&&(DM(r),s.zOrigin&&r[Gr]&&(r[Gr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},NM=function(e,n){var r={target:e,props:[],revert:NX,save:DX};return e._gsap||Kr.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},jM,ew=function(e,n){var r=ga.createElementNS?ga.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):ga.createElement(e);return r&&r.style?r:ga.createElement(e)},vs=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(mb,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Hu(n)||n,1)||""},xC="O,Moz,ms,Ms,Webkit".split(","),Hu=function(e,n,r){var s=n||Pl,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(xC[o]+e in i););return o<0?null:(o===3?"ms":o>=0?xC[o]:"")+e},tw=function(){bX()&&window.document&&(yC=window,ga=yC.document,lu=ga.documentElement,Pl=ew("div")||{style:{}},ew("div"),an=Hu(an),Gr=an+"Origin",Pl.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",jM=!!Hu("perspective"),pb=Kr.core.reverting,hb=1)},bC=function(e){var n=e.ownerSVGElement,r=ew("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),lu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),lu.removeChild(r),i},SC=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},FM=function(e){var n,r;try{n=e.getBBox()}catch{n=bC(e),r=1}return n&&(n.width||n.height)||r||(n=bC(e)),n&&!n.width&&!n.x&&!n.y?{x:+SC(e,["x","cx","x1"])||0,y:+SC(e,["y","cy","y1"])||0,width:0,height:0}:n},VM=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&FM(e))},Ia=function(e,n){if(n){var r=e.style,s;n in Io&&n!==Gr&&(n=an),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(mb,"-$1").toLowerCase())):r.removeAttribute(n)}},ya=function(e,n,r,s,i,o){var l=new qr(e._pt,n,r,0,1,o?LM:OM);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},EC={deg:1,rad:1,turn:1},jX={grid:1,flex:1},Ma=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=Pl.style,u=SX.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(u?"Width":"Height"),p=100,v=s==="px",y=s==="%",w,_,x,b;if(s===o||!i||EC[s]||EC[o])return i;if(o!=="px"&&!v&&(i=t(e,n,r,"px")),b=e.getCTM&&VM(e),(y||o==="%")&&(Io[n]||~n.indexOf("adius")))return w=b?e.getBBox()[u?"width":"height"]:e[f],bn(y?i/w*p:i/100*w);if(l[u?"width":"height"]=p+(v?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,b&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===ga||!_.appendChild)&&(_=ga.body),x=_._gsap,x&&y&&x.width&&u&&x.time===hs.time&&!x.uncache)return bn(i/x.width*p);if(y&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=p+s,w=e[f],k?e.style[n]=k:Ia(e,n)}else(y||o==="%")&&!jX[vs(_,"display")]&&(l.position=vs(e,"position")),_===e&&(l.position="static"),_.appendChild(Pl),w=Pl[f],_.removeChild(Pl),l.position="absolute";return u&&y&&(x=$l(_),x.time=hs.time,x.width=_[f]),bn(v?w*i/p:w&&i?p/w*i:0)},mo=function(e,n,r,s){var i;return hb||tw(),n in Fi&&n!=="transform"&&(n=Fi[n],~n.indexOf(",")&&(n=n.split(",")[0])),Io[n]&&n!=="transform"?(i=Kf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:$m(vs(e,Gr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Vm[n]&&Vm[n](e,n,r)||vs(e,n)||rM(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Ma(e,n,i,r)+r:i},FX=function(e,n,r,s){if(!r||r==="none"){var i=Hu(n,e,1),o=i&&vs(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=vs(e,"borderTopColor"))}var l=new qr(this._pt,e.style,n,0,1,RM),u=0,d=0,f,p,v,y,w,_,x,b,k,C,P,T;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=vs(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=vs(e,n)||s,_?e.style[n]=_:Ia(e,n)),f=[r,s],bM(f),r=f[0],s=f[1],v=r.match(Yc)||[],T=s.match(Yc)||[],T.length){for(;p=Yc.exec(s);)x=p[0],k=s.substring(u,p.index),w?w=(w+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(w=1),x!==(_=v[d++]||"")&&(y=parseFloat(_)||0,P=_.substr((y+"").length),x.charAt(1)==="="&&(x=au(y,x)+P),b=parseFloat(x),C=x.substr((b+"").length),u=Yc.lastIndex-C.length,C||(C=C||ws.units[n]||P,u===s.length&&(s+=C,l.e+=C)),P!==C&&(y=Ma(e,n,_,C)||0),l._pt={_next:l._pt,p:k||d===1?k:",",s:y,c:b-y,m:w&&w<4||n==="zIndex"?Math.round:0});l.c=u<s.length?s.substring(u,s.length):""}else l.r=n==="display"&&s==="none"?LM:OM;return QI.test(s)&&(l.e=0),this._pt=l,l},kC={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},VX=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]=kC[r]||r,n[1]=kC[s]||s,n.join(" ")},$X=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,u,d;if(i==="all"||i===!0)s.cssText="",u=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],Io[l]&&(u=1,l=l==="transformOrigin"?Gr:an),Ia(r,l);u&&(Ia(r,an),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Kf(r,1),o.uncache=1,DM(s)))}},Vm={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new qr(e._pt,n,r,0,0,$X);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},Gf=[1,0,0,1,0,0],$M={},HM=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},CC=function(e){var n=vs(e,an);return HM(n)?Gf:n.substr(7).match(XI).map(bn)},vb=function(e,n){var r=e._gsap||$l(e),s=e.style,i=CC(e),o,l,u,d;return r.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,i=[u.a,u.b,u.c,u.d,u.e,u.f],i.join(",")==="1,0,0,1,0,0"?Gf:i):(i===Gf&&!e.offsetParent&&e!==lu&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,lu.appendChild(e)),i=CC(e),u?s.display=u:Ia(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):lu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},nw=function(e,n,r,s,i,o){var l=e._gsap,u=i||vb(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,p=l.xOffset||0,v=l.yOffset||0,y=u[0],w=u[1],_=u[2],x=u[3],b=u[4],k=u[5],C=n.split(" "),P=parseFloat(C[0])||0,T=parseFloat(C[1])||0,O,M,R,L;r?u!==Gf&&(M=y*x-w*_)&&(R=P*(x/M)+T*(-_/M)+(_*k-x*b)/M,L=P*(-w/M)+T*(y/M)-(y*k-w*b)/M,P=R,T=L):(O=FM(e),P=O.x+(~C[0].indexOf("%")?P/100*O.width:P),T=O.y+(~(C[1]||C[0]).indexOf("%")?T/100*O.height:T)),s||s!==!1&&l.smooth?(b=P-d,k=T-f,l.xOffset=p+(b*y+k*_)-b,l.yOffset=v+(b*w+k*x)-k):l.xOffset=l.yOffset=0,l.xOrigin=P,l.yOrigin=T,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[Gr]="0px 0px",o&&(ya(o,l,"xOrigin",d,P),ya(o,l,"yOrigin",f,T),ya(o,l,"xOffset",p,l.xOffset),ya(o,l,"yOffset",v,l.yOffset)),e.setAttribute("data-svg-origin",P+" "+T)},Kf=function(e,n){var r=e._gsap||new EM(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",u=getComputedStyle(e),d=vs(e,Gr)||"0",f,p,v,y,w,_,x,b,k,C,P,T,O,M,R,L,D,V,j,U,X,q,Z,Y,H,Q,z,N,G,oe,se,ee;return f=p=v=_=x=b=k=C=P=0,y=w=1,r.svg=!!(e.getCTM&&VM(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[an]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[an]!=="none"?u[an]:"")),s.scale=s.rotate=s.translate="none"),M=vb(e,r.svg),r.svg&&(r.uncache?(H=e.getBBox(),d=r.xOrigin-H.x+"px "+(r.yOrigin-H.y)+"px",Y=""):Y=!n&&e.getAttribute("data-svg-origin"),nw(e,Y||d,!!Y||r.originIsAbsolute,r.smooth!==!1,M)),T=r.xOrigin||0,O=r.yOrigin||0,M!==Gf&&(V=M[0],j=M[1],U=M[2],X=M[3],f=q=M[4],p=Z=M[5],M.length===6?(y=Math.sqrt(V*V+j*j),w=Math.sqrt(X*X+U*U),_=V||j?jc(j,V)*bl:0,k=U||X?jc(U,X)*bl+_:0,k&&(w*=Math.abs(Math.cos(k*cu))),r.svg&&(f-=T-(T*V+O*U),p-=O-(T*j+O*X))):(ee=M[6],oe=M[7],z=M[8],N=M[9],G=M[10],se=M[11],f=M[12],p=M[13],v=M[14],R=jc(ee,G),x=R*bl,R&&(L=Math.cos(-R),D=Math.sin(-R),Y=q*L+z*D,H=Z*L+N*D,Q=ee*L+G*D,z=q*-D+z*L,N=Z*-D+N*L,G=ee*-D+G*L,se=oe*-D+se*L,q=Y,Z=H,ee=Q),R=jc(-U,G),b=R*bl,R&&(L=Math.cos(-R),D=Math.sin(-R),Y=V*L-z*D,H=j*L-N*D,Q=U*L-G*D,se=X*D+se*L,V=Y,j=H,U=Q),R=jc(j,V),_=R*bl,R&&(L=Math.cos(R),D=Math.sin(R),Y=V*L+j*D,H=q*L+Z*D,j=j*L-V*D,Z=Z*L-q*D,V=Y,q=H),x&&Math.abs(x)+Math.abs(_)>359.9&&(x=_=0,b=180-b),y=bn(Math.sqrt(V*V+j*j+U*U)),w=bn(Math.sqrt(Z*Z+ee*ee)),R=jc(q,Z),k=Math.abs(R)>2e-4?R*bl:0,P=se?1/(se<0?-se:se):0),r.svg&&(Y=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!HM(vs(e,an)),Y&&e.setAttribute("transform",Y))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(y*=-1,k+=_<=0?180:-180,_+=_<=0?180:-180):(w*=-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=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=v+o,r.scaleX=bn(y),r.scaleY=bn(w),r.rotation=bn(_)+l,r.rotationX=bn(x)+l,r.rotationY=bn(b)+l,r.skewX=k+l,r.skewY=C+l,r.transformPerspective=P+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Gr]=$m(d)),r.xOffset=r.yOffset=0,r.force3D=ws.force3D,r.renderTransform=r.svg?zX:jM?zM:HX,r.uncache=0,r},$m=function(e){return(e=e.split(" "))[0]+" "+e[1]},Ty=function(e,n,r){var s=vr(n);return bn(parseFloat(n)+parseFloat(Ma(e,"x",r+"px",s)))+s},HX=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,zM(e,n)},vl="0deg",Zd="0px",gl=") ",zM=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.z,d=r.rotation,f=r.rotationY,p=r.rotationX,v=r.skewX,y=r.skewY,w=r.scaleX,_=r.scaleY,x=r.transformPerspective,b=r.force3D,k=r.target,C=r.zOrigin,P="",T=b==="auto"&&e&&e!==1||b===!0;if(C&&(p!==vl||f!==vl)){var O=parseFloat(f)*cu,M=Math.sin(O),R=Math.cos(O),L;O=parseFloat(p)*cu,L=Math.cos(O),o=Ty(k,o,M*L*-C),l=Ty(k,l,-Math.sin(O)*-C),u=Ty(k,u,R*L*-C+C)}x!==Zd&&(P+="perspective("+x+gl),(s||i)&&(P+="translate("+s+"%, "+i+"%) "),(T||o!==Zd||l!==Zd||u!==Zd)&&(P+=u!==Zd||T?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+gl),d!==vl&&(P+="rotate("+d+gl),f!==vl&&(P+="rotateY("+f+gl),p!==vl&&(P+="rotateX("+p+gl),(v!==vl||y!==vl)&&(P+="skew("+v+", "+y+gl),(w!==1||_!==1)&&(P+="scale("+w+", "+_+gl),k.style[an]=P||"translate(0, 0)"},zX=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.rotation,d=r.skewX,f=r.skewY,p=r.scaleX,v=r.scaleY,y=r.target,w=r.xOrigin,_=r.yOrigin,x=r.xOffset,b=r.yOffset,k=r.forceCSS,C=parseFloat(o),P=parseFloat(l),T,O,M,R,L;u=parseFloat(u),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,u+=f),u||d?(u*=cu,d*=cu,T=Math.cos(u)*p,O=Math.sin(u)*p,M=Math.sin(u-d)*-v,R=Math.cos(u-d)*v,d&&(f*=cu,L=Math.tan(d-f),L=Math.sqrt(1+L*L),M*=L,R*=L,f&&(L=Math.tan(f),L=Math.sqrt(1+L*L),T*=L,O*=L)),T=bn(T),O=bn(O),M=bn(M),R=bn(R)):(T=p,R=v,O=M=0),(C&&!~(o+"").indexOf("px")||P&&!~(l+"").indexOf("px"))&&(C=Ma(y,"x",o,"px"),P=Ma(y,"y",l,"px")),(w||_||x||b)&&(C=bn(C+w-(w*T+_*M)+x),P=bn(P+_-(w*O+_*R)+b)),(s||i)&&(L=y.getBBox(),C=bn(C+s/100*L.width),P=bn(P+i/100*L.height)),L="matrix("+T+","+O+","+M+","+R+","+C+","+P+")",y.setAttribute("transform",L),k&&(y.style[an]=L)},BX=function(e,n,r,s,i){var o=360,l=Yn(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?bl:1),d=u-s,f=s+d+"deg",p,v;return l&&(p=i.split("_")[1],p==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),p==="cw"&&d<0?d=(d+o*wC)%o-~~(d/o)*o:p==="ccw"&&d>0&&(d=(d-o*wC)%o-~~(d/o)*o)),e._pt=v=new qr(e._pt,n,r,s,d,kX),v.e=f,v.u="deg",e._props.push(r),v},PC=function(e,n){for(var r in n)e[r]=n[r];return e},UX=function(e,n,r){var s=PC({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,f,p,v,y,w;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[an]=n,l=Kf(r,1),Ia(r,an),r.setAttribute("transform",d)):(d=getComputedStyle(r)[an],o[an]=n,l=Kf(r,1),o[an]=d);for(u in Io)d=s[u],f=l[u],d!==f&&i.indexOf(u)<0&&(y=vr(d),w=vr(f),p=y!==w?Ma(r,u,d,w):parseFloat(d),v=parseFloat(f),e._pt=new qr(e._pt,l,u,p,v-p,J_),e._pt.u=w||0,e._props.push(u));PC(l,s)};Zr("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});Vm[e>1?"border"+t:t]=function(l,u,d,f,p){var v,y;if(arguments.length<4)return v=o.map(function(w){return mo(l,w,d)}),y=v.join(" "),y.split(v[0]).length===5?v[0]:y;v=(f+"").split(" "),y={},o.forEach(function(w,_){return y[w]=v[_]=v[_]||v[(_-1)/2|0]}),l.init(u,y,p)}});var BM={name:"css",register:tw,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,u=r.vars.startAt,d,f,p,v,y,w,_,x,b,k,C,P,T,O,M,R,L;hb||tw(),this.styles=this.styles||NM(e),R=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(ds[_]&&kM(_,n,r,s,e,i)))){if(y=typeof f,w=Vm[_],y==="function"&&(f=f.call(r,s,e,i),y=typeof f),y==="string"&&~f.indexOf("random(")&&(f=Wf(f)),w)w(this,e,_,f,r)&&(M=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",ba.lastIndex=0,ba.test(d)||(x=vr(d),b=vr(f),b?x!==b&&(d=Ma(e,_,d,b)+b):x&&(f+=x)),this.add(l,"setProperty",d,f,s,i,0,0,_),o.push(_),R.push(_,0,l[_]);else if(y!=="undefined"){if(u&&_ in u?(d=typeof u[_]=="function"?u[_].call(r,s,e,i):u[_],Yn(d)&&~d.indexOf("random(")&&(d=Wf(d)),vr(d+"")||d==="auto"||(d+=ws.units[_]||vr(mo(e,_))||""),(d+"").charAt(1)==="="&&(d=mo(e,_))):d=mo(e,_),v=parseFloat(d),k=y==="string"&&f.charAt(1)==="="&&f.substr(0,2),k&&(f=f.substr(2)),p=parseFloat(f),_ in Fi&&(_==="autoAlpha"&&(v===1&&mo(e,"visibility")==="hidden"&&p&&(v=0),R.push("visibility",0,l.visibility),ya(this,l,"visibility",v?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=Fi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in Io,C){if(this.styles.save(_),L=f,y==="string"&&f.substring(0,6)==="var(--"){if(f=vs(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=f,f=vs(e,"perspective"),D?e.style.perspective=D:Ia(e,"perspective")}p=parseFloat(f)}if(P||(T=e._gsap,T.renderTransform&&!n.parseTransform||Kf(e,n.parseTransform),O=n.smoothOrigin!==!1&&T.smooth,P=this._pt=new qr(this._pt,l,an,0,1,T.renderTransform,T,0,-1),P.dep=1),_==="scale")this._pt=new qr(this._pt,T,"scaleY",T.scaleY,(k?au(T.scaleY,k+p):p)-T.scaleY||0,J_),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){R.push(Gr,0,l[Gr]),f=VX(f),T.svg?nw(e,f,0,O,0,this):(b=parseFloat(f.split(" ")[2])||0,b!==T.zOrigin&&ya(this,T,"zOrigin",T.zOrigin,b),ya(this,l,_,$m(d),$m(f)));continue}else if(_==="svgOrigin"){nw(e,f,1,O,0,this);continue}else if(_ in $M){BX(this,T,_,v,k?au(v,k+f):f);continue}else if(_==="smoothOrigin"){ya(this,T,"smooth",T.smooth,f);continue}else if(_==="force3D"){T[_]=f;continue}else if(_==="transform"){UX(this,f,e);continue}}else _ in l||(_=Hu(_)||_);if(C||(p||p===0)&&(v||v===0)&&!EX.test(f)&&_ in l)x=(d+"").substr((v+"").length),p||(p=0),b=vr(f)||(_ in ws.units?ws.units[_]:x),x!==b&&(v=Ma(e,_,d,b)),this._pt=new qr(this._pt,C?T:l,_,v,(k?au(v,k+p):p)-v,!C&&(b==="px"||_==="zIndex")&&n.autoRound!==!1?AX:J_),this._pt.u=b||0,C&&L!==f?(this._pt.b=d,this._pt.e=L,this._pt.r=PX):x!==b&&b!=="%"&&(this._pt.b=d,this._pt.r=CX);else if(_ in l)FX.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"){rb(_,f);continue}C||(_ in l?R.push(_,0,l[_]):typeof e[_]=="function"?R.push(_,2,e[_]()):R.push(_,1,d||e[_])),o.push(_)}}M&&IM(this)},render:function(e,n){if(n.tween._time||!pb())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:mo,aliases:Fi,getSetter:function(e,n,r){var s=Fi[n];return s&&s.indexOf(",")<0&&(n=s),n in Io&&n!==Gr&&(e._gsap.x||mo(e,"x"))?r&&_C===r?n==="scale"?MX:IX:(_C=r||{})&&(n==="scale"?OX:LX):e.style&&!eb(e.style[n])?TX:~n.indexOf("-")?RX:db(e,n)},core:{_removeProperty:Ia,_getMatrix:vb}};Kr.utils.checkPrefix=Hu;Kr.core.getStyleSaver=NM;(function(t,e,n,r){var s=Zr(t+","+e+","+n,function(i){Io[i]=1});Zr(e,function(i){ws.units[i]="deg",$M[i]=1}),Fi[s[13]]=t+","+e,Zr(r,function(i){var o=i.split(":");Fi[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");Zr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){ws.units[t]="px"});Kr.registerPlugin(BM);var ri=Kr.registerPlugin(BM)||Kr;ri.core.Tween;const j0="/assets/logo-animation",Ry=1280,WX=[{id:"eraser",src:`${j0}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${j0}/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:`${j0}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],ZX=[{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}],rw=({className:t})=>{const e=m.useRef(null),n=m.useRef(null),r=m.useRef(null);return m.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,u=(b,k)=>b+Math.random()*(k-b);let d=null,f,p=1;const v=WX.map(b=>({...b})),y=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const b=s.getBoundingClientRect(),k=b.width||Ry,C=b.height||Ry*.64;p=k/Ry,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const T=250*p/337,O=[],M=(R,L,D)=>{const V=document.createElement("div");return V.className="la-obj",V.style.width=`${L}px`,V.innerHTML=`<img src="${R}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild(V),V};return ZX.forEach((R,L)=>{const D=R.w*p,V=M(`${j0}/sea/${R.k}.png`,D,L%2===0);ri.set(V,{x:R.x*k-D/2,y:R.y*C-D/2,rotation:R.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:V,hero:!1,rest:1})}),v.forEach(R=>{const L=R.cssW*p;R.el=M(R.src,L,!!R.flip),R.finalScale=R.fit*T/(R.cssW*p),ri.set(R.el,{x:R.seaX*k-L/2,y:R.seaY*C-R.cssH*p/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:R.el,hero:!0,rest:150/R.cssW})}),O},w=(b,k)=>{const C=s.getBoundingClientRect(),P=o.getBoundingClientRect();return{x:P.left-C.left+b/326*P.width,y:P.top-C.top+k/337*P.height}},_=()=>{d&&d.revert();const b=y();if(l){d=ri.context(()=>{b.filter(P=>!P.hero).forEach(P=>ri.set(P.el,{scale:0})),v.forEach(P=>{if(!P.el)return;const T=w(P.localX,P.localY);ri.set(P.el,{x:T.x-P.cssW*p/2,y:T.y-P.cssH*p/2,rotation:P.rot,scale:P.finalScale})})},s);return}const k=[],C=[];d=ri.context(()=>{const P=ri.timeline();P.to(b.map(T=>T.el),{scale:T=>b[T].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),P.add(()=>{b.forEach(({el:T,hero:O},M)=>{const R=O?k:C,L=M%2?1:-1;R.push(ri.to(T,{rotation:"+="+u(2.5,6)*L,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),ri.to(T,{y:"+="+u(5,11)*L,x:"+="+u(4,9)*-L,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),P.to({},{duration:1.1}),P.add("pick"),v.forEach((T,O)=>{T.el&&P.to(T.el,{scale:150/T.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(T=>T.kill()),"clear"),P.to(b.filter(T=>!T.hero).map(T=>T.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(T=>T.kill()),"assemble"),v.forEach((T,O)=>{if(!T.el||T.finalScale===void 0)return;const M=w(T.localX,T.localY);P.to(T.el,{x:M.x-T.cssW*p/2,y:M.y-T.cssH*p/2,rotation:T.rot,scale:T.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.12)}),v.forEach(T=>{!T.el||T.finalScale===void 0||P.to(T.el,{scale:T.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};ri.ticker.fps(12),_();const x=()=>{clearTimeout(f),f=setTimeout(_,250)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(b=>b.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"})})})},qX=Object.freeze(Object.defineProperty({__proto__:null,default:rw},Symbol.toStringTag,{value:"Module"})),AC=({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"})]}),GX=({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(rw,{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(AC,{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(rw,{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(AC,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),KX="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",YX=({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:KX,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(cv,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),XX="data:image/svg+xml,%3csvg%20width='548'%20height='565'%20viewBox='0%200%20548%20565'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M136.53%20-0.00177124C170.301%20-0.00177124%20197.687%2027.3551%20197.724%2061.1255L198.089%20394.976C198.189%20486.214%20124.253%20560.23%2033.0153%20560.23C14.7818%20560.23%200.000557184%20545.449%200.000557184%20527.216V61.1923C0.000557184%2027.3957%2027.3981%20-0.00177124%2061.1947%20-0.00177124H136.53Z'%20fill='white'/%3e%3cpath%20d='M271.092%20463.876C271.092%20530.762%20310.368%20564.205%20388.919%20564.205C468.248%20564.205%20507.913%20530.762%20507.913%20463.876C507.913%20426.545%20498.191%20400.88%20478.748%20386.88C460.082%20372.103%20430.139%20364.715%20388.919%20364.715C350.032%20364.715%20320.478%20372.103%20300.257%20386.88C280.814%20400.88%20271.092%20426.545%20271.092%20463.876Z'%20fill='white'/%3e%3cpath%20d='M405.25%200.917969C408.273%200.917973%20411.331%201.11183%20414.358%201.66895C437.891%205.99962%20471.151%2018.8698%20498.612%2044.5137C526.065%2070.1496%20547.676%20108.515%20547.992%20163.691C547.992%20163.693%20547.994%20163.695%20547.997%20163.695C547.999%20163.695%20548.001%20163.697%20548.001%20163.7L547.996%20164.612L548.001%20165.526C548.001%20165.528%20547.999%20165.53%20547.997%20165.53C547.994%20165.53%20547.992%20165.532%20547.992%20165.535C547.665%20222.498%20524.643%20261.54%20495.935%20287.156C467.223%20312.776%20432.863%20324.939%20409.917%20328.291C409.844%20328.302%20409.769%20328.308%20409.695%20328.308H283.146C254.52%20328.308%20231.314%20305.102%20231.314%20276.477C231.315%20244.265%20255.799%20218.161%20287.447%20213.026C309.663%20209.422%20329.612%20204.399%20344.084%20196.322C354.361%20190.586%20359.717%20184.074%20362.521%20178.421C365.332%20172.756%20365.636%20167.843%20365.636%20165.225V163.994C365.635%20161.374%20365.33%20156.465%20362.521%20150.805C359.717%20145.152%20354.361%20138.639%20344.084%20132.903C329.612%20124.826%20309.663%20119.803%20287.447%20116.199C255.799%20111.065%20231.315%2084.9602%20231.314%2052.749C231.314%2024.1235%20254.52%200.917969%20283.146%200.917969H405.25Z'%20fill='white'/%3e%3c/svg%3e",Hm=44,qd=8,d0=16,QX=4,TC=-18,JX=.18,eQ=[.22,1,.36,1],RC=.92,tQ=1,nQ=.95,rQ=.4,sQ=[.19,1,.22,1],Iy=0,iQ=1,oQ=0,aQ=0,lQ=0,UM=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+qd,s=Math.max(r,e.width-Hm-qd),i=Math.max(qd,e.height-Hm-qd);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(qd,t.y))}},gb=()=>({width:window.innerWidth,height:window.innerHeight}),cQ=({position:t,boundsLeftPx:e=0})=>UM({position:t,viewport:gb(),boundsLeft:e}),uQ=()=>{if(typeof window>"u")return{x:d0,y:d0};const t=gb();return{x:t.width-Hm-d0,y:t.height-Hm-d0}},dQ=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=QX,fQ=t=>t.button===void 0||t.button<=lQ,IC=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},hQ=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=m.useRef(null),u=m.useRef(!1),[d,f]=m.useState(!1),[p,v]=m.useState(!1),y=n?!1:{opacity:Iy,scale:RC,x:TC},w=n?{opacity:Iy}:{opacity:Iy,scale:RC,x:TC},_=n?{duration:aQ}:{duration:JX,ease:eQ,scale:{duration:rQ,ease:sQ}},x=m.useCallback(()=>{const T=l.current;T&&(u.current=T.hasMoved),l.current=null,f(!1)},[]),b=m.useCallback(T=>{const O=l.current;if(!O)return;const M=IC(T),R=M.x-O.startPointer.x,L=M.y-O.startPointer.y,D=O.hasMoved||dQ({deltaX:R,deltaY:L});l.current={...O,hasMoved:D},D&&o(UM({position:{x:O.startPosition.x+R,y:O.startPosition.y+L},viewport:gb(),boundsLeft:s}))},[o,s]),k=m.useCallback(T=>{if(l.current||!fQ(T))return;const O=IC(T);l.current={startPointer:O,startPosition:r,hasMoved:!1},f(!0)},[r]),C=m.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),P=e?"Close panel":"Open panel";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:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x}):null,S.jsx(_s,{children:t?S.jsx(Gl,{label:P,side:"top",forceOpen:p&&!d?void 0:!1,children:S.jsx(di.button,{type:"button","aria-label":P,"data-cy":"reopen-panel",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),initial:y,animate:{opacity:iQ,scale:tQ,x:oQ},whileTap:{scale:nQ},exit:w,transition:_,onPointerDown:k,onMouseDown:k,onPointerMove:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x,onClick:C,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:XX,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},My=Es("useConfig"),pQ=300*1e3,mQ=1800*1e3,vQ=60*1e3,gQ=300*1e3,yQ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},_Q=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},wQ=t=>({...nI,...t??{}}),xQ=()=>{const t=rt(D_),e=mt(D_),n=mt(fI),r=mt(hI),s=mt(uv),i=mt(cG),o=mt(dI),l=mt(aG),u=mt(fh),d=mt(oI),f=m.useCallback(b=>{o(b.agentModeAvailable),d({name:b.name??null,email:b.email??null}),b.isMCPSession&&n(!0),b.mcpEditor&&r(b.mcpEditor),s(b.agentApplyMode??_Q()??null),i(b.queueAccessToken??yQ())},[s,o,n,r,i,d]),p=Xy({queryKey:["rivet-config"],queryFn:async()=>{const b=await fetch("/api/config");if(!b.ok)throw new Error(`Failed to fetch config: ${b.statusText}`);return await b.json()},staleTime:pQ,gcTime:mQ}),v=Xy({queryKey:["rivet-feature-flags"],queryFn:async()=>{const b=await fetch("/api/feature-flags");if(!b.ok)throw new Error(`Failed to fetch feature flags: ${b.statusText}`);return await b.json()},staleTime:vQ,gcTime:gQ}),{refetch:y}=p,{refetch:w}=v;m.useLayoutEffect(()=>{p.data&&(f(p.data),u(!1),My.info("Config loaded:",p.data)),v.data&&(e(wQ(v.data.featureFlags)),l(!0))},[p.data,v.data,f,u,e,l]),m.useLayoutEffect(()=>{p.error&&(l(!0),u(!1),My.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),v.error&&(l(!0),My.warn("Failed to load feature flags:",v.error instanceof Error?v.error.message:"Failed to load feature flags"))},[p.error,v.error,u,l]);const _=m.useCallback(async()=>{const[b]=await Promise.all([y(),w()]);return b.data?b.data:null},[y,w]);let x=null;return p.error instanceof Error?x=p.error.message:p.error&&(x="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&v.isPending,error:x,refetchConfig:_}},F0="rivet_just_signed_in",Fc=Es("useOAuthCallback"),bQ="https://rivet-proxy.onrender.com",SQ=()=>{const[t,e]=m.useState({isProcessing:!1,isComplete:!1,error:null});return m.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,u,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{Fc.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),p=f.get("access_token"),v=f.get("refresh_token"),w=new URLSearchParams(o).get("session");if(!p)throw new Error("No access token found in URL");if(!w)throw new Error("No session ID found in URL");Fc.info(`Completing OAuth with session: ${w}`);const _=await fetch(`${bQ}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:w,accessToken:p,refreshToken:v}),signal:n.signal}),x=await _.json();if(!_.ok||!x.success)throw new Error(x.error||x.message||"Failed to complete authentication");if(Fc.info("OAuth authentication completed successfully"),r)return;if((l=x.user)!=null&&l.id?(ke.identify(x.user.id,{...x.user.email?{email:x.user.email}:{}}),x.user.email&&ke.alias(x.user.email,x.user.id)):(u=x.user)!=null&&u.email&&ke.identify(x.user.email,{email:x.user.email}),(d=x.user)!=null&&d.email&&p)try{const k=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:p,refreshToken:v,userId:x.user.id}),signal:n.signal});k.ok||Fc.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;Fc.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(F0,"1");const b=window.location.pathname;window.history.replaceState({},document.title,b),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;const p=f instanceof Error?f.message:"Unknown error occurred";Fc.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},Oy=Es("useAgentVariantsSession"),EQ=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,MC=(t,e,n)=>{e.size===0&&!n||t.set($f,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[o,l]of r)l.status==="sending"&&l.variantRequestId&&(e.has(l.variantRequestId)||n&&l.variantRequest!==void 0)&&(s.delete(o),i=!0);return i?s:r})},kQ=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,o]of t){if(o.status!=="sending"||!o.awaitingSnapshotOutcome||o.variantRequest!==void 0)continue;const l=o.target;if(!l||l.kind!=="variant"||l.sessionId!==e.sessionId)continue;const u=(s=e.variants.find(d=>d.workItemId===l.variantId))==null?void 0:s.refinement;u&&(u.status==="succeeded"?(r.set(i,{...o,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(u.status==="failed"||u.status==="cancelled")&&(r.set(i,{...o,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},CQ=({enabled:t=!0}={})=>{const e=mt(dh),n=mt(rI),r=mt(nG),s=mt(cI),i=mt(oG),o=jw(),l=m.useRef(null);m.useEffect(()=>{if(!t)return;const u=new EventSource("/api/variants/events");return u.onmessage=d=>{try{const f=JSON.parse(d.data),p=l.current;if(f.active){const w=new Set(f.variants.map(_=>_.requestId).filter(_=>!!_));s(_=>_.filter(b=>!w.has(b.requestId))),MC(o,w,!1),o.set($f,_=>{let x=_;for(const b of f.variants){const k=b.adoptedSource;k&&(x=iG(x,{kind:"variant",sessionId:k.sessionId,variantId:k.variantId},{kind:"variant",sessionId:f.sessionId,variantId:b.workItemId}))}return x}),o.set($f,_=>kQ(_,f)),f.sessionId!==l.current&&(l.current=f.sessionId,n(!0),r("directions"))}else l.current=null,MC(o,new Set,EQ(f));e(f);const v=!f.active&&p!==null,y=f.active&&f.sessionId!==p;if(y&&fetch(`/api/variants/${f.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(w=>Oy.warn("failed to reset preview-port on session switch",w)),v||y){const w=new Set;if(f.active)for(const x of f.variants)w.add(Ff({kind:"variant",sessionId:f.sessionId,variantId:x.workItemId}));const _=o.get(To);for(const x of[_==null?void 0:_.left,_==null?void 0:_.right])x&&w.add(Ff({kind:"variant",sessionId:x.sessionId,variantId:x.variantId}));i(w)}}catch(f){Oy.warn("failed to parse SSE event payload",f)}},u.onerror=d=>{Oy.warn("SSE error (auto-reconnects)",d)},()=>{u.close()}},[t,e,n,r,s,i,o])};var PQ=Object.defineProperty,Gn=(t,e)=>PQ(t,"name",{value:e,configurable:!0});function yb(t){const e=t+"CollectionProvider",[n,r]=Ui(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=Gn(_=>{const{scope:x,children:b}=_,k=m.useRef(null),C=m.useRef(new Map).current;return S.jsx(s,{scope:x,itemMap:C,collectionRef:k,children:b})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",u=Pa(l),d=m.forwardRef((_,x)=>{const{scope:b,children:k}=_,C=i(l,b),P=Yt(x,C.collectionRef);return S.jsx(u,{ref:P,children:k})});d.displayName=l;const f=t+"CollectionItemSlot",p="data-radix-collection-item",v=Pa(f),y=m.forwardRef((_,x)=>{const{scope:b,children:k,...C}=_,P=m.useRef(null),T=Yt(x,P),O=i(f,b);return m.useEffect(()=>(O.itemMap.set(P,{ref:P,...C}),()=>void O.itemMap.delete(P))),S.jsx(v,{[p]:"",ref:T,children:k})});y.displayName=f;function w(_){const x=i(t+"CollectionConsumer",_);return m.useCallback(()=>{const k=x.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((O,M)=>C.indexOf(O.ref.current)-C.indexOf(M.ref.current))},[x.collectionRef,x.itemMap])}return Gn(w,"useCollection"),[{Provider:o,Slot:d,ItemSlot:y},w,r]}Gn(yb,"createCollection");var OC=new WeakMap,Rn,ls,Ly=(ls=class extends Map{constructor(n){super(n);Ke(this,Rn);Ae(this,Rn,[...super.keys()]),OC.set(this,!0)}set(n,r){return OC.get(this)&&(this.has(n)?B(this,Rn)[B(this,Rn).indexOf(n)]=n:B(this,Rn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=B(this,Rn).length,l=_b(n);let u=l>=0?l:o+l;const d=u<0||u>=o?-1:u;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const f=this.size+(i?0:1);l<0&&u++;const p=[...B(this,Rn)];let v,y=!1;for(let w=u;w<f;w++)if(u===w){let _=p[w];p[w]===r&&(_=p[w+1]),i&&this.delete(r),v=this.get(_),this.set(r,s)}else{!y&&p[w-1]===r&&(y=!0);const _=p[y?w:w-1],x=v;v=this.get(_),this.delete(_),this.set(_,x)}return this}with(n,r,s){const i=new ls(this);return i.insert(n,r,s),i}before(n){const r=B(this,Rn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=B(this,Rn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=B(this,Rn).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=B(this,Rn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ae(this,Rn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&B(this,Rn).splice(B(this,Rn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=V0(B(this,Rn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=V0(B(this,Rn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return B(this,Rn).indexOf(n)}keyAt(n){return V0(B(this,Rn),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 ls(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 ls(s)}reduce(...n){const[r,s]=n;let i=0,o=s??this.at(0);for(const l of this)i===0&&n.length===1?o=l:o=Reflect.apply(r,this,[o,l,i,this]),i++;return o}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?i=l:i=Reflect.apply(r,this,[i,l,o,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new ls(r)}toReversed(){const n=new ls;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 ls(r)}slice(n,r){const s=new ls;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let o=n;o<=i;o++){const l=this.keyAt(o),u=this.get(l);s.set(l,u)}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}},Rn=new WeakMap,Gn(ls,"OrderedDict"),ls);function V0(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=WM(t,e);return n===-1?void 0:t[n]}Gn(V0,"at");function WM(t,e){const n=t.length,r=_b(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}Gn(WM,"toSafeIndex");function _b(t){return t!==t||t===0?0:Math.trunc(t)}Gn(_b,"toSafeInteger");function AQ(t){const e=t+"CollectionProvider",[n,r]=Ui(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Ly,setItemMap:Gn(()=>{},"setItemMap")}),o=Gn(({state:C,...P})=>C?S.jsx(u,{...P,state:C}):S.jsx(l,{...P}),"CollectionProvider");o.displayName=e;const l=Gn(C=>{const P=x();return S.jsx(u,{...C,state:P})},"CollectionInit");l.displayName=e+"Init";const u=Gn(C=>{const{scope:P,children:T,state:O}=C,M=m.useRef(null),[R,L]=m.useState(null),D=Yt(M,L),[V,j]=O;return m.useEffect(()=>{if(!R)return;const U=GM(()=>{});return U.observe(R,{childList:!0,subtree:!0}),()=>{U.disconnect()}},[R]),S.jsx(s,{scope:P,itemMap:V,setItemMap:j,collectionRef:D,collectionRefObject:M,collectionElement:R,children:T})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",f=Pa(d),p=m.forwardRef((C,P)=>{const{scope:T,children:O}=C,M=i(d,T),R=Yt(P,M.collectionRef);return S.jsx(f,{ref:R,children:O})});p.displayName=d;const v=t+"CollectionItemSlot",y="data-radix-collection-item",w=Pa(v),_=m.forwardRef((C,P)=>{const{scope:T,children:O,...M}=C,R=m.useRef(null),[L,D]=m.useState(null),V=Yt(P,R,D),j=i(v,T),{setItemMap:U}=j,X=m.useRef(M);ZM(X.current,M)||(X.current=M);const q=X.current;return m.useEffect(()=>{const Z=q;return U(Y=>L?Y.has(L)?Y.set(L,{...Z,element:L}).toSorted(sw):(Y.set(L,{...Z,element:L}),Y.toSorted(sw)):Y),()=>{U(Y=>!L||!Y.has(L)?Y:(Y.delete(L),new Ly(Y)))}},[L,q,U]),S.jsx(w,{[y]:"",ref:V,children:O})});_.displayName=v;function x(){return m.useState(new Ly)}Gn(x,"useInitCollection");function b(C){const{itemMap:P}=i(t+"CollectionConsumer",C);return P}return Gn(b,"useCollection"),[{Provider:o,Slot:p,ItemSlot:_},{createCollectionScope:r,useCollection:b,useInitCollection:x}]}Gn(AQ,"createCollection");function ZM(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}Gn(ZM,"shallowEqual");function qM(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Gn(qM,"isElementPreceding");function sw(t,e){return!t[1].element||!e[1].element?0:qM(t[1].element,e[1].element)?-1:1}Gn(sw,"sortByDocumentPosition");function GM(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Gn(GM,"getChildListObserver");var TQ=Object.defineProperty,mh=(t,e)=>TQ(t,"name",{value:e,configurable:!0}),wb="Collapsible",[RQ,KM]=Ui(wb),[IQ,xb]=RQ(wb),MQ=m.forwardRef(mh(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,f]=La({prop:s,defaultProp:i??!1,onChange:l,caller:wb});return S.jsx(IQ,{scope:r,disabled:o,contentId:_a(),open:d,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),children:S.jsx(Sn.div,{"data-state":vv(d),"data-disabled":o?"":void 0,...u,ref:n})})},"Collapsible")),OQ="CollapsibleTrigger",LQ=m.forwardRef(mh(function(e,n){const{__scopeCollapsible:r,...s}=e,i=xb(OQ,r);return S.jsx(Sn.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":vv(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Gt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),YM="CollapsibleContent",DQ=m.forwardRef(mh(function(e,n){const{forceMount:r,...s}=e,i=xb(YM,e.__scopeCollapsible);return S.jsx(Da,{present:r||i.open,children:({present:o})=>S.jsx(NQ,{...s,ref:n,present:o})})},"CollapsibleContent")),NQ=m.forwardRef(mh(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=xb(YM,r),[u,d]=m.useState(s),f=m.useRef(null),p=Yt(n,f),v=m.useRef(0),y=v.current,w=m.useRef(0),_=w.current,x=l.open||u,b=m.useRef(x),k=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),Br(()=>{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();v.current=P.height,w.current=P.width,b.current||(C.style.transitionDuration=k.current.transitionDuration,C.style.animationName=k.current.animationName),d(s)}},[l.open,s]),S.jsx(Sn.div,{"data-state":vv(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!x,...o,ref:p,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})},"CollapsibleContentImpl"));function vv(t){return t?"open":"closed"}mh(vv,"getState");var jQ=MQ,FQ=LQ,VQ=DQ,$Q=Object.defineProperty,HQ=(t,e)=>$Q(t,"name",{value:e,configurable:!0}),zQ=m.createContext(void 0);function bb(t){const e=m.useContext(zQ);return t||e||"ltr"}HQ(bb,"useDirection");var BQ=Object.defineProperty,xs=(t,e)=>BQ(t,"name",{value:e,configurable:!0}),Wi="Accordion",UQ=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Sb,WQ,ZQ]=yb(Wi),[gv,one]=Ui(Wi,[ZQ,KM]),Eb=KM(),qQ=m.forwardRef(xs(function(e,n){const{type:r,...s}=e,i=s,o=s;return S.jsx(Sb.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?S.jsx(XQ,{...o,ref:n}):S.jsx(YQ,{...i,ref:n})})},"Accordion")),[XM,GQ]=gv(Wi),[QM,KQ]=gv(Wi,{collapsible:!1}),YQ=m.forwardRef(xs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=xs(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[u,d]=La({prop:r,defaultProp:s??"",onChange:i,caller:Wi});return S.jsx(XM,{scope:e.__scopeAccordion,value:m.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:m.useCallback(()=>o&&d(""),[o,d]),children:S.jsx(QM,{scope:e.__scopeAccordion,collapsible:o,children:S.jsx(JM,{...l,ref:n})})})},"AccordionImplSingle")),XQ=m.forwardRef(xs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=xs(()=>{},"onValueChange"),...o}=e,[l,u]=La({prop:r,defaultProp:s??[],onChange:i,caller:Wi}),d=m.useCallback(p=>u((v=[])=>[...v,p]),[u]),f=m.useCallback(p=>u((v=[])=>v.filter(y=>y!==p)),[u]);return S.jsx(XM,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:S.jsx(QM,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(JM,{...o,ref:n})})})},"AccordionImplMultiple")),[QQ,yv]=gv(Wi),JM=m.forwardRef(xs(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o="vertical",...l}=e,u=m.useRef(null),d=Yt(u,n),f=WQ(r),v=bb(i)==="ltr",y=Gt(e.onKeyDown,w=>{var L;if(!UQ.includes(w.key))return;const _=w.target,x=f().filter(D=>{var V;return!((V=D.ref.current)!=null&&V.disabled)}),b=x.findIndex(D=>D.ref.current===_),k=x.length;if(b===-1)return;w.preventDefault();let C=b;const P=0,T=k-1,O=xs(()=>{C=b+1,C>T&&(C=P)},"moveNext"),M=xs(()=>{C=b-1,C<P&&(C=T)},"movePrev");switch(w.key){case"Home":C=P;break;case"End":C=T;break;case"ArrowRight":o==="horizontal"&&(v?O():M());break;case"ArrowDown":o==="vertical"&&O();break;case"ArrowLeft":o==="horizontal"&&(v?M():O());break;case"ArrowUp":o==="vertical"&&M();break}const R=C%k;(L=x[R].ref.current)==null||L.focus()});return S.jsx(QQ,{scope:r,disabled:s,direction:i,orientation:o,children:S.jsx(Sb.Slot,{scope:r,children:S.jsx(Sn.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:y})})})},"AccordionImpl")),iw="AccordionItem",[JQ,kb]=gv(iw),eJ=m.forwardRef(xs(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=yv(iw,r),l=GQ(iw,r),u=Eb(r),d=_a(),f=s&&l.value.includes(s)||!1,p=o.disabled||e.disabled;return S.jsx(JQ,{scope:r,open:f,disabled:p,triggerId:d,children:S.jsx(jQ,{"data-orientation":o.orientation,"data-state":Cb(f),...u,...i,ref:n,disabled:p,open:f,onOpenChange:v=>{v?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),tJ="AccordionHeader",nJ=m.forwardRef(xs(function(e,n){const{__scopeAccordion:r,...s}=e,i=yv(Wi,r),o=kb(tJ,r);return S.jsx(Sn.h3,{"data-orientation":i.orientation,"data-state":Cb(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),LC="AccordionTrigger",rJ=m.forwardRef(xs(function(e,n){const{__scopeAccordion:r,...s}=e,i=yv(Wi,r),o=kb(LC,r),l=KQ(LC,r),u=Eb(r);return S.jsx(Sb.ItemSlot,{scope:r,children:S.jsx(FQ,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),sJ="AccordionContent",iJ=m.forwardRef(xs(function(e,n){const{__scopeAccordion:r,...s}=e,i=yv(Wi,r),o=kb(sJ,r),l=Eb(r);return S.jsx(VQ,{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 Cb(t){return t?"open":"closed"}xs(Cb,"getState");var eO=qQ,oJ=eJ,aJ=nJ,lJ=rJ,cJ=iJ;/**
130
- * @license lucide-react v1.41.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const tO=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
135
- * @license lucide-react v1.41.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const uJ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
140
- * @license lucide-react v1.41.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const dJ=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
145
- * @license lucide-react v1.41.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const DC=t=>{const e=dJ(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
150
- * @license lucide-react v1.41.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */var Dy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
155
- * @license lucide-react v1.41.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const fJ=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},hJ=m.createContext({}),pJ=()=>m.useContext(hJ),mJ=m.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...l},u)=>{const{size:d=24,strokeWidth:f=2,absoluteStrokeWidth:p=!1,color:v="currentColor",className:y=""}=pJ()??{},w=r??p?Number(n??f)*24/Number(e??d):n??f;return m.createElement("svg",{ref:u,...Dy,width:e??d??Dy.width,height:e??d??Dy.height,stroke:t??v,strokeWidth:w,className:tO("lucide",y,s),...!i&&!fJ(l)&&{"aria-hidden":"true"},...l},[...o.map(([_,x])=>m.createElement(_,x)),...Array.isArray(i)?i:[i]])});/**
160
- * @license lucide-react v1.41.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const tt=(t,e)=>{const n=m.forwardRef(({className:r,...s},i)=>m.createElement(mJ,{ref:i,iconNode:e,className:tO(`lucide-${uJ(DC(t))}`,`lucide-${t}`,r),...s}));return n.displayName=DC(t),n};/**
165
- * @license lucide-react v1.41.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const vJ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],gJ=tt("arrow-left",vJ);/**
170
- * @license lucide-react v1.41.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const yJ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],_J=tt("arrow-right",yJ);/**
175
- * @license lucide-react v1.41.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const wJ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],xJ=tt("arrow-up",wJ);/**
180
- * @license lucide-react v1.41.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const bJ=[["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"}]],SJ=tt("bell",bJ);/**
185
- * @license lucide-react v1.41.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const EJ=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],kJ=tt("brain",EJ);/**
190
- * @license lucide-react v1.41.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const CJ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],PJ=tt("check",CJ);/**
195
- * @license lucide-react v1.41.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const AJ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],TJ=tt("chevron-down",AJ);/**
200
- * @license lucide-react v1.41.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const RJ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],IJ=tt("chevron-right",RJ);/**
205
- * @license lucide-react v1.41.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const MJ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],OJ=tt("circle",MJ);/**
210
- * @license lucide-react v1.41.0 - ISC
211
- *
212
- * This source code is licensed under the ISC license.
213
- * See the LICENSE file in the root directory of this source tree.
214
- */const LJ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],DJ=tt("clock",LJ);/**
215
- * @license lucide-react v1.41.0 - ISC
216
- *
217
- * This source code is licensed under the ISC license.
218
- * See the LICENSE file in the root directory of this source tree.
219
- */const NJ=[["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"}]],jJ=tt("copy",NJ);/**
220
- * @license lucide-react v1.41.0 - ISC
221
- *
222
- * This source code is licensed under the ISC license.
223
- * See the LICENSE file in the root directory of this source tree.
224
- */const FJ=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],VJ=tt("dot",FJ);/**
225
- * @license lucide-react v1.41.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const $J=[["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"}]],HJ=tt("globe",$J);/**
230
- * @license lucide-react v1.41.0 - ISC
231
- *
232
- * This source code is licensed under the ISC license.
233
- * See the LICENSE file in the root directory of this source tree.
234
- */const zJ=[["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"}]],BJ=tt("heart",zJ);/**
235
- * @license lucide-react v1.41.0 - ISC
236
- *
237
- * This source code is licensed under the ISC license.
238
- * See the LICENSE file in the root directory of this source tree.
239
- */const UJ=[["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"}]],WJ=tt("house",UJ);/**
240
- * @license lucide-react v1.41.0 - ISC
241
- *
242
- * This source code is licensed under the ISC license.
243
- * See the LICENSE file in the root directory of this source tree.
244
- */const ZJ=[["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"}]],qJ=tt("image",ZJ);/**
245
- * @license lucide-react v1.41.0 - ISC
246
- *
247
- * This source code is licensed under the ISC license.
248
- * See the LICENSE file in the root directory of this source tree.
249
- */const GJ=[["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"}]],KJ=tt("inbox",GJ);/**
250
- * @license lucide-react v1.41.0 - ISC
251
- *
252
- * This source code is licensed under the ISC license.
253
- * See the LICENSE file in the root directory of this source tree.
254
- */const YJ=[["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"}]],XJ=tt("lightbulb",YJ);/**
255
- * @license lucide-react v1.41.0 - ISC
256
- *
257
- * This source code is licensed under the ISC license.
258
- * See the LICENSE file in the root directory of this source tree.
259
- */const QJ=[["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"}]],JJ=tt("link",QJ);/**
260
- * @license lucide-react v1.41.0 - ISC
261
- *
262
- * This source code is licensed under the ISC license.
263
- * See the LICENSE file in the root directory of this source tree.
264
- */const eee=[["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"}]],tee=tt("loader",eee);/**
265
- * @license lucide-react v1.41.0 - ISC
266
- *
267
- * This source code is licensed under the ISC license.
268
- * See the LICENSE file in the root directory of this source tree.
269
- */const nee=[["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"}]],ree=tt("lock",nee);/**
270
- * @license lucide-react v1.41.0 - ISC
271
- *
272
- * This source code is licensed under the ISC license.
273
- * See the LICENSE file in the root directory of this source tree.
274
- */const see=[["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"}]],iee=tt("mail",see);/**
275
- * @license lucide-react v1.41.0 - ISC
276
- *
277
- * This source code is licensed under the ISC license.
278
- * See the LICENSE file in the root directory of this source tree.
279
- */const oee=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],aee=tt("menu",oee);/**
280
- * @license lucide-react v1.41.0 - ISC
281
- *
282
- * This source code is licensed under the ISC license.
283
- * See the LICENSE file in the root directory of this source tree.
284
- */const lee=[["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"}]],cee=tt("message-circle",lee);/**
285
- * @license lucide-react v1.41.0 - ISC
286
- *
287
- * This source code is licensed under the ISC license.
288
- * See the LICENSE file in the root directory of this source tree.
289
- */const uee=[["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"}]],dee=tt("monitor",uee);/**
290
- * @license lucide-react v1.41.0 - ISC
291
- *
292
- * This source code is licensed under the ISC license.
293
- * See the LICENSE file in the root directory of this source tree.
294
- */const fee=[["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"}]],hee=tt("moon",fee);/**
295
- * @license lucide-react v1.41.0 - ISC
296
- *
297
- * This source code is licensed under the ISC license.
298
- * See the LICENSE file in the root directory of this source tree.
299
- */const pee=[["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"}]],mee=tt("paintbrush",pee);/**
300
- * @license lucide-react v1.41.0 - ISC
301
- *
302
- * This source code is licensed under the ISC license.
303
- * See the LICENSE file in the root directory of this source tree.
304
- */const vee=[["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"}]],gee=tt("palette",vee);/**
305
- * @license lucide-react v1.41.0 - ISC
306
- *
307
- * This source code is licensed under the ISC license.
308
- * See the LICENSE file in the root directory of this source tree.
309
- */const yee=[["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"}]],_ee=tt("pause",yee);/**
310
- * @license lucide-react v1.41.0 - ISC
311
- *
312
- * This source code is licensed under the ISC license.
313
- * See the LICENSE file in the root directory of this source tree.
314
- */const wee=[["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"}]],xee=tt("pencil",wee);/**
315
- * @license lucide-react v1.41.0 - ISC
316
- *
317
- * This source code is licensed under the ISC license.
318
- * See the LICENSE file in the root directory of this source tree.
319
- */const bee=[["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"}]],See=tt("pipette",bee);/**
320
- * @license lucide-react v1.41.0 - ISC
321
- *
322
- * This source code is licensed under the ISC license.
323
- * See the LICENSE file in the root directory of this source tree.
324
- */const Eee=[["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"}]],kee=tt("play",Eee);/**
325
- * @license lucide-react v1.41.0 - ISC
326
- *
327
- * This source code is licensed under the ISC license.
328
- * See the LICENSE file in the root directory of this source tree.
329
- */const Cee=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pee=tt("plus",Cee);/**
330
- * @license lucide-react v1.41.0 - ISC
331
- *
332
- * This source code is licensed under the ISC license.
333
- * See the LICENSE file in the root directory of this source tree.
334
- */const Aee=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],Tee=tt("rectangle-horizontal",Aee);/**
335
- * @license lucide-react v1.41.0 - ISC
336
- *
337
- * This source code is licensed under the ISC license.
338
- * See the LICENSE file in the root directory of this source tree.
339
- */const Ree=[["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"}]],Iee=tt("rocket",Ree);/**
340
- * @license lucide-react v1.41.0 - ISC
341
- *
342
- * This source code is licensed under the ISC license.
343
- * See the LICENSE file in the root directory of this source tree.
344
- */const Mee=[["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"}]],Oee=tt("rotate-ccw",Mee);/**
345
- * @license lucide-react v1.41.0 - ISC
346
- *
347
- * This source code is licensed under the ISC license.
348
- * See the LICENSE file in the root directory of this source tree.
349
- */const Lee=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Dee=tt("search",Lee);/**
350
- * @license lucide-react v1.41.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */const Nee=[["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"}]],jee=tt("settings",Nee);/**
355
- * @license lucide-react v1.41.0 - ISC
356
- *
357
- * This source code is licensed under the ISC license.
358
- * See the LICENSE file in the root directory of this source tree.
359
- */const Fee=[["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"}]],Vee=tt("shield",Fee);/**
360
- * @license lucide-react v1.41.0 - ISC
361
- *
362
- * This source code is licensed under the ISC license.
363
- * See the LICENSE file in the root directory of this source tree.
364
- */const $ee=[["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"}]],Hee=tt("skip-forward",$ee);/**
365
- * @license lucide-react v1.41.0 - ISC
366
- *
367
- * This source code is licensed under the ISC license.
368
- * See the LICENSE file in the root directory of this source tree.
369
- */const zee=[["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"}]],Bee=tt("square-library",zee);/**
370
- * @license lucide-react v1.41.0 - ISC
371
- *
372
- * This source code is licensed under the ISC license.
373
- * See the LICENSE file in the root directory of this source tree.
374
- */const Uee=[["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"}]],Wee=tt("star",Uee);/**
375
- * @license lucide-react v1.41.0 - ISC
376
- *
377
- * This source code is licensed under the ISC license.
378
- * See the LICENSE file in the root directory of this source tree.
379
- */const Zee=[["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"}]],qee=tt("sun",Zee);/**
380
- * @license lucide-react v1.41.0 - ISC
381
- *
382
- * This source code is licensed under the ISC license.
383
- * See the LICENSE file in the root directory of this source tree.
384
- */const Gee=[["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"}]],Kee=tt("user",Gee);/**
385
- * @license lucide-react v1.41.0 - ISC
386
- *
387
- * This source code is licensed under the ISC license.
388
- * See the LICENSE file in the root directory of this source tree.
389
- */const Yee=[["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"}]],Xee=tt("users",Yee);/**
390
- * @license lucide-react v1.41.0 - ISC
391
- *
392
- * This source code is licensed under the ISC license.
393
- * See the LICENSE file in the root directory of this source tree.
394
- */const Qee=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jee=tt("x",Qee),ete={"chevron-right":IJ,"chevron-down":TJ,pipette:See,x:Jee,copy:jJ,menu:aee,dot:VJ,monitor:dee,sun:qee,moon:hee,"rectangle-horizontal":Tee,circle:OJ,"square-library":Bee,clock:DJ,star:Wee,settings:jee,plus:Pee,"arrow-left":gJ,"arrow-right":_J,"arrow-up":xJ,search:Dee,loader:tee,users:Xee,lock:ree,mail:iee,bell:SJ,shield:Vee,palette:gee,lightbulb:XJ,rocket:Iee,heart:BJ,paintbrush:mee,brain:kJ,globe:HJ,user:Kee,image:qJ,link:JJ,check:PJ,"rotate-ccw":Oee,play:kee,pause:_ee,home:WJ,"message-circle":cee,inbox:KJ,pencil:xee,"skip-forward":Hee},NC={lucide:ete},nO=m.createContext(null);function tte(t){const e=m.useContext(nO);return e?NC[e.iconLibrary][t]:NC.lucide[t]}function nte({children:t,defaultLibrary:e="lucide"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{r(i)},[]);return S.jsx(nO.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const rO=m.createContext(null);function Pb(){return m.useContext(rO)}const sO=m.createContext(null);function iO(){const t=m.useContext(sO);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const rte=m.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=m.useRef(null),l=m.useRef(new Map),[u,d]=m.useState(new Map),{activeIndex:f,setActiveIndex:p,itemRects:v,sessionRef:y,handlers:w,registerItem:_,measureItems:x}=YR(o),b=m.useCallback((le,te)=>{te?l.current.set(le,te):l.current.delete(le)},[]),k=m.useCallback(()=>{if(!o.current)return;const le=new Map;l.current.forEach((te,Pe)=>{le.set(Pe,{top:te.offsetTop,left:te.offsetLeft,width:te.offsetWidth,height:te.offsetHeight})}),d(le)},[]),[C,P]=m.useState(()=>r==="single"?t.defaultValue??"":""),[T,O]=m.useState(()=>r==="multiple"?t.defaultValue??[]:[]),M=t.onValueChange,R=t.onValueChange,L=t.value,D=new Set(r==="multiple"?t.value??T:(()=>{const le=t.value??C;return le?[le]:[]})()),V=m.useCallback(le=>{const te=t;te.onValueChange?te.onValueChange(le):P(le)},[M]),j=m.useCallback(le=>{const te=t;te.onValueChange?te.onValueChange(le):O(le)},[R]),U=m.useCallback(le=>{if(r==="multiple"){const te=t.value??T;j(te.filter(Pe=>Pe!==le))}else V("")},[r,V,j,T,L]);m.useEffect(()=>{x(),k()},[x,k,n]);const X=[...D].join(",");m.useEffect(()=>{x(),k()},[x,k,X]);const[q,Z]=m.useState(null),Y=f!==null?v[f]:null,H=q!==null?v[q]:null,Q=f!==null&&!u.has(f),z=dv(),{value:N,defaultValue:G,onValueChange:oe,collapsible:se,type:ee,...de}=i,ve=r==="multiple"?{type:"multiple",value:t.value??T,onValueChange:j}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:V};return S.jsx(rO.Provider,{value:{registerItem:_,registerFullItem:b,activeIndex:f,grouped:!0,remeasure:()=>{x(),k()},openValues:D,openItemRects:u,toggleValue:U},children:S.jsx(eO,{...ve,asChild:!0,children:S.jsxs("div",{ref:le=>{o.current=le,typeof e=="function"?e(le):e&&(e.current=le)},onMouseEnter:w.onMouseEnter,onMouseMove:le=>{const te=o.current;if(te){const Pe=te.getBoundingClientRect(),Se=te.offsetHeight,Ne=Pe.height,Xe=Se>0?Ne/Se:1,Qe=(le.clientY-Pe.top)/Xe+te.scrollTop;for(const[lt,ut]of u){const je=v[lt];if(!je)continue;const st=je.top+je.height,Be=ut.top+ut.height;if(Qe>=st&&Qe<=Be){p(null);return}}}w.onMouseMove(le)},onMouseLeave:w.onMouseLeave,onFocus:le=>{var Pe;const te=(Pe=le.target.closest("[data-proximity-index]"))==null?void 0:Pe.getAttribute("data-proximity-index");if(te!=null){const Se=Number(te);p(Se),Z(le.target.matches(":focus-visible")?Se:null)}},onBlur:le=>{var te;(te=o.current)!=null&&te.contains(le.relatedTarget)||(Z(null),p(null))},className:$n("relative flex flex-col gap-0.5 w-72 max-w-full",s),...de,children:[S.jsx(_s,{children:[...u.entries()].map(([le,te])=>S.jsx(Eo.div,{className:`absolute ${z.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:te.top,left:te.left,width:te.width,height:te.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(_s,{children:Y&&S.jsx(Eo.div,{className:`absolute ${z.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:Y.top,left:Y.left,width:Y.width,height:Y.height},animate:{opacity:1,top:Y.top,left:Y.left,width:Y.width,height:Y.height},exit:{opacity:0,transition:{duration:.06}},transition:{...jf.fast,opacity:{duration:.08}}},y.current)}),S.jsx(_s,{children:H&&S.jsx(Eo.div,{className:`absolute ${z.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:H.left-2,top:H.top-2,width:H.width+4,height:H.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...jf.fast,opacity:{duration:.08}}})}),n]})})})});rte.displayName="AccordionGroup";const oO=m.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},u)=>{const[d,f]=m.useState(()=>e==="single"?r??"":""),[p,v]=m.useState(()=>e==="multiple"?r??[]:[]),y=new Set(e==="multiple"?s??p:(()=>{const k=s??d;return k?[k]:[]})()),w=m.useCallback(k=>{i?i(k):f(k)},[i]),_=m.useCallback(k=>{i?i(k):v(k)},[i]),x=m.useCallback(k=>{e==="multiple"?_((s??p).filter(P=>P!==k)):w("")},[e,s,p,w,_]),b=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:w};return S.jsx(eO,{...b,asChild:!0,children:S.jsx("div",{ref:u,className:$n("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:S.jsx(aO.Provider,{value:y,children:S.jsx(lO.Provider,{value:x,children:t})})})})});oO.displayName="Accordion";const aO=m.createContext(new Set),lO=m.createContext(()=>{}),cO=m.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=m.useRef(null),u=Pb(),d=m.useContext(aO),f=m.useContext(lO),p=dv(),v=u!=null&&u.grouped?u.openValues.has(t):d.has(t),y=m.useRef(null),w=m.useCallback(()=>{u!=null&&u.grouped?u.toggleValue(t):f(t)},[u,f,t]);return m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return u.registerItem(e,y.current),()=>u.registerItem(e,null)},[e,u]),m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return v?u.registerFullItem(e,l.current):u.registerFullItem(e,null),()=>u.registerFullItem(e,null)},[e,u,v]),S.jsx(sO.Provider,{value:{index:e,value:t,isOpen:v,onToggle:w,triggerRef:y},children:S.jsxs(oJ,{ref:_=>{l.current=_,typeof o=="function"?o(_):o&&(o.current=_)},value:t,disabled:n,"data-proximity-index":e,className:$n(!(u!=null&&u.grouped)&&"relative",s),...i,children:[!(u!=null&&u.grouped)&&S.jsx(_s,{children:v&&S.jsx(Eo.div,{className:`absolute inset-0 ${p.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]})})});cO.displayName="AccordionItem";const uO=m.forwardRef(({children:t,className:e,...n},r)=>{const s=tte("chevron-right"),i=Pb(),{index:o,isOpen:l,triggerRef:u}=iO(),d=dv(),[f,p]=m.useState(!1),v=i!=null&&i.grouped?i.activeIndex===o:f,y=S.jsx(aJ,{asChild:!0,children:S.jsx("div",{children:S.jsxs(lJ,{ref:r,className:$n(`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:mf.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:$n("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||v?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?mf.semibold:mf.normal},children:t})]}),S.jsx(Eo.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:jf.fast,children:S.jsx(s,{size:16,strokeWidth:l||v?2:1.5,className:$n("transition-[color,stroke-width] duration-80",l||v?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:u,children:y}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(_s,{children:f&&S.jsx(Eo.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}})}),y]})});uO.displayName="AccordionTrigger";const dO=m.forwardRef(({children:t,className:e,...n},r)=>{const s=Pb(),{isOpen:i}=iO();return S.jsx(_s,{initial:!1,children:i&&S.jsx(cJ,{forceMount:!0,asChild:!0,...n,children:S.jsx(Eo.div,{ref:r,className:$n("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...jf.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})})})})});dO.displayName="AccordionContent";const $0=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(oO,{type:"multiple",defaultValue:e,className:$n("w-full",n),children:t}),ste=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return S.jsxs(cO,{value:t,className:$n("w-full",!l&&"border-t border-main-border"),children:[S.jsxs(uO,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(dO,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};$0.Item=ste;const ite=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(cv,{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})]}),ote=()=>{const t=m.useRef(Date.now()),[e,n]=m.useState(0);return m.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},ate=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},jC="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",FC="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",lte="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",H0=["Applying","Thinking","Planning","Crafting"],cte=H0.reduce((t,e)=>t.length>=e.length?t:e),ute=20,dte="Still working — runs can take a few minutes.",fte=({hint:t,showElapsed:e=!0})=>{const[n,r]=m.useState(0),s=ote();m.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%H0.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=ute?dte:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(di.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(di.path,{animate:{d:[jC,FC,lte,FC,jC]},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:mf.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:cte}),S.jsx(_s,{mode:"popLayout",initial:!1,children:S.jsx(di.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:H0[n]},H0[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:ate(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var hte=Object.defineProperty,pte=(t,e)=>hte(t,"name",{value:e,configurable:!0});function Ab(t,[e,n]){return Math.min(n,Math.max(e,t))}pte(Ab,"clamp");var mte=Object.defineProperty,vte=(t,e)=>mte(t,"name",{value:e,configurable:!0});function fO(t){const e=m.useRef({value:t,previous:t});return m.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}vte(fO,"usePrevious");var gte=Object.defineProperty,Ct=(t,e)=>gte(t,"name",{value:e,configurable:!0}),hO=["PageUp","PageDown"],pO=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],mO={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},vh="Slider",[ow,yte,_te]=yb(vh),[Tb,ane]=Ui(vh,[_te]),[wte,gh]=Tb(vh),xte=m.forwardRef(Ct(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[s],value:p,onValueChange:v=Ct(()=>{},"onValueChange"),onValueCommit:y=Ct(()=>{},"onValueCommit"),inverted:w=!1,form:_,...x}=e,b=m.useRef(new Set),k=m.useRef(0),C=m.useRef(!1),T=l==="horizontal"?bte:Ste,[O,M]=m.useState(null),R=Yt(n,M),[L=[],D]=La({prop:p,defaultProp:f,onChange:Ct(Y=>{var Q;(Q=[...b.current][k.current])==null||Q.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,v(Y)},"onChange")}),V=m.useRef(L),j=m.useRef(L);m.useEffect(()=>{const Y=_?O==null?void 0:O.ownerDocument.getElementById(_):O==null?void 0:O.closest("form");if(Y instanceof HTMLFormElement){const H=Ct(()=>D(j.current),"reset");return Y.addEventListener("reset",H),()=>Y.removeEventListener("reset",H)}},[O,_,D]);function U(Y){const H=SO(L,Y);Z(Y,H)}Ct(U,"handleSlideStart");function X(Y){Z(Y,k.current)}Ct(X,"handleSlideMove");function q(){String(L)!==String(V.current)&&y(L)}Ct(q,"handleSlideEnd");function Z(Y,H,{commit:Q}={commit:!1}){const z=Ib(o),N=wf(Math.round((Y-s)/o)*o+s,z),G=Ab(N,[s,i]);D((oe=[])=>{const se=xO(oe,G,H);if(CO(se,d*o)){k.current=se.indexOf(G);const ee=String(se)!==String(oe);return ee&&Q&&y(se),ee?se:oe}else return oe})}return Ct(Z,"updateValues"),S.jsx(wte,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:k,thumbs:b.current,values:L,orientation:l,form:_,children:S.jsx(ow.Provider,{scope:e.__scopeSlider,children:S.jsx(ow.Slot,{scope:e.__scopeSlider,children:S.jsx(T,{"aria-disabled":u,"data-disabled":u?"":void 0,...x,ref:R,onPointerDown:Gt(x.onPointerDown,()=>{u||(V.current=L,C.current=!1)}),min:s,max:i,inverted:w,onSlideStart:u?void 0:U,onSlideMove:u?void 0:X,onSlideEnd:u?void 0:q,onHomeKeyDown:()=>{u||(C.current=!0,Z(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(C.current=!0,Z(i,L.length-1,{commit:!0}))},onStepKeyDown:({event:Y,direction:H})=>{if(!u){C.current=!0;const N=hO.includes(Y.key)||Y.shiftKey&&pO.includes(Y.key)?10:1,G=k.current,oe=L[G],se=PO(oe,{min:s,step:o,direction:H,multiplier:N});Z(se,G,{commit:!0})}}})})})})},"Slider")),[vO,gO]=Tb(vh,{startEdge:"left",endEdge:"right",size:"width",direction:1}),bte=m.forwardRef(Ct(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...p}=e,[v,y]=m.useState(null),w=Yt(n,y),_=m.useRef(void 0),x=bb(i),b=x==="ltr",k=b&&!o||!b&&o;function C(P){const T=_.current||v.getBoundingClientRect(),O=[0,T.width],R=_v(O,k?[r,s]:[s,r]);return _.current=T,R(P-T.left)}return Ct(C,"getValueFromPointer"),S.jsx(vO,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:S.jsx(yO,{dir:x,"data-orientation":"horizontal",...p,ref:w,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const T=C(P.clientX);l==null||l(T)},onSlideMove:P=>{const T=C(P.clientX);u==null||u(T)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:P=>{const O=mO[k?"from-left":"from-right"].includes(P.key);f==null||f({event:P,direction:O?-1:1})}})})},"SliderHorizontal")),Ste=m.forwardRef(Ct(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,p=m.useRef(null),v=Yt(n,p),y=m.useRef(void 0),w=!i;function _(x){const b=y.current||p.current.getBoundingClientRect(),k=[0,b.height],P=_v(k,w?[s,r]:[r,s]);return y.current=b,P(x-b.top)}return Ct(_,"getValueFromPointer"),S.jsx(vO,{scope:e.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:S.jsx(yO,{"data-orientation":"vertical",...f,ref:v,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const b=_(x.clientY);o==null||o(b)},onSlideMove:x=>{const b=_(x.clientY);l==null||l(b)},onSlideEnd:()=>{y.current=void 0,u==null||u()},onStepKeyDown:x=>{const k=mO[w?"from-bottom":"from-top"].includes(x.key);d==null||d({event:x,direction:k?-1:1})}})})},"SliderVertical")),yO=m.forwardRef(Ct(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,p=gh(vh,r);return S.jsx(Sn.span,{...f,ref:n,onKeyDown:Gt(e.onKeyDown,v=>{v.key==="Home"?(l(v),v.preventDefault()):v.key==="End"?(u(v),v.preventDefault()):hO.concat(pO).includes(v.key)&&(d(v),v.preventDefault())}),onPointerDown:Gt(e.onPointerDown,v=>{const y=v.target;y.setPointerCapture(v.pointerId),v.preventDefault(),p.thumbs.has(y)?y.focus({preventScroll:!0,focusVisible:!1}):s(v)}),onPointerMove:Gt(e.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&i(v)}),onPointerUp:Gt(e.onPointerUp,v=>{const y=v.target;y.hasPointerCapture(v.pointerId)&&(y.releasePointerCapture(v.pointerId),o(v))})})},"SliderImpl")),Ete="SliderTrack",kte=m.forwardRef(Ct(function(e,n){const{__scopeSlider:r,...s}=e,i=gh(Ete,r);return S.jsx(Sn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),VC="SliderRange",Cte=m.forwardRef(Ct(function(e,n){const{__scopeSlider:r,...s}=e,i=gh(VC,r),o=gO(VC,r),l=m.useRef(null),u=Yt(n,l),d=i.values.length,f=i.values.map(y=>Rb(y,i.min,i.max)),p=d>1?Math.min(...f):0,v=100-Math.max(...f);return S.jsx(Sn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:v+"%"}})},"SliderRange")),Pte="SliderThumb",[Ate,_O]=Tb(Pte),Tte="SliderThumbProvider";function wO(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=gh(Tte,e),o=yte(e),[l,u]=m.useState(null),d=m.useMemo(()=>l?o().findIndex(x=>x.ref.current===l):-1,[o,l]),f=Dx(l),p=l?!!i.form||!!l.closest("form"):!0,v=i.values[d],y=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),w=v===void 0?0:Rb(v,i.min,i.max);m.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:v,name:y,form:i.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:w,size:f};return S.jsx(Ate,{scope:e,..._,children:AO(s)?s(_):r})}Ct(wO,"SliderThumbProvider");var Ny="SliderThumbTrigger",Rte=m.forwardRef(Ct(function(e,n){const{__scopeSlider:r,...s}=e,i=gh(Ny,r),o=gO(Ny,r),{index:l,value:u,percent:d,size:f,onThumbChange:p}=_O(Ny,r),v=Yt(n,p),y=bO(l,i.values.length),w=f==null?void 0:f[o.size],_=w?EO(w,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(ow.ItemSlot,{scope:r,children:S.jsx(Sn.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":i.min,"aria-valuenow":u,"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:v,style:u===void 0?{display:"none"}:e.style,onFocus:Gt(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),Ite=m.forwardRef(Ct(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(wO,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>S.jsxs(S.Fragment,{children:[S.jsx(Rte,{...i,ref:n,__scopeSlider:r}),l?S.jsx(Ote,{__scopeSlider:r},o):null]})})},"SliderThumb")),Mte="SliderBubbleInput",Ote=m.forwardRef(Ct(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:o}=_O(Mte,e),l=m.useRef(null),u=Yt(l,r),d=fO(s);return m.useEffect(()=>{const f=l.current;if(!f)return;const p=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&y){const w=new Event("input",{bubbles:!0});y.call(f,s),f.dispatchEvent(w)}},[d,s]),S.jsx(Sn.input,{style:{display:"none"},name:i,form:o,...n,ref:u,defaultValue:s})},"SliderBubbleInput"));function xO(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}Ct(xO,"getNextSortedValues");function Rb(t,e,n){const i=100/(n-e)*(t-e);return Ab(i,[0,100])}Ct(Rb,"convertValueToPercentage");function bO(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}Ct(bO,"getLabel");function SO(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)}Ct(SO,"getClosestValueIndex");function EO(t,e,n){const r=t/2,i=_v([0,50],[0,r]);return(r-i(e)*n)*n}Ct(EO,"getThumbInBoundsOffset");function kO(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}Ct(kO,"getStepsBetweenValues");function CO(t,e){if(e>0){const n=kO(t);return Math.min(...n)>=e}return!0}Ct(CO,"hasMinStepsBetweenValues");function _v(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])}}Ct(_v,"linearScale");function Ib(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}Ct(Ib,"getDecimalCount");function wf(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}Ct(wf,"roundValue");function PO(t,{min:e,step:n,direction:r,multiplier:s}){const i=Ib(n),o=(t-e)/n,l=Math.round(o),u=wf(l*n+e,i)===wf(t,i);let d;return u?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),wf(d*n+e,i)}Ct(PO,"getNextStepValue");function AO(t){return typeof t=="function"}Ct(AO,"isFunction");const aw=m.forwardRef(({className:t,...e},n)=>S.jsxs(xte,{ref:n,className:$n("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(kte,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(Cte,{className:"absolute h-full bg-primary"})}),S.jsx(Ite,{className:$n("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")})]}));aw.displayName="Slider";const Lte=[{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"}],Dte=[{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"}],Nte=[{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"}],f0=[{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:"CommentMarker",path:"components/CommentMarker.tsx",status:"feature-only",note:"Preview overlay marker tied to comment positions."},{name:"CommentMarkerLayer",path:"components/CommentMarkerLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to comment collections."},{name:"CommentPopover",path:"components/CommentPopover.tsx",status:"feature-only",note:"Comment workflow popover tied to editor state."},{name:"CommentReferenceChip",path:"components/CommentReferenceChip.tsx",status:"feature-only",note:"Comment workflow chip tied to selected references."},{name:"CommentReferencePicker",path:"components/CommentReferencePicker.tsx",status:"feature-only",note:"Comment workflow picker tied to preview elements."},{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."}],jte=()=>{window.location.hash=""},ao=({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]}),$C=({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))}),Fte=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",Vte=()=>{const t=f0.filter(n=>n.status==="showcased").length,e=f0.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:jte,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(PZ,{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(RR,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(ao,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",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 wrapper"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(iu,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),S.jsx(iu,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),S.jsx(iu,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),S.jsx(pI,{primaryLabel:"Ship",primaryIcon:dy,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(Gl,{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(Yx,{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(ao,{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($C,{swatches:Lte})}),S.jsx(ao,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx($C,{swatches:Dte})}),S.jsx(ao,{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(ao,{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:Nte.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(ao,{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($0,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx($0.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(dy,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx($0.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(aw,{defaultValue:[64],max:100,step:1}),S.jsx(aw,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(ao,{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(ite,{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(Zx,{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(fte,{hint:"Reading selected elements"})})]})}),S.jsx(ao,{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(z_,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(ZI,{icon:S.jsx(dy,{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(Qx,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(ao,{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:f0.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:f0.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 ${Fte(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},$te=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",Hte=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"},jy=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:"editor_gate",method:"google_oauth",...s?{failure_reason:s}:{}}}),HC=Es("App"),zte=2e3,Bte=60,zC="Connecting to Google...",BC="https://rivet-proxy.onrender.com",Ute=`<!doctype html>
395
- <html lang="en">
396
- <head>
397
- <meta charset="utf-8" />
398
- <meta name="viewport" content="width=device-width, initial-scale=1" />
399
- <title>${zC}</title>
400
- <style>
401
- :root { color-scheme: light dark; }
402
- body {
403
- margin: 0;
404
- min-height: 100vh;
405
- display: grid;
406
- place-items: center;
407
- font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
408
- background: #111215;
409
- color: #f3f4f6;
410
- }
411
- .panel {
412
- border: 1px solid rgba(255, 255, 255, 0.16);
413
- border-radius: 12px;
414
- padding: 18px 22px;
415
- background: rgba(255, 255, 255, 0.06);
416
- font-size: 14px;
417
- }
418
- </style>
419
- </head>
420
- <body>
421
- <div class="panel">${zC}</div>
422
- </body>
423
- </html>`,lw=274,zm=395,Fy=Math.min(zm,Math.round((lw+zm)/2*1.1)),UC="rivet:panelWidth:v2",Wte=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},Zte=({projectPath:t})=>{const e=rt(iI)>0,[n,r]=h5(rI),s=Pz(),[i,o]=m.useState(()=>{if(typeof window>"u")return Fy;const P=Number(window.localStorage.getItem(UC));return Number.isFinite(P)&&P>=lw&&P<=zm?P:Fy}),[l,u]=m.useState(!1),[d,f]=m.useState(uQ),p=n?i:0,[v,y]=m.useState(n);m.useEffect(()=>{if(!n){y(!1);return}f(P=>cQ({position:P,boundsLeftPx:i}))},[n,i]),m.useEffect(()=>{window.localStorage.setItem(UC,String(i))},[i]),m.useEffect(()=>{if(!n)return;const P=T=>{T.key==="Escape"&&(Wte(T.target)||(T.preventDefault(),r(!1)))};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[n,r]);const w=m.useCallback(P=>{P.preventDefault(),P.stopPropagation();const T=P.clientX,O=i;u(!0);const M=L=>{const D=Math.min(zm,Math.max(lw,O+(L.clientX-T)));o(D)},R=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",R),u(!1)};window.addEventListener("pointermove",M),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",R)},[i]),_=m.useCallback(()=>o(Fy),[]),x=SQ(),b=rt(fh);CQ({enabled:!b});const k=x.isProcessing?"Completing authentication...":null,C=mt(uI);return m.useEffect(()=>{C(t??null)},[t,C]),S.jsxs(di.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[k!==null?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(YX,{message:k})}):null,S.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:S.jsx(EY,{})}),S.jsx(S.Fragment,{children:e?null:S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:v?i:0},children:S.jsxs(di.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-i},transition:s?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{n&&y(!0)},style:{width:i,willChange:"transform"},children:[S.jsx(LK,{onClose:()=>r(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:w,onDoubleClick:_,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 ${l?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),l&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(hQ,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:d,dragBoundsLeftPx:p,onPositionChange:f,onToggle:()=>r(P=>!P)})]})}),S.jsx(rB,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},cw="rivet_connect_deep_link",qte=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(cw);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(cw,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},Gte=qte(),Kte=()=>{const[t,e]=m.useState(window.location.hash),[n]=m.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(F0)==="1"),[r,s]=m.useState(!1),[i,o]=m.useState(Gte);m.useEffect(()=>{n&&window.sessionStorage.removeItem(F0)},[n]);const{config:l,refetchConfig:u,loading:d,error:f}=xQ(),p=mt(fh),[v,y]=m.useState(!1),[w,_]=m.useState(null),[x,b]=m.useState(!1);m.useEffect(()=>{l!=null&&l.userId?(ke.identify(l.userId,{...l.email?{email:l.email}:{}}),l.email&&ke.alias(l.email,l.userId)):l!=null&&l.email&&ke.identify(l.email,{email:l.email})},[l==null?void 0:l.userId,l==null?void 0:l.email]),m.useEffect(()=>{l&&ke.register({source:"visual_editor",surface:"visual_editor"})},[l]);const k=m.useCallback(async()=>{var U;const L=globalThis.crypto.randomUUID(),D=Date.now();y(!0),_(null);const V=jy({outcome:"started",authAttemptId:L,startedAt:D,now:D});ke.capture(V.event,V.properties);let j=null;try{if(j=window.open("","_blank"),!j)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{j.document.open(),j.document.write(Ute),j.document.close()}catch(Z){HC.warn("Failed to render loading state in auth popup:",Z)}const X=await fetch(`${BC}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core"})}),q=await X.json();if(!X.ok||!q.success||!q.authUrl||!q.sessionId||!q.pollSecret)throw new Error(q.error||q.message||"Failed to start Google login");if(j.closed)throw new Error("Sign-in window was closed before Google login started.");j.location.href=q.authUrl;for(let Z=0;Z<Bte;Z+=1){if(j.closed)throw new Error("Sign-in window was closed before authentication completed.");const H=await(await fetch(`${BC}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:q.sessionId,pollSecret:q.pollSecret})})).json();if(H.success&&H.token&&((U=H.user)!=null&&U.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:H.user.email,token:H.token,refreshToken:H.refreshToken,userId:H.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");j.close(),window.sessionStorage.setItem(F0,"1");const z=jy({outcome:"completed",authAttemptId:L,startedAt:D,now:Date.now()});ke.capture(z.event,z.properties),window.location.reload();return}if(H.error&&H.error!=="Pending")throw new Error(H.error||"Google login failed");await new Promise(Q=>setTimeout(Q,zte))}throw new Error("Authentication timed out. Please try again.")}catch(X){j&&!j.closed&&j.close();const q=X instanceof Error?X.message:"Failed to start login flow";HC.warn("Login failed:",q);const Z=jy({outcome:"failed",authAttemptId:L,startedAt:D,now:Date.now(),failureReason:Hte(q)});ke.capture(Z.event,Z.properties),_(q),y(!1)}},[]),C=l!=null&&l.agentModeAvailable!==!0,P=$te(t),T=m.useCallback(async()=>{b(!0),p(!0);try{await u()}finally{p(!1),b(!1)}},[u,p]);if(m.useEffect(()=>{const L=()=>{const D=window.location.hash;e(D)};return window.addEventListener("hashchange",L),()=>window.removeEventListener("hashchange",L)},[]),P==="design-system")return S.jsx(Vte,{});if(!d&&l===null&&!x){const L=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-dim mt-2 text-xs",children:L}),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:()=>{T()},children:"Retry"})]})})}if(C)return S.jsx(GX,{isSigningIn:v,onStartSignIn:()=>{k()},errorMessage:w,displayMode:"full"});const M=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,R=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!M;return S.jsxs(S.Fragment,{children:[S.jsx(Zte,{projectPath:l==null?void 0:l.projectPath}),S.jsx(H_,{context:"onboarding",isOpen:R,onClose:()=>s(!0)}),S.jsx(H_,{context:"menu",isOpen:M,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(cw),o(null)}})]})},Yte="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",Xte=new NL,Qte={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},Jte=()=>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."})});Q7.createRoot(document.getElementById("root")).render(S.jsx(we.StrictMode,{children:S.jsx($7,{apiKey:Yte,options:{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",...Qte,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.16.2",env:"production"})}},children:S.jsx(Z7,{fallback:S.jsx(Jte,{}),children:S.jsx(uL,{client:Xte,children:S.jsx(FG,{defaultShape:"rounded",children:S.jsx(nte,{defaultLibrary:"lucide",children:S.jsx(Kte,{})})})})})})}));