@tscircuit/runframe 0.0.770 → 0.0.772
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.
|
@@ -241,7 +241,7 @@ Check the render method of %s.`,Sa(Xc)||"Unknown"));var Xt=EI(ze,ct);Xt.payload=
|
|
|
241
241
|
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}OE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lCe,OE.createPortal=nUn,OE.createRoot=rUn,OE.findDOMNode=XLn,OE.flushSync=sUn,OE.hydrate=qLn,OE.hydrateRoot=oUn,OE.render=$Ln,OE.unmountComponentAtNode=tUn,OE.unstable_batchedUpdates=U9e,OE.unstable_renderSubtreeIntoContainer=iUn,OE.version=nCe,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}(),OE}var ZCe;function XCe(){if(ZCe)return qP.exports;ZCe=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}}return process.env.NODE_ENV==="production"?(i(),qP.exports=J0t()):qP.exports=W0t(),qP.exports}var qCe;function Z0t(){if(qCe)return eM;qCe=1;var i=XCe();if(process.env.NODE_ENV==="production")eM.createRoot=i.createRoot,eM.hydrateRoot=i.hydrateRoot;else{var e=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;eM.createRoot=function(t,n){e.usingClientEntryPoint=!0;try{return i.createRoot(t,n)}finally{e.usingClientEntryPoint=!1}},eM.hydrateRoot=function(t,n,r){e.usingClientEntryPoint=!0;try{return i.hydrateRoot(t,n,r)}finally{e.usingClientEntryPoint=!1}}}return eM}var $Ce=Z0t(),vt=bC();const Af=EC(vt),exe=IB({__proto__:null,default:Af},[vt]);function Eg(i,e,{checkForDefaultPrevented:t=!0}={}){return function(r){if(i==null||i(r),t===!1||!r.defaultPrevented)return e==null?void 0:e(r)}}function nM(i,e=[]){let t=[];function n(o,s){const a=vt.createContext(s),c=t.length;t=[...t,s];const l=A=>{var v;const{scope:d,children:h,...f}=A,y=((v=d==null?void 0:d[i])==null?void 0:v[c])||a,_=vt.useMemo(()=>f,Object.values(f));return ut.jsx(y.Provider,{value:_,children:h})};l.displayName=o+"Provider";function u(A,d){var y;const h=((y=d==null?void 0:d[i])==null?void 0:y[c])||a,f=vt.useContext(h);if(f)return f;if(s!==void 0)return s;throw new Error(`\`${A}\` must be used within \`${o}\``)}return[l,u]}const r=()=>{const o=t.map(s=>vt.createContext(s));return function(a){const c=(a==null?void 0:a[i])||o;return vt.useMemo(()=>({[`__scope${i}`]:{...a,[i]:c}}),[a,c])}};return r.scopeName=i,[n,X0t(r,...e)]}function X0t(...i){const e=i[0];if(i.length===1)return e;const t=()=>{const n=i.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(o){const s=n.reduce((a,{useScope:c,scopeName:l})=>{const A=c(o)[`__scope${l}`];return{...a,...A}},{});return vt.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return t.scopeName=e.scopeName,t}function txe(i,e){if(typeof i=="function")return i(e);i!=null&&(i.current=e)}function eF(...i){return e=>{let t=!1;const n=i.map(r=>{const o=txe(r,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let r=0;r<n.length;r++){const o=n[r];typeof o=="function"?o():txe(i[r],null)}}}}function zE(...i){return vt.useCallback(eF(...i),i)}function HN(i){const e=$0t(i),t=vt.forwardRef((n,r)=>{const{children:o,...s}=n,a=vt.Children.toArray(o),c=a.find(tht);if(c){const l=c.props.children,u=a.map(A=>A===c?vt.Children.count(l)>1?vt.Children.only(null):vt.isValidElement(l)?l.props.children:null:A);return ut.jsx(e,{...s,ref:r,children:vt.isValidElement(l)?vt.cloneElement(l,void 0,u):null})}return ut.jsx(e,{...s,ref:r,children:o})});return t.displayName=`${i}.Slot`,t}var q0t=HN("Slot");function $0t(i){const e=vt.forwardRef((t,n)=>{const{children:r,...o}=t;if(vt.isValidElement(r)){const s=iht(r),a=nht(o,r.props);return r.type!==vt.Fragment&&(a.ref=n?eF(n,s):s),vt.cloneElement(r,a)}return vt.Children.count(r)>1?vt.Children.only(null):null});return e.displayName=`${i}.SlotClone`,e}var eht=Symbol("radix.slottable");function tht(i){return vt.isValidElement(i)&&typeof i.type=="function"&&"__radixId"in i.type&&i.type.__radixId===eht}function nht(i,e){const t={...e};for(const n in e){const r=i[n],o=e[n];/^on[A-Z]/.test(n)?r&&o?t[n]=(...a)=>{const c=o(...a);return r(...a),c}:r&&(t[n]=r):n==="style"?t[n]={...r,...o}:n==="className"&&(t[n]=[r,o].filter(Boolean).join(" "))}return{...i,...t}}function iht(i){var n,r;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(r=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}function nxe(i){const e=i+"CollectionProvider",[t,n]=nM(e),[r,o]=t(e,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:_,children:v}=y,E=Af.useRef(null),b=Af.useRef(new Map).current;return ut.jsx(r,{scope:_,itemMap:b,collectionRef:E,children:v})};s.displayName=e;const a=i+"CollectionSlot",c=HN(a),l=Af.forwardRef((y,_)=>{const{scope:v,children:E}=y,b=o(a,v),M=zE(_,b.collectionRef);return ut.jsx(c,{ref:M,children:E})});l.displayName=a;const u=i+"CollectionItemSlot",A="data-radix-collection-item",d=HN(u),h=Af.forwardRef((y,_)=>{const{scope:v,children:E,...b}=y,M=Af.useRef(null),z=zE(_,M),U=o(u,v);return Af.useEffect(()=>(U.itemMap.set(M,{ref:M,...b}),()=>void U.itemMap.delete(M))),ut.jsx(d,{[A]:"",ref:z,children:E})});h.displayName=u;function f(y){const _=o(i+"CollectionConsumer",y);return Af.useCallback(()=>{const E=_.collectionRef.current;if(!E)return[];const b=Array.from(E.querySelectorAll(`[${A}]`));return Array.from(_.itemMap.values()).sort((U,L)=>b.indexOf(U.ref.current)-b.indexOf(L.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},f,n]}var e3=globalThis!=null&&globalThis.document?vt.useLayoutEffect:()=>{},rht=exe[" useId ".trim().toString()]||(()=>{}),oht=0;function iM(i){const[e,t]=vt.useState(rht());return e3(()=>{t(n=>n??String(oht++))},[i]),e?`radix-${e}`:""}var xZ=XCe();const sht=EC(xZ);var aht=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D9=aht.reduce((i,e)=>{const t=HN(`Primitive.${e}`),n=vt.forwardRef((r,o)=>{const{asChild:s,...a}=r,c=s?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),ut.jsx(c,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...i,[e]:n}},{});function ixe(i,e){i&&xZ.flushSync(()=>i.dispatchEvent(e))}function CB(i){const e=vt.useRef(i);return vt.useEffect(()=>{e.current=i}),vt.useMemo(()=>(...t)=>{var n;return(n=e.current)==null?void 0:n.call(e,...t)},[])}var cht=exe[" useInsertionEffect ".trim().toString()]||e3;function tF({prop:i,defaultProp:e,onChange:t=()=>{},caller:n}){const[r,o,s]=lht({defaultProp:e,onChange:t}),a=i!==void 0,c=a?i:r;{const u=vt.useRef(i!==void 0);vt.useEffect(()=>{const A=u.current;A!==a&&console.warn(`${n} is changing from ${A?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,n])}const l=vt.useCallback(u=>{var A;if(a){const d=uht(u)?u(i):u;d!==i&&((A=s.current)==null||A.call(s,d))}else o(u)},[a,i,o,s]);return[c,l]}function lht({defaultProp:i,onChange:e}){const[t,n]=vt.useState(i),r=vt.useRef(t),o=vt.useRef(e);return cht(()=>{o.current=e},[e]),vt.useEffect(()=>{var s;r.current!==t&&((s=o.current)==null||s.call(o,t),r.current=t)},[t,r]),[t,n,o]}function uht(i){return typeof i=="function"}var Aht=vt.createContext(void 0);function EZ(i){const e=vt.useContext(Aht);return i||e||"ltr"}var bZ="rovingFocusGroup.onEntryFocus",dht={bubbles:!1,cancelable:!0},VN="RovingFocusGroup",[BZ,rxe,hht]=nxe(VN),[fht,nF]=nM(VN,[hht]),[pht,ght]=fht(VN),oxe=vt.forwardRef((i,e)=>ut.jsx(BZ.Provider,{scope:i.__scopeRovingFocusGroup,children:ut.jsx(BZ.Slot,{scope:i.__scopeRovingFocusGroup,children:ut.jsx(mht,{...i,ref:e})})}));oxe.displayName=VN;var mht=vt.forwardRef((i,e)=>{const{__scopeRovingFocusGroup:t,orientation:n,loop:r=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...A}=i,d=vt.useRef(null),h=zE(e,d),f=EZ(o),[y,_]=tF({prop:s,defaultProp:a??null,onChange:c,caller:VN}),[v,E]=vt.useState(!1),b=CB(l),M=rxe(t),z=vt.useRef(!1),[U,L]=vt.useState(0);return vt.useEffect(()=>{const F=d.current;if(F)return F.addEventListener(bZ,b),()=>F.removeEventListener(bZ,b)},[b]),ut.jsx(pht,{scope:t,orientation:n,dir:f,loop:r,currentTabStopId:y,onItemFocus:vt.useCallback(F=>_(F),[_]),onItemShiftTab:vt.useCallback(()=>E(!0),[]),onFocusableItemAdd:vt.useCallback(()=>L(F=>F+1),[]),onFocusableItemRemove:vt.useCallback(()=>L(F=>F-1),[]),children:ut.jsx(D9.div,{tabIndex:v||U===0?-1:0,"data-orientation":n,...A,ref:h,style:{outline:"none",...i.style},onMouseDown:Eg(i.onMouseDown,()=>{z.current=!0}),onFocus:Eg(i.onFocus,F=>{const Y=!z.current;if(F.target===F.currentTarget&&Y&&!v){const G=new CustomEvent(bZ,dht);if(F.currentTarget.dispatchEvent(G),!G.defaultPrevented){const ee=M().filter(le=>le.focusable),j=ee.find(le=>le.active),ie=ee.find(le=>le.id===y),ge=[j,ie,...ee].filter(Boolean).map(le=>le.ref.current);cxe(ge,u)}}z.current=!1}),onBlur:Eg(i.onBlur,()=>E(!1))})})}),sxe="RovingFocusGroupItem",axe=vt.forwardRef((i,e)=>{const{__scopeRovingFocusGroup:t,focusable:n=!0,active:r=!1,tabStopId:o,children:s,...a}=i,c=iM(),l=o||c,u=ght(sxe,t),A=u.currentTabStopId===l,d=rxe(t),{onFocusableItemAdd:h,onFocusableItemRemove:f,currentTabStopId:y}=u;return vt.useEffect(()=>{if(n)return h(),()=>f()},[n,h,f]),ut.jsx(BZ.ItemSlot,{scope:t,id:l,focusable:n,active:r,children:ut.jsx(D9.span,{tabIndex:A?0:-1,"data-orientation":u.orientation,...a,ref:e,onMouseDown:Eg(i.onMouseDown,_=>{n?u.onItemFocus(l):_.preventDefault()}),onFocus:Eg(i.onFocus,()=>u.onItemFocus(l)),onKeyDown:Eg(i.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){u.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const v=vht(_,u.orientation,u.dir);if(v!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let b=d().filter(M=>M.focusable).map(M=>M.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const M=b.indexOf(_.currentTarget);b=u.loop?Iht(b,M+1):b.slice(M+1)}setTimeout(()=>cxe(b))}}),children:typeof s=="function"?s({isCurrentTabStop:A,hasTabStop:y!=null}):s})})});axe.displayName=sxe;var yht={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _ht(i,e){return e!=="rtl"?i:i==="ArrowLeft"?"ArrowRight":i==="ArrowRight"?"ArrowLeft":i}function vht(i,e,t){const n=_ht(i.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return yht[n]}function cxe(i,e=!1){const t=document.activeElement;for(const n of i)if(n===t||(n.focus({preventScroll:e}),document.activeElement!==t))return}function Iht(i,e){return i.map((t,n)=>i[(e+n)%i.length])}var lxe=oxe,uxe=axe;function Cht(i,e){return vt.useReducer((t,n)=>e[t][n]??t,i)}var rM=i=>{const{present:e,children:t}=i,n=xht(e),r=typeof t=="function"?t({present:n.isPresent}):vt.Children.only(t),o=zE(n.ref,Eht(r));return typeof t=="function"||n.isPresent?vt.cloneElement(r,{ref:o}):null};rM.displayName="Presence";function xht(i){const[e,t]=vt.useState(),n=vt.useRef(null),r=vt.useRef(i),o=vt.useRef("none"),s=i?"mounted":"unmounted",[a,c]=Cht(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return vt.useEffect(()=>{const l=iF(n.current);o.current=a==="mounted"?l:"none"},[a]),e3(()=>{const l=n.current,u=r.current;if(u!==i){const d=o.current,h=iF(l);i?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=i}},[i,c]),e3(()=>{if(e){let l;const u=e.ownerDocument.defaultView??window,A=h=>{const y=iF(n.current).includes(h.animationName);if(h.target===e&&y&&(c("ANIMATION_END"),!r.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",l=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},d=h=>{h.target===e&&(o.current=iF(n.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",A),e.addEventListener("animationend",A),()=>{u.clearTimeout(l),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",A),e.removeEventListener("animationend",A)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:vt.useCallback(l=>{n.current=l?getComputedStyle(l):null,t(l)},[])}}function iF(i){return(i==null?void 0:i.animationName)||"none"}function Eht(i){var n,r;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(r=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}var rF="Tabs",[bht,dUn]=nM(rF,[nF]),Axe=nF(),[Bht,wZ]=bht(rF),dxe=vt.forwardRef((i,e)=>{const{__scopeTabs:t,value:n,onValueChange:r,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:c="automatic",...l}=i,u=EZ(a),[A,d]=tF({prop:n,onChange:r,defaultProp:o??"",caller:rF});return ut.jsx(Bht,{scope:t,baseId:iM(),value:A,onValueChange:d,orientation:s,dir:u,activationMode:c,children:ut.jsx(D9.div,{dir:u,"data-orientation":s,...l,ref:e})})});dxe.displayName=rF;var hxe="TabsList",fxe=vt.forwardRef((i,e)=>{const{__scopeTabs:t,loop:n=!0,...r}=i,o=wZ(hxe,t),s=Axe(t);return ut.jsx(lxe,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:n,children:ut.jsx(D9.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:e})})});fxe.displayName=hxe;var pxe="TabsTrigger",gxe=vt.forwardRef((i,e)=>{const{__scopeTabs:t,value:n,disabled:r=!1,...o}=i,s=wZ(pxe,t),a=Axe(t),c=_xe(s.baseId,n),l=vxe(s.baseId,n),u=n===s.value;return ut.jsx(uxe,{asChild:!0,...a,focusable:!r,active:u,children:ut.jsx(D9.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...o,ref:e,onMouseDown:Eg(i.onMouseDown,A=>{!r&&A.button===0&&A.ctrlKey===!1?s.onValueChange(n):A.preventDefault()}),onKeyDown:Eg(i.onKeyDown,A=>{[" ","Enter"].includes(A.key)&&s.onValueChange(n)}),onFocus:Eg(i.onFocus,()=>{const A=s.activationMode!=="manual";!u&&!r&&A&&s.onValueChange(n)})})})});gxe.displayName=pxe;var mxe="TabsContent",yxe=vt.forwardRef((i,e)=>{const{__scopeTabs:t,value:n,forceMount:r,children:o,...s}=i,a=wZ(mxe,t),c=_xe(a.baseId,n),l=vxe(a.baseId,n),u=n===a.value,A=vt.useRef(u);return vt.useEffect(()=>{const d=requestAnimationFrame(()=>A.current=!1);return()=>cancelAnimationFrame(d)},[]),ut.jsx(rM,{present:r||u,children:({present:d})=>ut.jsx(D9.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:l,tabIndex:0,...s,ref:e,style:{...i.style,animationDuration:A.current?"0s":void 0},children:d&&o})})});yxe.displayName=mxe;function _xe(i,e){return`${i}-trigger-${e}`}function vxe(i,e){return`${i}-content-${e}`}var wht=dxe,Ixe=fxe,Cxe=gxe,xxe=yxe;function Exe(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=Exe(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function xB(){for(var i,e,t=0,n="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=Exe(i))&&(n&&(n+=" "),n+=e);return n}const SZ="-",Sht=i=>{const e=Mht(i),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=i;return{getClassGroupId:s=>{const a=s.split(SZ);return a[0]===""&&a.length!==1&&a.shift(),bxe(a,e)||Qht(s)},getConflictingClassGroupIds:(s,a)=>{const c=t[s]||[];return a&&n[s]?[...c,...n[s]]:c}}},bxe=(i,e)=>{var s;if(i.length===0)return e.classGroupId;const t=i[0],n=e.nextPart.get(t),r=n?bxe(i.slice(1),n):void 0;if(r)return r;if(e.validators.length===0)return;const o=i.join(SZ);return(s=e.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},Bxe=/^\[(.+)\]$/,Qht=i=>{if(Bxe.test(i)){const e=Bxe.exec(i)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},Mht=i=>{const{theme:e,prefix:t}=i,n={nextPart:new Map,validators:[]};return Dht(Object.entries(i.classGroups),t).forEach(([o,s])=>{QZ(s,n,o,e)}),n},QZ=(i,e,t,n)=>{i.forEach(r=>{if(typeof r=="string"){const o=r===""?e:wxe(e,r);o.classGroupId=t;return}if(typeof r=="function"){if(Rht(r)){QZ(r(n),e,t,n);return}e.validators.push({validator:r,classGroupId:t});return}Object.entries(r).forEach(([o,s])=>{QZ(s,wxe(e,o),t,n)})})},wxe=(i,e)=>{let t=i;return e.split(SZ).forEach(n=>{t.nextPart.has(n)||t.nextPart.set(n,{nextPart:new Map,validators:[]}),t=t.nextPart.get(n)}),t},Rht=i=>i.isThemeGetter,Dht=(i,e)=>e?i.map(([t,n])=>{const r=n.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[e+s,a])):o);return[t,r]}):i,Nht=i=>{if(i<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,n=new Map;const r=(o,s)=>{t.set(o,s),e++,e>i&&(e=0,n=t,t=new Map)};return{get(o){let s=t.get(o);if(s!==void 0)return s;if((s=n.get(o))!==void 0)return r(o,s),s},set(o,s){t.has(o)?t.set(o,s):r(o,s)}}},Sxe="!",Tht=i=>{const{separator:e,experimentalParseClassName:t}=i,n=e.length===1,r=e[0],o=e.length,s=a=>{const c=[];let l=0,u=0,A;for(let _=0;_<a.length;_++){let v=a[_];if(l===0){if(v===r&&(n||a.slice(_,_+o)===e)){c.push(a.slice(u,_)),u=_+o;continue}if(v==="/"){A=_;continue}}v==="["?l++:v==="]"&&l--}const d=c.length===0?a:a.substring(u),h=d.startsWith(Sxe),f=h?d.substring(1):d,y=A&&A>u?A-u:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:y}};return t?a=>t({className:a,parseClassName:s}):s},kht=i=>{if(i.length<=1)return i;const e=[];let t=[];return i.forEach(n=>{n[0]==="["?(e.push(...t.sort(),n),t=[]):t.push(n)}),e.push(...t.sort()),e},Pht=i=>({cache:Nht(i.cacheSize),parseClassName:Tht(i),...Sht(i)}),Fht=/\s+/,Lht=(i,e)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:r}=e,o=[],s=i.trim().split(Fht);let a="";for(let c=s.length-1;c>=0;c-=1){const l=s[c],{modifiers:u,hasImportantModifier:A,baseClassName:d,maybePostfixModifierPosition:h}=t(l);let f=!!h,y=n(f?d.substring(0,h):d);if(!y){if(!f){a=l+(a.length>0?" "+a:a);continue}if(y=n(d),!y){a=l+(a.length>0?" "+a:a);continue}f=!1}const _=kht(u).join(":"),v=A?_+Sxe:_,E=v+y;if(o.includes(E))continue;o.push(E);const b=r(y,f);for(let M=0;M<b.length;++M){const z=b[M];o.push(v+z)}a=l+(a.length>0?" "+a:a)}return a};function Uht(){let i=0,e,t,n="";for(;i<arguments.length;)(e=arguments[i++])&&(t=Qxe(e))&&(n&&(n+=" "),n+=t);return n}const Qxe=i=>{if(typeof i=="string")return i;let e,t="";for(let n=0;n<i.length;n++)i[n]&&(e=Qxe(i[n]))&&(t&&(t+=" "),t+=e);return t};function Ght(i,...e){let t,n,r,o=s;function s(c){const l=e.reduce((u,A)=>A(u),i());return t=Pht(l),n=t.cache.get,r=t.cache.set,o=a,a(c)}function a(c){const l=n(c);if(l)return l;const u=Lht(c,t);return r(c,u),u}return function(){return o(Uht.apply(null,arguments))}}const q1=i=>{const e=t=>t[i]||[];return e.isThemeGetter=!0,e},Mxe=/^\[(?:([a-z-]+):)?(.+)\]$/i,Oht=/^\d+\/\d+$/,zht=new Set(["px","full","screen"]),Yht=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hht=/\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$/,Vht=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Kht=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jht=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,k5=i=>oM(i)||zht.has(i)||Oht.test(i),t3=i=>sM(i,"length",tft),oM=i=>!!i&&!Number.isNaN(Number(i)),MZ=i=>sM(i,"number",oM),KN=i=>!!i&&Number.isInteger(Number(i)),Jht=i=>i.endsWith("%")&&oM(i.slice(0,-1)),yp=i=>Mxe.test(i),n3=i=>Yht.test(i),Wht=new Set(["length","size","percentage"]),Zht=i=>sM(i,Wht,Rxe),Xht=i=>sM(i,"position",Rxe),qht=new Set(["image","url"]),$ht=i=>sM(i,qht,ift),eft=i=>sM(i,"",nft),jN=()=>!0,sM=(i,e,t)=>{const n=Mxe.exec(i);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):t(n[2]):!1},tft=i=>Hht.test(i)&&!Vht.test(i),Rxe=()=>!1,nft=i=>Kht.test(i),ift=i=>jht.test(i),rft=Ght(()=>{const i=q1("colors"),e=q1("spacing"),t=q1("blur"),n=q1("brightness"),r=q1("borderColor"),o=q1("borderRadius"),s=q1("borderSpacing"),a=q1("borderWidth"),c=q1("contrast"),l=q1("grayscale"),u=q1("hueRotate"),A=q1("invert"),d=q1("gap"),h=q1("gradientColorStops"),f=q1("gradientColorStopPositions"),y=q1("inset"),_=q1("margin"),v=q1("opacity"),E=q1("padding"),b=q1("saturate"),M=q1("scale"),z=q1("sepia"),U=q1("skew"),L=q1("space"),F=q1("translate"),Y=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],ee=()=>["auto",yp,e],j=()=>[yp,e],ie=()=>["",k5,t3],he=()=>["auto",oM,yp],ge=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>["start","end","center","between","around","evenly","stretch"],Be=()=>["","0",yp],Re=()=>["auto","avoid","all","avoid-page","page","left","right","column"],De=()=>[oM,yp];return{cacheSize:500,separator:":",theme:{colors:[jN],spacing:[k5,t3],blur:["none","",n3,yp],brightness:De(),borderColor:[i],borderRadius:["none","","full",n3,yp],borderSpacing:j(),borderWidth:ie(),contrast:De(),grayscale:Be(),hueRotate:De(),invert:Be(),gap:j(),gradientColorStops:[i],gradientColorStopPositions:[Jht,t3],inset:ee(),margin:ee(),opacity:De(),padding:j(),saturate:De(),scale:De(),sepia:Be(),skew:De(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",yp]}],container:["container"],columns:[{columns:[n3]}],"break-after":[{"break-after":Re()}],"break-before":[{"break-before":Re()}],"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"],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:[...ge(),yp]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",KN,yp]}],basis:[{basis:ee()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",yp]}],grow:[{grow:Be()}],shrink:[{shrink:Be()}],order:[{order:["first","last","none",KN,yp]}],"grid-cols":[{"grid-cols":[jN]}],"col-start-end":[{col:["auto",{span:["full",KN,yp]},yp]}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":[jN]}],"row-start-end":[{row:["auto",{span:[KN,yp]},yp]}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",yp]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",yp]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",yp,e]}],"min-w":[{"min-w":[yp,e,"min","max","fit"]}],"max-w":[{"max-w":[yp,e,"none","full","min","max","fit","prose",{screen:[n3]},n3]}],h:[{h:[yp,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[yp,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[yp,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[yp,e,"auto","min","max","fit"]}],"font-size":[{text:["base",n3,t3]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",MZ]}],"font-family":[{font:[jN]}],"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:["tighter","tight","normal","wide","wider","widest",yp]}],"line-clamp":[{"line-clamp":["none",oM,MZ]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",k5,yp]}],"list-image":[{"list-image":["none",yp]}],"list-style-type":[{list:["none","disc","decimal",yp]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",k5,t3]}],"underline-offset":[{"underline-offset":["auto",k5,yp]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",yp]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",yp]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ge(),Xht]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Zht]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$ht]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:le()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[k5,yp]}],"outline-w":[{outline:[k5,t3]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[k5,t3]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",n3,eft]}],"shadow-color":[{shadow:[jN]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":me()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",n3,yp]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[A]}],saturate:[{saturate:[b]}],sepia:[{sepia:[z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[A]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",yp]}],duration:[{duration:De()}],ease:[{ease:["linear","in","out","in-out",yp]}],delay:[{delay:De()}],animate:[{animate:["none","spin","ping","pulse","bounce",yp]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[KN,yp]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[U]}],"skew-y":[{"skew-y":[U]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",yp]}],accent:[{accent:["auto",i]}],appearance:[{appearance:["none","auto"]}],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",yp]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",yp]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[k5,t3,MZ]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}});var Mo=typeof window<"u"?window:void 0,YE=typeof globalThis<"u"?globalThis:Mo,Dxe=Array.prototype,Nxe=Dxe.forEach,Txe=Dxe.indexOf,Sb=YE==null?void 0:YE.navigator,lu=YE==null?void 0:YE.document,HE=YE==null?void 0:YE.location,RZ=YE==null?void 0:YE.fetch,DZ=YE!=null&&YE.XMLHttpRequest&&"withCredentials"in new YE.XMLHttpRequest?YE.XMLHttpRequest:void 0,kxe=YE==null?void 0:YE.AbortController,VE=Sb==null?void 0:Sb.userAgent,jh=Mo??{},P5={DEBUG:!1,LIB_VERSION:"1.258.5"},NZ="$copy_autocapture",oft=["$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"],F5=function(i){return i.GZipJS="gzip-js",i.Base64="base64",i}({}),sft=["fatal","error","warning","log","info","debug"];function bg(i,e){return i.indexOf(e)!==-1}var oF=function(i){return i.trim()},TZ=function(i){return i.replace(/^\$/,"")},aft=Array.isArray,Pxe=Object.prototype,Fxe=Pxe.hasOwnProperty,sF=Pxe.toString,$1=aft||function(i){return sF.call(i)==="[object Array]"},n2=i=>typeof i=="function",tI=i=>i===Object(i)&&!$1(i),aM=i=>{if(tI(i)){for(var e in i)if(Fxe.call(i,e))return!1;return!0}return!1},ol=i=>i===void 0,nI=i=>sF.call(i)=="[object String]",kZ=i=>nI(i)&&i.trim().length===0,i3=i=>i===null,py=i=>ol(i)||i3(i),Tx=i=>sF.call(i)=="[object Number]",EB=i=>sF.call(i)==="[object Boolean]",cft=i=>i instanceof FormData,lft=i=>bg(oft,i),Lxe=i=>{var e={t:function(t){if(Mo&&(P5.DEBUG||jh.POSTHOG_DEBUG)&&!ol(Mo.console)&&Mo.console){for(var n=("__rrweb_original__"in Mo.console[t])?Mo.console[t].__rrweb_original__:Mo.console[t],r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];n(i,...o)}},info:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.t("log",...n)},warn:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.t("warn",...n)},error:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.t("error",...n)},critical:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];console.error(i,...n)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:t=>Lxe(i+" "+t)};return e},Mu=Lxe("[PostHog.js]"),BC=Mu.createLogger,uft=BC("[ExternalScriptsLoader]"),Uxe=(i,e,t)=>{if(i.config.disable_external_dependency_loading)return uft.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var n=lu==null?void 0:lu.querySelectorAll("script");if(n){for(var r=0;r<n.length;r++)if(n[r].src===e)return t()}var o=()=>{if(!lu)return t("document not found");var s=lu.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=e,s.onload=l=>t(void 0,l),s.onerror=l=>t(l),i.config.prepare_external_dependency_script&&(s=i.config.prepare_external_dependency_script(s)),!s)return t("prepare_external_dependency_script returned null");var a,c=lu.querySelectorAll("body > script");c.length>0?(a=c[0].parentNode)==null||a.insertBefore(s,c[0]):lu.body.appendChild(s)};lu!=null&&lu.body?o():lu==null||lu.addEventListener("DOMContentLoaded",o)};function jl(){return jl=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},jl.apply(null,arguments)}function Gxe(i,e){if(i==null)return{};var t={};for(var n in i)if({}.hasOwnProperty.call(i,n)){if(e.indexOf(n)!==-1)continue;t[n]=i[n]}return t}jh.__PosthogExtensions__=jh.__PosthogExtensions__||{},jh.__PosthogExtensions__.loadExternalDependency=(i,e,t)=>{var n="/static/"+e+".js?v="+i.version;if(e==="remote-config"&&(n="/array/"+i.config.token+"/config.js"),e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}var o=i.requestRouter.endpointFor("assets",n);Uxe(i,o,t)},jh.__PosthogExtensions__.loadSiteApp=(i,e,t)=>{var n=i.requestRouter.endpointFor("api",e);Uxe(i,n,t)};var aF={};function r3(i,e,t){if($1(i)){if(Nxe&&i.forEach===Nxe)i.forEach(e,t);else if("length"in i&&i.length===+i.length){for(var n=0,r=i.length;n<r;n++)if(n in i&&e.call(t,i[n],n)===aF)return}}}function Q_(i,e,t){if(!py(i)){if($1(i))return r3(i,e,t);if(cft(i)){for(var n of i.entries())if(e.call(t,n[1],n[0])===aF)return}else for(var r in i)if(Fxe.call(i,r)&&e.call(t,i[r],r)===aF)return}}var MI=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return r3(t,function(r){for(var o in r)r[o]!==void 0&&(i[o]=r[o])}),i},cF=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return r3(t,function(r){r3(r,function(o){i.push(o)})}),i};function lF(i){for(var e=Object.keys(i),t=e.length,n=new Array(t);t--;)n[t]=[e[t],i[e[t]]];return n}var Oxe=function(i){try{return i()}catch{return}},Aft=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.apply(this,t)}catch(r){Mu.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Mu.critical(r)}}},PZ=function(i){var e={};return Q_(i,function(t,n){(nI(t)&&t.length>0||Tx(t))&&(e[n]=t)}),e};function dft(i,e){return t=i,n=o=>nI(o)&&!i3(e)?o.slice(0,e):o,r=new Set,function o(s,a){return s!==Object(s)?n?n(s,a):s:r.has(s)?void 0:(r.add(s),$1(s)?(c=[],r3(s,l=>{c.push(o(l))})):(c={},Q_(s,(l,u)=>{r.has(l)||(c[u]=o(l,u))})),c);var c}(t);var t,n,r}var hft=["herokuapp.com","vercel.app","netlify.app"];function fft(i){var e=i==null?void 0:i.hostname;if(!nI(e))return!1;var t=e.split(".").slice(-2).join(".");for(var n of hft)if(t===n)return!1;return!0}function zxe(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return i[t]}function Bv(i,e,t,n){var{capture:r=!1,passive:o=!0}=n??{};i==null||i.addEventListener(e,t,{capture:r,passive:o})}var Yxe="$people_distinct_id",JN="__alias",WN="__timers",Hxe="$autocapture_disabled_server_side",FZ="$heatmaps_enabled_server_side",Vxe="$exception_capture_enabled_server_side",LZ="$error_tracking_suppression_rules",Kxe="$error_tracking_capture_extension_exceptions",jxe="$web_vitals_enabled_server_side",Jxe="$dead_clicks_enabled_server_side",Wxe="$web_vitals_allowed_metrics",UZ="$session_recording_enabled_server_side",Zxe="$console_log_recording_enabled_server_side",Xxe="$session_recording_network_payload_capture",qxe="$session_recording_masking",$xe="$session_recording_canvas_recording",eEe="$replay_sample_rate",tEe="$replay_minimum_duration",nEe="$replay_script_config",uF="$sesid",ZN="$session_is_sampled",GZ="$session_recording_url_trigger_activated_session",OZ="$session_recording_event_trigger_activated_session",cM="$enabled_feature_flags",XN="$early_access_features",zZ="$feature_flag_details",qN="$stored_person_properties",US="$stored_group_properties",YZ="$surveys",AF="$surveys_activated",dF="$flag_call_reported",L5="$user_state",HZ="$client_session_props",VZ="$capture_rate_limit",KZ="$initial_campaign_params",jZ="$initial_referrer_info",hF="$initial_person_info",fF="$epp",iEe="__POSTHOG_TOOLBAR__",pF="$posthog_cookieless",pft=[Yxe,JN,"__cmpns",WN,UZ,FZ,uF,cM,LZ,L5,XN,zZ,US,qN,YZ,dF,HZ,VZ,KZ,jZ,fF,hF];function rEe(i){return i instanceof Element&&(i.id===iEe||!(i.closest==null||!i.closest(".toolbar-global-fade-container")))}function gF(i){return!!i&&i.nodeType===1}function o3(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function oEe(i){return!!i&&i.nodeType===3}function sEe(i){return!!i&&i.nodeType===11}function JZ(i){return i?oF(i).split(/\s+/):[]}function aEe(i){var e=Mo==null?void 0:Mo.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}function mF(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return JZ(e)}function cEe(i){return py(i)?null:oF(i).split(/(\s+)/).filter(e=>lM(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function yF(i){var e="";return ZZ(i)&&!AEe(i)&&i.childNodes&&i.childNodes.length&&Q_(i.childNodes,function(t){var n;oEe(t)&&t.textContent&&(e+=(n=cEe(t.textContent))!==null&&n!==void 0?n:"")}),oF(e)}function lEe(i){return ol(i.target)?i.srcElement||null:(e=i.target)!=null&&e.shadowRoot?i.composedPath()[0]||null:i.target||null;var e}var WZ=["a","button","form","input","select","textarea","label"];function uEe(i){var e=i.parentNode;return!(!e||!gF(e))&&e}function gft(i,e,t,n,r){var o,s,a;if(t===void 0&&(t=void 0),!Mo||!i||o3(i,"html")||!gF(i)||(o=t)!=null&&o.url_allowlist&&!aEe(t.url_allowlist)||(s=t)!=null&&s.url_ignorelist&&aEe(t.url_ignorelist))return!1;if((a=t)!=null&&a.dom_event_allowlist){var c=t.dom_event_allowlist;if(c&&!c.some(_=>e.type===_))return!1}for(var l=!1,u=[i],A=!0,d=i;d.parentNode&&!o3(d,"body");)if(sEe(d.parentNode))u.push(d.parentNode.host),d=d.parentNode.host;else{if(!(A=uEe(d)))break;if(n||WZ.indexOf(A.tagName.toLowerCase())>-1)l=!0;else{var h=Mo.getComputedStyle(A);h&&h.getPropertyValue("cursor")==="pointer"&&(l=!0)}u.push(A),d=A}if(!function(_,v){var E=v==null?void 0:v.element_allowlist;if(ol(E))return!0;var b,M=function(U){if(E.some(L=>U.tagName.toLowerCase()===L))return{v:!0}};for(var z of _)if(b=M(z))return b.v;return!1}(u,t)||!function(_,v){var E=v==null?void 0:v.css_selector_allowlist;if(ol(E))return!0;var b,M=function(U){if(E.some(L=>U.matches(L)))return{v:!0}};for(var z of _)if(b=M(z))return b.v;return!1}(u,t))return!1;var f=Mo.getComputedStyle(i);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var y=i.tagName.toLowerCase();switch(y){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return l?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(WZ.indexOf(y)>-1||i.getAttribute("contenteditable")==="true")}}function ZZ(i){for(var e=i;e.parentNode&&!o3(e,"body");e=e.parentNode){var t=mF(e);if(bg(t,"ph-sensitive")||bg(t,"ph-no-capture"))return!1}if(bg(mF(i),"ph-include"))return!0;var n=i.type||"";if(nI(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=i.name||i.id||"";return!(nI(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function AEe(i){return!!(o3(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||o3(i,"select")||o3(i,"textarea")||i.getAttribute("contenteditable")==="true")}var dEe="(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})",mft=new RegExp("^(?:"+dEe+")$"),yft=new RegExp(dEe),hEe="\\d{3}-?\\d{2}-?\\d{4}",_ft=new RegExp("^("+hEe+")$"),vft=new RegExp("("+hEe+")");function lM(i,e){return e===void 0&&(e=!0),!(py(i)||nI(i)&&(i=oF(i),(e?mft:yft).test((i||"").replace(/[- ]/g,""))||(e?_ft:vft).test(i)))}function fEe(i){var e=yF(i);return lM(e=(e+" "+pEe(i)).trim())?e:""}function pEe(i){var e="";return i&&i.childNodes&&i.childNodes.length&&Q_(i.childNodes,function(t){var n;if(t&&((n=t.tagName)==null?void 0:n.toLowerCase())==="span")try{var r=yF(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+pEe(t)).trim())}catch(o){Mu.error("[AutoCapture]",o)}}),e}function Ift(i){return function(e){var t=e.map(n=>{var r,o,s="";if(n.tag_name&&(s+=n.tag_name),n.attr_class)for(var a of(n.attr_class.sort(),n.attr_class))s+="."+a.replace(/"/g,"");var c=jl({},n.text?{text:n.text}:{},{"nth-child":(r=n.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=n.nth_of_type)!==null&&o!==void 0?o:0},n.href?{href:n.href}:{},n.attr_id?{attr_id:n.attr_id}:{},n.attributes),l={};return lF(c).sort((u,A)=>{var[d]=u,[h]=A;return d.localeCompare(h)}).forEach(u=>{var[A,d]=u;return l[gEe(A.toString())]=gEe(d.toString())}),s+=":",s+=lF(l).map(u=>{var[A,d]=u;return A+'="'+d+'"'}).join("")});return t.join(";")}(function(e){return e.map(t=>{var n,r,o={text:(n=t.$el_text)==null?void 0:n.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)==null?void 0:r.slice(0,2048),attr_class:Cft(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return lF(t).filter(s=>{var[a]=s;return a.indexOf("attr__")===0}).forEach(s=>{var[a,c]=s;return o.attributes[a]=c}),o})}(i))}function gEe(i){return i.replace(/"|\\"/g,'\\"')}function Cft(i){var e=i.attr__class;return e?$1(e)?e:JZ(e):void 0}class mEe{constructor(){this.clicks=[]}isRageClick(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}var xft=["localhost","127.0.0.1"],uM=i=>{var e=lu==null?void 0:lu.createElement("a");return ol(e)?null:(e.href=i,e)},Eft=function(i,e){var t,n;e===void 0&&(e="&");var r=[];return Q_(i,function(o,s){ol(o)||ol(s)||s==="undefined"||(t=encodeURIComponent((a=>a instanceof File)(o)?o.name:o.toString()),n=encodeURIComponent(s),r[r.length]=n+"="+t)}),r.join(e)},_F=function(i,e){for(var t,n=((i.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<n.length;r++){var o=n[r].split("=");if(o[0]===e){t=o;break}}if(!$1(t)||t.length<2)return"";var s=t[1];try{s=decodeURIComponent(s)}catch{Mu.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},XZ=function(i,e,t){if(!i||!e||!e.length)return i;for(var n=i.split("#"),r=n[0]||"",o=n[1],s=r.split("?"),a=s[1],c=s[0],l=(a||"").split("&"),u=[],A=0;A<l.length;A++){var d=l[A].split("=");$1(d)&&(e.includes(d[0])?u.push(d[0]+"="+t):u.push(l[A]))}var h=c;return a!=null&&(h+="?"+u.join("&")),o!=null&&(h+="#"+o),h},vF=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},yEe=BC("[AutoCapture]");function qZ(i,e){return e.length>i?e.slice(0,i)+"...":e}function bft(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!gF(e));return e}function Bft(i,e,t,n){var r=i.tagName.toLowerCase(),o={tag_name:r};WZ.indexOf(r)>-1&&!t&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=qZ(1024,fEe(i)):o.$el_text=qZ(1024,yF(i)));var s=mF(i);s.length>0&&(o.classes=s.filter(function(u){return u!==""})),Q_(i.attributes,function(u){var A;if((!AEe(i)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(n==null||!n.includes(u.name))&&!e&&lM(u.value)&&(A=u.name,!nI(A)||A.substring(0,10)!=="_ngcontent"&&A.substring(0,7)!=="_nghost")){var d=u.value;u.name==="class"&&(d=JZ(d).join(" ")),o["attr__"+u.name]=qZ(1024,d)}});for(var a=1,c=1,l=i;l=bft(l);)a++,l.tagName===i.tagName&&c++;return o.nth_child=a,o.nth_of_type=c,o}function wft(i,e){for(var t,n,{e:r,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:c}=e,l=[i],u=i;u.parentNode&&!o3(u,"body");)sEe(u.parentNode)?(l.push(u.parentNode.host),u=u.parentNode.host):(l.push(u.parentNode),u=u.parentNode);var A,d=[],h={},f=!1,y=!1;if(Q_(l,M=>{var z=ZZ(M);M.tagName.toLowerCase()==="a"&&(f=M.getAttribute("href"),f=z&&f&&lM(f)&&f),bg(mF(M),"ph-no-capture")&&(y=!0),d.push(Bft(M,o,s,a));var U=function(L){if(!ZZ(L))return{};var F={};return Q_(L.attributes,function(Y){if(Y.name&&Y.name.indexOf("data-ph-capture-attribute")===0){var G=Y.name.replace("data-ph-capture-attribute-",""),ee=Y.value;G&&ee&&lM(ee)&&(F[G]=ee)}}),F}(M);MI(h,U)}),y)return{props:{},explicitNoCapture:y};if(s||(i.tagName.toLowerCase()==="a"||i.tagName.toLowerCase()==="button"?d[0].$el_text=fEe(i):d[0].$el_text=yF(i)),f){var _,v;d[0].attr__href=f;var E=(_=uM(f))==null?void 0:_.host,b=Mo==null||(v=Mo.location)==null?void 0:v.host;E&&b&&E!==b&&(A=f)}return{props:MI({$event_type:r.type,$ce_version:1},c?{}:{$elements:d},{$elements_chain:Ift(d)},(t=d[0])!=null&&t.$el_text?{$el_text:(n=d[0])==null?void 0:n.$el_text}:{},A&&r.type==="click"?{$external_click_url:A}:{},h)}}class Sft{constructor(e){this.i=!1,this.o=null,this.rageclicks=new mEe,this.h=!1,this.instance=e,this.m=null}get S(){var e,t,n=tI(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map(r=>new RegExp(r)),n}$(){if(this.isBrowserSupported()){if(Mo&&lu){var e=n=>{n=n||(Mo==null?void 0:Mo.event);try{this.k(n)}catch(r){yEe.error("Failed to capture event",r)}};if(Bv(lu,"submit",e,{capture:!0}),Bv(lu,"change",e,{capture:!0}),Bv(lu,"click",e,{capture:!0}),this.S.capture_copied_text){var t=n=>{n=n||(Mo==null?void 0:Mo.event),this.k(n,NZ)};Bv(lu,"copy",t,{capture:!0}),Bv(lu,"cut",t,{capture:!0})}}}else yEe.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.i&&(this.$(),this.i=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.h=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Hxe]:!!e.autocapture_opt_out}),this.o=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.m=e}getElementSelectors(e){var t,n=[];return(t=this.m)==null||t.forEach(r=>{var o=lu==null?void 0:lu.querySelectorAll(r);o==null||o.forEach(s=>{e===s&&n.push(r)})}),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[Hxe],r=this.o;if(i3(r)&&!EB(n)&&!this.instance.I())return!1;var o=(t=this.o)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!o}k(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=lEe(e);oEe(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.k(e,"$rageclick");var o=t===NZ;if(r&&gft(r,e,this.S,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:a}=wft(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsChainAsString:this.h});if(a)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(s.$element_selectors=c),t===NZ){var l,u=cEe(Mo==null||(l=Mo.getSelection())==null?void 0:l.toString()),A=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=A}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return n2(lu==null?void 0:lu.querySelectorAll)}}Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return Tx(i)&&isFinite(i)&&Math.floor(i)===i});var _Ee="0123456789abcdef";class IF{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||t<0||n<0||r<0||e>0xffffffffffff||t>4095||n>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|t>>>8,o[7]=t,o[8]=128|n>>>24,o[9]=n>>>16,o[10]=n>>>8,o[11]=n,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new IF(o)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+_Ee.charAt(this.bytes[t]>>>4)+_Ee.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new IF(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}}class Qft{constructor(){this.P=0,this.R=0,this.T=new Mft}generate(){var e=this.generateOrAbort();if(ol(e)){this.P=0;var t=this.generateOrAbort();if(ol(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.M();else{if(!(e+1e4>this.P))return;this.R++,this.R>4398046511103&&(this.P++,this.M())}return IF.fromFieldsV7(this.P,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.T.nextUint32())}M(){this.R=1024*this.T.nextUint32()+(1023&this.T.nextUint32())}}var vEe,IEe=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<i.length;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};Mo&&!ol(Mo.crypto)&&crypto.getRandomValues&&(IEe=i=>crypto.getRandomValues(i));class Mft{constructor(){this.C=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.C.length&&(IEe(this.C),this.F=0),this.C[this.F++]}}var s3=()=>Rft().toString(),Rft=()=>(vEe||(vEe=new Qft)).generate(),$N="",Dft=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Nft(i,e){if(e){var t=function(r,o){if(o===void 0&&(o=lu),$N)return $N;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var s=r.split("."),a=Math.min(s.length,8),c="dmn_chk_"+s3();!$N&&a--;){var l=s.slice(a).join("."),u=c+"=1;domain=."+l+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(c)&&(o.cookie=u+";max-age=0",$N=l)}return $N}(i);if(!t){var n=(r=>{var o=r.match(Dft);return o?o[0]:""})(i);n!==t&&Mu.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}var bB={O:()=>!!lu,A:function(i){Mu.error("cookieStore error: "+i)},D:function(i){if(lu){try{for(var e=i+"=",t=lu.cookie.split(";").filter(o=>o.length),n=0;n<t.length;n++){for(var r=t[n];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},L:function(i){var e;try{e=JSON.parse(bB.D(i))||{}}catch{}return e},j:function(i,e,t,n,r){if(lu)try{var o="",s="",a=Nft(lu.location.hostname,n);if(t){var c=new Date;c.setTime(c.getTime()+24*t*60*60*1e3),o="; expires="+c.toUTCString()}r&&(s="; secure");var l=i+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&Mu.warn("cookieStore warning: large cookie, len="+l.length),lu.cookie=l,l}catch{return}},N:function(i,e){try{bB.j(i,"",-1,e)}catch{return}}},$Z=null,N9={O:function(){if(!i3($Z))return $Z;var i=!0;if(ol(Mo))i=!1;else try{var e="__mplssupport__";N9.j(e,"xyz"),N9.D(e)!=='"xyz"'&&(i=!1),N9.N(e)}catch{i=!1}return i||Mu.error("localStorage unsupported; falling back to cookie store"),$Z=i,i},A:function(i){Mu.error("localStorage error: "+i)},D:function(i){try{return Mo==null?void 0:Mo.localStorage.getItem(i)}catch(e){N9.A(e)}return null},L:function(i){try{return JSON.parse(N9.D(i))||{}}catch{}return null},j:function(i,e){try{Mo==null||Mo.localStorage.setItem(i,JSON.stringify(e))}catch(t){N9.A(t)}},N:function(i){try{Mo==null||Mo.localStorage.removeItem(i)}catch(e){N9.A(e)}}},Tft=["distinct_id",uF,ZN,fF,hF],CF=jl({},N9,{L:function(i){try{var e={};try{e=bB.L(i)||{}}catch{}var t=MI(e,JSON.parse(N9.D(i)||"{}"));return N9.j(i,t),t}catch{}return null},j:function(i,e,t,n,r,o){try{N9.j(i,e,void 0,void 0,o);var s={};Tft.forEach(a=>{e[a]&&(s[a]=e[a])}),Object.keys(s).length&&bB.j(i,s,t,n,r,o)}catch(a){N9.A(a)}},N:function(i,e){try{Mo==null||Mo.localStorage.removeItem(i),bB.N(i,e)}catch(t){N9.A(t)}}}),xF={},kft={O:function(){return!0},A:function(i){Mu.error("memoryStorage error: "+i)},D:function(i){return xF[i]||null},L:function(i){return xF[i]||null},j:function(i,e){xF[i]=e},N:function(i){delete xF[i]}},GS=null,KC={O:function(){if(!i3(GS))return GS;if(GS=!0,ol(Mo))GS=!1;else try{var i="__support__";KC.j(i,"xyz"),KC.D(i)!=='"xyz"'&&(GS=!1),KC.N(i)}catch{GS=!1}return GS},A:function(i){Mu.error("sessionStorage error: ",i)},D:function(i){try{return Mo==null?void 0:Mo.sessionStorage.getItem(i)}catch(e){KC.A(e)}return null},L:function(i){try{return JSON.parse(KC.D(i))||null}catch{}return null},j:function(i,e){try{Mo==null||Mo.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){KC.A(t)}},N:function(i){try{Mo==null||Mo.sessionStorage.removeItem(i)}catch(e){KC.A(e)}}},AM=function(i){return i[i.PENDING=-1]="PENDING",i[i.DENIED=0]="DENIED",i[i.GRANTED=1]="GRANTED",i}({});let Pft=class{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.U()?AM.DENIED:this.q}isOptedOut(){return this.consent===AM.DENIED||this.consent===AM.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.B.j(this.H,e?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.B.N(this.H,this.S.cross_subdomain_cookie)}get H(){var{token:e,opt_out_capturing_cookie_prefix:t}=this._instance.config;return(t||"__ph_opt_in_out_")+e}get q(){var e=this.B.D(this.H);return e==="1"?AM.GRANTED:e==="0"?AM.DENIED:AM.PENDING}get B(){if(!this.W){var e=this.S.opt_out_capturing_persistence_type;this.W=e==="localStorage"?N9:bB;var t=e==="localStorage"?bB:N9;t.D(this.H)&&(this.W.D(this.H)||this.optInOut(t.D(this.H)==="1"),t.N(this.H,this.S.cross_subdomain_cookie))}return this.W}U(){return!!this.S.respect_dnt&&!!zxe([Sb==null?void 0:Sb.doNotTrack,Sb==null?void 0:Sb.msDoNotTrack,jh.doNotTrack],e=>bg([!0,1,"1","yes"],e))}};var EF=BC("[Dead Clicks]"),Fft=()=>!0,Lft=i=>{var e,t=!((e=i.instance.persistence)==null||!e.get_property(Jxe)),n=i.instance.config.capture_dead_clicks;return EB(n)?n:t};class CEe{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Jxe]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.J(()=>{this.V()})}J(e){var t,n;(t=jh.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=jh.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",r=>{r?EF.error("failed to load script",r):e()})}V(){var e;if(lu){if(!this.G&&(e=jh.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=tI(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.G=jh.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.G.start(lu),EF.info("starting...")}}else EF.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,EF.info("stopping..."))}}function Qb(i,e,t,n,r){return e>t&&(Mu.warn("min cannot be greater than max."),e=t),Tx(i)?i>t?(n&&Mu.warn(n+" cannot be greater than max: "+t+". Using max value instead."),t):i<e?(n&&Mu.warn(n+" cannot be less than min: "+e+". Using min value instead."),e):i:(n&&Mu.warn(n+" must be a number. using max or fallback. max: "+t+", fallback: "+r),Qb(r||t,e,t,n))}class xEe{constructor(e){this.K={},this.Y=()=>{Object.keys(this.K).forEach(t=>{var n=this.X(t)+this.Z;n>=this.tt?delete this.K[t]:this.it(t,n)})},this.X=t=>this.K[String(t)],this.it=(t,n)=>{this.K[String(t)]=n},this.consumeRateLimit=t=>{var n,r=(n=this.X(t))!==null&&n!==void 0?n:this.tt;if((r=Math.max(r-1,0))===0)return!0;this.it(t,r);var o,s=r===0;return s&&((o=this.et)==null||o.call(this,t)),s},this.rt=e,this.et=this.rt.et,this.tt=Qb(this.rt.bucketSize,0,100,"rate limiter bucket size"),this.Z=Qb(this.rt.refillRate,0,this.tt,"rate limiter refill rate"),this.st=Qb(this.rt.refillInterval,0,864e5,"rate limiter refill interval"),setInterval(()=>{this.Y()},this.st)}}var bF=BC("[ExceptionAutocapture]");class Uft{constructor(e){var t,n,r;this.nt=()=>{var o;if(Mo&&this.isEnabled&&(o=jh.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=jh.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=jh.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,c=jh.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ot&&this.S.capture_unhandled_errors&&(this.ot=s(this.captureException.bind(this))),!this.lt&&this.S.capture_unhandled_rejections&&(this.lt=a(this.captureException.bind(this))),!this.ut&&this.S.capture_console_errors&&(this.ut=c(this.captureException.bind(this)))}catch(l){bF.error("failed to start",l),this.ht()}}},this._instance=e,this.dt=!((t=this._instance.persistence)==null||!t.props[Vxe]),this.S=this.vt(),this.ct=new xEe({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4}),this.startIfEnabled()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return tI(e)?t=jl({},t,e):(ol(e)?this.dt:e)&&(t=jl({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.S.capture_console_errors||this.S.capture_unhandled_errors||this.S.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(bF.info("enabled"),this.J(this.nt))}J(e){var t,n;(t=jh.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=jh.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return bF.error("failed to load script",r);e()})}ht(){var e,t,n;(e=this.ot)==null||e.call(this),this.ot=void 0,(t=this.lt)==null||t.call(this),this.lt=void 0,(n=this.ut)==null||n.call(this),this.ut=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.dt=!!t||!1,this.S=this.vt(),this._instance.persistence&&this._instance.persistence.register({[Vxe]:this.dt}),this.startIfEnabled()}captureException(e){var t,n=this._instance.requestRouter.endpointFor("ui");e.$exception_personURL=n+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id();var r=(t=e.$exception_list[0].type)!==null&&t!==void 0?t:"Exception";this.ct.consumeRateLimit(r)?bF.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}}function EEe(i){return!ol(Event)&&bEe(i,Event)}function bEe(i,e){try{return i instanceof e}catch{return!1}}function BEe(i){switch(Object.prototype.toString.call(i)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return bEe(i,Error)}}function BF(i,e){return Object.prototype.toString.call(i)==="[object "+e+"]"}function eX(i){return BF(i,"DOMError")}var wEe=/\(error: (.*)\)/,SEe=50,dM="?";function tX(i,e,t,n){var r={platform:"web:javascript",filename:i,function:e==="<anonymous>"?dM:e,in_app:!0};return ol(t)||(r.lineno=t),ol(n)||(r.colno=n),r}var Gft=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Oft=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,zft=/\((\S*)(?::(\d+))(?::(\d+))\)/,Yft=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Hft=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Vft=function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];var n=e.sort((r,o)=>r[0]-o[0]).map(r=>r[1]);return function(r,o){o===void 0&&(o=0);for(var s=[],a=r.split(`
|
|
242
242
|
`),c=o;c<a.length;c++){var l=a[c];if(!(l.length>1024)){var u=wEe.test(l)?l.replace(wEe,"$1"):l;if(!u.match(/\S*Error: /)){for(var A of n){var d=A(u);if(d){s.push(d);break}}if(s.length>=SEe)break}}}return function(h){if(!h.length)return[];var f=Array.from(h);return f.reverse(),f.slice(0,SEe).map(y=>jl({},y,{filename:y.filename||Kft(f).filename,function:y.function||dM}))}(s)}}([30,i=>{var e=Gft.exec(i);if(e){var[,t,n,r]=e;return tX(t,dM,+n,+r)}var o=Oft.exec(i);if(o){if(o[2]&&o[2].indexOf("eval")===0){var s=zft.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,c]=MEe(o[1]||dM,o[2]);return tX(c,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,i=>{var e=Yft.exec(i);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var t=Hft.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}var n=e[3],r=e[1]||dM;return[r,n]=MEe(r,n),tX(n,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]);function Kft(i){return i[i.length-1]||{}}var wF,QEe,nX,MEe=(i,e)=>{var t=i.indexOf("safari-extension")!==-1,n=i.indexOf("safari-web-extension")!==-1;return t||n?[i.indexOf("@")!==-1?i.split("@")[0]:dM,t?"safari-extension:"+e:"safari-web-extension:"+e]:[i,e]},jft=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function iX(i,e){e===void 0&&(e=0);var t=i.stacktrace||i.stack||"",n=function(s){return s&&Jft.test(s.message)?1:0}(i);try{var r=Vft,o=function(s,a){var c=function(l){var u=globalThis._posthogChunkIds;if(!u)return{};var A=Object.keys(u);return nX&&A.length===QEe||(QEe=A.length,nX=A.reduce((d,h)=>{wF||(wF={});var f=wF[h];if(f)d[f[0]]=f[1];else for(var y=l(h),_=y.length-1;_>=0;_--){var v=y[_],E=v==null?void 0:v.filename,b=u[h];if(E&&b){d[E]=b,wF[h]=[E,b];break}}return d},{})),nX}(a);return s.forEach(l=>{l.filename&&(l.chunk_id=c[l.filename])}),s}(r(t,n),r);return o.slice(0,o.length-e)}catch{}return[]}var Jft=/Minified React error #\d+;/i;function Wft(i,e){var t,n,r=iX(i),o=(t=e==null?void 0:e.handled)===null||t===void 0||t,s=(n=e==null?void 0:e.synthetic)!==null&&n!==void 0&&n;return{type:e!=null&&e.overrideExceptionType?e.overrideExceptionType:i.name,value:function(a){var c=a.message;return c.error&&typeof c.error.message=="string"?String(c.error.message):String(c)}(i),stacktrace:{frames:r,type:"raw"},mechanism:{handled:o,synthetic:s}}}function REe(i,e){var t=Wft(i,e);return i.cause&&BEe(i.cause)&&i.cause!==i?[t,...REe(i.cause,{handled:e==null?void 0:e.handled,synthetic:e==null?void 0:e.synthetic})]:[t]}function rX(i,e){return{$exception_list:REe(i,e),$exception_level:"error"}}function oX(i,e){var t,n,r,o=(t=e==null?void 0:e.handled)===null||t===void 0||t,s=(n=e==null?void 0:e.synthetic)===null||n===void 0||n,a={type:e!=null&&e.overrideExceptionType?e.overrideExceptionType:(r=e==null?void 0:e.defaultExceptionType)!==null&&r!==void 0?r:"Error",value:i||(e==null?void 0:e.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(e!=null&&e.syntheticException){var c=iX(e.syntheticException,1);c.length&&(a.stacktrace={frames:c,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Zft(i){return nI(i)&&!kZ(i)&&sft.indexOf(i)>=0}function Xft(i,e){var t,n,r=(t=e==null?void 0:e.handled)===null||t===void 0||t,o=(n=e==null?void 0:e.synthetic)===null||n===void 0||n,s=e!=null&&e.overrideExceptionType?e.overrideExceptionType:EEe(i)?i.constructor.name:"Error",a="Non-Error 'exception' captured with keys: "+function(u,A){A===void 0&&(A=40);var d=Object.keys(u);if(d.sort(),!d.length)return"[object has no keys]";for(var h=d.length;h>0;h--){var f=d.slice(0,h).join(", ");if(!(f.length>A))return h===d.length||f.length<=A?f:f.slice(0,A)+"..."}return""}(i),c={type:s,value:a,mechanism:{handled:r,synthetic:o}};if(e!=null&&e.syntheticException){var l=iX(e==null?void 0:e.syntheticException,1);l.length&&(c.stacktrace={frames:l,type:"raw"})}return{$exception_list:[c],$exception_level:Zft(i.level)?i.level:"error"}}function qft(i,e){var{error:t,event:n}=i,r={$exception_list:[]},o=t||n;if(eX(o)||function(d){return BF(d,"DOMException")}(o)){var s=o;if(function(d){return"stack"in d}(o))r=rX(o,e);else{var a=s.name||(eX(s)?"DOMError":"DOMException"),c=s.message?a+": "+s.message:a;r=oX(c,jl({},e,{overrideExceptionType:eX(s)?"DOMError":"DOMException",defaultExceptionMessage:c}))}return"code"in s&&(r.$exception_DOMException_code=""+s.code),r}if(function(d){return BF(d,"ErrorEvent")}(o)&&o.error)return rX(o.error,e);if(BEe(o))return rX(o,e);if(function(d){return BF(d,"Object")}(o)||EEe(o))return Xft(o,e);if(ol(t)&&nI(n)){var l="Error",u=n,A=n.match(jft);return A&&(l=A[1],u=A[2]),oX(u,jl({},e,{overrideExceptionType:l,defaultExceptionMessage:u}))}return oX(o,e)}function DEe(i,e,t){try{if(!(e in i))return()=>{};var n=i[e],r=t(n);return n2(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),i[e]=r,()=>{i[e]=n}}catch{return()=>{}}}class $ft{constructor(e){var t;this._instance=e,this.ft=(Mo==null||(t=Mo.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Mu.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this._t&&this._t(),this._t=void 0,Mu.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Mo&&Mo.history){var n=this;(e=Mo.history.pushState)!=null&&e.__posthog_wrapped__||DEe(Mo.history,"pushState",r=>function(o,s,a){r.call(this,o,s,a),n.gt("pushState")}),(t=Mo.history.replaceState)!=null&&t.__posthog_wrapped__||DEe(Mo.history,"replaceState",r=>function(o,s,a){r.call(this,o,s,a),n.gt("replaceState")}),this.bt()}}gt(e){try{var t,n=Mo==null||(t=Mo.location)==null?void 0:t.pathname;if(!n)return;n!==this.ft&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ft=n}catch(r){Mu.error("Error capturing "+e+" pageview",r)}}bt(){if(!this._t){var e=()=>{this.gt("popstate")};Bv(Mo,"popstate",e),this._t=()=>{Mo&&Mo.removeEventListener("popstate",e)}}}}function SF(i){var e,t;return((e=JSON.stringify(i,(t=[],function(n,r){if(tI(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r})))==null?void 0:e.length)||0}function sX(i,e){if(e===void 0&&(e=66060288e-1),i.size>=e&&i.data.length>1){var t=Math.floor(i.data.length/2),n=i.data.slice(0,t),r=i.data.slice(t);return[sX({size:SF(n),data:n,sessionId:i.sessionId,windowId:i.windowId}),sX({size:SF(r),data:r,sessionId:i.sessionId,windowId:i.windowId})].flatMap(o=>o)}return[i]}var U5=(i=>(i[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i))(U5||{}),k2=(i=>(i[i.Mutation=0]="Mutation",i[i.MouseMove=1]="MouseMove",i[i.MouseInteraction=2]="MouseInteraction",i[i.Scroll=3]="Scroll",i[i.ViewportResize=4]="ViewportResize",i[i.Input=5]="Input",i[i.TouchMove=6]="TouchMove",i[i.MediaInteraction=7]="MediaInteraction",i[i.StyleSheetRule=8]="StyleSheetRule",i[i.CanvasMutation=9]="CanvasMutation",i[i.Font=10]="Font",i[i.Log=11]="Log",i[i.Drag=12]="Drag",i[i.StyleDeclaration=13]="StyleDeclaration",i[i.Selection=14]="Selection",i[i.AdoptedStyleSheet=15]="AdoptedStyleSheet",i[i.CustomElement=16]="CustomElement",i))(k2||{}),aX="[SessionRecording]",cX="redacted",QF={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:i=>i,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},ept=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],tpt=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],npt=["/s/","/e/","/i/"];function NEe(i,e,t,n){if(py(i))return i;var r=(e==null?void 0:e["content-length"])||function(o){return new Blob([o]).size}(i);return nI(r)&&(r=parseInt(r)),r>t?aX+" "+n+" body too large to record ("+r+" bytes)":i}function TEe(i,e){if(py(i))return i;var t=i;return lM(t,!1)||(t=aX+" "+e+" body "+cX),Q_(tpt,n=>{var r,o;(r=t)!=null&&r.length&&((o=t)==null?void 0:o.indexOf(n))!==-1&&(t=aX+" "+e+" body "+cX+" as might contain: "+n)}),t}var ipt=(i,e)=>{var t,n,r,o={payloadSizeLimitBytes:QF.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...QF.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...QF.payloadHostDenyList]},s=i.session_recording.recordHeaders!==!1&&e.recordHeaders,a=i.session_recording.recordBody!==!1&&e.recordBody,c=i.capture_performance!==!1&&e.recordPerformance,l=(t=o,r=Math.min(1e6,(n=t.payloadSizeLimitBytes)!==null&&n!==void 0?n:1e6),d=>(d!=null&&d.requestBody&&(d.requestBody=NEe(d.requestBody,d.requestHeaders,r,"Request")),d!=null&&d.responseBody&&(d.responseBody=NEe(d.responseBody,d.responseHeaders,r,"Response")),d)),u=d=>{return l(((y,_)=>{var v,E=uM(y.name),b=_.indexOf("http")===0?(v=uM(_))==null?void 0:v.pathname:_;b==="/"&&(b="");var M=E==null?void 0:E.pathname.replace(b||"","");if(!(E&&M&&npt.some(z=>M.indexOf(z)===0)))return y})((f=(h=d).requestHeaders,py(f)||Q_(Object.keys(f??{}),y=>{ept.includes(y.toLowerCase())&&(f[y]=cX)}),h),i.api_host));var h,f},A=n2(i.session_recording.maskNetworkRequestFn);return A&&n2(i.session_recording.maskCapturedNetworkRequestFn)&&Mu.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),A&&(i.session_recording.maskCapturedNetworkRequestFn=d=>{var h=i.session_recording.maskNetworkRequestFn({url:d.name});return jl({},d,{name:h==null?void 0:h.url})}),o.maskRequestFn=n2(i.session_recording.maskCapturedNetworkRequestFn)?d=>{var h,f=u(d);return f&&(h=i.session_recording.maskCapturedNetworkRequestFn==null?void 0:i.session_recording.maskCapturedNetworkRequestFn(f))!==null&&h!==void 0?h:void 0}:d=>function(h){if(!ol(h))return h.requestBody=TEe(h.requestBody,"Request"),h.responseBody=TEe(h.responseBody,"Response"),h}(u(d)),jl({},QF,o,{recordHeaders:s,recordBody:a,recordPerformance:c,recordInitialRequests:c})};class rpt{constructor(e,t){var n,r;t===void 0&&(t={}),this.yt={},this.wt=o=>{if(!this.yt[o]){var s,a;this.yt[o]=!0;var c=this.St(o);(s=(a=this.rt).onBlockedNode)==null||s.call(a,o,c)}},this.$t=o=>{var s=this.St(o);if((s==null?void 0:s.nodeName)!=="svg"&&s instanceof Element){var a=s.closest("svg");if(a)return[this._rrweb.mirror.getId(a),a]}return[o,s]},this.St=o=>this._rrweb.mirror.getNode(o),this.xt=o=>{var s,a,c,l,u,A,d,h;return((s=(a=o.removes)==null?void 0:a.length)!==null&&s!==void 0?s:0)+((c=(l=o.attributes)==null?void 0:l.length)!==null&&c!==void 0?c:0)+((u=(A=o.texts)==null?void 0:A.length)!==null&&u!==void 0?u:0)+((d=(h=o.adds)==null?void 0:h.length)!==null&&d!==void 0?d:0)},this.throttleMutations=o=>{if(o.type!==3||o.data.source!==0)return o;var s=o.data,a=this.xt(s);s.attributes&&(s.attributes=s.attributes.filter(l=>{var[u]=this.$t(l.id);return!this.ct.consumeRateLimit(u)&&l}));var c=this.xt(s);return c!==0||a===c?o:void 0},this._rrweb=e,this.rt=t,this.ct=new xEe({bucketSize:(n=this.rt.bucketSize)!==null&&n!==void 0?n:100,refillRate:(r=this.rt.refillRate)!==null&&r!==void 0?r:10,refillInterval:1e3,et:this.wt})}}var i2=Uint8Array,KE=Uint16Array,hM=Uint32Array,lX=new i2([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]),uX=new i2([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]),kEe=new i2([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),PEe=function(i,e){for(var t=new KE(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];var r=new hM(t[30]);for(n=1;n<30;++n)for(var o=t[n];o<t[n+1];++o)r[o]=o-t[n]<<5|n;return[t,r]},FEe=PEe(lX,2),opt=FEe[0],AX=FEe[1];opt[28]=258,AX[258]=28;for(var LEe=PEe(uX,0)[1],UEe=new KE(32768),ev=0;ev<32768;++ev){var OS=(43690&ev)>>>1|(21845&ev)<<1;OS=(61680&(OS=(52428&OS)>>>2|(13107&OS)<<2))>>>4|(3855&OS)<<4,UEe[ev]=((65280&OS)>>>8|(255&OS)<<8)>>>1}var e8=function(i,e,t){for(var n=i.length,r=0,o=new KE(e);r<n;++r)++o[i[r]-1];var s,a=new KE(e);for(r=0;r<e;++r)a[r]=a[r-1]+o[r-1]<<1;for(s=new KE(n),r=0;r<n;++r)s[r]=UEe[a[i[r]-1]++]>>>15-i[r];return s},zS=new i2(288);for(ev=0;ev<144;++ev)zS[ev]=8;for(ev=144;ev<256;++ev)zS[ev]=9;for(ev=256;ev<280;++ev)zS[ev]=7;for(ev=280;ev<288;++ev)zS[ev]=8;var MF=new i2(32);for(ev=0;ev<32;++ev)MF[ev]=5;var spt=e8(zS,9),apt=e8(MF,5),GEe=function(i){return(i/8>>0)+(7&i&&1)},OEe=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var n=new(i instanceof KE?KE:i instanceof hM?hM:i2)(t-e);return n.set(i.subarray(e,t)),n},G5=function(i,e,t){t<<=7&e;var n=e/8>>0;i[n]|=t,i[n+1]|=t>>>8},t8=function(i,e,t){t<<=7&e;var n=e/8>>0;i[n]|=t,i[n+1]|=t>>>8,i[n+2]|=t>>>16},dX=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var r=t.length,o=t.slice();if(!r)return[new i2(0),0];if(r==1){var s=new i2(t[0].s+1);return s[t[0].s]=1,[s,1]}t.sort(function(z,U){return z.f-U.f}),t.push({s:-1,f:25001});var a=t[0],c=t[1],l=0,u=1,A=2;for(t[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=r-1;)a=t[t[l].f<t[A].f?l++:A++],c=t[l!=u&&t[l].f<t[A].f?l++:A++],t[u++]={s:-1,f:a.f+c.f,l:a,r:c};var d=o[0].s;for(n=1;n<r;++n)o[n].s>d&&(d=o[n].s);var h=new KE(d+1),f=hX(t[u-1],h,0);if(f>e){n=0;var y=0,_=f-e,v=1<<_;for(o.sort(function(z,U){return h[U.s]-h[z.s]||z.f-U.f});n<r;++n){var E=o[n].s;if(!(h[E]>e))break;y+=v-(1<<f-h[E]),h[E]=e}for(y>>>=_;y>0;){var b=o[n].s;h[b]<e?y-=1<<e-h[b]++-1:++n}for(;n>=0&&y;--n){var M=o[n].s;h[M]==e&&(--h[M],++y)}f=e}return[new i2(h),f]},hX=function(i,e,t){return i.s==-1?Math.max(hX(i.l,e,t+1),hX(i.r,e,t+1)):e[i.s]=t},zEe=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new KE(++e),n=0,r=i[0],o=1,s=function(c){t[n++]=c},a=1;a<=e;++a)if(i[a]==r&&a!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=i[a]}return[t.subarray(0,n),e]},n8=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},fX=function(i,e,t){var n=t.length,r=GEe(e+2);i[r]=255&n,i[r+1]=n>>>8,i[r+2]=255^i[r],i[r+3]=255^i[r+1];for(var o=0;o<n;++o)i[r+o+4]=t[o];return 8*(r+4+n)},YEe=function(i,e,t,n,r,o,s,a,c,l,u){G5(e,u++,t),++r[256];for(var A=dX(r,15),d=A[0],h=A[1],f=dX(o,15),y=f[0],_=f[1],v=zEe(d),E=v[0],b=v[1],M=zEe(y),z=M[0],U=M[1],L=new KE(19),F=0;F<E.length;++F)L[31&E[F]]++;for(F=0;F<z.length;++F)L[31&z[F]]++;for(var Y=dX(L,7),G=Y[0],ee=Y[1],j=19;j>4&&!G[kEe[j-1]];--j);var ie,he,ge,le,me=l+5<<3,pe=n8(r,zS)+n8(o,MF)+s,Be=n8(r,d)+n8(o,y)+s+14+3*j+n8(L,G)+(2*L[16]+3*L[17]+7*L[18]);if(me<=pe&&me<=Be)return fX(e,u,i.subarray(c,c+l));if(G5(e,u,1+(Be<pe)),u+=2,Be<pe){ie=e8(d,h),he=d,ge=e8(y,_),le=y;var Re=e8(G,ee);for(G5(e,u,b-257),G5(e,u+5,U-1),G5(e,u+10,j-4),u+=14,F=0;F<j;++F)G5(e,u+3*F,G[kEe[F]]);u+=3*j;for(var De=[E,z],we=0;we<2;++we){var Je=De[we];for(F=0;F<Je.length;++F){var qe=31&Je[F];G5(e,u,Re[qe]),u+=G[qe],qe>15&&(G5(e,u,Je[F]>>>5&127),u+=Je[F]>>>12)}}}else ie=spt,he=zS,ge=apt,le=MF;for(F=0;F<a;++F)if(n[F]>255){qe=n[F]>>>18&31,t8(e,u,ie[qe+257]),u+=he[qe+257],qe>7&&(G5(e,u,n[F]>>>23&31),u+=lX[qe]);var rt=31&n[F];t8(e,u,ge[rt]),u+=le[rt],rt>3&&(t8(e,u,n[F]>>>5&8191),u+=uX[rt])}else t8(e,u,ie[n[F]]),u+=he[n[F]];return t8(e,u,ie[256]),u+he[256]},cpt=new hM([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lpt=function(){for(var i=new hM(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),upt=function(){var i=4294967295;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=lpt[255&t^e[n]]^t>>>8;i=t},d:function(){return 4294967295^i}}},Apt=function(i,e,t,n,r){return function(o,s,a,c,l,u){var A=o.length,d=new i2(c+A+5*(1+Math.floor(A/7e3))+l),h=d.subarray(c,d.length-l),f=0;if(!s||A<8)for(var y=0;y<=A;y+=65535){var _=y+65535;_<A?f=fX(h,f,o.subarray(y,_)):(h[y]=u,f=fX(h,f,o.subarray(y,A)))}else{for(var v=cpt[s-1],E=v>>>13,b=8191&v,M=(1<<a)-1,z=new KE(32768),U=new KE(M+1),L=Math.ceil(a/3),F=2*L,Y=function(Yt){return(o[Yt]^o[Yt+1]<<L^o[Yt+2]<<F)&M},G=new hM(25e3),ee=new KE(288),j=new KE(32),ie=0,he=0,ge=(y=0,0),le=0,me=0;y<A;++y){var pe=Y(y),Be=32767&y,Re=U[pe];if(z[Be]=Re,U[pe]=Be,le<=y){var De=A-y;if((ie>7e3||ge>24576)&&De>423){f=YEe(o,h,0,G,ee,j,he,ge,me,y-me,f),ge=ie=he=0,me=y;for(var we=0;we<286;++we)ee[we]=0;for(we=0;we<30;++we)j[we]=0}var Je=2,qe=0,rt=b,yt=Be-Re&32767;if(De>2&&pe==Y(y-yt))for(var wt=Math.min(E,De)-1,mt=Math.min(32767,y),ke=Math.min(258,De);yt<=mt&&--rt&&Be!=Re;){if(o[y+Je]==o[y+Je-yt]){for(var Xe=0;Xe<ke&&o[y+Xe]==o[y+Xe-yt];++Xe);if(Xe>Je){if(Je=Xe,qe=yt,Xe>wt)break;var et=Math.min(yt,Xe-2),ht=0;for(we=0;we<et;++we){var Bt=y-yt+we+32768&32767,gt=Bt-z[Bt]+32768&32767;gt>ht&&(ht=gt,Re=Bt)}}}yt+=(Be=Re)-(Re=z[Be])+32768&32767}if(qe){G[ge++]=268435456|AX[Je]<<18|LEe[qe];var un=31&AX[Je],jt=31&LEe[qe];he+=lX[un]+uX[jt],++ee[257+un],++j[jt],le=y+Je,++ie}else G[ge++]=o[y],++ee[o[y]]}}f=YEe(o,h,u,G,ee,j,he,ge,me,y-me,f)}return OEe(d,0,c+GEe(f)+l)}(i,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+e.mem,t,n,!0)},pX=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},dpt=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&pX(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var n=0;n<=t.length;++n)i[n+10]=t.charCodeAt(n)}},hpt=function(i){return 10+(i.filename&&i.filename.length+1||0)};function HEe(i,e){e===void 0&&(e={});var t=upt(),n=i.length;t.p(i);var r=Apt(i,e,hpt(e),8),o=r.length;return dpt(r,e),pX(r,o-8,t.d()),pX(r,o-4,n),r}function VEe(i,e){var t=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var n=new i2(i.length+(i.length>>>1)),r=0,o=function(l){n[r++]=l},s=0;s<t;++s){if(r+5>n.length){var a=new i2(r+8+(t-s<<1));a.set(n),n=a}var c=i.charCodeAt(s);c<128||e?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&i.charCodeAt(++s))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return OEe(n,0,r)}function fpt(i,e){return function(t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r),n|=0;return Math.abs(n)}(i)%100<Qb(100*e,0,100)}var a3="disabled",gX="sampled",RF="active",YS="buffering",mX="paused",yX="trigger",BB=yX+"_activated",kx=yX+"_pending",wB=yX+"_"+a3;function KEe(i,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(i))}class jEe{constructor(e){this.kt=e}triggerStatus(e){var t=this.kt.map(n=>n.triggerStatus(e));return t.includes(BB)?BB:t.includes(kx)?kx:wB}stop(){this.kt.forEach(e=>e.stop())}}class JEe{constructor(e){this.kt=e}triggerStatus(e){var t=new Set;for(var n of this.kt)t.add(n.triggerStatus(e));switch(t.delete(wB),t.size){case 0:return wB;case 1:return Array.from(t)[0];default:return kx}}stop(){this.kt.forEach(e=>e.stop())}}class ppt{triggerStatus(){return kx}stop(){}}class gpt{constructor(e){this.Et=[],this.It=[],this.urlBlocked=!1,this._instance=e}onRemoteConfig(e){var t,n;this.Et=((t=e.sessionRecording)==null?void 0:t.urlTriggers)||[],this.It=((n=e.sessionRecording)==null?void 0:n.urlBlocklist)||[]}Pt(e){var t;return this.Et.length===0?wB:((t=this._instance)==null?void 0:t.get_property(GZ))===e?BB:kx}triggerStatus(e){var t=this.Pt(e),n=t===BB?BB:t===kx?kx:wB;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:n}),n}checkUrlTriggerConditions(e,t,n){if(Mo!==void 0&&Mo.location.href){var r=Mo.location.href,o=this.urlBlocked,s=KEe(r,this.It);o&&s||(s&&!o?e():!s&&o&&t(),KEe(r,this.Et)&&n("url"))}}stop(){}}class mpt{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Rt=()=>{},this._instance=e}triggerStatus(){var e=kx;return py(this.linkedFlag)&&(e=wB),this.linkedFlagSeen&&(e=BB),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onRemoteConfig(e,t){var n;if(this.linkedFlag=((n=e.sessionRecording)==null?void 0:n.linkedFlag)||null,!py(this.linkedFlag)&&!this.linkedFlagSeen){var r=nI(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,o=nI(this.linkedFlag)?null:this.linkedFlag.variant;this.Rt=this._instance.onFeatureFlags((s,a)=>{var c=!1;if(tI(a)&&r in a){var l=a[r];c=EB(l)?l===!0:o?l===o:!!l}this.linkedFlagSeen=c,c&&t(r,o)})}}stop(){this.Rt()}}let ypt=class{constructor(e){this.Tt=[],this._instance=e}onRemoteConfig(e){var t;this.Tt=((t=e.sessionRecording)==null?void 0:t.eventTriggers)||[]}Mt(e){var t;return this.Tt.length===0?wB:((t=this._instance)==null?void 0:t.get_property(OZ))===e?BB:kx}triggerStatus(e){var t=this.Mt(e),n=t===BB?BB:t===kx?kx:wB;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:n}),n}stop(){}};function _pt(i){return i.isRecordingEnabled?YS:a3}function vpt(i){if(!i.receivedFlags)return YS;if(!i.isRecordingEnabled)return a3;if(i.urlTriggerMatching.urlBlocked)return mX;var e=i.isSampled===!0,t=new jEe([i.eventTriggerMatching,i.urlTriggerMatching,i.linkedFlagMatching]).triggerStatus(i.sessionId);return e?gX:t===BB?RF:t===kx?YS:i.isSampled===!1?a3:RF}function Ipt(i){if(!i.receivedFlags)return YS;if(!i.isRecordingEnabled)return a3;if(i.urlTriggerMatching.urlBlocked)return mX;var e=new JEe([i.eventTriggerMatching,i.urlTriggerMatching,i.linkedFlagMatching]).triggerStatus(i.sessionId),t=e!==wB,n=EB(i.isSampled);return t&&e===kx?YS:t&&e===wB||n&&!i.isSampled?a3:i.isSampled===!0?gX:RF}var i8="[SessionRecording]",Px=BC(i8);function DF(){var i;return jh==null||(i=jh.__PosthogExtensions__)==null||(i=i.rrweb)==null?void 0:i.record}var Cpt=3e5,xpt=[k2.MouseMove,k2.MouseInteraction,k2.Scroll,k2.ViewportResize,k2.Input,k2.TouchMove,k2.MediaInteraction,k2.Drag],WEe=i=>({rrwebMethod:i,enqueuedAt:Date.now(),attempt:1});function HS(i){return function(e,t){for(var n="",r=0;r<e.length;){var o=e[r++];n+=String.fromCharCode(o)}return n}(HEe(VEe(JSON.stringify(i))))}function ZEe(i){return i.type===U5.Custom&&i.data.tag==="sessionIdle"}class Ept{get sessionId(){return this.Ct}get Ft(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Ot}get At(){if(!this._instance.sessionManager)throw new Error(i8+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Dt(){var e,t;return this.Lt.triggerStatus(this.sessionId)===kx?6e4:(e=(t=this._instance.config.session_recording)==null?void 0:t.full_snapshot_interval_millis)!==null&&e!==void 0?e:Cpt}get jt(){var e=this._instance.get_property(ZN);return EB(e)?e:null}get Nt(){var e,t,n=(e=this.C)==null?void 0:e.data[((t=this.C)==null?void 0:t.data.length)-1],{sessionStartTimestamp:r}=this.At.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-r:null}get zt(){var e=!!this._instance.get_property(UZ),t=!this._instance.config.disable_session_recording;return Mo&&e&&t}get Ut(){var e=!!this._instance.get_property(Zxe),t=this._instance.config.enable_recording_console_log;return t??e}get qt(){var e,t,n,r,o,s,a=this._instance.config.session_recording.captureCanvas,c=this._instance.get_property($xe),l=(e=(t=a==null?void 0:a.recordCanvas)!==null&&t!==void 0?t:c==null?void 0:c.enabled)!==null&&e!==void 0&&e,u=(n=(r=a==null?void 0:a.canvasFps)!==null&&r!==void 0?r:c==null?void 0:c.fps)!==null&&n!==void 0?n:4,A=(o=(s=a==null?void 0:a.canvasQuality)!==null&&s!==void 0?s:c==null?void 0:c.quality)!==null&&o!==void 0?o:.4;if(typeof A=="string"){var d=parseFloat(A);A=isNaN(d)?.4:d}return{enabled:l,fps:Qb(u,0,12,"canvas recording fps",4),quality:Qb(A,0,1,"canvas recording quality",.4)}}get Bt(){var e,t,n=this._instance.get_property(Xxe),r={recordHeaders:(e=this._instance.config.session_recording)==null?void 0:e.recordHeaders,recordBody:(t=this._instance.config.session_recording)==null?void 0:t.recordBody},o=(r==null?void 0:r.recordHeaders)||(n==null?void 0:n.recordHeaders),s=(r==null?void 0:r.recordBody)||(n==null?void 0:n.recordBody),a=tI(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,c=!!(EB(a)?a:n!=null&&n.capturePerformance);return o||s||c?{recordHeaders:o,recordBody:s,recordPerformance:c}:void 0}get Ht(){var e,t,n,r,o,s,a=this._instance.get_property(qxe),c={maskAllInputs:(e=this._instance.config.session_recording)==null?void 0:e.maskAllInputs,maskTextSelector:(t=this._instance.config.session_recording)==null?void 0:t.maskTextSelector,blockSelector:(n=this._instance.config.session_recording)==null?void 0:n.blockSelector},l=(r=c==null?void 0:c.maskAllInputs)!==null&&r!==void 0?r:a==null?void 0:a.maskAllInputs,u=(o=c==null?void 0:c.maskTextSelector)!==null&&o!==void 0?o:a==null?void 0:a.maskTextSelector,A=(s=c==null?void 0:c.blockSelector)!==null&&s!==void 0?s:a==null?void 0:a.blockSelector;return ol(l)&&ol(u)&&ol(A)?void 0:{maskAllInputs:l==null||l,maskTextSelector:u,blockSelector:A}}get Wt(){var e=this._instance.get_property(eEe);return Tx(e)?e:null}get Gt(){var e=this._instance.get_property(tEe);return Tx(e)?e:null}get status(){return this.Jt?this.Vt({receivedFlags:this.Jt,isRecordingEnabled:this.zt,isSampled:this.jt,urlTriggerMatching:this.Kt,eventTriggerMatching:this.Yt,linkedFlagMatching:this.Xt,sessionId:this.sessionId}):YS}constructor(e){if(this.Vt=_pt,this.Jt=!1,this.Qt=[],this.Zt="unknown",this.ti=Date.now(),this.Lt=new ppt,this.ii=void 0,this.ei=void 0,this.ri=void 0,this.si=void 0,this.ni=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.oi=()=>{this.ai()},this.li=()=>{this.ui("browser offline",{})},this.hi=()=>{this.ui("browser online",{})},this.di=()=>{if(lu!=null&&lu.visibilityState){var r="window "+lu.visibilityState;this.ui(r,{})}},this._instance=e,this.Ot=!1,this.vi="/s/",this.ci=void 0,this.Jt=!1,!this._instance.sessionManager)throw Px.error("started without valid sessionManager"),new Error(i8+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(i8+" cannot be used with __preview_experimental_cookieless_mode.");this.Xt=new mpt(this._instance),this.Kt=new gpt(this._instance),this.Yt=new ypt(this._instance);var{sessionId:t,windowId:n}=this.At.checkAndGetSessionAndWindowId();this.Ct=t,this.fi=n,this.C=this.pi(),this.Ft>=this.At.sessionTimeoutMs&&Px.warn("session_idle_threshold_ms ("+this.Ft+") is greater than the session timeout ("+this.At.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.zt?(this.gi(e),Bv(Mo,"beforeunload",this.oi),Bv(Mo,"offline",this.li),Bv(Mo,"online",this.hi),Bv(Mo,"visibilitychange",this.di),this.mi(),this.bi(),py(this.ii)&&(this.ii=this._instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var n=t!=null&&t.properties.$current_url?this.yi(t==null?void 0:t.properties.$current_url):"";if(!n)return;this.ui("$pageview",{href:n})}}catch(r){Px.error("Could not add $pageview to rrweb session",r)}})),this.ei||(this.ei=this.At.onSessionId((t,n,r)=>{var o,s;r&&(this.ui("$session_id_change",{sessionId:t,windowId:n,changeReason:r}),(o=this._instance)==null||(o=o.persistence)==null||o.unregister(OZ),(s=this._instance)==null||(s=s.persistence)==null||s.unregister(GZ))}))):this.stopRecording()}stopRecording(){var e,t,n,r;this.Ot&&this.ci&&(this.ci(),this.ci=void 0,this.Ot=!1,Mo==null||Mo.removeEventListener("beforeunload",this.oi),Mo==null||Mo.removeEventListener("offline",this.li),Mo==null||Mo.removeEventListener("online",this.hi),Mo==null||Mo.removeEventListener("visibilitychange",this.di),this.pi(),clearInterval(this.wi),(e=this.ii)==null||e.call(this),this.ii=void 0,(t=this.ni)==null||t.call(this),this.ni=void 0,(n=this.ei)==null||n.call(this),this.ei=void 0,(r=this.si)==null||r.call(this),this.si=void 0,this.Yt.stop(),this.Kt.stop(),this.Xt.stop(),Px.info("stopped"))}Si(){var e;(e=this._instance.persistence)==null||e.unregister(ZN)}$i(e){var t,n=this.Ct!==e,r=this.Wt;if(Tx(r)){var o=this.jt,s=n||!EB(o),a=s?fpt(e,r):o;s&&(a?this.xi(gX):Px.warn("Sample rate ("+r+") has determined that this sessionId ("+e+") will not be sent to the server."),this.ui("samplingDecisionMade",{sampleRate:r,isSampled:a})),(t=this._instance.persistence)==null||t.register({[ZN]:a})}else this.Si()}onRemoteConfig(e){var t,n,r,o;this.ui("$remote_config_received",e),this.ki(e),(t=e.sessionRecording)!=null&&t.endpoint&&(this.vi=(o=e.sessionRecording)==null?void 0:o.endpoint),this.mi(),((n=e.sessionRecording)==null?void 0:n.triggerMatchType)==="any"?(this.Vt=vpt,this.Lt=new jEe([this.Yt,this.Kt])):(this.Vt=Ipt,this.Lt=new JEe([this.Yt,this.Kt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:(r=e.sessionRecording)==null?void 0:r.triggerMatchType}),this.Kt.onRemoteConfig(e),this.Yt.onRemoteConfig(e),this.Xt.onRemoteConfig(e,(s,a)=>{this.xi("linked_flag_matched",{flag:s,variant:a})}),this.Jt=!0,this.startIfEnabledOrStop()}mi(){Tx(this.Wt)&&py(this.si)&&(this.si=this.At.onSessionId(e=>{this.$i(e)}))}ki(e){if(this._instance.persistence){var t,n=this._instance.persistence,r=()=>{var o,s,a,c,l,u,A,d,h,f=(o=e.sessionRecording)==null?void 0:o.sampleRate,y=py(f)?null:parseFloat(f);py(y)&&this.Si();var _=(s=e.sessionRecording)==null?void 0:s.minimumDurationMilliseconds;n.register({[UZ]:!!e.sessionRecording,[Zxe]:(a=e.sessionRecording)==null?void 0:a.consoleLogRecordingEnabled,[Xxe]:jl({capturePerformance:e.capturePerformance},(c=e.sessionRecording)==null?void 0:c.networkPayloadCapture),[qxe]:(l=e.sessionRecording)==null?void 0:l.masking,[$xe]:{enabled:(u=e.sessionRecording)==null?void 0:u.recordCanvas,fps:(A=e.sessionRecording)==null?void 0:A.canvasFps,quality:(d=e.sessionRecording)==null?void 0:d.canvasQuality},[eEe]:y,[tEe]:ol(_)?null:_,[nEe]:(h=e.sessionRecording)==null?void 0:h.scriptConfig})};r(),(t=this.ri)==null||t.call(this),this.ri=this.At.onSessionId(r)}}log(e,t){var n;t===void 0&&(t="log"),(n=this._instance.sessionRecording)==null||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}gi(e){if(!ol(Object.assign)&&!ol(Array.from)&&!(this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var t;this.Ot=!0,this.At.checkAndGetSessionAndWindowId(),DF()?this.Ei():(t=jh.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,this.Ii,n=>{if(n)return Px.error("could not load recorder",n);this.Ei()}),Px.info("starting"),this.status===RF&&this.xi(e||"recording_initialized")}}get Ii(){var e;return((e=this._instance)==null||(e=e.persistence)==null||(e=e.get_property(nEe))==null?void 0:e.script)||"recorder"}Pi(e){var t;return e.type===3&&xpt.indexOf((t=e.data)==null?void 0:t.source)!==-1}Ri(e){var t=this.Pi(e);t||this.Zt||e.timestamp-this.ti>this.Ft&&(this.Zt=!0,clearInterval(this.wi),this.ui("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ti,threshold:this.Ft,bufferLength:this.C.data.length,bufferSize:this.C.size}),this.ai());var n=!1;if(t&&(this.ti=e.timestamp,this.Zt)){var r=this.Zt==="unknown";this.Zt=!1,r||(this.ui("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)}if(!this.Zt){var{windowId:o,sessionId:s}=this.At.checkAndGetSessionAndWindowId(!t,e.timestamp),a=this.Ct!==s,c=this.fi!==o;this.fi=o,this.Ct=s,a||c?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this.Ti()}}Mi(e){try{return e.rrwebMethod(),!0}catch(t){return this.Qt.length<10?this.Qt.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Px.warn("could not emit queued rrweb event.",t,e),!1}}ui(e,t){return this.Mi(WEe(()=>DF().addCustomEvent(e,t)))}Ci(){return this.Mi(WEe(()=>DF().takeFullSnapshot()))}Ei(){var e,t,n,r,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},s=this._instance.config.session_recording;for(var[a,c]of Object.entries(s||{}))a in o&&(a==="maskInputOptions"?o.maskInputOptions=jl({password:!0},c):o[a]=c);this.qt&&this.qt.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.qt.fps},o.dataURLOptions={type:"image/webp",quality:this.qt.quality}),this.Ht&&(o.maskAllInputs=(t=this.Ht.maskAllInputs)===null||t===void 0||t,o.maskTextSelector=(n=this.Ht.maskTextSelector)!==null&&n!==void 0?n:void 0,o.blockSelector=(r=this.Ht.blockSelector)!==null&&r!==void 0?r:void 0);var l=DF();if(l){this.Fi=(e=this.Fi)!==null&&e!==void 0?e:new rpt(l,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(A,d)=>{var h="Too many mutations on node '"+A+"'. Rate limiting. This could be due to SVG animations or something similar";Px.info(h,{node:d}),this.log(i8+" "+h,"warn")}});var u=this.Oi();this.ci=l(jl({emit:A=>{this.onRRwebEmit(A)},plugins:u},o)),this.ti=Date.now(),this.Zt=EB(this.Zt)?this.Zt:"unknown",this.ui("$session_options",{sessionRecordingOptions:o,activePlugins:u.map(A=>A==null?void 0:A.name)}),this.ui("$posthog_config",{config:this._instance.config})}else Px.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ti(){if(this.wi&&clearInterval(this.wi),this.Zt!==!0){var e=this.Dt;e&&(this.wi=setInterval(()=>{this.Ci()},e))}}Oi(){var e,t,n=[],r=(e=jh.__PosthogExtensions__)==null||(e=e.rrwebPlugins)==null?void 0:e.getRecordConsolePlugin;r&&this.Ut&&n.push(r());var o=(t=jh.__PosthogExtensions__)==null||(t=t.rrwebPlugins)==null?void 0:t.getRecordNetworkPlugin;return this.Bt&&n2(o)&&(!xft.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?n.push(o(ipt(this._instance.config,this.Bt))):Px.info("NetworkCapture not started because we are on localhost.")),n}onRRwebEmit(e){var t;if(this.Ai(),e&&tI(e)){if(e.type===U5.Meta){var n=this.yi(e.data.href);if(this.Di=n,!n)return;e.data.href=n}else this.Li();if(this.Kt.checkUrlTriggerConditions(()=>this.ji(),()=>this.Ni(),d=>this.zi(d)),!this.Kt.urlBlocked||(r=e).type===U5.Custom&&r.data.tag==="recording paused"){var r;e.type===U5.FullSnapshot&&this.Ti(),e.type===U5.FullSnapshot&&this.Jt&&this.Lt.triggerStatus(this.sessionId)===kx&&this.pi();var o=this.Fi?this.Fi.throttleMutations(e):e;if(o){var s=function(d){var h=d;if(h&&tI(h)&&h.type===6&&tI(h.data)&&h.data.plugin==="rrweb/console@1"){h.data.payload.payload.length>10&&(h.data.payload.payload=h.data.payload.payload.slice(0,10),h.data.payload.payload.push("...[truncated]"));for(var f=[],y=0;y<h.data.payload.payload.length;y++)h.data.payload.payload[y]&&h.data.payload.payload[y].length>2e3?f.push(h.data.payload.payload[y].slice(0,2e3)+"...[truncated]"):f.push(h.data.payload.payload[y]);return h.data.payload.payload=f,d}return d}(o);if(this.Ri(s),this.Zt!==!0||ZEe(s)){if(ZEe(s)){var a=s.data.payload;if(a){var c=a.lastActivityTimestamp,l=a.threshold;s.timestamp=c+l}}var u=(t=this._instance.config.session_recording.compress_events)===null||t===void 0||t?function(d){if(SF(d)<1024)return d;try{if(d.type===U5.FullSnapshot)return jl({},d,{data:HS(d.data),cv:"2024-10"});if(d.type===U5.IncrementalSnapshot&&d.data.source===k2.Mutation)return jl({},d,{cv:"2024-10",data:jl({},d.data,{texts:HS(d.data.texts),attributes:HS(d.data.attributes),removes:HS(d.data.removes),adds:HS(d.data.adds)})});if(d.type===U5.IncrementalSnapshot&&d.data.source===k2.StyleSheetRule)return jl({},d,{cv:"2024-10",data:jl({},d.data,{adds:d.data.adds?HS(d.data.adds):void 0,removes:d.data.removes?HS(d.data.removes):void 0})})}catch(h){Px.error("could not compress event - will use uncompressed event",h)}return d}(s):s,A={$snapshot_bytes:SF(u),$snapshot_data:u,$session_id:this.Ct,$window_id:this.fi};this.status!==a3?this.Ui(A):this.pi()}}}}}Li(){if(!this._instance.config.capture_pageview&&Mo){var e=this.yi(Mo.location.href);this.Di!==e&&(this.ui("$url_changed",{href:e}),this.Di=e)}}Ai(){if(this.Qt.length){var e=[...this.Qt];this.Qt=[],e.forEach(t=>{Date.now()-t.enqueuedAt<=2e3&&this.Mi(t)})}}yi(e){var t=this._instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return(n=r=t.maskNetworkRequestFn(r))==null?void 0:n.url}return e}pi(){return this.C={size:0,data:[],sessionId:this.Ct,windowId:this.fi},this.C}ai(){this.qi&&(clearTimeout(this.qi),this.qi=void 0);var e=this.Gt,t=this.Nt,n=Tx(t)&&t>=0,r=Tx(e)&&n&&t<e;return this.status===YS||this.status===mX||this.status===a3||r?(this.qi=setTimeout(()=>{this.ai()},2e3),this.C):(this.C.data.length>0&&sX(this.C).forEach(o=>{this.Bi({$snapshot_bytes:o.size,$snapshot_data:o.data,$session_id:o.sessionId,$window_id:o.windowId,$lib:"web",$lib_version:P5.LIB_VERSION})}),this.pi())}Ui(e){var t,n=2+(((t=this.C)==null?void 0:t.data.length)||0);!this.Zt&&(this.C.size+e.$snapshot_bytes+n>943718.4||this.C.sessionId!==this.Ct)&&(this.C=this.ai()),this.C.size+=e.$snapshot_bytes,this.C.data.push(e.$snapshot_data),this.qi||this.Zt||(this.qi=setTimeout(()=>{this.ai()},2e3))}Bi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.vi),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(e){var t;this.Lt.triggerStatus(this.sessionId)===kx&&((t=this._instance)==null||(t=t.persistence)==null||t.register({[e==="url"?GZ:OZ]:this.Ct}),this.ai(),this.xi(e+"_trigger_matched"))}ji(){this.Kt.urlBlocked||(this.Kt.urlBlocked=!0,clearInterval(this.wi),Px.info("recording paused due to URL blocker"),this.ui("recording paused",{reason:"url blocker"}))}Ni(){this.Kt.urlBlocked&&(this.Kt.urlBlocked=!1,this.Ci(),this.Ti(),this.ui("recording resumed",{reason:"left blocked url"}),Px.info("recording resumed"))}bi(){this.Yt.Tt.length!==0&&py(this.ni)&&(this.ni=this._instance.on("eventCaptured",e=>{try{this.Yt.Tt.includes(e.event)&&this.zi("event")}catch(t){Px.error("Could not activate event trigger",t)}}))}overrideLinkedFlag(){this.Xt.linkedFlagSeen=!0,this.Ci(),this.xi("linked_flag_overridden")}overrideSampling(){var e;(e=this._instance.persistence)==null||e.register({[ZN]:!0}),this.Ci(),this.xi("sampling_overridden")}overrideTrigger(e){this.zi(e)}xi(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),Px.info(e.replace("_"," "),t),bg(["recording_initialized","session_id_changed"],e)||this.ui(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.At.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.C.data.length,$sdk_debug_replay_internal_buffer_size:this.C.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:e}}}var _X=BC("[SegmentIntegration]");function bpt(i,e){var t=i.config.segment;if(!t)return e();(function(n,r){var o=n.config.segment;if(!o)return r();var s=c=>{var l=()=>c.anonymousId()||s3();n.config.get_device_id=l,c.id()&&(n.register({distinct_id:c.id(),$device_id:l()}),n.persistence.set_property(L5,"identified")),r()},a=o.user();"then"in a&&n2(a.then)?a.then(c=>s(c)):s(a)})(i,()=>{t.register((n=>{Promise&&Promise.resolve||_X.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,s)=>{if(!s)return o;o.event.userId||o.event.anonymousId===n.get_distinct_id()||(_X.info("No userId set, resetting PostHog"),n.reset()),o.event.userId&&o.event.userId!==n.get_distinct_id()&&(_X.info("UserId set, identifying with PostHog"),n.identify(o.event.userId));var a=n.calculateEventProperties(s,o.event.properties);return o.event.properties=Object.assign({},a,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>r(o,o.event.event),page:o=>r(o,"$pageview"),identify:o=>r(o,"$identify"),screen:o=>r(o,"$screen")}})(i)).then(()=>{e()})})}var XEe="posthog-js";function qEe(i,e){var{organization:t,projectId:n,prefix:r,severityAllowList:o=["error"]}=e===void 0?{}:e;return s=>{var a,c,l,u,A;if(!(o==="*"||o.includes(s.level))||!i.__loaded)return s;s.tags||(s.tags={});var d=i.requestRouter.endpointFor("ui","/project/"+i.config.token+"/person/"+i.get_distinct_id());s.tags["PostHog Person URL"]=d,i.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=i.get_session_replay_url({withTimestamp:!0}));var h=((a=s.exception)==null?void 0:a.values)||[],f=h.map(_=>jl({},_,{stacktrace:_.stacktrace?jl({},_.stacktrace,{type:"raw",frames:(_.stacktrace.frames||[]).map(v=>jl({},v,{platform:"web:javascript"}))}):void 0})),y={$exception_message:((c=h[0])==null?void 0:c.value)||s.message,$exception_type:(l=h[0])==null?void 0:l.type,$exception_personURL:d,$exception_level:s.level,$exception_list:f,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((u=h[0])==null?void 0:u.value)||s.message,$sentry_exception_type:(A=h[0])==null?void 0:A.type,$sentry_tags:s.tags};return t&&n&&(y.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+s.event_id),i.exceptions.sendExceptionEvent(y),s}}let Bpt=class{constructor(e,t,n,r,o){this.name=XEe,this.setupOnce=function(s){s(qEe(e,{organization:t,projectId:n,prefix:r,severityAllowList:o}))}}};var wpt=Mo!=null&&Mo.location?vF(Mo.location.hash,"__posthog")||vF(location.hash,"state"):null,$Ee="_postHogToolbarParams",ebe=BC("[Toolbar]"),c3=function(i){return i[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.LOADING=1]="LOADING",i[i.LOADED=2]="LOADED",i}(c3||{});class Spt{constructor(e){this.instance=e}Hi(e){jh.ph_toolbar_state=e}Wi(){var e;return(e=jh.ph_toolbar_state)!==null&&e!==void 0?e:c3.UNINITIALIZED}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),!Mo||!lu)return!1;e=e??Mo.location,n=n??Mo.history;try{if(!t){try{Mo.localStorage.setItem("test","test"),Mo.localStorage.removeItem("test")}catch{return!1}t=Mo==null?void 0:Mo.localStorage}var r,o=wpt||vF(e.hash,"__posthog")||vF(e.hash,"state"),s=o?Oxe(()=>JSON.parse(atob(decodeURIComponent(o))))||Oxe(()=>JSON.parse(decodeURIComponent(o))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem($Ee)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}Gi(e){var t=jh.ph_load_toolbar||jh.ph_load_editor;!py(t)&&n2(t)?t(e,this.instance):ebe.warn("No toolbar load function found")}loadToolbar(e){var t=!(lu==null||!lu.getElementById(iEe));if(!Mo||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=jl({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Mo.localStorage.setItem($Ee,JSON.stringify(jl({},r,{source:void 0}))),this.Wi()===c3.LOADED)this.Gi(r);else if(this.Wi()===c3.UNINITIALIZED){var o;this.Hi(c3.LOADING),(o=jh.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",s=>{if(s)return ebe.error("[Toolbar] Failed to load",s),void this.Hi(c3.UNINITIALIZED);this.Hi(c3.LOADED),this.Gi(r)}),Bv(Mo,"turbolinks:load",()=>{this.Hi(c3.UNINITIALIZED),this.loadToolbar(r)})}return!0}Ji(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}var Qpt=BC("[TracingHeaders]");class Mpt{constructor(e){this.Vi=void 0,this.Ki=void 0,this.nt=()=>{var t,n;ol(this.Vi)&&((t=jh.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),ol(this.Ki)&&((n=jh.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}J(e){var t,n;(t=jh.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=jh.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return Qpt.error("failed to load script",r);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.J(this.nt):((e=this.Vi)==null||e.call(this),(t=this.Ki)==null||t.call(this),this.Vi=void 0,this.Ki=void 0)}}var l3=BC("[Web Vitals]"),tbe=9e5;class Rpt{constructor(e){var t;this.Yi=!1,this.i=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xi=()=>{clearTimeout(this.Qi),this.C.metrics.length!==0&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((n,r)=>jl({},n,{["$web_vitals_"+r.name+"_event"]:jl({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Zi=n=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(ol(o))l3.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.te();ol(s)||(py(n==null?void 0:n.name)||py(n==null?void 0:n.value)?l3.error("Invalid metric received",n):this.ie&&n.value>=this.ie?l3.error("Ignoring metric with value >= "+this.ie,n):(this.C.url!==s&&(this.Xi(),this.Qi=setTimeout(this.Xi,this.flushToCaptureTimeoutMs)),ol(this.C.url)&&(this.C.url=s),this.C.firstMetricTimestamp=ol(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.C.metrics.push(jl({},n,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Xi()))}},this.nt=()=>{var n,r,o,s,a=jh.__PosthogExtensions__;ol(a)||ol(a.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:o,onINP:s}=a.postHogWebVitalsCallbacks),n&&r&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Zi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Zi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Zi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Zi.bind(this)),this.i=!0):l3.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Yi=!((t=this._instance.persistence)==null||!t.props[jxe]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=tI(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return ol(n)?((t=this._instance.persistence)==null?void 0:t.props[Wxe])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(tI(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get ie(){var e=tI(this._instance.config.capture_performance)&&Tx(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:tbe;return 0<e&&e<=6e4?tbe:e}get isEnabled(){var e=HE==null?void 0:HE.protocol;if(e!=="http:"&&e!=="https:")return l3.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=tI(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:EB(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return EB(t)?t:this.Yi}startIfEnabled(){this.isEnabled&&!this.i&&(l3.info("enabled, starting..."),this.J(this.nt))}onRemoteConfig(e){var t=tI(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=tI(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[jxe]:t}),this._instance.persistence.register({[Wxe]:n})),this.Yi=t,this.startIfEnabled()}J(e){var t,n;(t=jh.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(n=jh.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"web-vitals",r=>{r?l3.error("failed to load script",r):e()})}te(){var e=Mo?Mo.location.href:void 0;return e||l3.error("Could not determine current URL"),e}}var Dpt=BC("[Heatmaps]");function nbe(i){return tI(i)&&"clientX"in i&&"clientY"in i&&Tx(i.clientX)&&Tx(i.clientY)}class Npt{constructor(e){var t;this.rageclicks=new mEe,this.Yi=!1,this.i=!1,this.ee=null,this.instance=e,this.Yi=!((t=this.instance.persistence)==null||!t.props[FZ])}get flushIntervalMilliseconds(){var e=5e3;return tI(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ol(this.instance.config.capture_heatmaps)?ol(this.instance.config.enable_heatmaps)?this.Yi:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.i)return;Dpt.info("starting..."),this.re(),this.ee=setInterval(this.se.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval((e=this.ee)!==null&&e!==void 0?e:void 0),(t=this.ne)==null||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[FZ]:t}),this.Yi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}oe(e){this.ae(e.originalEvent,"deadclick")}re(){Mo&&lu&&(Bv(Mo,"beforeunload",this.se.bind(this)),Bv(lu,"click",e=>this.ae(e||(Mo==null?void 0:Mo.event)),{capture:!0}),Bv(lu,"mousemove",e=>this.le(e||(Mo==null?void 0:Mo.event)),{capture:!0}),this.ne=new CEe(this.instance,Fft,this.oe.bind(this)),this.ne.startIfEnabled(),this.i=!0)}ue(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=function(a,c,l){for(var u=a;u&&gF(u)&&!o3(u,"body");){if(u===l)return!1;if(bg(c,Mo==null?void 0:Mo.getComputedStyle(u).position))return!0;u=uEe(u)}return!1}(lEe(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}ae(e,t){var n;if(t===void 0&&(t="click"),!rEe(e.target)&&nbe(e)){var r=this.ue(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.he(jl({},r,{type:"rageclick"})),this.he(r)}}le(e){!rEe(e.target)&&nbe(e)&&(clearTimeout(this.de),this.de=setTimeout(()=>{this.he(this.ue(e,"mousemove"))},500))}he(e){if(Mo){var t=Mo.location.href;this.C=this.C||{},this.C[t]||(this.C[t]=[]),this.C[t].push(e)}}se(){this.C&&!aM(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Tpt{constructor(e){this._instance=e}doPageView(e,t){var n,r=this.ve(e,t);return this.ce={pathname:(n=Mo==null?void 0:Mo.location.pathname)!==null&&n!==void 0?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ve(e,(t=this.ce)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ce)==null?void 0:e.pageViewId}}ve(e,t){var n=this.ce;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:a,maxScrollY:c,maxContentHeight:l,lastContentY:u,maxContentY:A}=o;if(!(ol(s)||ol(a)||ol(c)||ol(l)||ol(u)||ol(A))){s=Math.ceil(s),a=Math.ceil(a),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u),A=Math.ceil(A);var d=s<=1?1:Qb(a/s,0,1),h=s<=1?1:Qb(c/s,0,1),f=l<=1?1:Qb(u/l,0,1),y=l<=1?1:Qb(A/l,0,1);r=MI(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:f,$prev_pageview_max_content:A,$prev_pageview_max_content_percentage:y})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}}var kpt=function(i){var e,t,n,r,o="";for(e=t=0,n=(i=(i+"").replace(/\r\n/g,`
|
|
243
243
|
`).replace(/\r/g,`
|
|
244
|
-
`)).length,r=0;r<n;r++){var s=i.charCodeAt(r),a=null;s<128?t++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),i3(a)||(t>e&&(o+=i.substring(e,t)),o+=a,e=t=r+1)}return t>e&&(o+=i.substring(e,i.length)),o},Ppt=!!DZ||!!RZ,ibe="text/plain",NF=(i,e)=>{var[t,n]=i.split("?"),r=jl({},e);n==null||n.split("&").forEach(s=>{var[a]=s.split("=");delete r[a]});var o=Eft(r);return t+"?"+(o=o?(n?n+"&":"")+o:n)},r8=(i,e)=>JSON.stringify(i,(t,n)=>typeof n=="bigint"?n.toString():n,e),vX=i=>{var{data:e,compression:t}=i;if(e){if(t===F5.GZipJS){var n=HEe(VEe(r8(e)),{mtime:0}),r=new Blob([n],{type:ibe});return{contentType:ibe,body:r,estimatedSize:r.size}}if(t===F5.Base64){var o=function(c){var l,u,A,d,h,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",y=0,_=0,v="",E=[];if(!c)return c;c=kpt(c);do l=(h=c.charCodeAt(y++)<<16|c.charCodeAt(y++)<<8|c.charCodeAt(y++))>>18&63,u=h>>12&63,A=h>>6&63,d=63&h,E[_++]=f.charAt(l)+f.charAt(u)+f.charAt(A)+f.charAt(d);while(y<c.length);switch(v=E.join(""),c.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v}(r8(e)),s=(c=>"data="+encodeURIComponent(typeof c=="string"?c:r8(c)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=r8(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},o8=[];RZ&&o8.push({transport:"fetch",method:i=>{var e,t,{contentType:n,body:r,estimatedSize:o}=(e=vX(i))!==null&&e!==void 0?e:{},s=new Headers;Q_(i.headers,function(u,A){s.append(A,u)}),n&&s.append("Content-Type",n);var a=i.url,c=null;if(kxe){var l=new kxe;c={signal:l.signal,timeout:setTimeout(()=>l.abort(),i.timeout)}}RZ(a,jl({method:(i==null?void 0:i.method)||"GET",headers:s,keepalive:i.method==="POST"&&(o||0)<52428.8,body:r,signal:(t=c)==null?void 0:t.signal},i.fetchOptions)).then(u=>u.text().then(A=>{var d={statusCode:u.status,text:A};if(u.status===200)try{d.json=JSON.parse(A)}catch(h){Mu.error(h)}i.callback==null||i.callback(d)})).catch(u=>{Mu.error(u),i.callback==null||i.callback({statusCode:0,text:u})}).finally(()=>c?clearTimeout(c.timeout):null)}}),DZ&&o8.push({transport:"XHR",method:i=>{var e,t=new DZ;t.open(i.method||"GET",i.url,!0);var{contentType:n,body:r}=(e=vX(i))!==null&&e!==void 0?e:{};Q_(i.headers,function(o,s){t.setRequestHeader(s,o)}),n&&t.setRequestHeader("Content-Type",n),i.timeout&&(t.timeout=i.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}i.callback==null||i.callback(o)}},t.send(r)}}),Sb!=null&&Sb.sendBeacon&&o8.push({transport:"sendBeacon",method:i=>{var e=NF(i.url,{beacon:"1"});try{var t,{contentType:n,body:r}=(t=vX(i))!==null&&t!==void 0?t:{},o=typeof r=="string"?new Blob([r],{type:n}):r;Sb.sendBeacon(e,o)}catch{}}});var fM=function(i,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(i)}catch{return!1}};function rbe(i,e,t){return r8({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Fpt={exact:(i,e)=>e.some(t=>i.some(n=>t===n)),is_not:(i,e)=>e.every(t=>i.every(n=>t!==n)),regex:(i,e)=>e.some(t=>i.some(n=>fM(t,n))),not_regex:(i,e)=>e.every(t=>i.every(n=>!fM(t,n))),icontains:(i,e)=>e.map(TF).some(t=>i.map(TF).some(n=>t.includes(n))),not_icontains:(i,e)=>e.map(TF).every(t=>i.map(TF).every(n=>!t.includes(n)))},TF=i=>i.toLowerCase(),obe=BC("[Error tracking]");class Lpt{constructor(e){var t,n;this.fe=[],this._instance=e,this.fe=(t=(n=this._instance.persistence)==null?void 0:n.get_property(LZ))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r,o=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.fe=o,this._instance.persistence&&this._instance.persistence.register({[LZ]:this.fe,[Kxe]:s})}get pe(){var e,t=!!this._instance.get_property(Kxe),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}sendExceptionEvent(e){if(this._e(e))obe.info("Skipping exception capture because a suppression rule matched");else{if(this.pe||!this.ge(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});obe.info("Skipping exception capture because it was thrown by an extension")}}_e(e){var t=e.$exception_list;if(!t||!$1(t)||t.length===0)return!1;var n=t.reduce((r,o)=>{var{type:s,value:a}=o;return nI(s)&&s.length>0&&r.$exception_types.push(s),nI(a)&&a.length>0&&r.$exception_values.push(a),r},{$exception_types:[],$exception_values:[]});return this.fe.some(r=>{var o=r.values.map(s=>{var a,c=Fpt[s.operator],l=$1(s.value)?s.value:[s.value],u=(a=n[s.key])!==null&&a!==void 0?a:[];return l.length>0&&c(l,u)});return r.type==="OR"?o.some(Boolean):o.every(Boolean)})}ge(e){var t=e.$exception_list;return!(!t||!$1(t))&&t.flatMap(n=>{var r,o;return(r=(o=n.stacktrace)==null?void 0:o.frames)!==null&&r!==void 0?r:[]}).some(n=>n.filename&&n.filename.startsWith("chrome-extension://"))}}var r2="Mobile",kF="iOS",SB="Android",s8="Tablet",sbe=SB+" "+s8,abe="iPad",cbe="Apple",lbe=cbe+" Watch",a8="Safari",pM="BlackBerry",ube="Samsung",Abe=ube+"Browser",dbe=ube+" Internet",VS="Chrome",Upt=VS+" OS",hbe=VS+" "+kF,IX="Internet Explorer",fbe=IX+" "+r2,CX="Opera",Gpt=CX+" Mini",xX="Edge",pbe="Microsoft "+xX,gM="Firefox",gbe=gM+" "+kF,c8="Nintendo",l8="PlayStation",mM="Xbox",mbe=SB+" "+r2,ybe=r2+" "+a8,u8="Windows",EX=u8+" Phone",_be="Nokia",bX="Ouya",vbe="Generic",Opt=vbe+" "+r2.toLowerCase(),Ibe=vbe+" "+s8.toLowerCase(),BX="Konqueror",fE="(\\d+(\\.\\d+)?)",wX=new RegExp("Version/"+fE),zpt=new RegExp(mM,"i"),Ypt=new RegExp(l8+" \\w+","i"),Hpt=new RegExp(c8+" \\w+","i"),SX=new RegExp(pM+"|PlayBook|BB10","i"),Vpt={"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"},Kpt=(i,e)=>e&&bg(e,cbe)||function(t){return bg(t,a8)&&!bg(t,VS)&&!bg(t,SB)}(i),Cbe=function(i,e){return e=e||"",bg(i," OPR/")&&bg(i,"Mini")?Gpt:bg(i," OPR/")?CX:SX.test(i)?pM:bg(i,"IE"+r2)||bg(i,"WPDesktop")?fbe:bg(i,Abe)?dbe:bg(i,xX)||bg(i,"Edg/")?pbe:bg(i,"FBIOS")?"Facebook "+r2:bg(i,"UCWEB")||bg(i,"UCBrowser")?"UC Browser":bg(i,"CriOS")?hbe:bg(i,"CrMo")||bg(i,VS)?VS:bg(i,SB)&&bg(i,a8)?mbe:bg(i,"FxiOS")?gbe:bg(i.toLowerCase(),BX.toLowerCase())?BX:Kpt(i,e)?bg(i,r2)?ybe:a8:bg(i,gM)?gM:bg(i,"MSIE")||bg(i,"Trident/")?IX:bg(i,"Gecko")?gM:""},jpt={[fbe]:[new RegExp("rv:"+fE)],[pbe]:[new RegExp(xX+"?\\/"+fE)],[VS]:[new RegExp("("+VS+"|CrMo)\\/"+fE)],[hbe]:[new RegExp("CriOS\\/"+fE)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+fE)],[a8]:[wX],[ybe]:[wX],[CX]:[new RegExp("(Opera|OPR)\\/"+fE)],[gM]:[new RegExp(gM+"\\/"+fE)],[gbe]:[new RegExp("FxiOS\\/"+fE)],[BX]:[new RegExp("Konqueror[:/]?"+fE,"i")],[pM]:[new RegExp(pM+" "+fE),wX],[mbe]:[new RegExp("android\\s"+fE,"i")],[dbe]:[new RegExp(Abe+"\\/"+fE)],[IX]:[new RegExp("(rv:|MSIE )"+fE)],Mozilla:[new RegExp("rv:"+fE)]},Jpt=function(i,e){var t=Cbe(i,e),n=jpt[t];if(ol(n))return null;for(var r=0;r<n.length;r++){var o=n[r],s=i.match(o);if(s)return parseFloat(s[s.length-2])}return null},xbe=[[new RegExp(mM+"; "+mM+" (.*?)[);]","i"),i=>[mM,i&&i[1]||""]],[new RegExp(c8,"i"),[c8,""]],[new RegExp(l8,"i"),[l8,""]],[SX,[pM,""]],[new RegExp(u8,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[EX,""];if(new RegExp(r2).test(e)&&!/IEMobile\b/.test(e))return[u8+" "+r2,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var n=t[1],r=Vpt[n]||"";return/arm/i.test(e)&&(r="RT"),[u8,r]}return[u8,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[kF,e.join(".")]}return[kF,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=ol(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+SB+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+SB+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[SB,e.join(".")]}return[SB,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Upt,""]],[/Linux|debian/i,["Linux",""]]],Ebe=function(i){return Hpt.test(i)?c8:Ypt.test(i)?l8:zpt.test(i)?mM:new RegExp(bX,"i").test(i)?bX:new RegExp("("+EX+"|WPDesktop)","i").test(i)?EX:/iPad/.test(i)?abe:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?lbe:SX.test(i)?pM:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(_be,"i").test(i)?_be:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(r2).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?SB:sbe:SB:new RegExp("(pda|"+r2+")","i").test(i)?Opt:new RegExp(s8,"i").test(i)&&!new RegExp(s8+" pc","i").test(i)?Ibe:""},PF="https?://(.*)",FF=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Wpt=cF(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],FF),QX="<masked>",Zpt=["li_fat_id"];function bbe(i,e,t){if(!lu)return{};var n,r=e?cF([],FF,t||[]):[],o=Bbe(XZ(lu.URL,r,QX),i),s=(n={},Q_(Zpt,function(a){var c=bB.D(a);n[a]=c||null}),n);return MI(s,o)}function Bbe(i,e){var t=Wpt.concat(e||[]),n={};return Q_(t,function(r){var o=_F(i,r);n[r]=o||null}),n}function wbe(i){var e=function(o){return o?o.search(PF+"google.([^/?]*)")===0?"google":o.search(PF+"bing.com")===0?"bing":o.search(PF+"yahoo.com")===0?"yahoo":o.search(PF+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",n={};if(!i3(e)){n.$search_engine=e;var r=lu?_F(lu.referrer,t):"";r.length&&(n.ph_keyword=r)}return n}function Sbe(){return navigator.language||navigator.userLanguage}function Qbe(){return(lu==null?void 0:lu.referrer)||"$direct"}function Mbe(i,e){var t=i?cF([],FF,e||[]):[],n=HE==null?void 0:HE.href.substring(0,1e3);return{r:Qbe().substring(0,1e3),u:n?XZ(n,t,QX):void 0}}function Rbe(i){var e,{r:t,u:n}=i,r={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=uM(t))==null?void 0:e.host};if(n){r.$current_url=n;var o=uM(n);r.$host=o==null?void 0:o.host,r.$pathname=o==null?void 0:o.pathname;var s=Bbe(n);MI(r,s)}if(t){var a=wbe(t);MI(r,a)}return r}function Dbe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Xpt(){try{return new Date().getTimezoneOffset()}catch{return}}function qpt(i,e){if(!VE)return{};var t,n,r,o=i?cF([],FF,e||[]):[],[s,a]=function(c){for(var l=0;l<xbe.length;l++){var[u,A]=xbe[l],d=u.exec(c),h=d&&(n2(A)?A(d,c):A);if(h)return h}return["",""]}(VE);return MI(PZ({$os:s,$os_version:a,$browser:Cbe(VE,navigator.vendor),$device:Ebe(VE),$device_type:(n=VE,r=Ebe(n),r===abe||r===sbe||r==="Kobo"||r==="Kindle Fire"||r===Ibe?s8:r===c8||r===mM||r===l8||r===bX?"Console":r===lbe?"Wearable":r?r2:"Desktop"),$timezone:Dbe(),$timezone_offset:Xpt()}),{$current_url:XZ(HE==null?void 0:HE.href,o,QX),$host:HE==null?void 0:HE.host,$pathname:HE==null?void 0:HE.pathname,$raw_user_agent:VE.length>1e3?VE.substring(0,997)+"...":VE,$browser_version:Jpt(VE,navigator.vendor),$browser_language:Sbe(),$browser_language_prefix:(t=Sbe(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:Mo==null?void 0:Mo.screen.height,$screen_width:Mo==null?void 0:Mo.screen.width,$viewport_height:Mo==null?void 0:Mo.innerHeight,$viewport_width:Mo==null?void 0:Mo.innerWidth,$lib:"web",$lib_version:P5.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var QB=BC("[FeatureFlags]"),MX="$active_feature_flags",yM="$override_feature_flags",Nbe="$feature_flag_payloads",A8="$override_feature_flag_payloads",Tbe="$feature_flag_request_id",kbe=i=>{var e={};for(var[t,n]of lF(i||{}))n&&(e[t]=n);return e},$pt=i=>{var e=i.flags;return e?(i.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var n;return[t,(n=e[t].variant)!==null&&n!==void 0?n:e[t].enabled]})),i.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var n;return(n=e[t].metadata)==null?void 0:n.payload}).map(t=>{var n;return[t,(n=e[t].metadata)==null?void 0:n.payload]}))):QB.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),i},egt=function(i){return i.FeatureFlags="feature_flags",i.Recordings="recordings",i}({});class tgt{constructor(e){this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.$e=!0;else{var e=!this.ke&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Ee({disableFlags:e})}}get hasLoadedFlags(){return this.be}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(zZ),t=this._instance.get_property(yM),n=this._instance.get_property(A8);if(!n&&!t)return e||{};var r=MI({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of o){var a,c,l=r[s],u=t==null?void 0:t[s],A=ol(u)?(a=l==null?void 0:l.enabled)!==null&&a!==void 0&&a:!!u,d=ol(u)?l.variant:typeof u=="string"?u:void 0,h=n==null?void 0:n[s],f=jl({},l,{enabled:A,variant:A?d??(l==null?void 0:l.variant):void 0});A!==(l==null?void 0:l.enabled)&&(f.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(f.original_variant=l==null?void 0:l.variant),h&&(f.metadata=jl({},l==null?void 0:l.metadata,{payload:h,original_payload:l==null||(c=l.metadata)==null?void 0:c.payload})),r[s]=f}return this.me||(QB.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.me=!0),r}getFlagVariants(){var e=this._instance.get_property(cM),t=this._instance.get_property(yM);if(!t)return e||{};for(var n=MI({},e),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.me||(QB.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.me=!0),n}getFlagPayloads(){var e=this._instance.get_property(Nbe),t=this._instance.get_property(A8);if(!t)return e||{};for(var n=MI({},e||{}),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.me||(QB.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.me=!0),n}reloadFeatureFlags(){this.we||this._instance.config.advanced_disable_feature_flags||this.ke||(this.ke=setTimeout(()=>{this.Ee()},5))}Ie(){clearTimeout(this.ke),this.ke=void 0}ensureFlagsLoaded(){this.be||this.ye||this.ke||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.we=e}Ee(e){var t;if(this.Ie(),!this._instance.I())if(this.ye)this.Se=!0;else{var n={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:jl({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(qN)||{}),group_properties:this._instance.get_property(US)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0);var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("api",o+s);r&&(n.timezone=Dbe()),this.ye=!0,this._instance.Pe({method:"POST",url:a,data:n,compression:this._instance.config.disable_compression?void 0:F5.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:c=>{var l,u,A=!0;if(c.statusCode===200&&(this.Se||(this.$anon_distinct_id=void 0),A=!1),this.ye=!1,this.$e||(this.$e=!0,this._instance.Re((u=c.json)!==null&&u!==void 0?u:{})),!n.disable_flags||this.Se)if(this.xe=!A,c.json&&(l=c.json.quotaLimited)!=null&&l.includes(egt.FeatureFlags))QB.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.");else{var d;n.disable_flags||this.receivedFeatureFlags((d=c.json)!==null&&d!==void 0?d:{},A),this.Se&&(this.Se=!1,this.Ee())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this.be||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,o=this._instance.get_property(Tbe)||void 0,s=this._instance.get_property(dF)||{};if((t.send_event||!("send_event"in t))&&(!(e in s)||!s[e].includes(r))){var a,c,l,u,A,d,h,f,y;$1(s[e])?s[e].push(r):s[e]=[r],(a=this._instance.persistence)==null||a.register({[dF]:s});var _=this.getFeatureFlagDetails(e),v={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((l=this._instance.config.bootstrap)==null||(l=l.featureFlagPayloads)==null?void 0:l[e])||null,$used_bootstrap_value:!this.xe};ol(_==null||(u=_.metadata)==null?void 0:u.version)||(v.$feature_flag_version=_.metadata.version);var E,b=(A=_==null||(d=_.reason)==null?void 0:d.description)!==null&&A!==void 0?A:_==null||(h=_.reason)==null?void 0:h.code;b&&(v.$feature_flag_reason=b),_!=null&&(f=_.metadata)!=null&&f.id&&(v.$feature_flag_id=_.metadata.id),ol(_==null?void 0:_.original_variant)&&ol(_==null?void 0:_.original_enabled)||(v.$feature_flag_original_response=ol(_.original_variant)?_.original_enabled:_.original_variant),_!=null&&(y=_.metadata)!=null&&y.original_payload&&(v.$feature_flag_original_payload=_==null||(E=_.metadata)==null?void 0:E.original_payload),this._instance.capture("$feature_flag_called",v)}return n}QB.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var n=this._instance.config.token;this._instance.Pe({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:n},compression:this._instance.config.disable_compression?void 0:F5.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var o,s=(o=r.json)==null?void 0:o.featureFlagPayloads;t((s==null?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this.be||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);QB.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.be=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(s,a,c,l,u){c===void 0&&(c={}),l===void 0&&(l={}),u===void 0&&(u={});var A=$pt(s),d=A.flags,h=A.featureFlags,f=A.featureFlagPayloads;if(h){var y=s.requestId;if($1(h)){QB.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(h)for(var v=0;v<h.length;v++)_[h[v]]=!0;a&&a.register({[MX]:h,[cM]:_})}else{var E=h,b=f,M=d;s.errorsWhileComputingFlags&&(E=jl({},c,E),b=jl({},l,b),M=jl({},u,M)),a&&a.register(jl({[MX]:Object.keys(kbe(E)),[cM]:E||{},[Nbe]:b||{},[zZ]:M||{}},y?{[Tbe]:y}:{}))}}})(e,this._instance.persistence,n,r,o),this.Te(t)}}override(e,t){t===void 0&&(t=!1),QB.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return QB.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(yM),this._instance.persistence.unregister(A8),void this.Te();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.me=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(yM);else if(n.flags)if($1(n.flags)){for(var r={},o=0;o<n.flags.length;o++)r[n.flags[o]]=!0;this._instance.persistence.register({[yM]:r})}else this._instance.persistence.register({[yM]:n.flags})}return"payloads"in n&&(n.payloads===!1?this._instance.persistence.unregister(A8):n.payloads&&this._instance.persistence.register({[A8]:n.payloads})),void this.Te()}this.Te()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.be){var{flags:t,flagVariants:n}=this.Me();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,o=(this._instance.get_property(XN)||[]).find(l=>l.flagKey===e),s={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:s};o&&(a.$early_access_feature_name=o.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var c=jl({},this.getFlagVariants(),{[e]:t});(r=this._instance.persistence)==null||r.register({[MX]:Object.keys(kbe(c)),[cM]:c}),this.Te()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(XN),o=n?"&"+n.map(s=>"stage="+s).join("&"):"";if(r&&!t)return e(r);this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:s=>{var a,c;if(s.json){var l=s.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(XN),(c=this._instance.persistence)==null||c.register({[XN]:l}),e(l)}}})}Me(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}Te(e){var{flags:t,flagVariants:n}=this.Me();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(qN)||{};this._instance.register({[qN]:jl({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(qN)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(US)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(r=>{n[r]=jl({},n[r],e[r]),delete e[r]}),this._instance.register({[US]:jl({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(US)||{};this._instance.register({[US]:jl({},t,{[e]:{}})})}else this._instance.unregister(US)}reset(){this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this.$anon_distinct_id=void 0,this.Ie(),this.me=!1}}var ngt=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class RX{constructor(e,t){this.S=e,this.props={},this.Ce=!1,this.Fe=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.B=this.Oe(e),this.load(),e.debug&&Mu.info("Persistence loaded",e.persistence,jl({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Ae}Oe(e){ngt.indexOf(e.persistence.toLowerCase())===-1&&(Mu.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&N9.O()?N9:t==="localstorage+cookie"&&CF.O()?CF:t==="sessionstorage"&&KC.O()?KC:t==="memory"?kft:t==="cookie"?bB:CF.O()?CF:bB}properties(){var e={};return Q_(this.props,function(t,n){if(n===cM&&tI(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/"+r[o]]=t[r[o]];else a=n,c=!1,(i3(s=pft)?c:Txe&&s.indexOf===Txe?s.indexOf(a)!=-1:(Q_(s,function(l){if(c||(c=l===a))return aF}),c))||(e[n]=t);var s,a,c}),e}load(){if(!this.Ae){var e=this.B.L(this.Fe);e&&(this.props=MI({},e))}}save(){this.Ae||this.B.j(this.Fe,this.props,this.De,this.Le,this.je,this.S.debug)}remove(){this.B.N(this.Fe,!1),this.B.N(this.Fe,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(tI(e)){ol(t)&&(t="None"),this.De=ol(n)?this.Ne:n;var r=!1;if(Q_(e,(o,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==t||(this.props[s]=o,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(tI(e)){this.De=ol(t)?this.Ne:t;var n=!1;if(Q_(e,(r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Ce){var e=bbe(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);aM(PZ(e))||this.register(e),this.Ce=!0}}update_search_keyword(){var e;this.register((e=lu==null?void 0:lu.referrer)?wbe(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Qbe(),$referring_domain:lu!=null&&lu.referrer&&((e=uM(lu.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[KZ]||this.props[jZ]||this.register_once({[hF]:Mbe(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Q_([jZ,KZ],s=>{var a=this.props[s];a&&Q_(a,function(c,l){e["$initial_"+TZ(l)]=c})});var t,n,r=this.props[hF];if(r){var o=(t=Rbe(r),n={},Q_(t,function(s,a){n["$initial_"+TZ(a)]=s}),n);MI(e,o)}return e}safe_merge(e){return Q_(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){if(this.Ne=this.De=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.Oe(e),o=this.props;this.clear(),this.B=r,this.props=o,this.save()}}set_disabled(e){this.Ae=e,this.Ae?this.remove():this.save()}set_cross_subdomain(e){e!==this.Le&&(this.Le=e,this.remove(),this.save())}set_secure(e){e!==this.je&&(this.je=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[WN]||{};n[e]=t,this.props[WN]=n,this.save()}remove_event_timer(e){var t=(this.props[WN]||{})[e];return ol(t)||(delete this.props[WN][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class Pbe{constructor(){this.ze={},this.ze={}}on(e,t){return this.ze[e]||(this.ze[e]=[]),this.ze[e].push(t),()=>{this.ze[e]=this.ze[e].filter(n=>n!==t)}}emit(e,t){for(var n of this.ze[e]||[])n(t);for(var r of this.ze["*"]||[])r(e,t)}}class KS{constructor(e){this.Ue=new Pbe,this.qe=(t,n)=>this.Be(t,n)&&this.He(t,n)&&this.We(t,n),this.Be=(t,n)=>n==null||!n.event||(t==null?void 0:t.event)===(n==null?void 0:n.event),this._instance=e,this.Ge=new Set,this.Je=new Set}init(){var e;if(!ol((e=this._instance)==null?void 0:e.Ve)){var t;(t=this._instance)==null||t.Ve((n,r)=>{this.on(n,r)})}}register(e){var t,n;if(!ol((t=this._instance)==null?void 0:t.Ve)&&(e.forEach(s=>{var a,c;(a=this.Je)==null||a.add(s),(c=s.steps)==null||c.forEach(l=>{var u;(u=this.Ge)==null||u.add((l==null?void 0:l.event)||"")})}),(n=this._instance)!=null&&n.autocapture)){var r,o=new Set;e.forEach(s=>{var a;(a=s.steps)==null||a.forEach(c=>{c!=null&&c.selector&&o.add(c==null?void 0:c.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,t){var n;t!=null&&e.length!=0&&(this.Ge.has(e)||this.Ge.has(t==null?void 0:t.event))&&this.Je&&((n=this.Je)==null?void 0:n.size)>0&&this.Je.forEach(r=>{this.Ke(t,r)&&this.Ue.emit("actionCaptured",r.name)})}Ye(e){this.onAction("actionCaptured",t=>e(t))}Ke(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var n of t.steps)if(this.qe(e,n))return!0;return!1}onAction(e,t){return this.Ue.on(e,t)}He(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!="string"||!KS.Xe(r,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static Xe(e,t,n){switch(n){case"regex":return!!Mo&&fM(e,t);case"exact":return t===e;case"contains":var r=KS.Qe(t).replace(/_/g,".").replace(/%/g,".*");return fM(e,r);default:return!1}}static Qe(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}We(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Ze(e).some(o=>!(t!=null&&t.href&&!KS.Xe(o.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||o.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!KS.Xe(o.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!KS.Xe(o.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact"))))return!1;if(t!=null&&t.selector){var n,r=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(!r||!r.includes(t==null?void 0:t.selector))return!1}return!0}Ze(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}(function(i){return i.Button="button",i.Tab="tab",i.Selector="selector",i})({}),function(i){return i.TopLeft="top_left",i.TopRight="top_right",i.TopCenter="top_center",i.MiddleLeft="middle_left",i.MiddleRight="middle_right",i.MiddleCenter="middle_center",i.Left="left",i.Center="center",i.Right="right",i.NextToTrigger="next_to_trigger",i}({});var DX=function(i){return i.Popover="popover",i.API="api",i.Widget="widget",i.ExternalSurvey="external_survey",i}({});(function(i){return i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link",i})({}),function(i){return i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question",i}({}),function(i){return i.Once="once",i.Recurring="recurring",i.Always="always",i}({});var NX=function(i){return i.SHOWN="survey shown",i.DISMISSED="survey dismissed",i.SENT="survey sent",i}({}),Fbe=function(i){return i.SURVEY_ID="$survey_id",i.SURVEY_NAME="$survey_name",i.SURVEY_RESPONSE="$survey_response",i.SURVEY_ITERATION="$survey_iteration",i.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",i.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",i.SURVEY_SUBMISSION_ID="$survey_submission_id",i.SURVEY_QUESTIONS="$survey_questions",i.SURVEY_COMPLETED="$survey_completed",i}({}),T9=BC("[Surveys]"),TX="seenSurvey_",igt=(i,e)=>{var t="$survey_"+e+"/"+i.id;return i.current_iteration&&i.current_iteration>0&&(t="$survey_"+e+"/"+i.id+"/"+i.current_iteration),t},rgt=[DX.Popover,DX.Widget,DX.API];class ogt{constructor(e){this._instance=e,this.tr=new Map,this.ir=new Map}register(e){var t;ol((t=this._instance)==null?void 0:t.Ve)||(this.er(e),this.rr(e))}rr(e){var t=e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.actions)&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0});t.length!==0&&(this.sr==null&&(this.sr=new KS(this._instance),this.sr.init(),this.sr.Ye(n=>{this.onAction(n)})),t.forEach(n=>{var r,o,s,a,c;n.conditions&&(r=n.conditions)!=null&&r.actions&&(o=n.conditions)!=null&&(o=o.actions)!=null&&o.values&&((s=n.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((a=this.sr)==null||a.register(n.conditions.actions.values),(c=n.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach(l=>{if(l&&l.name){var u=this.ir.get(l.name);u&&u.push(n.id),this.ir.set(l.name,u||[n.id])}}))}))}er(e){var t;e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}).length!==0&&((t=this._instance)==null||t.Ve((n,r)=>{this.onEvent(n,r)}),e.forEach(n=>{var r;(r=n.conditions)==null||(r=r.events)==null||(r=r.values)==null||r.forEach(o=>{if(o&&o.name){var s=this.tr.get(o.name);s&&s.push(n.id),this.tr.set(o.name,s||[n.id])}})}))}onEvent(e,t){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[AF])||[];if(e==="survey shown"&&t&&r.length>0){var o;T9.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var s=t==null||(o=t.properties)==null?void 0:o.$survey_id;if(s){var a=r.indexOf(s);a>=0&&(r.splice(a,1),this.nr(r))}}else this.tr.has(e)&&(T9.info("survey event matched, updating activated surveys",{event:e,surveys:this.tr.get(e)}),this.nr(r.concat(this.tr.get(e)||[])))}onAction(e){var t,n=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[AF])||[];this.ir.has(e)&&this.nr(n.concat(this.ir.get(e)||[]))}nr(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[AF]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[AF];return t||[]}getEventToSurveys(){return this.tr}ar(){return this.sr}}class sgt{constructor(e){this.lr=void 0,this._surveyManager=null,this.ur=!1,this.hr=!1,this.dr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(py(t))return T9.warn("Flags not loaded yet. Not loading surveys.");var n=$1(t);this.lr=n?t.length>0:t,T9.info("flags response received, isSurveysEnabled: "+this.lr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(TX)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this._surveyManager)if(this.hr)T9.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)T9.info("Disabled. Not loading surveys.");else{var e=jh==null?void 0:jh.__PosthogExtensions__;if(e){if(!ol(this.lr)||this._instance.config.advanced_enable_surveys){var t=this.lr||this._instance.config.advanced_enable_surveys;this.hr=!0;try{var n=e.generateSurveys;if(n)return void this.vr(n,t);var r=e.loadExternalDependency;if(!r)return void this.cr("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",o=>{o||!e.generateSurveys?this.cr("Could not load surveys script",o):this.vr(e.generateSurveys,t)})}catch(o){throw this.cr("Error initializing surveys",o),o}finally{this.hr=!1}}}else T9.error("PostHog Extensions not found.")}}vr(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new ogt(this._instance),T9.info("Surveys loaded successfully"),this.pr({isLoaded:!0})}cr(e,t){T9.error(e,t),this.pr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.dr.push(e),this._surveyManager&&this.pr({isLoaded:!0}),()=>{this.dr=this.dr.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return T9.info("Disabled. Not loading surveys."),e([]);var n=this._instance.get_property(YZ);if(n&&!t)return e(n,{isLoaded:!0});if(this.ur)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.ur=!0,this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.ur=!1;var s=r.statusCode;if(s!==200||!r.json){var a="Surveys API could not be loaded, status: "+s;return T9.error(a),e([],{isLoaded:!1,error:a})}var c,l=r.json.surveys||[],u=l.filter(A=>function(d){return!(!d.start_date||d.end_date)}(A)&&(function(d){var h;return!((h=d.conditions)==null||(h=h.events)==null||(h=h.values)==null||!h.length)}(A)||function(d){var h;return!((h=d.conditions)==null||(h=h.actions)==null||(h=h.values)==null||!h.length)}(A)));return u.length>0&&((c=this._surveyEventReceiver)==null||c.register(u)),(o=this._instance.persistence)==null||o.register({[YZ]:l}),e(l,{isLoaded:!0})}})}catch(r){throw this.ur=!1,r}}pr(e){for(var t of this.dr)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){T9.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!py(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);T9.warn("init was not called")}_r(e){var t=null;return this.getSurveys(n=>{var r;t=(r=n.find(o=>o.id===e))!==null&&r!==void 0?r:null}),t}gr(e){if(py(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this._r(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(py(this._surveyManager))return T9.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return py(this._surveyManager)?(T9.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(n=>{this.getSurveys(r=>{var o,s=(o=r.find(c=>c.id===e))!==null&&o!==void 0?o:null;if(s){var a=this.gr(s);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(py(this._surveyManager))T9.warn("init was not called");else{var n=this._r(e);if(n)if(rgt.includes(n.type)){var r=lu==null?void 0:lu.querySelector(t);r?this._surveyManager.renderSurvey(n,r):T9.warn("Survey element not found")}else T9.warn("Surveys of type "+n.type+" cannot be rendered in the app");else T9.warn("Survey not found")}}}var Lbe=BC("[RateLimiter]");class agt{constructor(e){var t,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(s=>{Lbe.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void Lbe.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((n=e.config.rate_limiting)==null?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,n,r;e===void 0&&(e=!1);var o=new Date().getTime(),s=(t=(n=this.instance.persistence)==null?void 0:n.get_property(VZ))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:o};s.tokens+=(o-s.last)/1e3*this.captureEventsPerSecond,s.last=o,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var a=s.tokens<1;return a||e||(s.tokens=Math.max(0,s.tokens-1)),!a||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(r=this.instance.persistence)==null||r.set_property(VZ,s),{isRateLimited:a,remainingTokens:s.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var jS=BC("[RemoteConfig]");class cgt{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=jh._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}mr(e){var t,n;(t=jh.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=jh.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(jS.error("PostHog Extensions not found. Cannot load remote config."),e())}br(e){this._instance.Pe({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return jS.info("Using preloaded remote config",this.remoteConfig),void this.Re(this.remoteConfig);if(this._instance.I())return void jS.warn("Remote config is disabled. Falling back to local config.");this.mr(e=>{if(!e)return jS.info("No config found after loading remote JS config. Falling back to JSON."),void this.br(t=>{this.Re(t)});this.Re(e)})}catch(e){jS.error("Error loading remote config",e)}}Re(e){e?this._instance.config.__preview_remote_config?(this._instance.Re(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):jS.info("__preview_remote_config is disabled. Logging config instead",e):jS.error("Failed to fetch remote config from PostHog.")}}var kX=3e3;class lgt{constructor(e,t){this.yr=!0,this.wr=[],this.Sr=Qb((t==null?void 0:t.flush_interval_ms)||kX,250,5e3,"flush interval",kX),this.$r=e}enqueue(e){this.wr.push(e),this.kr||this.Er()}unload(){this.Ir();var e=this.wr.length>0?this.Pr():{},t=Object.values(e);[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.$r(jl({},n,{transport:"sendBeacon"}))})}enable(){this.yr=!1,this.Er()}Er(){var e=this;this.yr||(this.kr=setTimeout(()=>{if(this.Ir(),this.wr.length>0){var t=this.Pr(),n=function(){var o=t[r],s=new Date().getTime();o.data&&$1(o.data)&&Q_(o.data,a=>{a.offset=Math.abs(a.timestamp-s),delete a.timestamp}),e.$r(o)};for(var r in t)n()}},this.Sr))}Ir(){clearTimeout(this.kr),this.kr=void 0}Pr(){var e={};return Q_(this.wr,t=>{var n,r=t,o=(r?r.batchKey:null)||r.url;ol(e[o])&&(e[o]=jl({},r,{data:[]})),(n=e[o].data)==null||n.push(r.data)}),this.wr=[],e}}var ugt=["retriesPerformedSoFar"];class Agt{constructor(e){this.Rr=!1,this.Tr=3e3,this.wr=[],this._instance=e,this.wr=[],this.Mr=!0,!ol(Mo)&&"onLine"in Mo.navigator&&(this.Mr=Mo.navigator.onLine,Bv(Mo,"online",()=>{this.Mr=!0,this.se()}),Bv(Mo,"offline",()=>{this.Mr=!1}))}get length(){return this.wr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=Gxe(e,ugt);Tx(t)&&t>0&&(n.url=NF(n.url,{retry_count:t})),this._instance.Pe(jl({},n,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(t??0)<10?this.Cr(jl({retriesPerformedSoFar:t},n)):n.callback==null||n.callback(r)}}))}Cr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(s){var a=3e3*Math.pow(2,s),c=a/2,l=Math.min(18e5,a),u=(Math.random()-.5)*(l-c);return Math.ceil(l+u)}(t),r=Date.now()+n;this.wr.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),Mu.warn(o),this.Rr||(this.Rr=!0,this.Fr())}Fr(){this.Or&&clearTimeout(this.Or),this.Or=setTimeout(()=>{this.Mr&&this.wr.length>0&&this.se(),this.Fr()},this.Tr)}se(){var e=Date.now(),t=[],n=this.wr.filter(o=>o.retryAt<e||(t.push(o),!1));if(this.wr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Or&&(clearTimeout(this.Or),this.Or=void 0),this.wr))try{this._instance.Pe(jl({},e,{transport:"sendBeacon"}))}catch(t){Mu.error(t)}this.wr=[]}}class dgt{constructor(e){this.Ar=()=>{var t,n,r,o;this.Dr||(this.Dr={});var s=this.scrollElement(),a=this.scrollY(),c=s?Math.max(0,s.scrollHeight-s.clientHeight):0,l=a+((s==null?void 0:s.clientHeight)||0),u=(s==null?void 0:s.scrollHeight)||0;this.Dr.lastScrollY=Math.ceil(a),this.Dr.maxScrollY=Math.max(a,(t=this.Dr.maxScrollY)!==null&&t!==void 0?t:0),this.Dr.maxScrollHeight=Math.max(c,(n=this.Dr.maxScrollHeight)!==null&&n!==void 0?n:0),this.Dr.lastContentY=l,this.Dr.maxContentY=Math.max(l,(r=this.Dr.maxContentY)!==null&&r!==void 0?r:0),this.Dr.maxContentHeight=Math.max(u,(o=this.Dr.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Dr}resetContext(){var e=this.Dr;return setTimeout(this.Ar,0),e}startMeasuringScrollPosition(){Bv(Mo,"scroll",this.Ar,{capture:!0}),Bv(Mo,"scrollend",this.Ar,{capture:!0}),Bv(Mo,"resize",this.Ar)}scrollElement(){if(!this._instance.config.scroll_root_selector)return Mo==null?void 0:Mo.document.documentElement;var e=$1(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var n=Mo==null?void 0:Mo.document.querySelector(t);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Mo&&(Mo.scrollY||Mo.pageYOffset||Mo.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Mo&&(Mo.scrollX||Mo.pageXOffset||Mo.document.documentElement.scrollLeft)||0}}var hgt=i=>Mbe(i==null?void 0:i.config.mask_personal_data_properties,i==null?void 0:i.config.custom_personal_data_properties);class fgt{constructor(e,t,n,r){this.Lr=o=>{var s=this.jr();if(!s||s.sessionId!==o){var a={sessionId:o,props:this.Nr(this._instance)};this.zr.register({[HZ]:a})}},this._instance=e,this.Ur=t,this.zr=n,this.Nr=r||hgt,this.Ur.onSessionId(this.Lr)}jr(){return this.zr.props[HZ]}getSetOnceProps(){var e,t=(e=this.jr())==null?void 0:e.props;return t?"r"in t?Rbe(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Q_(PZ(this.getSetOnceProps()),(t,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+TZ(n)]=t}),e}}var Ube=BC("[SessionId]");class pgt{constructor(e,t,n){var r;if(this.qr=[],this.Br=(u,A)=>Math.abs(u-A)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.zr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Hr=t||s3,this.Wr=n||s3;var o=this.S.persistence_name||this.S.token,s=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Qb(s,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Gr(),this.Jr="ph_"+o+"_window_id",this.Vr="ph_"+o+"_primary_window_exists",this.Kr()){var a=KC.L(this.Jr),c=KC.L(this.Vr);a&&!c?this.fi=a:KC.N(this.Jr),KC.j(this.Vr,!0)}if((r=this.S.bootstrap)!=null&&r.sessionID)try{var l=(u=>{var A=u.replace(/-/g,"");if(A.length!==32)throw new Error("Not a valid UUID");if(A[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(A.substring(0,12),16)})(this.S.bootstrap.sessionID);this.Yr(this.S.bootstrap.sessionID,new Date().getTime(),l)}catch(u){Ube.error("Invalid sessionID in bootstrap",u)}this.Xr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ol(this.qr)&&(this.qr=[]),this.qr.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.qr=this.qr.filter(t=>t!==e)}}Kr(){return this.S.persistence!=="memory"&&!this.zr.Ae&&KC.O()}Qr(e){e!==this.fi&&(this.fi=e,this.Kr()&&KC.j(this.Jr,e))}Zr(){return this.fi?this.fi:this.Kr()?KC.L(this.Jr):null}Yr(e,t,n){e===this.Ct&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Ct=e,this.zr.register({[uF]:[t,e,n]}))}ts(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.zr.props[uF];return $1(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Yr(null,null,null)}Xr(){Bv(Mo,"beforeunload",()=>{this.Kr()&&KC.N(this.Vr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||new Date().getTime(),[r,o,s]=this.ts(),a=this.Zr(),c=Tx(s)&&s>0&&Math.abs(n-s)>864e5,l=!1,u=!o,A=!e&&this.Br(n,r);u||A||c?(o=this.Hr(),a=this.Wr(),Ube.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:c}}),s=n,l=!0):a||(a=this.Wr(),l=!0);var d=r===0||!e||c?n:r,h=s===0?new Date().getTime():s;return this.Qr(a),this.Yr(o,d,h),e||this.Gr(),l&&this.qr.forEach(f=>f(o,a,l?{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:c}:void 0)),{sessionId:o,windowId:a,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:r}}Gr(){clearTimeout(this.es),this.es=setTimeout(()=>{var[e]=this.ts();this.Br(new Date().getTime(),e)&&this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var ggt=["$set_once","$set"],u3=BC("[SiteApps]");class mgt{constructor(e){this._instance=e,this.rs=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ss(e,t){if(t){var n=this.globalsForEvent(t);this.rs.push(n),this.rs.length>1e3&&(this.rs=this.rs.slice(10))}}get siteAppLoaders(){var e;return(e=jh._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ve(this.ss.bind(this));this.ns=()=>{e(),this.rs=[],this.ns=void 0}}}globalsForEvent(e){var t,n,r,o,s,a,c;if(!e)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],A=this._instance.get_property("$stored_group_properties")||{};for(var[d,h]of Object.entries(A))l[d]={id:u[d],type:d,properties:h};var{$set_once:f,$set:y}=e;return{event:jl({},Gxe(e,ggt),{properties:jl({},e.properties,y?{$set:jl({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},y)}:{},f?{$set_once:jl({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},f)}:{}),elements_chain:(s=(a=e.properties)==null?void 0:a.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(c=e.properties)==null?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var a;!t.errored&&this.rs.length&&(u3.info("Processing "+this.rs.length+" events for site app with id "+e.id),this.rs.forEach(c=>t.processEvent==null?void 0:t.processEvent(c)),t.processedBuffer=!0),Object.values(this.apps).every(c=>c.processedBuffer||c.errored)&&((a=this.ns)==null||a.call(this))},r=!1,o=a=>{t.errored=!a,t.loaded=!0,u3.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:a=>{o(a)}});s&&(t.processEvent=s),r=!0}catch(a){u3.error("Error while initializing PostHog app with config id "+e.id,a),o(!1)}if(r&&t.loaded)try{n()}catch(a){u3.error("Error while processing buffered events PostHog app with config id "+e.id,a),t.errored=!0}}os(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ls(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){u3.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.os(),void this._instance.on("eventCaptured",l=>this.ls(l))):void u3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.ns)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(l){var u;jh["__$$ph_site_app_"+l]=o._instance,(u=jh.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,c,A=>{if(A)return u3.error("Error while initializing PostHog app with config id "+l,A)})};for(var{id:a,url:c}of e.siteApps)s(a)}else u3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var ygt=["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","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Gbe=function(i,e){if(!i)return!1;var t=i.toLowerCase();return ygt.concat(e||[]).some(n=>{var r=n.toLowerCase();return t.indexOf(r)!==-1})},Obe=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&Gbe(t,e))return!0;try{var n=i==null?void 0:i.userAgentData;if(n!=null&&n.brands&&n.brands.some(r=>Gbe(r==null?void 0:r.brand,e)))return!0}catch{}return!!i.webdriver},d8=function(i){return i.US="us",i.EU="eu",i.CUSTOM="custom",i}({}),zbe="i.posthog.com";class _gt{constructor(e){this.us={},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 uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+zbe,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.us[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.us[this.apiHost]=d8.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.us[this.apiHost]=d8.EU:this.us[this.apiHost]=d8.CUSTOM),this.us[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(this.region===d8.CUSTOM)return this.apiHost+t;var n=zbe+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var vgt={icontains:(i,e)=>!!Mo&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!Mo&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!Mo&&fM(e.href,i),not_regex:(i,e)=>!!Mo&&!fM(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i};class Fx{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),t.getWebExperiments(r=>{Fx.hs("retrieved web experiments from the server"),t.ds=new Map,r.forEach(o=>{if(o.feature_flag_key){var s;t.ds&&(Fx.hs("setting flag key ",o.feature_flag_key," to web experiment ",o),(s=t.ds)==null||s.set(o.feature_flag_key,o));var a=t._instance.getFeatureFlag(o.feature_flag_key);nI(a)&&o.variants[a]&&t.vs(o.name,a,o.variants[a].transforms)}else if(o.variants)for(var c in o.variants){var l=o.variants[c];Fx.cs(l)&&t.vs(o.name,c,l.transforms)}})},n)},this._instance=e,this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}onFeatureFlags(e){if(this._is_bot())Fx.hs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(py(this.ds))return this.ds=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Fx.hs("applying feature flags",e),e.forEach(t=>{var n;if(this.ds&&(n=this.ds)!=null&&n.has(t)){var r,o=this._instance.getFeatureFlag(t),s=(r=this.ds)==null?void 0:r.get(t);o&&s!=null&&s.variants[o]&&this.vs(s.name,o,s.variants[o].transforms)}})}}previewWebExperiment(){var e=Fx.getWindowLocation();if(e!=null&&e.search){var t=_F(e==null?void 0:e.search,"__experiment_id"),n=_F(e==null?void 0:e.search,"__experiment_variant");t&&n&&(Fx.hs("previewing web experiments "+t+" && "+n),this.getWebExperiments(r=>{this.fs(parseInt(t),n,r)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var s=o.json.experiments||[];return e(s)}})}fs(e,t,n){var r=n.filter(o=>o.id===e);r&&r.length>0&&(Fx.hs("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.vs(r[0].name,t,r[0].variants[t].transforms))}static cs(e){return!py(e.conditions)&&Fx.ps(e)&&Fx._s(e)}static ps(e){var t;if(py(e.conditions)||py((t=e.conditions)==null?void 0:t.url))return!0;var n,r,o,s=Fx.getWindowLocation();return!!s&&((n=e.conditions)==null||!n.url||vgt[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,s))}static getWindowLocation(){return Mo==null?void 0:Mo.location}static _s(e){var t;if(py(e.conditions)||py((t=e.conditions)==null?void 0:t.utm))return!0;var n=bbe();if(n.utm_source){var r,o,s,a,c,l,u,A,d=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==n.utm_campaign,h=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==n.utm_source,f=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_medium)==n.utm_medium,y=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((A=e.conditions)==null||(A=A.utm)==null?void 0:A.utm_term)==n.utm_term;return d&&f&&y&&h}return!1}static hs(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Mu.info("[WebExperiments] "+e,n)}vs(e,t,n){this._is_bot()?Fx.hs("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?n.forEach(r=>{if(r.selector){var o;Fx.hs("applying transform of variant "+t+" for experiment "+e+" ",r);var s=(o=document)==null?void 0:o.querySelectorAll(r.selector);s==null||s.forEach(a=>{var c=a;r.html&&(c.innerHTML=r.html),r.css&&c.setAttribute("style",r.css)})}}):Fx.hs("Control variants leave the page unmodified.")}_is_bot(){return Sb&&this._instance?Obe(Sb,this._instance.config.custom_blocked_useragents):void 0}}var Igt=BC("[PostHog ExternalIntegrations]"),Cgt={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class xgt{constructor(e){this._instance=e}J(e,t){var n;(n=jh.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,r=>{if(r)return Igt.error("failed to load script",r);t()})}startIfEnabledOrStop(){var e=this,t=function(s){var a,c,l;!r||(a=jh.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[s]||e.J(Cgt[s],()=>{var u;(u=jh.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[s])==null||u.start(e._instance)}),!r&&(c=jh.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[s]&&((l=jh.__PosthogExtensions__)==null||(l=l.integrations)==null||(l=l[s])==null||l.stop())};for(var[n,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;t(n)}}}var h8={},PX=()=>{},_M="posthog",Ybe=!Ppt&&(VE==null?void 0:VE.indexOf("MSIE"))===-1&&(VE==null?void 0:VE.indexOf("Mozilla"))===-1,Hbe=i=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:fft(lu==null?void 0:lu.location),persistence:"localStorage+cookie",persistence_name:"",loaded:PX,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:i!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:i??"unset",debug:HE&&nI(HE==null?void 0:HE.search)&&HE.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(Mo==null||(e=Mo.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",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;Mu.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:kX},error_tracking:{},_onCapture:PX}},Vbe=i=>{var e={};ol(i.process_person)||(e.person_profiles=i.process_person),ol(i.xhr_headers)||(e.request_headers=i.xhr_headers),ol(i.cookie_name)||(e.persistence_name=i.cookie_name),ol(i.disable_cookie)||(e.disable_persistence=i.disable_cookie),ol(i.store_google)||(e.save_campaign_params=i.store_google),ol(i.verbose)||(e.debug=i.verbose);var t=MI({},e,i);return $1(i.property_blacklist)&&(ol(i.property_denylist)?t.property_denylist=i.property_blacklist:$1(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:Mu.error("Invalid value for property_denylist config: "+i.property_denylist)),t};class Egt{constructor(){this.__forceAllowLocalhost=!1}get gs(){return this.__forceAllowLocalhost}set gs(e){Mu.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class LF{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Egt,this.bs=!1,this.version=P5.LIB_VERSION,this.ys=new Pbe,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Hbe(),this.SentryIntegration=Bpt,this.sentryIntegration=e=>function(t,n){var r=qEe(t,n);return{name:XEe,processEvent:o=>r(o)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.ws=!1,this.Ss=null,this.$s=null,this.xs=null,this.featureFlags=new tgt(this),this.toolbar=new Spt(this),this.scrollManager=new dgt(this),this.pageViewManager=new Tpt(this),this.surveys=new sgt(this),this.experiments=new Fx(this),this.exceptions=new Lpt(this),this.rateLimiter=new agt(this),this.requestRouter=new _gt(this),this.consent=new Pft(this),this.externalIntegrations=new xgt(this),this.people={set:(e,t,n)=>{var r=nI(e)?{[e]:t}:e;this.setPersonProperties(r),n==null||n({})},set_once:(e,t,n)=>{var r=nI(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n==null||n({})}},this.on("eventCaptured",e=>Mu.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,t,n){if(n&&n!==_M){var r,o=(r=h8[n])!==null&&r!==void 0?r:new LF;return o._init(e,t,n),h8[n]=o,h8[_M][n]=o,o}return this._init(e,t,n)}_init(e,t,n){var r,o;if(t===void 0&&(t={}),ol(e)||kZ(e))return Mu.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 Mu.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.ks=t,this.Es=[],t.person_profiles&&(this.$s=t.person_profiles),this.set_config(MI({},Hbe(t.defaults),Vbe(t),{name:n,token:e})),this.config.on_xhr_error&&Mu.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:F5.GZipJS;var s=this.Is();this.persistence=new RX(this.config,s),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new RX(jl({},this.config,{persistence:"sessionStorage"}),s);var a=jl({},this.persistence.props),c=jl({},this.sessionPersistence.props);if(this.register({$initialization_time:new Date().toISOString()}),this.Ps=new lgt(E=>this.Rs(E),this.config.request_queue_config),this.Ts=new Agt(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new pgt(this),this.sessionPropsManager=new fgt(this,this.sessionManager,this.persistence)),new Mpt(this).startIfEnabledOrStop(),this.siteApps=new mgt(this),(r=this.siteApps)==null||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Ept(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Sft(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Npt(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Rpt(this),this.exceptionObserver=new Uft(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new CEe(this,Lft),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new $ft(this),this.historyAutocapture.startIfEnabled(),P5.DEBUG=P5.DEBUG||this.config.debug,P5.DEBUG&&Mu.info("Starting in debug mode",{this:this,config:t,thisC:jl({},this.config),p:a,s:c}),((o=t.bootstrap)==null?void 0:o.distinctID)!==void 0){var l,u,A=this.config.get_device_id(s3()),d=(l=t.bootstrap)!=null&&l.isIdentifiedID?A:t.bootstrap.distinctID;this.persistence.set_property(L5,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.Ms()){var h,f,y=Object.keys(((h=t.bootstrap)==null?void 0:h.featureFlags)||{}).filter(E=>{var b;return!((b=t.bootstrap)==null||(b=b.featureFlags)==null||!b[E])}).reduce((E,b)=>{var M;return E[b]=((M=t.bootstrap)==null||(M=M.featureFlags)==null?void 0:M[b])||!1,E},{}),_=Object.keys(((f=t.bootstrap)==null?void 0:f.featureFlagPayloads)||{}).filter(E=>y[E]).reduce((E,b)=>{var M,z;return(M=t.bootstrap)!=null&&(M=M.featureFlagPayloads)!=null&&M[b]&&(E[b]=(z=t.bootstrap)==null||(z=z.featureFlagPayloads)==null?void 0:z[b]),E},{});this.featureFlags.receivedFeatureFlags({featureFlags:y,featureFlagPayloads:_})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:pF,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(s3());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(L5,"anonymous")}return Bv(Mo,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?bpt(this,()=>this.Cs()):this.Cs(),n2(this.config._onCapture)&&this.config._onCapture!==PX&&(Mu.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",E=>this.config._onCapture(E.event,E))),this.config.ip&&Mu.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}Re(e){var t,n,r,o,s,a,c,l;if(!lu||!lu.body)return Mu.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Re(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=bg(e.supportedCompression,F5.GZipJS)?F5.GZipJS:bg(e.supportedCompression,F5.Base64)?F5.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.$s?this.$s:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(s=this.heatmaps)==null||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(a=this.webVitalsAutocapture)==null||a.onRemoteConfig(e),(c=this.exceptionObserver)==null||c.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(l=this.deadClicksAutocapture)==null||l.onRemoteConfig(e)}Cs(){try{this.config.loaded(this)}catch(e){Mu.critical("`loaded` function failed",e)}this.Fs(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Os()},1),new cgt(this).load(),this.featureFlags.flags()}Fs(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this.Ps)==null||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||r3(this.__request_queue,e=>this.Rs(e)),this.__request_queue=[],this.Fs()}_handle_unload(){var e,t;this.config.request_batching?(this.As()&&this.capture("$pageleave"),(e=this.Ps)==null||e.unload(),(t=this.Ts)==null||t.unload()):this.As()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Pe(e){this.__loaded&&(Ybe?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=NF(e.url,{ip:this.config.ip?1:0}),e.headers=jl({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var n,r,o,s=jl({},t);s.timeout=s.timeout||6e4,s.url=NF(s.url,{_:new Date().getTime().toString(),ver:P5.LIB_VERSION,compression:s.compression});var a=(n=s.transport)!==null&&n!==void 0?n:"fetch",c=(r=(o=zxe(o8,l=>l.transport===a))==null?void 0:o.method)!==null&&r!==void 0?r:o8[0].method;if(!c)throw new Error("No available transport method");c(s)})(jl({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(r=this.config).on_request_error)==null||n.call(r,t)),e.callback==null||e.callback(t)}}))))}Rs(e){this.Ts?this.Ts.retriableRequest(e):this.Pe(e)}_execute_array(e){var t,n=[],r=[],o=[];r3(e,a=>{a&&(t=a[0],$1(t)?o.push(a):n2(a)?a.call(this):$1(a)&&t==="alias"?n.push(a):$1(a)&&t.indexOf("capture")!==-1&&n2(this[t])?o.push(a):r.push(a))});var s=function(a,c){r3(a,function(l){if($1(l[0])){var u=c;Q_(l,function(A){u=u[A[0]].apply(u,A.slice(1))})}else this[l[0]].apply(this,l.slice(1))},c)};s(n,this),s(r,this),s(o,this)}Ms(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ps){if(!this.consent.isOptedOut())if(!ol(e)&&nI(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){t!=null&&t.$current_url&&!nI(t==null?void 0:t.$current_url)&&(Mu.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,a=(n==null?void 0:n.timestamp)||s,c=s3(),l={uuid:c,event:e,properties:this.calculateEventProperties(e,t||{},a,c)};o&&(l.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),n!=null&&n.$set&&(l.$set=n==null?void 0:n.$set);var u,A,d=this.Ds(n==null?void 0:n.$set_once);if(d&&(l.$set_once=d),(l=dft(l,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,ol(n==null?void 0:n.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=s),e===NX.DISMISSED||e===NX.SENT){var h=t==null?void 0:t[Fbe.SURVEY_ID],f=t==null?void 0:t[Fbe.SURVEY_ITERATION];localStorage.setItem((A=""+TX+(u={id:h,current_iteration:f}).id,u.current_iteration&&u.current_iteration>0&&(A=""+TX+u.id+"_"+u.current_iteration),A),"true"),l.$set=jl({},l.$set,{[igt({id:h,current_iteration:f},e===NX.SENT?"responded":"dismissed")]:!0})}var y=jl({},l.properties.$set,l.$set);if(aM(y)||this.setPersonPropertiesForFlags(y),!py(this.config.before_send)){var _=this.Ls(l);if(!_)return;l=_}this.ys.emit("eventCaptured",l);var v={method:"POST",url:(r=n==null?void 0:n._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:n==null?void 0:n._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Rs(v):this.Ps.enqueue(v),l}Mu.critical("This capture call is ignored due to client rate limiting.")}}else Mu.error("No event name provided to posthog.capture")}else Mu.uninitializedWarning("posthog.capture")}Ve(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,n,r,o){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var s=o?void 0:this.persistence.remove_event_timer(e),a=jl({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(a.$cookieless_mode=!0),e==="$snapshot"){var c=jl({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=c.distinct_id,(!nI(a.distinct_id)&&!Tx(a.distinct_id)||kZ(a.distinct_id))&&Mu.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,u=qpt(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:A,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,n.getTime());a.$session_id=A,a.$window_id=d}this.sessionPropsManager&&MI(a,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&MI(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(h=this.Ts)==null?void 0:h.length}catch(v){a.$sdk_debug_error_capturing_properties=String(v)}if(this.requestRouter.region===d8.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),a=MI(a,l),e==="$pageview"&&lu&&(a.title=lu.title),!ol(s)){var f=n.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}VE&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=MI({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),$1(this.config.property_denylist)?Q_(this.config.property_denylist,function(v){delete a[v]}):Mu.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(Mu.error("sanitize_properties is deprecated. Use before_send instead"),a=y(a,e));var _=this.js();return a.$process_person_profile=_,_&&!o&&this.Ns("_calculate_event_properties"),a}Ds(e){var t;if(!this.persistence||!this.js()||this.bs)return e;var n=this.persistence.get_initial_props(),r=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),o=MI({},n,r||{},e||{}),s=this.config.sanitize_properties;return s&&(Mu.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),this.bs=!0,aM(o)?void 0:o}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}zs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.ys.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,n){if(!this.__loaded||!this.persistence)return Mu.uninitializedWarning("posthog.identify");if(Tx(e)&&(e=e.toString(),Mu.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Mu.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.');else if(e!==pF){if(this.Ns("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(JN)&&(this.unregister(JN),this.register({distinct_id:e}));var s=(this.persistence.get_property(L5)||"anonymous")==="anonymous";e!==r&&s?(this.persistence.set_property(L5,"identified"),this.setPersonPropertiesForFlags(jl({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.xs=rbe(e,t,n),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(dF))}}else Mu.critical('The string "'+pF+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Mu.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ns("posthog.setPersonProperties")){var n=rbe(this.get_distinct_id(),e,t);this.xs!==n?(this.setPersonPropertiesForFlags(jl({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.xs=n):Mu.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,n){if(e&&t){if(this.Ns("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:jl({},r,{[e]:t})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===t||n||this.reloadFeatureFlags()}}else Mu.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Ns("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,o;if(Mu.info("reset"),!this.__loaded)return Mu.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(L5,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.xs=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:pF,$device_id:null},"");else{var a=this.config.get_device_id(s3());this.register_once({distinct_id:a,$device_id:e?a:s},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&n){var o,s=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!n)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-s,0)}return r}alias(e,t){return e===this.get_property(Yxe)?(Mu.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ns("posthog.alias")?(ol(t)&&(t=this.get_distinct_id()),e!==t?(this.zs(JN,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Mu.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=jl({},this.config);if(tI(e)){var n,r,o,s,a;MI(this.config,Vbe(e));var c=this.Is();(n=this.persistence)==null||n.update_config(this.config,t,c),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new RX(jl({},this.config,{persistence:"sessionStorage"}),c),N9.O()&&N9.D("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(P5.DEBUG=!0,Mu.info("set_config",{config:e,oldConfig:t,newConfig:jl({},this.config)})),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.Us(),(a=this.externalIntegrations)==null||a.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,n={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,o,s,a,c;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),n.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),n.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),n.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),n.event_trigger&&((c=this.sessionRecording)==null||c.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var n=new Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(jl({},qft((r=>r instanceof Error)(e)?{error:e,event:e.message}:{event:e},{syntheticException:n}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:_M;return t!==_M&&(t=_M+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(L5))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(L5))==="identified"}js(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&aM(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[JN])&&((t=this.persistence)==null||(t=t.props)==null||!t[fF]))}As(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.js()||this.Ns("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ns(e){return this.config.person_profiles==="never"?(Mu.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.zs(fF,!0),!0)}Is(){var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default;return this.config.disable_persistence||e&&!!t}Us(){var e,t,n,r,o=this.Is();return((e=this.persistence)==null?void 0:e.Ae)!==o&&((n=this.persistence)==null||n.set_disabled(o)),((t=this.sessionPersistence)==null?void 0:t.Ae)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Us(),(ol(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e==null?void 0:e.captureEventName)!==null&&t!==void 0?t:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Os()}opt_out_capturing(){this.consent.optInOut(!1),this.Us()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Us()}_is_bot(){return Sb?Obe(Sb,this.config.custom_blocked_useragents):void 0}Os(){lu&&(lu.visibilityState==="visible"?this.ws||(this.ws=!0,this.capture("$pageview",{title:lu.title},{send_instantly:!0}),this.Ss&&(lu.removeEventListener("visibilitychange",this.Ss),this.Ss=null)):this.Ss||(this.Ss=this.Os.bind(this),Bv(lu,"visibilitychange",this.Ss)))}debug(e){e===!1?(Mo==null||Mo.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(Mo==null||Mo.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var e,t,n,r,o,s,a,c=this.ks||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Mu.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):(n="advanced_disable_decide",r=!1,o=Mu,s=(t="advanced_disable_flags")in(e=c)&&!ol(e[t]),a=n in e&&!ol(e[n]),s?e[t]:a?(o&&o.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n]):r)}Ls(e){if(py(this.config.before_send))return e;var t=$1(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),py(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return lft(e.event)?Mu.warn(o+". This can cause unexpected behavior."):Mu.info(o),null}n.properties&&!aM(n.properties)||Mu.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;return(e=this.pageViewManager.ce)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}}(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=Aft(i.prototype[e[t]])})(LF,["identify"]);var Kbe,UF=(Kbe=h8[_M]=new LF,function(){function i(){i.done||(i.done=!0,Ybe=!1,Q_(h8,function(e){e._dom_loaded()}))}lu!=null&&lu.addEventListener?lu.readyState==="complete"?i():Bv(lu,"DOMContentLoaded",i,{capture:!1}):Mo&&Mu.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Kbe);!window.location.hostname.includes("localhost")&&!window.location.hostname.includes("127.0.0.1")&&(UF.__loaded||UF.init("phc_htd8AQjSfVEsFCLQMAiUooG4Q0DKBCjqYuQglc9V3Wo",{api_host:"https://postpig.tscircuit.com",person_profiles:"always"}));function bgt(i){const e=String.fromCodePoint(...i);return btoa(e)}var Mb=Uint8Array,Rb=Uint16Array,FX=Int32Array,LX=new Mb([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]),UX=new Mb([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]),jbe=new Mb([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Jbe=function(i,e){for(var t=new Rb(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var r=new FX(t[30]),n=1;n<30;++n)for(var o=t[n];o<t[n+1];++o)r[o]=o-t[n]<<5|n;return{b:t,r}},Wbe=Jbe(LX,2),Bgt=Wbe.b,GX=Wbe.r;Bgt[28]=258,GX[258]=28;for(var wgt=Jbe(UX,0),Zbe=wgt.r,OX=new Rb(32768),tv=0;tv<32768;++tv){var A3=(tv&43690)>>1|(tv&21845)<<1;A3=(A3&52428)>>2|(A3&13107)<<2,A3=(A3&61680)>>4|(A3&3855)<<4,OX[tv]=((A3&65280)>>8|(A3&255)<<8)>>1}for(var f8=function(i,e,t){for(var n=i.length,r=0,o=new Rb(e);r<n;++r)i[r]&&++o[i[r]-1];var s=new Rb(e);for(r=1;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;var a;if(t){a=new Rb(1<<e);var c=15-e;for(r=0;r<n;++r)if(i[r])for(var l=r<<4|i[r],u=e-i[r],A=s[i[r]-1]++<<u,d=A|(1<<u)-1;A<=d;++A)a[OX[A]>>c]=l}else for(a=new Rb(n),r=0;r<n;++r)i[r]&&(a[r]=OX[s[i[r]-1]++]>>15-i[r]);return a},JS=new Mb(288),tv=0;tv<144;++tv)JS[tv]=8;for(var tv=144;tv<256;++tv)JS[tv]=9;for(var tv=256;tv<280;++tv)JS[tv]=7;for(var tv=280;tv<288;++tv)JS[tv]=8;for(var GF=new Mb(32),tv=0;tv<32;++tv)GF[tv]=5;var Sgt=f8(JS,9,0),Qgt=f8(GF,5,0),Xbe=function(i){return(i+7)/8|0},qbe=function(i,e,t){return(t==null||t>i.length)&&(t=i.length),new Mb(i.subarray(e,t))},O5=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8},p8=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8,i[n+2]|=t>>16},zX=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var r=t.length,o=t.slice();if(!r)return{t:n2e,l:0};if(r==1){var s=new Mb(t[0].s+1);return s[t[0].s]=1,{t:s,l:1}}t.sort(function(z,U){return z.f-U.f}),t.push({s:-1,f:25001});var a=t[0],c=t[1],l=0,u=1,A=2;for(t[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=r-1;)a=t[t[l].f<t[A].f?l++:A++],c=t[l!=u&&t[l].f<t[A].f?l++:A++],t[u++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=o[0].s,n=1;n<r;++n)o[n].s>d&&(d=o[n].s);var h=new Rb(d+1),f=YX(t[u-1],h,0);if(f>e){var n=0,y=0,_=f-e,v=1<<_;for(o.sort(function(U,L){return h[L.s]-h[U.s]||U.f-L.f});n<r;++n){var E=o[n].s;if(h[E]>e)y+=v-(1<<f-h[E]),h[E]=e;else break}for(y>>=_;y>0;){var b=o[n].s;h[b]<e?y-=1<<e-h[b]++-1:++n}for(;n>=0&&y;--n){var M=o[n].s;h[M]==e&&(--h[M],++y)}f=e}return{t:new Mb(h),l:f}},YX=function(i,e,t){return i.s==-1?Math.max(YX(i.l,e,t+1),YX(i.r,e,t+1)):e[i.s]=t},$be=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new Rb(++e),n=0,r=i[0],o=1,s=function(c){t[n++]=c},a=1;a<=e;++a)if(i[a]==r&&a!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=i[a]}return{c:t.subarray(0,n),n:e}},g8=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},e2e=function(i,e,t){var n=t.length,r=Xbe(e+2);i[r]=n&255,i[r+1]=n>>8,i[r+2]=i[r]^255,i[r+3]=i[r+1]^255;for(var o=0;o<n;++o)i[r+o+4]=t[o];return(r+4+n)*8},t2e=function(i,e,t,n,r,o,s,a,c,l,u){O5(e,u++,t),++r[256];for(var A=zX(r,15),d=A.t,h=A.l,f=zX(o,15),y=f.t,_=f.l,v=$be(d),E=v.c,b=v.n,M=$be(y),z=M.c,U=M.n,L=new Rb(19),F=0;F<E.length;++F)++L[E[F]&31];for(var F=0;F<z.length;++F)++L[z[F]&31];for(var Y=zX(L,7),G=Y.t,ee=Y.l,j=19;j>4&&!G[jbe[j-1]];--j);var ie=l+5<<3,he=g8(r,JS)+g8(o,GF)+s,ge=g8(r,d)+g8(o,y)+s+14+3*j+g8(L,G)+2*L[16]+3*L[17]+7*L[18];if(c>=0&&ie<=he&&ie<=ge)return e2e(e,u,i.subarray(c,c+l));var le,me,pe,Be;if(O5(e,u,1+(ge<he)),u+=2,ge<he){le=f8(d,h,0),me=d,pe=f8(y,_,0),Be=y;var Re=f8(G,ee,0);O5(e,u,b-257),O5(e,u+5,U-1),O5(e,u+10,j-4),u+=14;for(var F=0;F<j;++F)O5(e,u+3*F,G[jbe[F]]);u+=3*j;for(var De=[E,z],we=0;we<2;++we)for(var Je=De[we],F=0;F<Je.length;++F){var qe=Je[F]&31;O5(e,u,Re[qe]),u+=G[qe],qe>15&&(O5(e,u,Je[F]>>5&127),u+=Je[F]>>12)}}else le=Sgt,me=JS,pe=Qgt,Be=GF;for(var F=0;F<a;++F){var rt=n[F];if(rt>255){var qe=rt>>18&31;p8(e,u,le[qe+257]),u+=me[qe+257],qe>7&&(O5(e,u,rt>>23&31),u+=LX[qe]);var yt=rt&31;p8(e,u,pe[yt]),u+=Be[yt],yt>3&&(p8(e,u,rt>>5&8191),u+=UX[yt])}else p8(e,u,le[rt]),u+=me[rt]}return p8(e,u,le[256]),u+me[256]},Mgt=new FX([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),n2e=new Mb(0),Rgt=function(i,e,t,n,r,o){var s=o.z||i.length,a=new Mb(n+s+5*(1+Math.ceil(s/7e3))+r),c=a.subarray(n,a.length-r),l=o.l,u=(o.r||0)&7;if(e){u&&(c[0]=o.r>>3);for(var A=Mgt[e-1],d=A>>13,h=A&8191,f=(1<<t)-1,y=o.p||new Rb(32768),_=o.h||new Rb(f+1),v=Math.ceil(t/3),E=2*v,b=function(gt){return(i[gt]^i[gt+1]<<v^i[gt+2]<<E)&f},M=new FX(25e3),z=new Rb(288),U=new Rb(32),L=0,F=0,Y=o.i||0,G=0,ee=o.w||0,j=0;Y+2<s;++Y){var ie=b(Y),he=Y&32767,ge=_[ie];if(y[he]=ge,_[ie]=he,ee<=Y){var le=s-Y;if((L>7e3||G>24576)&&(le>423||!l)){u=t2e(i,c,0,M,z,U,F,G,j,Y-j,u),G=L=F=0,j=Y;for(var me=0;me<286;++me)z[me]=0;for(var me=0;me<30;++me)U[me]=0}var pe=2,Be=0,Re=h,De=he-ge&32767;if(le>2&&ie==b(Y-De))for(var we=Math.min(d,le)-1,Je=Math.min(32767,Y),qe=Math.min(258,le);De<=Je&&--Re&&he!=ge;){if(i[Y+pe]==i[Y+pe-De]){for(var rt=0;rt<qe&&i[Y+rt]==i[Y+rt-De];++rt);if(rt>pe){if(pe=rt,Be=De,rt>we)break;for(var yt=Math.min(De,rt-2),wt=0,me=0;me<yt;++me){var mt=Y-De+me&32767,ke=y[mt],Xe=mt-ke&32767;Xe>wt&&(wt=Xe,ge=mt)}}}he=ge,ge=y[he],De+=he-ge&32767}if(Be){M[G++]=268435456|GX[pe]<<18|Zbe[Be];var et=GX[pe]&31,ht=Zbe[Be]&31;F+=LX[et]+UX[ht],++z[257+et],++U[ht],ee=Y+pe,++L}else M[G++]=i[Y],++z[i[Y]]}}for(Y=Math.max(Y,ee);Y<s;++Y)M[G++]=i[Y],++z[i[Y]];u=t2e(i,c,l,M,z,U,F,G,j,Y-j,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=_,o.p=y,o.i=Y,o.w=ee)}else{for(var Y=o.w||0;Y<s+l;Y+=65535){var Bt=Y+65535;Bt>=s&&(c[u/8|0]=l,Bt=s),u=e2e(c,u+1,i.subarray(Y,Bt))}o.i=s}return qbe(a,0,n+Xbe(u)+r)},Dgt=function(){for(var i=new Int32Array(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(t&1&&-306674912)^t>>>1;i[e]=t}return i}(),Ngt=function(){var i=-1;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=Dgt[t&255^e[n]]^t>>>8;i=t},d:function(){return~i}}},Tgt=function(i,e,t,n,r){if(!r&&(r={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),s=new Mb(o.length+i.length);s.set(o),s.set(i,o.length),i=s,r.w=o.length}return Rgt(i,e.level==null?6:e.level,e.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(i.length)))*1.5):20:12+e.mem,t,n,r)},HX=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},kgt=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&HX(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var n=0;n<=t.length;++n)i[n+10]=t.charCodeAt(n)}},Pgt=function(i){return 10+(i.filename?i.filename.length+1:0)};function i2e(i,e){e||(e={});var t=Ngt(),n=i.length;t.p(i);var r=Tgt(i,e,Pgt(e),8),o=r.length;return kgt(r,e),HX(r,o-8,t.d()),HX(r,o-4,n),r}var r2e=typeof TextEncoder<"u"&&new TextEncoder,Fgt=typeof TextDecoder<"u"&&new TextDecoder,Lgt=0;try{Fgt.decode(n2e,{stream:!0}),Lgt=1}catch{}function o2e(i,e){var t;if(r2e)return r2e.encode(i);for(var n=i.length,r=new Mb(i.length+(i.length>>1)),o=0,s=function(l){r[o++]=l},t=0;t<n;++t){if(o+5>r.length){var a=new Mb(o+8+(n-t<<1));a.set(r),r=a}var c=i.charCodeAt(t);c<128||e?s(c):c<2048?(s(192|c>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|i.charCodeAt(++t)&1023,s(240|c>>18),s(128|c>>12&63),s(128|c>>6&63),s(128|c&63)):(s(224|c>>12),s(128|c>>6&63),s(128|c&63))}return qbe(r,0,o)}function Ugt(i,e){const t=JSON.stringify(i),n=i2e(o2e(t));return`https://tscircuit.com/editor?#data:application/gzip;base64,${bgt(n)}`}function o1(...i){return rft(xB(i))}const s2e=i=>i.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),Ggt=wht,a2e=vt.forwardRef(({className:i,...e},t)=>ut.jsx(Ixe,{ref:t,className:o1("rf-inline-flex rf-h-9 rf-items-center rf-justify-center rf-rounded-lg rf-bg-zinc-100 rf-p-1 rf-text-zinc-500 dark:rf-bg-zinc-800 dark:rf-text-zinc-400",i),...e}));a2e.displayName=Ixe.displayName;const vM=vt.forwardRef(({className:i,...e},t)=>ut.jsx(Cxe,{ref:t,className:o1("rf-inline-flex rf-items-center rf-justify-center rf-whitespace-nowrap rf-rounded-md rf-px-3 rf-py-1 rf-text-sm rf-font-medium rf-ring-offset-white rf-transition-all focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 disabled:rf-pointer-events-none disabled:rf-opacity-50 data-[state=active]:rf-bg-white data-[state=active]:rf-text-zinc-950 data-[state=active]:rf-shadow dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=active]:rf-bg-zinc-950 dark:data-[state=active]:rf-text-zinc-50",i),...e}));vM.displayName=Cxe.displayName;const MB=vt.forwardRef(({className:i,...e},t)=>ut.jsx(xxe,{ref:t,className:o1("rf-h-full rf-mt-2 rf-ring-offset-white focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300",i),...e}));MB.displayName=xxe.displayName;var Um;(function(i){i.assertEqual=r=>{};function e(r){}i.assertIs=e;function t(r){throw new Error}i.assertNever=t,i.arrayToEnum=r=>{const o={};for(const s of r)o[s]=s;return o},i.getValidEnumValues=r=>{const o=i.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),s={};for(const a of o)s[a]=r[a];return i.objectValues(s)},i.objectValues=r=>i.objectKeys(r).map(function(o){return r[o]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},i.find=(r,o)=>{for(const s of r)if(o(s))return s},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}i.joinValues=n,i.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Um||(Um={}));var c2e;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(c2e||(c2e={}));const uu=Um.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),d3=i=>{switch(typeof i){case"undefined":return uu.undefined;case"string":return uu.string;case"number":return Number.isNaN(i)?uu.nan:uu.number;case"boolean":return uu.boolean;case"function":return uu.function;case"bigint":return uu.bigint;case"symbol":return uu.symbol;case"object":return Array.isArray(i)?uu.array:i===null?uu.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?uu.promise:typeof Map<"u"&&i instanceof Map?uu.map:typeof Set<"u"&&i instanceof Set?uu.set:typeof Date<"u"&&i instanceof Date?uu.date:uu.object;default:return uu.unknown}},xa=Um.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let RB=class pdt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(o){return o.message},n={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let a=n,c=0;for(;c<s.path.length;){const l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return r(this),n}static assert(e){if(!(e instanceof pdt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Um.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};RB.create=i=>new RB(i);const m8=(i,e)=>{let t;switch(i.code){case xa.invalid_type:i.received===uu.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case xa.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,Um.jsonStringifyReplacer)}`;break;case xa.unrecognized_keys:t=`Unrecognized key(s) in object: ${Um.joinValues(i.keys,", ")}`;break;case xa.invalid_union:t="Invalid input";break;case xa.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Um.joinValues(i.options)}`;break;case xa.invalid_enum_value:t=`Invalid enum value. Expected ${Um.joinValues(i.options)}, received '${i.received}'`;break;case xa.invalid_arguments:t="Invalid function arguments";break;case xa.invalid_return_type:t="Invalid function return type";break;case xa.invalid_date:t="Invalid date";break;case xa.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:Um.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case xa.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case xa.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case xa.custom:t="Invalid input";break;case xa.invalid_intersection_types:t="Intersection results could not be merged";break;case xa.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case xa.not_finite:t="Number must be finite";break;default:t=e.defaultError,Um.assertNever(i)}return{message:t}};let Ogt=m8;function VX(){return Ogt}const KX=i=>{const{data:e,path:t,errorMaps:n,issueData:r}=i,o=[...t,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let a="";const c=n.filter(l=>!!l).slice().reverse();for(const l of c)a=l(s,{data:e,defaultError:a}).message;return{...r,path:o,message:a}};function _l(i,e){const t=VX(),n=KX({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===m8?void 0:m8].filter(r=>!!r)});i.common.issues.push(n)}let Db=class gdt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if(r.status==="aborted")return K0;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const o=await r.key,s=await r.value;n.push({key:o,value:s})}return gdt.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return K0;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}};const K0=Object.freeze({status:"aborted"}),y8=i=>({status:"dirty",value:i}),jE=i=>({status:"valid",value:i}),l2e=i=>i.status==="aborted",u2e=i=>i.status==="dirty",IM=i=>i.status==="valid",OF=i=>typeof Promise<"u"&&i instanceof Promise;var QA;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(QA||(QA={}));let DB=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const A2e=(i,e)=>{if(IM(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new RB(i.common.issues);return this._error=t,this._error}}};function Zf(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:r}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(s,a)=>{const{message:c}=i;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??t??a.defaultError}},description:r}}let Bg=class{get description(){return this._def.description}_getType(e){return d3(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:d3(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Db,ctx:{common:e.parent.common,data:e.data,parsedType:d3(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(OF(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d3(e)},r=this._parseSync({data:e,path:n.path,parent:n});return A2e(n,r)}"~validate"(e){var n,r;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d3(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:t});return IM(o)?{value:o.value}:{issues:t.common.issues}}catch(o){(r=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(o=>IM(o)?{value:o.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d3(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(OF(r)?r:Promise.resolve(r));return A2e(n,o)}refine(e,t){const n=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,o)=>{const s=e(r),a=()=>o.addIssue({code:xa.custom,...n(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new ZS({schema:this,typeName:rh.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return H5.create(this,this._def)}nullable(){return XS.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xM.create(this)}promise(){return v8.create(this,this._def)}or(e){return HF.create([this,e],this._def)}and(e){return VF.create(this,e,this._def)}transform(e){return new ZS({...Zf(this._def),schema:this,typeName:rh.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new JF({...Zf(this._def),innerType:this,defaultValue:t,typeName:rh.ZodDefault})}brand(){return new C2e({typeName:rh.ZodBranded,type:this,...Zf(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new WF({...Zf(this._def),innerType:this,catchValue:t,typeName:rh.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return hmt.create(this,e)}readonly(){return ZF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const zgt=/^c[^\s-]{8,}$/i,Ygt=/^[0-9a-z]+$/,Hgt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vgt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Kgt=/^[a-z0-9_-]{21}$/i,jgt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Jgt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Wgt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zgt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let jX;const Xgt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qgt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$gt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,emt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tmt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nmt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,d2e="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",imt=new RegExp(`^${d2e}$`);function h2e(i){let e="[0-5]\\d";i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`);const t=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function rmt(i){return new RegExp(`^${h2e(i)}$`)}function omt(i){let e=`${d2e}T${h2e(i)}`;const t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function smt(i,e){return!!((e==="v4"||!e)&&Xgt.test(i)||(e==="v6"||!e)&&$gt.test(i))}function amt(i,e){if(!jgt.test(i))return!1;try{const[t]=i.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function cmt(i,e){return!!((e==="v4"||!e)&&qgt.test(i)||(e==="v6"||!e)&&emt.test(i))}let zF=class YP extends Bg{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==uu.string){const o=this._getOrReturnCtx(e);return _l(o,{code:xa.invalid_type,expected:uu.string,received:o.parsedType}),K0}const n=new Db;let r;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(r=this._getOrReturnCtx(e,r),s?_l(r,{code:xa.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&_l(r,{code:xa.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Wgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"email",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")jX||(jX=new RegExp(Zgt,"u")),jX.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"emoji",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Vgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"uuid",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Kgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"nanoid",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")zgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"cuid",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Ygt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"cuid2",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Hgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"ulid",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),_l(r,{validation:"url",code:xa.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"regex",code:xa.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?omt(o).test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?imt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?rmt(o).test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Jgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"duration",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?smt(e.data,o.version)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"ip",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?amt(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"jwt",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?cmt(e.data,o.version)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"cidr",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?tmt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"base64",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?nmt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"base64url",code:xa.invalid_string,message:o.message}),n.dirty()):Um.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:xa.invalid_string,...QA.errToObj(n)})}_addCheck(e){return new YP({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...QA.errToObj(e)})}url(e){return this._addCheck({kind:"url",...QA.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...QA.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...QA.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...QA.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...QA.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...QA.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...QA.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...QA.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...QA.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...QA.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...QA.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...QA.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...QA.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...QA.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...QA.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...QA.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...QA.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...QA.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...QA.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...QA.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...QA.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...QA.errToObj(t)})}nonempty(e){return this.min(1,QA.errToObj(e))}trim(){return new YP({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new YP({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new YP({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};zF.create=i=>new zF({checks:[],typeName:rh.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...Zf(i)});function lmt(i,e){const t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n,o=Number.parseInt(i.toFixed(r).replace(".","")),s=Number.parseInt(e.toFixed(r).replace(".",""));return o%s/10**r}let JX=class uCe extends Bg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==uu.number){const o=this._getOrReturnCtx(e);return _l(o,{code:xa.invalid_type,expected:uu.number,received:o.parsedType}),K0}let n;const r=new Db;for(const o of this._def.checks)o.kind==="int"?Um.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?lmt(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.not_finite,message:o.message}),r.dirty()):Um.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,QA.toString(t))}gt(e,t){return this.setLimit("min",e,!1,QA.toString(t))}lte(e,t){return this.setLimit("max",e,!0,QA.toString(t))}lt(e,t){return this.setLimit("max",e,!1,QA.toString(t))}setLimit(e,t,n,r){return new uCe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:QA.toString(r)}]})}_addCheck(e){return new uCe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:QA.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:QA.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:QA.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:QA.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:QA.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:QA.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:QA.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:QA.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:QA.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Um.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};JX.create=i=>new JX({checks:[],typeName:rh.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...Zf(i)});let f2e=class ACe extends Bg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==uu.bigint)return this._getInvalidInput(e);let n;const r=new Db;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):Um.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return _l(t,{code:xa.invalid_type,expected:uu.bigint,received:t.parsedType}),K0}gte(e,t){return this.setLimit("min",e,!0,QA.toString(t))}gt(e,t){return this.setLimit("min",e,!1,QA.toString(t))}lte(e,t){return this.setLimit("max",e,!0,QA.toString(t))}lt(e,t){return this.setLimit("max",e,!1,QA.toString(t))}setLimit(e,t,n,r){return new ACe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:QA.toString(r)}]})}_addCheck(e){return new ACe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:QA.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:QA.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:QA.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:QA.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:QA.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};f2e.create=i=>new f2e({checks:[],typeName:rh.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...Zf(i)});let WX=class extends Bg{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==uu.boolean){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.boolean,received:n.parsedType}),K0}return jE(e.data)}};WX.create=i=>new WX({typeName:rh.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...Zf(i)});let p2e=class mdt extends Bg{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==uu.date){const o=this._getOrReturnCtx(e);return _l(o,{code:xa.invalid_type,expected:uu.date,received:o.parsedType}),K0}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return _l(o,{code:xa.invalid_date}),K0}const n=new Db;let r;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Um.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new mdt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:QA.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:QA.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};p2e.create=i=>new p2e({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:rh.ZodDate,...Zf(i)});let g2e=class extends Bg{_parse(e){if(this._getType(e)!==uu.symbol){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.symbol,received:n.parsedType}),K0}return jE(e.data)}};g2e.create=i=>new g2e({typeName:rh.ZodSymbol,...Zf(i)});let ZX=class extends Bg{_parse(e){if(this._getType(e)!==uu.undefined){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.undefined,received:n.parsedType}),K0}return jE(e.data)}};ZX.create=i=>new ZX({typeName:rh.ZodUndefined,...Zf(i)});let YF=class extends Bg{_parse(e){if(this._getType(e)!==uu.null){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.null,received:n.parsedType}),K0}return jE(e.data)}};YF.create=i=>new YF({typeName:rh.ZodNull,...Zf(i)});let _8=class extends Bg{constructor(){super(...arguments),this._any=!0}_parse(e){return jE(e.data)}};_8.create=i=>new _8({typeName:rh.ZodAny,...Zf(i)});let CM=class extends Bg{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jE(e.data)}};CM.create=i=>new CM({typeName:rh.ZodUnknown,...Zf(i)});let h3=class extends Bg{_parse(e){const t=this._getOrReturnCtx(e);return _l(t,{code:xa.invalid_type,expected:uu.never,received:t.parsedType}),K0}};h3.create=i=>new h3({typeName:rh.ZodNever,...Zf(i)});let m2e=class extends Bg{_parse(e){if(this._getType(e)!==uu.undefined){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.void,received:n.parsedType}),K0}return jE(e.data)}};m2e.create=i=>new m2e({typeName:rh.ZodVoid,...Zf(i)});let xM=class aZ extends Bg{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==uu.array)return _l(t,{code:xa.invalid_type,expected:uu.array,received:t.parsedType}),K0;if(r.exactLength!==null){const s=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(s||a)&&(_l(t,{code:s?xa.too_big:xa.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(_l(t,{code:xa.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(_l(t,{code:xa.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((s,a)=>r.type._parseAsync(new DB(t,s,t.path,a)))).then(s=>Db.mergeArray(n,s));const o=[...t.data].map((s,a)=>r.type._parseSync(new DB(t,s,t.path,a)));return Db.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new aZ({...this._def,minLength:{value:e,message:QA.toString(t)}})}max(e,t){return new aZ({...this._def,maxLength:{value:e,message:QA.toString(t)}})}length(e,t){return new aZ({...this._def,exactLength:{value:e,message:QA.toString(t)}})}nonempty(e){return this.min(1,e)}};xM.create=(i,e)=>new xM({type:i,minLength:null,maxLength:null,exactLength:null,typeName:rh.ZodArray,...Zf(e)});function EM(i){if(i instanceof z5){const e={};for(const t in i.shape){const n=i.shape[t];e[t]=H5.create(EM(n))}return new z5({...i._def,shape:()=>e})}else return i instanceof xM?new xM({...i._def,type:EM(i.element)}):i instanceof H5?H5.create(EM(i.unwrap())):i instanceof XS?XS.create(EM(i.unwrap())):i instanceof WS?WS.create(i.items.map(e=>EM(e))):i}let z5=class mB extends Bg{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Um.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==uu.object){const l=this._getOrReturnCtx(e);return _l(l,{code:xa.invalid_type,expected:uu.object,received:l.parsedType}),K0}const{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof h3&&this._def.unknownKeys==="strip"))for(const l in r.data)s.includes(l)||a.push(l);const c=[];for(const l of s){const u=o[l],A=r.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new DB(r,A,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof h3){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(l==="strict")a.length>0&&(_l(r,{code:xa.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const A=r.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new DB(r,A,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const A=await u.key,d=await u.value;l.push({key:A,value:d,alwaysSet:u.alwaysSet})}return l}).then(l=>Db.mergeObjectSync(n,l)):Db.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return QA.errToObj,new mB({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var o,s;const r=((s=(o=this._def).errorMap)==null?void 0:s.call(o,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:QA.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new mB({...this._def,unknownKeys:"strip"})}passthrough(){return new mB({...this._def,unknownKeys:"passthrough"})}extend(e){return new mB({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new mB({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:rh.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new mB({...this._def,catchall:e})}pick(e){const t={};for(const n of Um.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new mB({...this._def,shape:()=>t})}omit(e){const t={};for(const n of Um.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new mB({...this._def,shape:()=>t})}deepPartial(){return EM(this)}partial(e){const t={};for(const n of Um.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new mB({...this._def,shape:()=>t})}required(e){const t={};for(const n of Um.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof H5;)o=o._def.innerType;t[n]=o}return new mB({...this._def,shape:()=>t})}keyof(){return v2e(Um.objectKeys(this.shape))}};z5.create=(i,e)=>new z5({shape:()=>i,unknownKeys:"strip",catchall:h3.create(),typeName:rh.ZodObject,...Zf(e)}),z5.strictCreate=(i,e)=>new z5({shape:()=>i,unknownKeys:"strict",catchall:h3.create(),typeName:rh.ZodObject,...Zf(e)}),z5.lazycreate=(i,e)=>new z5({shape:i,unknownKeys:"strip",catchall:h3.create(),typeName:rh.ZodObject,...Zf(e)});let HF=class extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new RB(a.ctx.common.issues));return _l(t,{code:xa.invalid_union,unionErrors:s}),K0}if(t.common.async)return Promise.all(n.map(async o=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(r);{let o;const s=[];for(const c of n){const l={...t,common:{...t.common,issues:[]},parent:null},u=c._parseSync({data:t.data,path:t.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(c=>new RB(c));return _l(t,{code:xa.invalid_union,unionErrors:a}),K0}}get options(){return this._def.options}};HF.create=(i,e)=>new HF({options:i,typeName:rh.ZodUnion,...Zf(e)});const Y5=i=>i instanceof qX?Y5(i.schema):i instanceof ZS?Y5(i.innerType()):i instanceof KF?[i.value]:i instanceof jF?i.options:i instanceof $X?Um.objectValues(i.enum):i instanceof JF?Y5(i._def.innerType):i instanceof ZX?[void 0]:i instanceof YF?[null]:i instanceof H5?[void 0,...Y5(i.unwrap())]:i instanceof XS?[null,...Y5(i.unwrap())]:i instanceof C2e||i instanceof ZF?Y5(i.unwrap()):i instanceof WF?Y5(i._def.innerType):[];let umt=class ydt extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==uu.object)return _l(t,{code:xa.invalid_type,expected:uu.object,received:t.parsedType}),K0;const n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(_l(t,{code:xa.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),K0)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const o of t){const s=Y5(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,o)}}return new ydt({typeName:rh.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Zf(n)})}};function XX(i,e){const t=d3(i),n=d3(e);if(i===e)return{valid:!0,data:i};if(t===uu.object&&n===uu.object){const r=Um.objectKeys(e),o=Um.objectKeys(i).filter(a=>r.indexOf(a)!==-1),s={...i,...e};for(const a of o){const c=XX(i[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(t===uu.array&&n===uu.array){if(i.length!==e.length)return{valid:!1};const r=[];for(let o=0;o<i.length;o++){const s=i[o],a=e[o],c=XX(s,a);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return t===uu.date&&n===uu.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}let VF=class extends Bg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if(l2e(o)||l2e(s))return K0;const a=XX(o.value,s.value);return a.valid?((u2e(o)||u2e(s))&&t.dirty(),{status:t.value,value:a.data}):(_l(n,{code:xa.invalid_intersection_types}),K0)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};VF.create=(i,e,t)=>new VF({left:i,right:e,typeName:rh.ZodIntersection,...Zf(t)});let WS=class _dt extends Bg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==uu.array)return _l(n,{code:xa.invalid_type,expected:uu.array,received:n.parsedType}),K0;if(n.data.length<this._def.items.length)return _l(n,{code:xa.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K0;!this._def.rest&&n.data.length>this._def.items.length&&(_l(n,{code:xa.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...n.data].map((s,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new DB(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Db.mergeArray(t,s)):Db.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new _dt({...this._def,rest:e})}};WS.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new WS({items:i,typeName:rh.ZodTuple,rest:null,...Zf(e)})};let Amt=class dCe extends Bg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==uu.object)return _l(n,{code:xa.invalid_type,expected:uu.object,received:n.parsedType}),K0;const r=[],o=this._def.keyType,s=this._def.valueType;for(const a in n.data)r.push({key:o._parse(new DB(n,a,n.path,a)),value:s._parse(new DB(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Db.mergeObjectAsync(t,r):Db.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof Bg?new dCe({keyType:e,valueType:t,typeName:rh.ZodRecord,...Zf(n)}):new dCe({keyType:zF.create(),valueType:e,typeName:rh.ZodRecord,...Zf(t)})}},y2e=class extends Bg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==uu.map)return _l(n,{code:xa.invalid_type,expected:uu.map,received:n.parsedType}),K0;const r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,c],l)=>({key:r._parse(new DB(n,a,n.path,[l,"key"])),value:o._parse(new DB(n,c,n.path,[l,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of s){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return K0;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const c of s){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return K0;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}}}};y2e.create=(i,e,t)=>new y2e({valueType:e,keyType:i,typeName:rh.ZodMap,...Zf(t)});let _2e=class hCe extends Bg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==uu.set)return _l(n,{code:xa.invalid_type,expected:uu.set,received:n.parsedType}),K0;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(_l(n,{code:xa.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(_l(n,{code:xa.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function s(c){const l=new Set;for(const u of c){if(u.status==="aborted")return K0;u.status==="dirty"&&t.dirty(),l.add(u.value)}return{status:t.value,value:l}}const a=[...n.data.values()].map((c,l)=>o._parse(new DB(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,t){return new hCe({...this._def,minSize:{value:e,message:QA.toString(t)}})}max(e,t){return new hCe({...this._def,maxSize:{value:e,message:QA.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};_2e.create=(i,e)=>new _2e({valueType:i,minSize:null,maxSize:null,typeName:rh.ZodSet,...Zf(e)});let dmt=class cZ extends Bg{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==uu.function)return _l(t,{code:xa.invalid_type,expected:uu.function,received:t.parsedType}),K0;function n(a,c){return KX({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,VX(),m8].filter(l=>!!l),issueData:{code:xa.invalid_arguments,argumentsError:c}})}function r(a,c){return KX({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,VX(),m8].filter(l=>!!l),issueData:{code:xa.invalid_return_type,returnTypeError:c}})}const o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof v8){const a=this;return jE(async function(...c){const l=new RB([]),u=await a._def.args.parseAsync(c,o).catch(h=>{throw l.addIssue(n(c,h)),l}),A=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(A,o).catch(h=>{throw l.addIssue(r(A,h)),l})})}else{const a=this;return jE(function(...c){const l=a._def.args.safeParse(c,o);if(!l.success)throw new RB([n(c,l.error)]);const u=Reflect.apply(s,this,l.data),A=a._def.returns.safeParse(u,o);if(!A.success)throw new RB([r(u,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new cZ({...this._def,args:WS.create(e).rest(CM.create())})}returns(e){return new cZ({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new cZ({args:e||WS.create([]).rest(CM.create()),returns:t||CM.create(),typeName:rh.ZodFunction,...Zf(n)})}},qX=class extends Bg{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};qX.create=(i,e)=>new qX({getter:i,typeName:rh.ZodLazy,...Zf(e)});let KF=class extends Bg{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return _l(t,{received:t.data,code:xa.invalid_literal,expected:this._def.value}),K0}return{status:"valid",value:e.data}}get value(){return this._def.value}};KF.create=(i,e)=>new KF({value:i,typeName:rh.ZodLiteral,...Zf(e)});function v2e(i,e){return new jF({values:i,typeName:rh.ZodEnum,...Zf(e)})}let jF=class fCe extends Bg{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return _l(t,{expected:Um.joinValues(n),received:t.parsedType,code:xa.invalid_type}),K0}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return _l(t,{received:t.data,code:xa.invalid_enum_value,options:n}),K0}return jE(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return fCe.create(e,{...this._def,...t})}exclude(e,t=this._def){return fCe.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};jF.create=v2e;let $X=class extends Bg{_parse(e){const t=Um.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==uu.string&&n.parsedType!==uu.number){const r=Um.objectValues(t);return _l(n,{expected:Um.joinValues(r),received:n.parsedType,code:xa.invalid_type}),K0}if(this._cache||(this._cache=new Set(Um.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=Um.objectValues(t);return _l(n,{received:n.data,code:xa.invalid_enum_value,options:r}),K0}return jE(e.data)}get enum(){return this._def.values}};$X.create=(i,e)=>new $X({values:i,typeName:rh.ZodNativeEnum,...Zf(e)});let v8=class extends Bg{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==uu.promise&&t.common.async===!1)return _l(t,{code:xa.invalid_type,expected:uu.promise,received:t.parsedType}),K0;const n=t.parsedType===uu.promise?t.data:Promise.resolve(t.data);return jE(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};v8.create=(i,e)=>new v8({type:i,typeName:rh.ZodPromise,...Zf(e)});let ZS=class extends Bg{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===rh.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:s=>{_l(n,s),s.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const s=r.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(t.value==="aborted")return K0;const c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?K0:c.status==="dirty"||t.value==="dirty"?y8(c.value):c});{if(t.value==="aborted")return K0;const a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?K0:a.status==="dirty"||t.value==="dirty"?y8(a.value):a}}if(r.type==="refinement"){const s=a=>{const c=r.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?K0:(a.status==="dirty"&&t.dirty(),s(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?K0:(a.status==="dirty"&&t.dirty(),s(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!IM(s))return K0;const a=r.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>IM(s)?Promise.resolve(r.transform(s.value,o)).then(a=>({status:t.value,value:a})):K0);Um.assertNever(r)}};ZS.create=(i,e,t)=>new ZS({schema:i,typeName:rh.ZodEffects,effect:e,...Zf(t)}),ZS.createWithPreprocess=(i,e,t)=>new ZS({schema:e,effect:{type:"preprocess",transform:i},typeName:rh.ZodEffects,...Zf(t)});let H5=class extends Bg{_parse(e){return this._getType(e)===uu.undefined?jE(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};H5.create=(i,e)=>new H5({innerType:i,typeName:rh.ZodOptional,...Zf(e)});let XS=class extends Bg{_parse(e){return this._getType(e)===uu.null?jE(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};XS.create=(i,e)=>new XS({innerType:i,typeName:rh.ZodNullable,...Zf(e)});let JF=class extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===uu.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};JF.create=(i,e)=>new JF({innerType:i,typeName:rh.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Zf(e)});let WF=class extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return OF(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new RB(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new RB(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};WF.create=(i,e)=>new WF({innerType:i,typeName:rh.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Zf(e)});let I2e=class extends Bg{_parse(e){if(this._getType(e)!==uu.nan){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.nan,received:n.parsedType}),K0}return{status:"valid",value:e.data}}};I2e.create=i=>new I2e({typeName:rh.ZodNaN,...Zf(i)});let C2e=class extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},hmt=class vdt extends Bg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?K0:o.status==="dirty"?(t.dirty(),y8(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?K0:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new vdt({in:e,out:t,typeName:rh.ZodPipeline})}},ZF=class extends Bg{_parse(e){const t=this._def.innerType._parse(e),n=r=>(IM(r)&&(r.value=Object.freeze(r.value)),r);return OF(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}};ZF.create=(i,e)=>new ZF({innerType:i,typeName:rh.ZodReadonly,...Zf(e)});function x2e(i,e){const t=typeof i=="function"?i(e):typeof i=="string"?{message:i}:i;return typeof t=="string"?{message:t}:t}function NB(i,e={},t){return i?_8.create().superRefine((n,r)=>{const o=i(n);if(o instanceof Promise)return o.then(s=>{if(!s){const a=x2e(e,n),c=a.fatal??t??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!o){const s=x2e(e,n),a=s.fatal??t??!0;r.addIssue({code:"custom",...s,fatal:a})}}):_8.create()}var rh;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(rh||(rh={}));const Pe=zF.create,Ci=JX.create,go=WX.create,fmt=YF.create,pE=_8.create;CM.create,h3.create;const uo=xM.create,Un=z5.create,Bd=HF.create,f3=umt.create;VF.create,WS.create;const nv=Amt.create,pmt=dmt.create,Sn=KF.create,ya=jF.create,gmt=v8.create;H5.create,XS.create;const mmt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let eq=(i=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(i|=0));for(;i--;)e+=mmt[t[i]&63];return e};var E2e={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1e3,Hz:1}},g:{baseUnit:"g",variants:{kg:1e3,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:.001,Ω:1,kΩ:1e3,KΩ:1e3,kohm:1e3,MΩ:1e6,GΩ:1e9,TΩ:1e12}},V:{baseUnit:"V",variants:{mV:.001,V:1,kV:1e3,KV:1e3,MV:1e6,GV:1e9,TV:1e12}},A:{baseUnit:"A",variants:{µA:1e-6,mA:.001,ma:.001,A:1,kA:1e3,MA:1e6}},F:{baseUnit:"F",variants:{pF:1e-12,nF:1e-9,µF:1e-6,uF:1e-6,mF:.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1e3,L:1e3}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{s:1e3}},mm:{baseUnit:"mm",variants:{nm:1e-6,µm:.001,um:.001,mm:1,cm:10,dm:100,m:1e3,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:.0254}}},tq=new Set;for(const[i,e]of Object.entries(E2e)){tq.add(i);for(const t of Object.keys(e.variants))tq.add(t)}function ymt(i){for(const[e,t]of Object.entries(E2e))if(i in t.variants)return{baseUnit:t.baseUnit,conversionFactor:t.variants[i]};return{baseUnit:i,conversionFactor:1}}var b2e={tera:1e12,T:1e12,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1e3,k:1e3,deci:.1,d:.1,centi:.01,c:.01,milli:.001,m:.001,micro:1e-6,u:1e-6,µ:1e-6,nano:1e-9,n:1e-9,pico:1e-12,p:1e-12},P2=i=>{var a;if(typeof i>"u")return{parsedUnit:null,unitOfValue:null,value:null};if(typeof i=="string"&&i.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(i),parsedUnit:null,unitOfValue:null};if(typeof i=="number")return{value:i,parsedUnit:null,unitOfValue:null};if(typeof i=="object"&&"x"in i&&"y"in i){const{parsedUnit:c,unitOfValue:l}=P2(i.x);return{parsedUnit:c,unitOfValue:l,value:{x:P2(i.x).value,y:P2(i.y).value}}}const t=(a=i.toString().split("").reverse().join("").match(/[^\d\s]+/))==null?void 0:a[0];if(!t)throw new Error(`Could not determine unit: "${i}"`);const n=t.split("").reverse().join(""),r=i.slice(0,-n.length);if(n in b2e&&!tq.has(n)){const c=b2e[n];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*c}}const{baseUnit:o,conversionFactor:s}=ymt(n);return{parsedUnit:n,unitOfValue:o,value:s*Number.parseFloat(r)}},bM=Pe().or(Ci()).transform(i=>P2(i).value),BM=Pe().or(Ci()).transform(i=>P2(i).value).transform(i=>Number.parseFloat(i.toPrecision(12))),nq=Pe().or(Ci()).transform(i=>P2(i).value),qS=Pe().or(Ci()).transform(i=>P2(i).value),on=Pe().or(Ci()).transform(i=>P2(i).value),XF=Pe().or(Ci()).transform(i=>P2(i).value),Fi=on,_mt=Pe().or(Ci()).transform(i=>P2(i).value),vmt=Pe().or(Ci()).transform(i=>P2(i).value),Lx=Pe().or(Ci()).transform(i=>typeof i=="number"?i:i.endsWith("deg")?Number.parseFloat(i.split("deg")[0]):i.endsWith("rad")?Number.parseFloat(i.split("rad")[0])*180/Math.PI:Number.parseFloat(i)),B2e=Ci().or(Pe().endsWith("mAh")).transform(i=>{if(typeof i=="string"){const e=i.replace("mAh",""),t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error("Invalid capacity");return t}return i}).describe("Battery capacity in mAh"),dg=Un({x:Fi,y:Fi}),Imt=dg,wM=Un({x:Fi,y:Fi,z:Fi}),Cmt=wM,iq=Un({width:Ci(),height:Ci()}),ad=i=>Pe().optional().default(()=>`${i}_${eq(10)}`),qF=ya(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),$F=ya(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),k9=Un({type:Sn("source_component"),ftype:Pe().optional(),source_component_id:Pe(),name:Pe(),manufacturer_part_number:Pe().optional(),supplier_part_numbers:nv($F,uo(Pe())).optional(),display_value:Pe().optional(),are_pins_interchangeable:go().optional(),internally_connected_source_port_ids:uo(uo(Pe())).optional(),source_group_id:Pe().optional(),subcircuit_id:Pe().optional()}),rq=k9.extend({ftype:Sn("simple_capacitor"),capacitance:BM,max_voltage_rating:qS.optional(),display_capacitance:Pe().optional(),max_decoupling_trace_length:Fi.optional()}),oq=k9.extend({ftype:Sn("simple_resistor"),resistance:bM,display_resistance:Pe().optional()}),eL=k9.extend({ftype:Sn("simple_diode")}),sq=eL.extend({ftype:Sn("simple_led"),color:Pe().optional(),wavelength:Pe().optional()}),w2e=k9.extend({ftype:Sn("simple_ground")}),aq=k9.extend({ftype:Sn("simple_chip")}),cq=k9.extend({ftype:Sn("simple_power_source"),voltage:qS}),xmt=k9.extend({ftype:Sn("simple_fuse"),current_rating_amps:Ci().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:Ci().describe("Voltage rating in volts, e.g. ±5V would be 5")}),lq=k9.extend({ftype:Sn("simple_battery"),capacity:B2e}),uq=k9.extend({ftype:Sn("simple_inductor"),inductance:nq,max_current_rating:Ci().optional()}),Aq=k9.extend({ftype:Sn("simple_push_button")}),dq=k9.extend({ftype:Sn("simple_potentiometer"),max_resistance:bM}),S2e=k9.extend({ftype:Sn("simple_crystal"),frequency:Ci().describe("Frequency in Hz"),load_capacitance:Ci().optional().describe("Load capacitance in pF")}),hq=k9.extend({ftype:Sn("simple_pin_header"),pin_count:Ci(),gender:ya(["male","female"]).optional().default("male")}),fq=k9.extend({ftype:Sn("simple_resonator"),load_capacitance:BM,equivalent_series_resistance:bM.optional(),frequency:XF}),pq=k9.extend({ftype:Sn("simple_transistor"),transistor_type:ya(["npn","pnp"])}),gq=k9.extend({ftype:Sn("simple_test_point"),footprint_variant:ya(["pad","through_hole"]).optional(),pad_shape:ya(["rect","circle"]).optional(),pad_diameter:Bd([Ci(),Pe()]).optional(),hole_diameter:Bd([Ci(),Pe()]).optional(),width:Bd([Ci(),Pe()]).optional(),height:Bd([Ci(),Pe()]).optional()}),mq=k9.extend({ftype:Sn("simple_mosfet"),channel_type:ya(["n","p"]),mosfet_mode:ya(["enhancement","depletion"])}),yq=k9.extend({ftype:Sn("simple_switch")}),_q=Un({type:Sn("source_project_metadata"),name:Pe().optional(),software_used_string:Pe().optional(),project_url:Pe().optional(),created_at:Pe().datetime().optional()}),Q2e=Un({type:Sn("source_missing_property_error"),source_missing_property_error_id:ad("source_missing_property_error"),source_component_id:Pe(),property_name:Pe(),subcircuit_id:Pe().optional(),error_type:Sn("source_missing_property_error").default("source_missing_property_error"),message:Pe()}).describe("The source code is missing a property"),M2e=Un({type:Sn("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:ad("source_failed_to_create_component_error"),error_type:Sn("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:Pe().optional(),subcircuit_id:Pe().optional(),parent_source_component_id:Pe().optional(),message:Pe(),pcb_center:Un({x:Ci().optional(),y:Ci().optional()}).optional(),schematic_center:Un({x:Ci().optional(),y:Ci().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),vq=Un({type:Sn("source_trace_not_connected"),source_trace_not_connected_id:ad("source_trace_not_connected"),error_type:Sn("source_trace_not_connected").default("source_trace_not_connected"),message:Pe(),subcircuit_id:Pe().optional(),source_group_id:Pe().optional(),source_trace_id:Pe().optional(),connected_source_port_ids:uo(Pe()).optional(),selectors_not_found:uo(Pe()).optional()}).describe("Occurs when a source trace selector does not match any ports"),R2e=Bd([oq,rq,eL,sq,w2e,aq,cq,lq,uq,Aq,dq,S2e,hq,fq,yq,pq,gq,mq,xmt,_q,Q2e,M2e,vq]),D2e=Un({type:Sn("source_port"),pin_number:Ci().optional(),port_hints:uo(Pe()).optional(),name:Pe(),source_port_id:Pe(),source_component_id:Pe(),subcircuit_id:Pe().optional(),subcircuit_connectivity_map_key:Pe().optional()}),N2e=Un({type:Sn("source_trace"),source_trace_id:Pe(),connected_source_port_ids:uo(Pe()),connected_source_net_ids:uo(Pe()),subcircuit_id:Pe().optional(),subcircuit_connectivity_map_key:Pe().optional(),max_length:Ci().optional(),min_trace_thickness:Ci().optional(),display_name:Pe().optional()}),T2e=Un({type:Sn("source_group"),source_group_id:Pe(),subcircuit_id:Pe().optional(),parent_subcircuit_id:Pe().optional(),parent_source_group_id:Pe().optional(),is_subcircuit:go().optional(),name:Pe().optional()}),k2e=Un({type:Sn("source_net"),source_net_id:Pe(),name:Pe(),member_source_group_ids:uo(Pe()),is_power:go().optional(),is_ground:go().optional(),is_digital_signal:go().optional(),is_analog_signal:go().optional(),trace_width:Ci().optional(),subcircuit_id:Pe().optional(),subcircuit_connectivity_map_key:Pe().optional()}),P2e=Un({type:Sn("source_pcb_ground_plane"),source_pcb_ground_plane_id:Pe(),source_group_id:Pe(),source_net_id:Pe(),subcircuit_id:Pe().optional()}).describe("Defines a ground plane in the source domain"),F2e=Un({type:Sn("schematic_box"),schematic_component_id:Pe().optional(),width:Fi,height:Fi,is_dashed:go().default(!1),x:Fi,y:Fi,subcircuit_id:Pe().optional()}).describe("Draws a box on the schematic"),L2e=Un({type:Sn("schematic_path"),schematic_component_id:Pe(),fill_color:ya(["red","blue"]).optional(),is_filled:go().optional(),points:uo(dg),subcircuit_id:Pe().optional()}),U2e=nv(Un({left_margin:on.optional(),right_margin:on.optional(),top_margin:on.optional(),bottom_margin:on.optional()})),G2e=Un({left_size:Ci(),right_size:Ci(),top_size:Ci().optional(),bottom_size:Ci().optional()}),O2e=Un({left_side:Un({pins:uo(Ci()),direction:ya(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:Un({pins:uo(Ci()),direction:ya(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:Un({pins:uo(Ci()),direction:ya(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:Un({pins:uo(Ci()),direction:ya(["left-to-right","right-to-left"]).optional()}).optional()}),z2e=Bd([G2e,O2e]),Y2e=Un({type:Sn("schematic_component"),size:iq,center:dg,source_component_id:Pe(),schematic_component_id:Pe(),pin_spacing:on.optional(),pin_styles:U2e.optional(),box_width:on.optional(),symbol_name:Pe().optional(),port_arrangement:z2e.optional(),port_labels:nv(Pe()).optional(),symbol_display_value:Pe().optional(),subcircuit_id:Pe().optional(),schematic_group_id:Pe().optional()}),H2e=Un({type:Sn("schematic_line"),schematic_component_id:Pe(),x1:Fi,x2:Fi,y1:Fi,y2:Fi,subcircuit_id:Pe().optional()}),V2e=Un({type:Sn("schematic_trace"),schematic_trace_id:Pe(),source_trace_id:Pe(),junctions:uo(Un({x:Ci(),y:Ci()})),edges:uo(Un({from:Un({x:Ci(),y:Ci()}),to:Un({x:Ci(),y:Ci()}),is_crossing:go().optional(),from_schematic_port_id:Pe().optional(),to_schematic_port_id:Pe().optional()})),subcircuit_id:Pe().optional()}),Emt=ya(["center","left","right","top","bottom"]),K2e=Un({type:Sn("schematic_text"),schematic_component_id:Pe().optional(),schematic_text_id:Pe(),text:Pe(),font_size:Ci().default(.18),position:Un({x:Fi,y:Fi}),rotation:Ci().default(0),anchor:Bd([Emt.describe("legacy"),qF]).default("center"),color:Pe().default("#000000"),subcircuit_id:Pe().optional()}),j2e=Un({type:Sn("schematic_port"),schematic_port_id:Pe(),source_port_id:Pe(),schematic_component_id:Pe().optional(),center:dg,facing_direction:ya(["up","down","left","right"]).optional(),distance_from_component_edge:Ci().optional(),side_of_component:ya(["top","bottom","left","right"]).optional(),true_ccw_index:Ci().optional(),pin_number:Ci().optional(),display_pin_label:Pe().optional(),subcircuit_id:Pe().optional(),is_connected:go().optional()}).describe("Defines a port on a schematic component"),J2e=Un({type:Sn("schematic_net_label"),schematic_net_label_id:ad("schematic_net_label"),schematic_trace_id:Pe().optional(),source_trace_id:Pe().optional(),source_net_id:Pe(),center:dg,anchor_position:dg.optional(),anchor_side:ya(["top","bottom","left","right"]),text:Pe(),symbol_name:Pe().optional(),is_movable:go().optional(),subcircuit_id:Pe().optional()}),W2e=Un({type:Sn("schematic_error"),schematic_error_id:Pe(),error_type:Sn("schematic_port_not_found").default("schematic_port_not_found"),message:Pe(),subcircuit_id:Pe().optional()}).describe("Defines a schematic error on the schematic"),Z2e=Un({type:Sn("schematic_layout_error"),schematic_layout_error_id:ad("schematic_layout_error"),error_type:Sn("schematic_layout_error").default("schematic_layout_error"),message:Pe(),source_group_id:Pe(),schematic_group_id:Pe(),subcircuit_id:Pe().optional()}).describe("Error emitted when schematic layout fails for a group"),tL=Un({type:Sn("schematic_debug_object"),label:Pe().optional(),subcircuit_id:Pe().optional()}),X2e=tL.extend({shape:Sn("rect"),center:dg,size:iq}),q2e=tL.extend({shape:Sn("line"),start:dg,end:dg}),$2e=tL.extend({shape:Sn("point"),center:dg}),eBe=f3("shape",[X2e,q2e,$2e]),tBe=Un({type:Sn("schematic_voltage_probe"),schematic_voltage_probe_id:Pe(),position:dg,schematic_trace_id:Pe(),voltage:qS.optional(),subcircuit_id:Pe().optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),Iq=Un({type:Sn("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:ad("schematic_manual_edit_conflict_warning"),warning_type:Sn("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:Pe(),schematic_component_id:Pe(),schematic_group_id:Pe().optional(),subcircuit_id:Pe().optional(),source_component_id:Pe()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),nBe=Un({type:Sn("schematic_group"),schematic_group_id:ad("schematic_group"),source_group_id:Pe(),is_subcircuit:go().optional(),subcircuit_id:Pe().optional(),width:on,height:on,center:dg,schematic_component_ids:uo(Pe()),name:Pe().optional(),description:Pe().optional()}).describe("Defines a group of components on the schematic"),iBe=Un({type:Sn("schematic_table"),schematic_table_id:ad("schematic_table"),anchor_position:dg,column_widths:uo(Fi),row_heights:uo(Fi),cell_padding:Fi.optional(),border_width:Fi.optional(),subcircuit_id:Pe().optional(),schematic_component_id:Pe().optional(),anchor:qF.optional()}).describe("Defines a table on the schematic"),rBe=Un({type:Sn("schematic_table_cell"),schematic_table_cell_id:ad("schematic_table_cell"),schematic_table_id:Pe(),start_row_index:Ci(),end_row_index:Ci(),start_column_index:Ci(),end_column_index:Ci(),text:Pe().optional(),center:dg,width:Fi,height:Fi,horizontal_align:ya(["left","center","right"]).optional(),vertical_align:ya(["top","middle","bottom"]).optional(),font_size:Fi.optional(),subcircuit_id:Pe().optional()}).describe("Defines a cell within a schematic_table"),I8=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],Cq=ya(I8),wg=Cq.or(Un({name:Cq})).transform(i=>typeof i=="string"?i:i.name),SM=ya(["top","bottom"]),oBe=Un({x:Fi,y:Fi,via:go().optional(),via_to_layer:wg.optional()}),bmt=uo(oBe),V5=Un({x:Fi,y:Fi,via:go().optional(),to_layer:wg.optional(),trace_width:Fi.optional()}),sBe=Un({type:Sn("pcb_component"),pcb_component_id:ad("pcb_component"),source_component_id:Pe(),center:dg,layer:wg,rotation:Lx,width:on,height:on,subcircuit_id:Pe().optional(),pcb_group_id:Pe().optional()}).describe("Defines a component on the PCB"),aBe=Un({type:Sn("pcb_hole"),pcb_hole_id:ad("pcb_hole"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:ya(["circle","square"]),hole_diameter:Ci(),x:Fi,y:Fi}),Bmt=aBe.describe("Defines a circular or square hole on the PCB"),cBe=Un({type:Sn("pcb_hole"),pcb_hole_id:ad("pcb_hole"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:Sn("oval"),hole_width:Ci(),hole_height:Ci(),x:Fi,y:Fi}),wmt=cBe.describe("Defines an oval hole on the PCB"),lBe=aBe.or(cBe),Smt=Un({type:Sn("pcb_plated_hole"),shape:Sn("circle"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),outer_diameter:Ci(),hole_diameter:Ci(),x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),Qmt=Un({type:Sn("pcb_plated_hole"),shape:ya(["oval","pill"]),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),outer_width:Ci(),outer_height:Ci(),hole_width:Ci(),hole_height:Ci(),x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),Mmt=Un({type:Sn("pcb_plated_hole"),shape:Sn("circular_hole_with_rect_pad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:Sn("circle"),pad_shape:Sn("rect"),hole_diameter:Ci(),rect_pad_width:Ci(),rect_pad_height:Ci(),x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),Rmt=Un({type:Sn("pcb_plated_hole"),shape:Sn("pill_hole_with_rect_pad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:Sn("pill"),pad_shape:Sn("rect"),hole_width:Ci(),hole_height:Ci(),rect_pad_width:Ci(),rect_pad_height:Ci(),x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),Dmt=Un({type:Sn("pcb_plated_hole"),shape:Sn("rotated_pill_hole_with_rect_pad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:Sn("rotated_pill"),pad_shape:Sn("rect"),hole_width:Ci(),hole_height:Ci(),hole_ccw_rotation:Lx,rect_pad_width:Ci(),rect_pad_height:Ci(),rect_ccw_rotation:Lx,x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),uBe=Bd([Smt,Qmt,Mmt,Rmt,Dmt]),ABe=Un({type:Sn("pcb_port"),pcb_port_id:ad("pcb_port"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),source_port_id:Pe(),pcb_component_id:Pe(),x:Fi,y:Fi,layers:uo(wg)}).describe("Defines a port on the PCB"),Nmt=Un({type:Sn("pcb_smtpad"),shape:Sn("circle"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,radius:Ci(),layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),Tmt=Un({type:Sn("pcb_smtpad"),shape:Sn("rect"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),kmt=Un({type:Sn("pcb_smtpad"),shape:Sn("rotated_rect"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),ccw_rotation:Lx,layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),dBe=Un({type:Sn("pcb_smtpad"),shape:Sn("pill"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),radius:Ci(),layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),Pmt=Un({type:Sn("pcb_smtpad"),shape:Sn("rotated_pill"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),radius:Ci(),ccw_rotation:Lx,layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),Fmt=Un({type:Sn("pcb_smtpad"),shape:Sn("polygon"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),points:uo(dg),layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),hBe=f3("shape",[Nmt,Tmt,kmt,Pmt,dBe,Fmt]).describe("Defines an SMT pad on the PCB"),Lmt=Un({type:Sn("pcb_solder_paste"),shape:Sn("circle"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,radius:Ci(),layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),Umt=Un({type:Sn("pcb_solder_paste"),shape:Sn("rect"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),Gmt=Un({type:Sn("pcb_solder_paste"),shape:Sn("pill"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),radius:Ci(),layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),Omt=Un({type:Sn("pcb_solder_paste"),shape:Sn("rotated_rect"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),ccw_rotation:Fi,layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),zmt=Un({type:Sn("pcb_solder_paste"),shape:Sn("oval"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),fBe=Bd([Lmt,Umt,Gmt,Omt,zmt]).describe("Defines solderpaste on the PCB"),pBe=Un({type:Sn("pcb_text"),pcb_text_id:ad("pcb_text"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),text:Pe(),center:dg,layer:wg,width:on,height:on,lines:Ci(),align:ya(["bottom-left"])}).describe("Defines text on the PCB"),gBe=Un({route_type:Sn("wire"),x:Fi,y:Fi,width:Fi,start_pcb_port_id:Pe().optional(),end_pcb_port_id:Pe().optional(),layer:wg}),mBe=Un({route_type:Sn("via"),x:Fi,y:Fi,hole_diameter:Fi.optional(),outer_diameter:Fi.optional(),from_layer:Pe(),to_layer:Pe()}),xq=Bd([gBe,mBe]),yBe=Un({type:Sn("pcb_trace"),source_trace_id:Pe().optional(),pcb_component_id:Pe().optional(),pcb_trace_id:ad("pcb_trace"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),route_thickness_mode:ya(["constant","interpolated"]).default("constant").optional(),route_order_index:Ci().optional(),should_round_corners:go().optional(),trace_length:Ci().optional(),route:uo(xq)}).describe("Defines a trace on the PCB"),_Be=Un({type:Sn("pcb_trace_error"),pcb_trace_error_id:ad("pcb_trace_error"),error_type:Sn("pcb_trace_error").default("pcb_trace_error"),message:Pe(),center:dg.optional(),pcb_trace_id:Pe(),source_trace_id:Pe(),pcb_component_ids:uo(Pe()),pcb_port_ids:uo(Pe()),subcircuit_id:Pe().optional()}).describe("Defines a trace error on the PCB"),vBe=Un({type:Sn("pcb_port_not_matched_error"),pcb_error_id:ad("pcb_error"),error_type:Sn("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),message:Pe(),pcb_component_ids:uo(Pe()),subcircuit_id:Pe().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),IBe=Un({type:Sn("pcb_via"),pcb_via_id:ad("pcb_via"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,outer_diameter:Fi.default("0.6mm"),hole_diameter:Fi.default("0.25mm"),from_layer:wg.optional(),to_layer:wg.optional(),layers:uo(wg),pcb_trace_id:Pe().optional()}).describe("Defines a via on the PCB"),CBe=Un({type:Sn("pcb_board"),pcb_board_id:ad("pcb_board"),is_subcircuit:go().optional(),subcircuit_id:Pe().optional(),width:on,height:on,center:dg,thickness:on.optional().default(1.4),num_layers:Ci().optional().default(4),outline:uo(dg).optional(),material:ya(["fr4","fr1"]).default("fr4")}).describe("Defines the board outline of the PCB"),xBe=Un({type:Sn("pcb_placement_error"),pcb_placement_error_id:ad("pcb_placement_error"),error_type:Sn("pcb_placement_error").default("pcb_placement_error"),message:Pe(),subcircuit_id:Pe().optional()}).describe("Defines a placement error on the PCB"),EBe=Un({type:Sn("pcb_trace_hint"),pcb_trace_hint_id:ad("pcb_trace_hint"),pcb_port_id:Pe(),pcb_component_id:Pe(),route:uo(V5),subcircuit_id:Pe().optional()}).describe("A hint that can be used during generation of a PCB trace"),bBe=Un({type:Sn("pcb_silkscreen_line"),pcb_silkscreen_line_id:ad("pcb_silkscreen_line"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),stroke_width:Fi.default("0.1mm"),x1:Fi,y1:Fi,x2:Fi,y2:Fi,layer:SM}).describe("Defines a silkscreen line on the PCB"),BBe=Un({type:Sn("pcb_silkscreen_path"),pcb_silkscreen_path_id:ad("pcb_silkscreen_path"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),layer:SM,route:uo(dg),stroke_width:on}).describe("Defines a silkscreen path on the PCB"),wBe=Un({type:Sn("pcb_silkscreen_text"),pcb_silkscreen_text_id:ad("pcb_silkscreen_text"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),font:Sn("tscircuit2024").default("tscircuit2024"),font_size:Fi.default("0.2mm"),pcb_component_id:Pe(),text:Pe(),ccw_rotation:Ci().optional(),layer:wg,is_mirrored:go().default(!1).optional(),anchor_position:dg.default({x:0,y:0}),anchor_alignment:qF.default("center")}).describe("Defines silkscreen text on the PCB"),SBe=Un({type:Sn("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:ad("pcb_silkscreen_rect"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,width:on,height:on,layer:wg,stroke_width:on.default("1mm"),is_filled:go().default(!0).optional(),has_stroke:go().optional(),is_stroke_dashed:go().optional()}).describe("Defines a silkscreen rect on the PCB"),QBe=Un({type:Sn("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:ad("pcb_silkscreen_circle"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,radius:on,layer:SM,stroke_width:on.default("1mm")}).describe("Defines a silkscreen circle on the PCB"),MBe=Un({type:Sn("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:ad("pcb_silkscreen_oval"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,radius_x:Fi,radius_y:Fi,layer:SM}).describe("Defines a silkscreen oval on the PCB"),RBe=Un({type:Sn("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:ad("pcb_fabrication_note_text"),subcircuit_id:Pe().optional(),pcb_group_id:Pe().optional(),font:Sn("tscircuit2024").default("tscircuit2024"),font_size:Fi.default("1mm"),pcb_component_id:Pe(),text:Pe(),layer:SM,anchor_position:dg.default({x:0,y:0}),anchor_alignment:ya(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:Pe().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),DBe=Un({type:Sn("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:ad("pcb_fabrication_note_path"),pcb_component_id:Pe(),subcircuit_id:Pe().optional(),layer:wg,route:uo(dg),stroke_width:on,color:Pe().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),NBe=Un({type:Sn("pcb_footprint_overlap_error"),pcb_error_id:ad("pcb_error"),error_type:Sn("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),message:Pe(),pcb_smtpad_ids:uo(Pe()).optional(),pcb_plated_hole_ids:uo(Pe()).optional(),pcb_hole_ids:uo(Pe()).optional(),pcb_keepout_ids:uo(Pe()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),TBe=Un({type:Sn("pcb_keepout"),shape:Sn("rect"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,width:Fi,height:Fi,pcb_keepout_id:Pe(),layers:uo(Pe()),description:Pe().optional()}).or(Un({type:Sn("pcb_keepout"),shape:Sn("circle"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,radius:Fi,pcb_keepout_id:Pe(),layers:uo(Pe()),description:Pe().optional()})),Eq=Un({type:Sn("pcb_cutout"),pcb_cutout_id:ad("pcb_cutout"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional()}),kBe=Eq.extend({shape:Sn("rect"),center:dg,width:on,height:on,rotation:Lx.optional()}),PBe=Eq.extend({shape:Sn("circle"),center:dg,radius:on}),FBe=Eq.extend({shape:Sn("polygon"),points:uo(dg)}),LBe=f3("shape",[kBe,PBe,FBe]).describe("Defines a cutout on the PCB, removing board material."),UBe=Un({type:Sn("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:ad("pcb_missing_footprint_error"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),error_type:Sn("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:Pe(),message:Pe()}).describe("Defines a missing footprint error on the PCB"),GBe=Un({type:Sn("pcb_group"),pcb_group_id:ad("pcb_group"),source_group_id:Pe(),is_subcircuit:go().optional(),subcircuit_id:Pe().optional(),width:on,height:on,center:dg,pcb_component_ids:uo(Pe()),name:Pe().optional(),description:Pe().optional(),layout_mode:Pe().optional(),autorouter_configuration:Un({trace_clearance:on}).optional(),autorouter_used_string:Pe().optional()}).describe("Defines a group of components on the PCB"),OBe=Un({type:Sn("pcb_autorouting_error"),pcb_error_id:ad("pcb_autorouting_error"),error_type:Sn("pcb_autorouting_error").default("pcb_autorouting_error"),message:Pe(),subcircuit_id:Pe().optional()}).describe("The autorouting has failed to route a portion of the board"),bq=Un({type:Sn("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:ad("pcb_manual_edit_conflict_warning"),warning_type:Sn("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:Pe(),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),source_component_id:Pe()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),zBe=Un({type:Sn("pcb_breakout_point"),pcb_breakout_point_id:ad("pcb_breakout_point"),pcb_group_id:Pe(),subcircuit_id:Pe().optional(),source_trace_id:Pe().optional(),source_port_id:Pe().optional(),source_net_id:Pe().optional(),x:Fi,y:Fi}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),YBe=Un({type:Sn("pcb_ground_plane"),pcb_ground_plane_id:ad("pcb_ground_plane"),source_pcb_ground_plane_id:Pe(),source_net_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional()}).describe("Defines a ground plane on the PCB"),HBe=Un({type:Sn("pcb_ground_plane_region"),pcb_ground_plane_region_id:ad("pcb_ground_plane_region"),pcb_ground_plane_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),layer:wg,points:uo(dg)}).describe("Defines a polygon region of a ground plane"),VBe=Un({type:Sn("pcb_thermal_spoke"),pcb_thermal_spoke_id:ad("pcb_thermal_spoke"),pcb_ground_plane_id:Pe(),shape:Pe(),spoke_count:Ci(),spoke_thickness:Fi,spoke_inner_diameter:Fi,spoke_outer_diameter:Fi,pcb_plated_hole_id:Pe().optional(),subcircuit_id:Pe().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),KBe=Un({type:Sn("cad_component"),cad_component_id:Pe(),pcb_component_id:Pe(),source_component_id:Pe(),position:wM,rotation:wM.optional(),size:wM.optional(),layer:wg.optional(),subcircuit_id:Pe().optional(),footprinter_string:Pe().optional(),model_obj_url:Pe().optional(),model_stl_url:Pe().optional(),model_3mf_url:Pe().optional(),model_jscad:pE().optional()}).describe("Defines a component on the PCB"),jBe=Un({type:Sn("simulation_voltage_source"),simulation_voltage_source_id:ad("simulation_voltage_source"),positive_source_port_id:Pe(),negative_source_port_id:Pe(),voltage:qS}).describe("Defines a voltage source for simulation"),JBe=Bd([N2e,D2e,R2e,k2e,T2e,aq,rq,eL,sq,oq,cq,lq,uq,hq,fq,yq,pq,gq,mq,dq,Aq,P2e,_q,vq,sBe,lBe,UBe,bq,uBe,TBe,ABe,pBe,yBe,IBe,hBe,fBe,CBe,GBe,EBe,bBe,BBe,wBe,SBe,QBe,MBe,_Be,xBe,vBe,DBe,RBe,OBe,NBe,zBe,LBe,YBe,HBe,VBe,F2e,K2e,H2e,Y2e,j2e,V2e,L2e,W2e,Z2e,J2e,eBe,tBe,Iq,nBe,iBe,rBe,KBe,jBe]),nL=JBe;const Bq=Object.freeze(Object.defineProperty({__proto__:null,all_layers:I8,any_circuit_element:JBe,any_soup_element:nL,any_source_component:R2e,battery_capacity:B2e,cad_component:KBe,capacitance:BM,current:_mt,distance:Fi,frequency:XF,getZodPrefixedIdWithDefault:ad,inductance:nq,layer_ref:wg,layer_string:Cq,length:on,ninePointAnchor:qF,pcb_autorouting_error:OBe,pcb_board:CBe,pcb_breakout_point:zBe,pcb_component:sBe,pcb_cutout:LBe,pcb_cutout_circle:PBe,pcb_cutout_polygon:FBe,pcb_cutout_rect:kBe,pcb_fabrication_note_path:DBe,pcb_fabrication_note_text:RBe,pcb_footprint_overlap_error:NBe,pcb_ground_plane:YBe,pcb_ground_plane_region:HBe,pcb_group:GBe,pcb_hole:lBe,pcb_hole_circle_or_square_shape:Bmt,pcb_hole_oval_shape:wmt,pcb_keepout:TBe,pcb_manual_edit_conflict_warning:bq,pcb_missing_footprint_error:UBe,pcb_placement_error:xBe,pcb_plated_hole:uBe,pcb_port:ABe,pcb_port_not_matched_error:vBe,pcb_route_hint:oBe,pcb_route_hints:bmt,pcb_silkscreen_circle:QBe,pcb_silkscreen_line:bBe,pcb_silkscreen_oval:MBe,pcb_silkscreen_path:BBe,pcb_silkscreen_rect:SBe,pcb_silkscreen_text:wBe,pcb_smtpad:hBe,pcb_smtpad_pill:dBe,pcb_solder_paste:fBe,pcb_text:pBe,pcb_thermal_spoke:VBe,pcb_trace:yBe,pcb_trace_error:_Be,pcb_trace_hint:EBe,pcb_trace_route_point:xq,pcb_trace_route_point_via:mBe,pcb_trace_route_point_wire:gBe,pcb_via:IBe,point:dg,point3:wM,port_arrangement:z2e,position:Imt,position3:Cmt,resistance:bM,rotation:Lx,route_hint_point:V5,schematic_box:F2e,schematic_component:Y2e,schematic_component_port_arrangement_by_sides:O2e,schematic_component_port_arrangement_by_size:G2e,schematic_debug_line:q2e,schematic_debug_object:eBe,schematic_debug_object_base:tL,schematic_debug_point:$2e,schematic_debug_rect:X2e,schematic_error:W2e,schematic_group:nBe,schematic_layout_error:Z2e,schematic_line:H2e,schematic_manual_edit_conflict_warning:Iq,schematic_net_label:J2e,schematic_path:L2e,schematic_pin_styles:U2e,schematic_port:j2e,schematic_table:iBe,schematic_table_cell:rBe,schematic_text:K2e,schematic_trace:V2e,schematic_voltage_probe:tBe,simulation_voltage_source:jBe,size:iq,source_component_base:k9,source_failed_to_create_component_error:M2e,source_group:T2e,source_missing_property_error:Q2e,source_net:k2e,source_pcb_ground_plane:P2e,source_port:D2e,source_project_metadata:_q,source_simple_battery:lq,source_simple_capacitor:rq,source_simple_chip:aq,source_simple_crystal:S2e,source_simple_diode:eL,source_simple_ground:w2e,source_simple_inductor:uq,source_simple_led:sq,source_simple_mosfet:mq,source_simple_pin_header:hq,source_simple_potentiometer:dq,source_simple_power_source:cq,source_simple_push_button:Aq,source_simple_resistor:oq,source_simple_resonator:fq,source_simple_switch:yq,source_simple_test_point:gq,source_simple_transistor:pq,source_trace:N2e,source_trace_not_connected:vq,supplier_name:$F,time:vmt,visible_layer:SM,voltage:qS},Symbol.toStringTag,{value:"Module"}));function Li(i,e){return Array.isArray(e)?[i.a*e[0]+i.c*e[1]+i.e,i.b*e[0]+i.d*e[1]+i.f]:{x:i.a*e.x+i.c*e.y+i.e,y:i.b*e.x+i.d*e.y+i.f}}function Ymt(i,e){return e.map(t=>Li(i,t))}function WBe(i){return{a:parseFloat(i.a),b:parseFloat(i.b),c:parseFloat(i.c),d:parseFloat(i.d),e:parseFloat(i.e),f:parseFloat(i.f)}}const Hmt=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function wq(i){const e=i.match(Hmt);if(e===null||e.length<7)throw new Error(`'${i}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function Oy(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function F2(i){const{a:e,b:t,c:n,d:r,e:o,f:s}=i,a=e*r-t*n;return{a:r/a,b:t/-a,c:n/-a,d:e/a,e:(r*o-n*s)/-a,f:(t*o-e*s)/a}}function C8(i){return typeof i>"u"}function QM(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Vmt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Kmt(i){return Vmt(i)&&"a"in i&&QM(i.a)&&"b"in i&&QM(i.b)&&"c"in i&&QM(i.c)&&"d"in i&&QM(i.d)&&"e"in i&&QM(i.e)&&"f"in i&&QM(i.f)}function wd(i,e=0){return{a:1,c:0,e:i,b:0,d:1,f:e}}function TB(...i){i=Array.isArray(i[0])?i[0]:i;const e=(t,n)=>({a:t.a*n.a+t.c*n.b,c:t.a*n.c+t.c*n.d,e:t.a*n.e+t.c*n.f+t.e,b:t.b*n.a+t.d*n.b,d:t.b*n.c+t.d*n.d,f:t.b*n.e+t.d*n.f+t.f});switch(i.length){case 0:throw new Error("no matrices provided");case 1:return i[0];case 2:return e(i[0],i[1]);default:{const[t,n,...r]=i,o=e(t,n);return TB(o,...r)}}}function Xu(...i){return TB(...i)}const{cos:jmt,sin:Jmt,PI:Wmt}=Math;function gE(i,e,t){const n=jmt(i),r=Jmt(i),o={a:n,c:-r,e:0,b:r,d:n,f:0};return C8(e)||C8(t)?o:TB([wd(e,t),o,wd(-e,-t)])}function Sq(i,e=void 0,t=void 0){return gE(i*Wmt/180,e,t)}function P9(i,e=void 0,t=void 0,n=void 0){C8(e)&&(e=i);const r={a:i,c:0,e:0,b:0,d:e,f:0};return C8(t)||C8(n)?r:TB([wd(t,n),r,wd(-t,-n)])}function ZBe(i,e){return{a:1,c:i,e:0,b:e,d:1,f:0}}const{tan:XBe}=Math;function qBe(i,e){return{a:1,c:XBe(i),e:0,b:XBe(e),d:1,f:0}}function Qq(i,e){return qBe(i*Math.PI/180,e*Math.PI/180)}function Zmt(i){return p3(i)}function $Be(i){return p3(i)}function p3(i){return`matrix(${i.a},${i.b},${i.c},${i.d},${i.e},${i.f})`}function e5e(i,e=1e10){return{a:Math.round(i.a*e)/e,b:Math.round(i.b*e)/e,c:Math.round(i.c*e)/e,d:Math.round(i.d*e)/e,e:Math.round(i.e*e)/e,f:Math.round(i.f*e)/e}}function t5e(i,e){const t=i[0].x!=null?i[0].x:i[0][0],n=i[0].y!=null?i[0].y:i[0][1],r=e[0].x!=null?e[0].x:e[0][0],o=e[0].y!=null?e[0].y:e[0][1],s=i[1].x!=null?i[1].x:i[1][0],a=i[1].y!=null?i[1].y:i[1][1],c=e[1].x!=null?e[1].x:e[1][0],l=e[1].y!=null?e[1].y:e[1][1],u=i[2].x!=null?i[2].x:i[2][0],A=i[2].y!=null?i[2].y:i[2][1],d=e[2].x!=null?e[2].x:e[2][0],h=e[2].y!=null?e[2].y:e[2][1],f={a:t-u,b:n-A,c:s-u,d:a-A,e:u,f:A},y={a:r-d,b:o-h,c:c-d,d:l-h,e:d,f:h},_=F2(f),v=TB([y,_]);return e5e(v)}function Xmt(i){return Array.isArray(i)?i.map(e):e(i);function e(t){switch(t.type){case"matrix":if("a"in t&&"b"in t&&"c"in t&&"d"in t&&"e"in t&&"f"in t)return WBe(t);throw new Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"ty"in t?wd(t.tx,t.ty):wd(t.tx);case"scale":if(!("sx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"sy"in t?P9(t.sx,t.sy):P9(t.sx);case"rotate":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return"cx"in t&&"cy"in t?Sq(t.angle,t.cx,t.cy):Sq(t.angle);case"skewX":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return Qq(t.angle,0);case"skewY":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return Qq(0,t.angle);case"shear":if(!("shx"in t&&"shy"in t))throw new Error("MISSING_MANDATORY_PARAM");return ZBe(t.shx,t.shy);default:throw new Error("UNSUPPORTED_DESCRIPTOR")}}}function qmt(i,e){function t(){this.constructor=i}t.prototype=e.prototype,i.prototype=new t}function MM(i,e,t,n){var r=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(r,MM.prototype),r.expected=e,r.found=t,r.location=n,r.name="SyntaxError",r}qmt(MM,Error);function Mq(i,e,t){return t=t||" ",i.length>e?i:(e-=i.length,t+=t.repeat(e),i+t.slice(0,e))}MM.prototype.format=function(i){var e="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<i.length;n++)if(i[n].source===this.location.source){t=i[n].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,o=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,s=this.location.source+":"+o.line+":"+o.column;if(t){var a=this.location.end,c=Mq("",o.line.toString().length," "),l=t[r.line-1],u=r.line===a.line?a.column:l.length+1,A=u-r.column||1;e+=`
|
|
244
|
+
`)).length,r=0;r<n;r++){var s=i.charCodeAt(r),a=null;s<128?t++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),i3(a)||(t>e&&(o+=i.substring(e,t)),o+=a,e=t=r+1)}return t>e&&(o+=i.substring(e,i.length)),o},Ppt=!!DZ||!!RZ,ibe="text/plain",NF=(i,e)=>{var[t,n]=i.split("?"),r=jl({},e);n==null||n.split("&").forEach(s=>{var[a]=s.split("=");delete r[a]});var o=Eft(r);return t+"?"+(o=o?(n?n+"&":"")+o:n)},r8=(i,e)=>JSON.stringify(i,(t,n)=>typeof n=="bigint"?n.toString():n,e),vX=i=>{var{data:e,compression:t}=i;if(e){if(t===F5.GZipJS){var n=HEe(VEe(r8(e)),{mtime:0}),r=new Blob([n],{type:ibe});return{contentType:ibe,body:r,estimatedSize:r.size}}if(t===F5.Base64){var o=function(c){var l,u,A,d,h,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",y=0,_=0,v="",E=[];if(!c)return c;c=kpt(c);do l=(h=c.charCodeAt(y++)<<16|c.charCodeAt(y++)<<8|c.charCodeAt(y++))>>18&63,u=h>>12&63,A=h>>6&63,d=63&h,E[_++]=f.charAt(l)+f.charAt(u)+f.charAt(A)+f.charAt(d);while(y<c.length);switch(v=E.join(""),c.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v}(r8(e)),s=(c=>"data="+encodeURIComponent(typeof c=="string"?c:r8(c)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=r8(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},o8=[];RZ&&o8.push({transport:"fetch",method:i=>{var e,t,{contentType:n,body:r,estimatedSize:o}=(e=vX(i))!==null&&e!==void 0?e:{},s=new Headers;Q_(i.headers,function(u,A){s.append(A,u)}),n&&s.append("Content-Type",n);var a=i.url,c=null;if(kxe){var l=new kxe;c={signal:l.signal,timeout:setTimeout(()=>l.abort(),i.timeout)}}RZ(a,jl({method:(i==null?void 0:i.method)||"GET",headers:s,keepalive:i.method==="POST"&&(o||0)<52428.8,body:r,signal:(t=c)==null?void 0:t.signal},i.fetchOptions)).then(u=>u.text().then(A=>{var d={statusCode:u.status,text:A};if(u.status===200)try{d.json=JSON.parse(A)}catch(h){Mu.error(h)}i.callback==null||i.callback(d)})).catch(u=>{Mu.error(u),i.callback==null||i.callback({statusCode:0,text:u})}).finally(()=>c?clearTimeout(c.timeout):null)}}),DZ&&o8.push({transport:"XHR",method:i=>{var e,t=new DZ;t.open(i.method||"GET",i.url,!0);var{contentType:n,body:r}=(e=vX(i))!==null&&e!==void 0?e:{};Q_(i.headers,function(o,s){t.setRequestHeader(s,o)}),n&&t.setRequestHeader("Content-Type",n),i.timeout&&(t.timeout=i.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}i.callback==null||i.callback(o)}},t.send(r)}}),Sb!=null&&Sb.sendBeacon&&o8.push({transport:"sendBeacon",method:i=>{var e=NF(i.url,{beacon:"1"});try{var t,{contentType:n,body:r}=(t=vX(i))!==null&&t!==void 0?t:{},o=typeof r=="string"?new Blob([r],{type:n}):r;Sb.sendBeacon(e,o)}catch{}}});var fM=function(i,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(i)}catch{return!1}};function rbe(i,e,t){return r8({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Fpt={exact:(i,e)=>e.some(t=>i.some(n=>t===n)),is_not:(i,e)=>e.every(t=>i.every(n=>t!==n)),regex:(i,e)=>e.some(t=>i.some(n=>fM(t,n))),not_regex:(i,e)=>e.every(t=>i.every(n=>!fM(t,n))),icontains:(i,e)=>e.map(TF).some(t=>i.map(TF).some(n=>t.includes(n))),not_icontains:(i,e)=>e.map(TF).every(t=>i.map(TF).every(n=>!t.includes(n)))},TF=i=>i.toLowerCase(),obe=BC("[Error tracking]");class Lpt{constructor(e){var t,n;this.fe=[],this._instance=e,this.fe=(t=(n=this._instance.persistence)==null?void 0:n.get_property(LZ))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r,o=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.fe=o,this._instance.persistence&&this._instance.persistence.register({[LZ]:this.fe,[Kxe]:s})}get pe(){var e,t=!!this._instance.get_property(Kxe),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}sendExceptionEvent(e){if(this._e(e))obe.info("Skipping exception capture because a suppression rule matched");else{if(this.pe||!this.ge(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});obe.info("Skipping exception capture because it was thrown by an extension")}}_e(e){var t=e.$exception_list;if(!t||!$1(t)||t.length===0)return!1;var n=t.reduce((r,o)=>{var{type:s,value:a}=o;return nI(s)&&s.length>0&&r.$exception_types.push(s),nI(a)&&a.length>0&&r.$exception_values.push(a),r},{$exception_types:[],$exception_values:[]});return this.fe.some(r=>{var o=r.values.map(s=>{var a,c=Fpt[s.operator],l=$1(s.value)?s.value:[s.value],u=(a=n[s.key])!==null&&a!==void 0?a:[];return l.length>0&&c(l,u)});return r.type==="OR"?o.some(Boolean):o.every(Boolean)})}ge(e){var t=e.$exception_list;return!(!t||!$1(t))&&t.flatMap(n=>{var r,o;return(r=(o=n.stacktrace)==null?void 0:o.frames)!==null&&r!==void 0?r:[]}).some(n=>n.filename&&n.filename.startsWith("chrome-extension://"))}}var r2="Mobile",kF="iOS",SB="Android",s8="Tablet",sbe=SB+" "+s8,abe="iPad",cbe="Apple",lbe=cbe+" Watch",a8="Safari",pM="BlackBerry",ube="Samsung",Abe=ube+"Browser",dbe=ube+" Internet",VS="Chrome",Upt=VS+" OS",hbe=VS+" "+kF,IX="Internet Explorer",fbe=IX+" "+r2,CX="Opera",Gpt=CX+" Mini",xX="Edge",pbe="Microsoft "+xX,gM="Firefox",gbe=gM+" "+kF,c8="Nintendo",l8="PlayStation",mM="Xbox",mbe=SB+" "+r2,ybe=r2+" "+a8,u8="Windows",EX=u8+" Phone",_be="Nokia",bX="Ouya",vbe="Generic",Opt=vbe+" "+r2.toLowerCase(),Ibe=vbe+" "+s8.toLowerCase(),BX="Konqueror",fE="(\\d+(\\.\\d+)?)",wX=new RegExp("Version/"+fE),zpt=new RegExp(mM,"i"),Ypt=new RegExp(l8+" \\w+","i"),Hpt=new RegExp(c8+" \\w+","i"),SX=new RegExp(pM+"|PlayBook|BB10","i"),Vpt={"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"},Kpt=(i,e)=>e&&bg(e,cbe)||function(t){return bg(t,a8)&&!bg(t,VS)&&!bg(t,SB)}(i),Cbe=function(i,e){return e=e||"",bg(i," OPR/")&&bg(i,"Mini")?Gpt:bg(i," OPR/")?CX:SX.test(i)?pM:bg(i,"IE"+r2)||bg(i,"WPDesktop")?fbe:bg(i,Abe)?dbe:bg(i,xX)||bg(i,"Edg/")?pbe:bg(i,"FBIOS")?"Facebook "+r2:bg(i,"UCWEB")||bg(i,"UCBrowser")?"UC Browser":bg(i,"CriOS")?hbe:bg(i,"CrMo")||bg(i,VS)?VS:bg(i,SB)&&bg(i,a8)?mbe:bg(i,"FxiOS")?gbe:bg(i.toLowerCase(),BX.toLowerCase())?BX:Kpt(i,e)?bg(i,r2)?ybe:a8:bg(i,gM)?gM:bg(i,"MSIE")||bg(i,"Trident/")?IX:bg(i,"Gecko")?gM:""},jpt={[fbe]:[new RegExp("rv:"+fE)],[pbe]:[new RegExp(xX+"?\\/"+fE)],[VS]:[new RegExp("("+VS+"|CrMo)\\/"+fE)],[hbe]:[new RegExp("CriOS\\/"+fE)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+fE)],[a8]:[wX],[ybe]:[wX],[CX]:[new RegExp("(Opera|OPR)\\/"+fE)],[gM]:[new RegExp(gM+"\\/"+fE)],[gbe]:[new RegExp("FxiOS\\/"+fE)],[BX]:[new RegExp("Konqueror[:/]?"+fE,"i")],[pM]:[new RegExp(pM+" "+fE),wX],[mbe]:[new RegExp("android\\s"+fE,"i")],[dbe]:[new RegExp(Abe+"\\/"+fE)],[IX]:[new RegExp("(rv:|MSIE )"+fE)],Mozilla:[new RegExp("rv:"+fE)]},Jpt=function(i,e){var t=Cbe(i,e),n=jpt[t];if(ol(n))return null;for(var r=0;r<n.length;r++){var o=n[r],s=i.match(o);if(s)return parseFloat(s[s.length-2])}return null},xbe=[[new RegExp(mM+"; "+mM+" (.*?)[);]","i"),i=>[mM,i&&i[1]||""]],[new RegExp(c8,"i"),[c8,""]],[new RegExp(l8,"i"),[l8,""]],[SX,[pM,""]],[new RegExp(u8,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[EX,""];if(new RegExp(r2).test(e)&&!/IEMobile\b/.test(e))return[u8+" "+r2,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var n=t[1],r=Vpt[n]||"";return/arm/i.test(e)&&(r="RT"),[u8,r]}return[u8,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[kF,e.join(".")]}return[kF,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=ol(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+SB+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+SB+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[SB,e.join(".")]}return[SB,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Upt,""]],[/Linux|debian/i,["Linux",""]]],Ebe=function(i){return Hpt.test(i)?c8:Ypt.test(i)?l8:zpt.test(i)?mM:new RegExp(bX,"i").test(i)?bX:new RegExp("("+EX+"|WPDesktop)","i").test(i)?EX:/iPad/.test(i)?abe:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?lbe:SX.test(i)?pM:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(_be,"i").test(i)?_be:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(r2).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?SB:sbe:SB:new RegExp("(pda|"+r2+")","i").test(i)?Opt:new RegExp(s8,"i").test(i)&&!new RegExp(s8+" pc","i").test(i)?Ibe:""},PF="https?://(.*)",FF=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Wpt=cF(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],FF),QX="<masked>",Zpt=["li_fat_id"];function bbe(i,e,t){if(!lu)return{};var n,r=e?cF([],FF,t||[]):[],o=Bbe(XZ(lu.URL,r,QX),i),s=(n={},Q_(Zpt,function(a){var c=bB.D(a);n[a]=c||null}),n);return MI(s,o)}function Bbe(i,e){var t=Wpt.concat(e||[]),n={};return Q_(t,function(r){var o=_F(i,r);n[r]=o||null}),n}function wbe(i){var e=function(o){return o?o.search(PF+"google.([^/?]*)")===0?"google":o.search(PF+"bing.com")===0?"bing":o.search(PF+"yahoo.com")===0?"yahoo":o.search(PF+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",n={};if(!i3(e)){n.$search_engine=e;var r=lu?_F(lu.referrer,t):"";r.length&&(n.ph_keyword=r)}return n}function Sbe(){return navigator.language||navigator.userLanguage}function Qbe(){return(lu==null?void 0:lu.referrer)||"$direct"}function Mbe(i,e){var t=i?cF([],FF,e||[]):[],n=HE==null?void 0:HE.href.substring(0,1e3);return{r:Qbe().substring(0,1e3),u:n?XZ(n,t,QX):void 0}}function Rbe(i){var e,{r:t,u:n}=i,r={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=uM(t))==null?void 0:e.host};if(n){r.$current_url=n;var o=uM(n);r.$host=o==null?void 0:o.host,r.$pathname=o==null?void 0:o.pathname;var s=Bbe(n);MI(r,s)}if(t){var a=wbe(t);MI(r,a)}return r}function Dbe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Xpt(){try{return new Date().getTimezoneOffset()}catch{return}}function qpt(i,e){if(!VE)return{};var t,n,r,o=i?cF([],FF,e||[]):[],[s,a]=function(c){for(var l=0;l<xbe.length;l++){var[u,A]=xbe[l],d=u.exec(c),h=d&&(n2(A)?A(d,c):A);if(h)return h}return["",""]}(VE);return MI(PZ({$os:s,$os_version:a,$browser:Cbe(VE,navigator.vendor),$device:Ebe(VE),$device_type:(n=VE,r=Ebe(n),r===abe||r===sbe||r==="Kobo"||r==="Kindle Fire"||r===Ibe?s8:r===c8||r===mM||r===l8||r===bX?"Console":r===lbe?"Wearable":r?r2:"Desktop"),$timezone:Dbe(),$timezone_offset:Xpt()}),{$current_url:XZ(HE==null?void 0:HE.href,o,QX),$host:HE==null?void 0:HE.host,$pathname:HE==null?void 0:HE.pathname,$raw_user_agent:VE.length>1e3?VE.substring(0,997)+"...":VE,$browser_version:Jpt(VE,navigator.vendor),$browser_language:Sbe(),$browser_language_prefix:(t=Sbe(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:Mo==null?void 0:Mo.screen.height,$screen_width:Mo==null?void 0:Mo.screen.width,$viewport_height:Mo==null?void 0:Mo.innerHeight,$viewport_width:Mo==null?void 0:Mo.innerWidth,$lib:"web",$lib_version:P5.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var QB=BC("[FeatureFlags]"),MX="$active_feature_flags",yM="$override_feature_flags",Nbe="$feature_flag_payloads",A8="$override_feature_flag_payloads",Tbe="$feature_flag_request_id",kbe=i=>{var e={};for(var[t,n]of lF(i||{}))n&&(e[t]=n);return e},$pt=i=>{var e=i.flags;return e?(i.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var n;return[t,(n=e[t].variant)!==null&&n!==void 0?n:e[t].enabled]})),i.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var n;return(n=e[t].metadata)==null?void 0:n.payload}).map(t=>{var n;return[t,(n=e[t].metadata)==null?void 0:n.payload]}))):QB.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),i},egt=function(i){return i.FeatureFlags="feature_flags",i.Recordings="recordings",i}({});class tgt{constructor(e){this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.$e=!0;else{var e=!this.ke&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Ee({disableFlags:e})}}get hasLoadedFlags(){return this.be}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(zZ),t=this._instance.get_property(yM),n=this._instance.get_property(A8);if(!n&&!t)return e||{};var r=MI({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of o){var a,c,l=r[s],u=t==null?void 0:t[s],A=ol(u)?(a=l==null?void 0:l.enabled)!==null&&a!==void 0&&a:!!u,d=ol(u)?l.variant:typeof u=="string"?u:void 0,h=n==null?void 0:n[s],f=jl({},l,{enabled:A,variant:A?d??(l==null?void 0:l.variant):void 0});A!==(l==null?void 0:l.enabled)&&(f.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(f.original_variant=l==null?void 0:l.variant),h&&(f.metadata=jl({},l==null?void 0:l.metadata,{payload:h,original_payload:l==null||(c=l.metadata)==null?void 0:c.payload})),r[s]=f}return this.me||(QB.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.me=!0),r}getFlagVariants(){var e=this._instance.get_property(cM),t=this._instance.get_property(yM);if(!t)return e||{};for(var n=MI({},e),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.me||(QB.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.me=!0),n}getFlagPayloads(){var e=this._instance.get_property(Nbe),t=this._instance.get_property(A8);if(!t)return e||{};for(var n=MI({},e||{}),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.me||(QB.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.me=!0),n}reloadFeatureFlags(){this.we||this._instance.config.advanced_disable_feature_flags||this.ke||(this.ke=setTimeout(()=>{this.Ee()},5))}Ie(){clearTimeout(this.ke),this.ke=void 0}ensureFlagsLoaded(){this.be||this.ye||this.ke||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.we=e}Ee(e){var t;if(this.Ie(),!this._instance.I())if(this.ye)this.Se=!0;else{var n={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:jl({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(qN)||{}),group_properties:this._instance.get_property(US)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0);var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("api",o+s);r&&(n.timezone=Dbe()),this.ye=!0,this._instance.Pe({method:"POST",url:a,data:n,compression:this._instance.config.disable_compression?void 0:F5.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:c=>{var l,u,A=!0;if(c.statusCode===200&&(this.Se||(this.$anon_distinct_id=void 0),A=!1),this.ye=!1,this.$e||(this.$e=!0,this._instance.Re((u=c.json)!==null&&u!==void 0?u:{})),!n.disable_flags||this.Se)if(this.xe=!A,c.json&&(l=c.json.quotaLimited)!=null&&l.includes(egt.FeatureFlags))QB.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.");else{var d;n.disable_flags||this.receivedFeatureFlags((d=c.json)!==null&&d!==void 0?d:{},A),this.Se&&(this.Se=!1,this.Ee())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this.be||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,o=this._instance.get_property(Tbe)||void 0,s=this._instance.get_property(dF)||{};if((t.send_event||!("send_event"in t))&&(!(e in s)||!s[e].includes(r))){var a,c,l,u,A,d,h,f,y;$1(s[e])?s[e].push(r):s[e]=[r],(a=this._instance.persistence)==null||a.register({[dF]:s});var _=this.getFeatureFlagDetails(e),v={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((l=this._instance.config.bootstrap)==null||(l=l.featureFlagPayloads)==null?void 0:l[e])||null,$used_bootstrap_value:!this.xe};ol(_==null||(u=_.metadata)==null?void 0:u.version)||(v.$feature_flag_version=_.metadata.version);var E,b=(A=_==null||(d=_.reason)==null?void 0:d.description)!==null&&A!==void 0?A:_==null||(h=_.reason)==null?void 0:h.code;b&&(v.$feature_flag_reason=b),_!=null&&(f=_.metadata)!=null&&f.id&&(v.$feature_flag_id=_.metadata.id),ol(_==null?void 0:_.original_variant)&&ol(_==null?void 0:_.original_enabled)||(v.$feature_flag_original_response=ol(_.original_variant)?_.original_enabled:_.original_variant),_!=null&&(y=_.metadata)!=null&&y.original_payload&&(v.$feature_flag_original_payload=_==null||(E=_.metadata)==null?void 0:E.original_payload),this._instance.capture("$feature_flag_called",v)}return n}QB.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var n=this._instance.config.token;this._instance.Pe({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:n},compression:this._instance.config.disable_compression?void 0:F5.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var o,s=(o=r.json)==null?void 0:o.featureFlagPayloads;t((s==null?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this.be||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);QB.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.be=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(s,a,c,l,u){c===void 0&&(c={}),l===void 0&&(l={}),u===void 0&&(u={});var A=$pt(s),d=A.flags,h=A.featureFlags,f=A.featureFlagPayloads;if(h){var y=s.requestId;if($1(h)){QB.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(h)for(var v=0;v<h.length;v++)_[h[v]]=!0;a&&a.register({[MX]:h,[cM]:_})}else{var E=h,b=f,M=d;s.errorsWhileComputingFlags&&(E=jl({},c,E),b=jl({},l,b),M=jl({},u,M)),a&&a.register(jl({[MX]:Object.keys(kbe(E)),[cM]:E||{},[Nbe]:b||{},[zZ]:M||{}},y?{[Tbe]:y}:{}))}}})(e,this._instance.persistence,n,r,o),this.Te(t)}}override(e,t){t===void 0&&(t=!1),QB.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return QB.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(yM),this._instance.persistence.unregister(A8),void this.Te();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.me=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(yM);else if(n.flags)if($1(n.flags)){for(var r={},o=0;o<n.flags.length;o++)r[n.flags[o]]=!0;this._instance.persistence.register({[yM]:r})}else this._instance.persistence.register({[yM]:n.flags})}return"payloads"in n&&(n.payloads===!1?this._instance.persistence.unregister(A8):n.payloads&&this._instance.persistence.register({[A8]:n.payloads})),void this.Te()}this.Te()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.be){var{flags:t,flagVariants:n}=this.Me();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,o=(this._instance.get_property(XN)||[]).find(l=>l.flagKey===e),s={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:s};o&&(a.$early_access_feature_name=o.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var c=jl({},this.getFlagVariants(),{[e]:t});(r=this._instance.persistence)==null||r.register({[MX]:Object.keys(kbe(c)),[cM]:c}),this.Te()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(XN),o=n?"&"+n.map(s=>"stage="+s).join("&"):"";if(r&&!t)return e(r);this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:s=>{var a,c;if(s.json){var l=s.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(XN),(c=this._instance.persistence)==null||c.register({[XN]:l}),e(l)}}})}Me(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}Te(e){var{flags:t,flagVariants:n}=this.Me();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(qN)||{};this._instance.register({[qN]:jl({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(qN)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(US)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(r=>{n[r]=jl({},n[r],e[r]),delete e[r]}),this._instance.register({[US]:jl({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(US)||{};this._instance.register({[US]:jl({},t,{[e]:{}})})}else this._instance.unregister(US)}reset(){this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this.$anon_distinct_id=void 0,this.Ie(),this.me=!1}}var ngt=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class RX{constructor(e,t){this.S=e,this.props={},this.Ce=!1,this.Fe=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.B=this.Oe(e),this.load(),e.debug&&Mu.info("Persistence loaded",e.persistence,jl({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Ae}Oe(e){ngt.indexOf(e.persistence.toLowerCase())===-1&&(Mu.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&N9.O()?N9:t==="localstorage+cookie"&&CF.O()?CF:t==="sessionstorage"&&KC.O()?KC:t==="memory"?kft:t==="cookie"?bB:CF.O()?CF:bB}properties(){var e={};return Q_(this.props,function(t,n){if(n===cM&&tI(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/"+r[o]]=t[r[o]];else a=n,c=!1,(i3(s=pft)?c:Txe&&s.indexOf===Txe?s.indexOf(a)!=-1:(Q_(s,function(l){if(c||(c=l===a))return aF}),c))||(e[n]=t);var s,a,c}),e}load(){if(!this.Ae){var e=this.B.L(this.Fe);e&&(this.props=MI({},e))}}save(){this.Ae||this.B.j(this.Fe,this.props,this.De,this.Le,this.je,this.S.debug)}remove(){this.B.N(this.Fe,!1),this.B.N(this.Fe,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(tI(e)){ol(t)&&(t="None"),this.De=ol(n)?this.Ne:n;var r=!1;if(Q_(e,(o,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==t||(this.props[s]=o,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(tI(e)){this.De=ol(t)?this.Ne:t;var n=!1;if(Q_(e,(r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Ce){var e=bbe(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);aM(PZ(e))||this.register(e),this.Ce=!0}}update_search_keyword(){var e;this.register((e=lu==null?void 0:lu.referrer)?wbe(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Qbe(),$referring_domain:lu!=null&&lu.referrer&&((e=uM(lu.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[KZ]||this.props[jZ]||this.register_once({[hF]:Mbe(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Q_([jZ,KZ],s=>{var a=this.props[s];a&&Q_(a,function(c,l){e["$initial_"+TZ(l)]=c})});var t,n,r=this.props[hF];if(r){var o=(t=Rbe(r),n={},Q_(t,function(s,a){n["$initial_"+TZ(a)]=s}),n);MI(e,o)}return e}safe_merge(e){return Q_(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){if(this.Ne=this.De=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.Oe(e),o=this.props;this.clear(),this.B=r,this.props=o,this.save()}}set_disabled(e){this.Ae=e,this.Ae?this.remove():this.save()}set_cross_subdomain(e){e!==this.Le&&(this.Le=e,this.remove(),this.save())}set_secure(e){e!==this.je&&(this.je=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[WN]||{};n[e]=t,this.props[WN]=n,this.save()}remove_event_timer(e){var t=(this.props[WN]||{})[e];return ol(t)||(delete this.props[WN][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class Pbe{constructor(){this.ze={},this.ze={}}on(e,t){return this.ze[e]||(this.ze[e]=[]),this.ze[e].push(t),()=>{this.ze[e]=this.ze[e].filter(n=>n!==t)}}emit(e,t){for(var n of this.ze[e]||[])n(t);for(var r of this.ze["*"]||[])r(e,t)}}class KS{constructor(e){this.Ue=new Pbe,this.qe=(t,n)=>this.Be(t,n)&&this.He(t,n)&&this.We(t,n),this.Be=(t,n)=>n==null||!n.event||(t==null?void 0:t.event)===(n==null?void 0:n.event),this._instance=e,this.Ge=new Set,this.Je=new Set}init(){var e;if(!ol((e=this._instance)==null?void 0:e.Ve)){var t;(t=this._instance)==null||t.Ve((n,r)=>{this.on(n,r)})}}register(e){var t,n;if(!ol((t=this._instance)==null?void 0:t.Ve)&&(e.forEach(s=>{var a,c;(a=this.Je)==null||a.add(s),(c=s.steps)==null||c.forEach(l=>{var u;(u=this.Ge)==null||u.add((l==null?void 0:l.event)||"")})}),(n=this._instance)!=null&&n.autocapture)){var r,o=new Set;e.forEach(s=>{var a;(a=s.steps)==null||a.forEach(c=>{c!=null&&c.selector&&o.add(c==null?void 0:c.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,t){var n;t!=null&&e.length!=0&&(this.Ge.has(e)||this.Ge.has(t==null?void 0:t.event))&&this.Je&&((n=this.Je)==null?void 0:n.size)>0&&this.Je.forEach(r=>{this.Ke(t,r)&&this.Ue.emit("actionCaptured",r.name)})}Ye(e){this.onAction("actionCaptured",t=>e(t))}Ke(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var n of t.steps)if(this.qe(e,n))return!0;return!1}onAction(e,t){return this.Ue.on(e,t)}He(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!="string"||!KS.Xe(r,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static Xe(e,t,n){switch(n){case"regex":return!!Mo&&fM(e,t);case"exact":return t===e;case"contains":var r=KS.Qe(t).replace(/_/g,".").replace(/%/g,".*");return fM(e,r);default:return!1}}static Qe(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}We(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Ze(e).some(o=>!(t!=null&&t.href&&!KS.Xe(o.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||o.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!KS.Xe(o.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!KS.Xe(o.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact"))))return!1;if(t!=null&&t.selector){var n,r=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(!r||!r.includes(t==null?void 0:t.selector))return!1}return!0}Ze(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}(function(i){return i.Button="button",i.Tab="tab",i.Selector="selector",i})({}),function(i){return i.TopLeft="top_left",i.TopRight="top_right",i.TopCenter="top_center",i.MiddleLeft="middle_left",i.MiddleRight="middle_right",i.MiddleCenter="middle_center",i.Left="left",i.Center="center",i.Right="right",i.NextToTrigger="next_to_trigger",i}({});var DX=function(i){return i.Popover="popover",i.API="api",i.Widget="widget",i.ExternalSurvey="external_survey",i}({});(function(i){return i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link",i})({}),function(i){return i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question",i}({}),function(i){return i.Once="once",i.Recurring="recurring",i.Always="always",i}({});var NX=function(i){return i.SHOWN="survey shown",i.DISMISSED="survey dismissed",i.SENT="survey sent",i}({}),Fbe=function(i){return i.SURVEY_ID="$survey_id",i.SURVEY_NAME="$survey_name",i.SURVEY_RESPONSE="$survey_response",i.SURVEY_ITERATION="$survey_iteration",i.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",i.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",i.SURVEY_SUBMISSION_ID="$survey_submission_id",i.SURVEY_QUESTIONS="$survey_questions",i.SURVEY_COMPLETED="$survey_completed",i}({}),T9=BC("[Surveys]"),TX="seenSurvey_",igt=(i,e)=>{var t="$survey_"+e+"/"+i.id;return i.current_iteration&&i.current_iteration>0&&(t="$survey_"+e+"/"+i.id+"/"+i.current_iteration),t},rgt=[DX.Popover,DX.Widget,DX.API];class ogt{constructor(e){this._instance=e,this.tr=new Map,this.ir=new Map}register(e){var t;ol((t=this._instance)==null?void 0:t.Ve)||(this.er(e),this.rr(e))}rr(e){var t=e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.actions)&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0});t.length!==0&&(this.sr==null&&(this.sr=new KS(this._instance),this.sr.init(),this.sr.Ye(n=>{this.onAction(n)})),t.forEach(n=>{var r,o,s,a,c;n.conditions&&(r=n.conditions)!=null&&r.actions&&(o=n.conditions)!=null&&(o=o.actions)!=null&&o.values&&((s=n.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((a=this.sr)==null||a.register(n.conditions.actions.values),(c=n.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach(l=>{if(l&&l.name){var u=this.ir.get(l.name);u&&u.push(n.id),this.ir.set(l.name,u||[n.id])}}))}))}er(e){var t;e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}).length!==0&&((t=this._instance)==null||t.Ve((n,r)=>{this.onEvent(n,r)}),e.forEach(n=>{var r;(r=n.conditions)==null||(r=r.events)==null||(r=r.values)==null||r.forEach(o=>{if(o&&o.name){var s=this.tr.get(o.name);s&&s.push(n.id),this.tr.set(o.name,s||[n.id])}})}))}onEvent(e,t){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[AF])||[];if(e==="survey shown"&&t&&r.length>0){var o;T9.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var s=t==null||(o=t.properties)==null?void 0:o.$survey_id;if(s){var a=r.indexOf(s);a>=0&&(r.splice(a,1),this.nr(r))}}else this.tr.has(e)&&(T9.info("survey event matched, updating activated surveys",{event:e,surveys:this.tr.get(e)}),this.nr(r.concat(this.tr.get(e)||[])))}onAction(e){var t,n=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[AF])||[];this.ir.has(e)&&this.nr(n.concat(this.ir.get(e)||[]))}nr(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[AF]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[AF];return t||[]}getEventToSurveys(){return this.tr}ar(){return this.sr}}class sgt{constructor(e){this.lr=void 0,this._surveyManager=null,this.ur=!1,this.hr=!1,this.dr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(py(t))return T9.warn("Flags not loaded yet. Not loading surveys.");var n=$1(t);this.lr=n?t.length>0:t,T9.info("flags response received, isSurveysEnabled: "+this.lr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(TX)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this._surveyManager)if(this.hr)T9.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)T9.info("Disabled. Not loading surveys.");else{var e=jh==null?void 0:jh.__PosthogExtensions__;if(e){if(!ol(this.lr)||this._instance.config.advanced_enable_surveys){var t=this.lr||this._instance.config.advanced_enable_surveys;this.hr=!0;try{var n=e.generateSurveys;if(n)return void this.vr(n,t);var r=e.loadExternalDependency;if(!r)return void this.cr("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",o=>{o||!e.generateSurveys?this.cr("Could not load surveys script",o):this.vr(e.generateSurveys,t)})}catch(o){throw this.cr("Error initializing surveys",o),o}finally{this.hr=!1}}}else T9.error("PostHog Extensions not found.")}}vr(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new ogt(this._instance),T9.info("Surveys loaded successfully"),this.pr({isLoaded:!0})}cr(e,t){T9.error(e,t),this.pr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.dr.push(e),this._surveyManager&&this.pr({isLoaded:!0}),()=>{this.dr=this.dr.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return T9.info("Disabled. Not loading surveys."),e([]);var n=this._instance.get_property(YZ);if(n&&!t)return e(n,{isLoaded:!0});if(this.ur)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.ur=!0,this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.ur=!1;var s=r.statusCode;if(s!==200||!r.json){var a="Surveys API could not be loaded, status: "+s;return T9.error(a),e([],{isLoaded:!1,error:a})}var c,l=r.json.surveys||[],u=l.filter(A=>function(d){return!(!d.start_date||d.end_date)}(A)&&(function(d){var h;return!((h=d.conditions)==null||(h=h.events)==null||(h=h.values)==null||!h.length)}(A)||function(d){var h;return!((h=d.conditions)==null||(h=h.actions)==null||(h=h.values)==null||!h.length)}(A)));return u.length>0&&((c=this._surveyEventReceiver)==null||c.register(u)),(o=this._instance.persistence)==null||o.register({[YZ]:l}),e(l,{isLoaded:!0})}})}catch(r){throw this.ur=!1,r}}pr(e){for(var t of this.dr)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){T9.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!py(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);T9.warn("init was not called")}_r(e){var t=null;return this.getSurveys(n=>{var r;t=(r=n.find(o=>o.id===e))!==null&&r!==void 0?r:null}),t}gr(e){if(py(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this._r(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(py(this._surveyManager))return T9.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return py(this._surveyManager)?(T9.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(n=>{this.getSurveys(r=>{var o,s=(o=r.find(c=>c.id===e))!==null&&o!==void 0?o:null;if(s){var a=this.gr(s);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(py(this._surveyManager))T9.warn("init was not called");else{var n=this._r(e);if(n)if(rgt.includes(n.type)){var r=lu==null?void 0:lu.querySelector(t);r?this._surveyManager.renderSurvey(n,r):T9.warn("Survey element not found")}else T9.warn("Surveys of type "+n.type+" cannot be rendered in the app");else T9.warn("Survey not found")}}}var Lbe=BC("[RateLimiter]");class agt{constructor(e){var t,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(s=>{Lbe.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void Lbe.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((n=e.config.rate_limiting)==null?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,n,r;e===void 0&&(e=!1);var o=new Date().getTime(),s=(t=(n=this.instance.persistence)==null?void 0:n.get_property(VZ))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:o};s.tokens+=(o-s.last)/1e3*this.captureEventsPerSecond,s.last=o,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var a=s.tokens<1;return a||e||(s.tokens=Math.max(0,s.tokens-1)),!a||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(r=this.instance.persistence)==null||r.set_property(VZ,s),{isRateLimited:a,remainingTokens:s.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var jS=BC("[RemoteConfig]");class cgt{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=jh._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}mr(e){var t,n;(t=jh.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=jh.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(jS.error("PostHog Extensions not found. Cannot load remote config."),e())}br(e){this._instance.Pe({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return jS.info("Using preloaded remote config",this.remoteConfig),void this.Re(this.remoteConfig);if(this._instance.I())return void jS.warn("Remote config is disabled. Falling back to local config.");this.mr(e=>{if(!e)return jS.info("No config found after loading remote JS config. Falling back to JSON."),void this.br(t=>{this.Re(t)});this.Re(e)})}catch(e){jS.error("Error loading remote config",e)}}Re(e){e?this._instance.config.__preview_remote_config?(this._instance.Re(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):jS.info("__preview_remote_config is disabled. Logging config instead",e):jS.error("Failed to fetch remote config from PostHog.")}}var kX=3e3;class lgt{constructor(e,t){this.yr=!0,this.wr=[],this.Sr=Qb((t==null?void 0:t.flush_interval_ms)||kX,250,5e3,"flush interval",kX),this.$r=e}enqueue(e){this.wr.push(e),this.kr||this.Er()}unload(){this.Ir();var e=this.wr.length>0?this.Pr():{},t=Object.values(e);[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.$r(jl({},n,{transport:"sendBeacon"}))})}enable(){this.yr=!1,this.Er()}Er(){var e=this;this.yr||(this.kr=setTimeout(()=>{if(this.Ir(),this.wr.length>0){var t=this.Pr(),n=function(){var o=t[r],s=new Date().getTime();o.data&&$1(o.data)&&Q_(o.data,a=>{a.offset=Math.abs(a.timestamp-s),delete a.timestamp}),e.$r(o)};for(var r in t)n()}},this.Sr))}Ir(){clearTimeout(this.kr),this.kr=void 0}Pr(){var e={};return Q_(this.wr,t=>{var n,r=t,o=(r?r.batchKey:null)||r.url;ol(e[o])&&(e[o]=jl({},r,{data:[]})),(n=e[o].data)==null||n.push(r.data)}),this.wr=[],e}}var ugt=["retriesPerformedSoFar"];class Agt{constructor(e){this.Rr=!1,this.Tr=3e3,this.wr=[],this._instance=e,this.wr=[],this.Mr=!0,!ol(Mo)&&"onLine"in Mo.navigator&&(this.Mr=Mo.navigator.onLine,Bv(Mo,"online",()=>{this.Mr=!0,this.se()}),Bv(Mo,"offline",()=>{this.Mr=!1}))}get length(){return this.wr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=Gxe(e,ugt);Tx(t)&&t>0&&(n.url=NF(n.url,{retry_count:t})),this._instance.Pe(jl({},n,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(t??0)<10?this.Cr(jl({retriesPerformedSoFar:t},n)):n.callback==null||n.callback(r)}}))}Cr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(s){var a=3e3*Math.pow(2,s),c=a/2,l=Math.min(18e5,a),u=(Math.random()-.5)*(l-c);return Math.ceil(l+u)}(t),r=Date.now()+n;this.wr.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),Mu.warn(o),this.Rr||(this.Rr=!0,this.Fr())}Fr(){this.Or&&clearTimeout(this.Or),this.Or=setTimeout(()=>{this.Mr&&this.wr.length>0&&this.se(),this.Fr()},this.Tr)}se(){var e=Date.now(),t=[],n=this.wr.filter(o=>o.retryAt<e||(t.push(o),!1));if(this.wr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Or&&(clearTimeout(this.Or),this.Or=void 0),this.wr))try{this._instance.Pe(jl({},e,{transport:"sendBeacon"}))}catch(t){Mu.error(t)}this.wr=[]}}class dgt{constructor(e){this.Ar=()=>{var t,n,r,o;this.Dr||(this.Dr={});var s=this.scrollElement(),a=this.scrollY(),c=s?Math.max(0,s.scrollHeight-s.clientHeight):0,l=a+((s==null?void 0:s.clientHeight)||0),u=(s==null?void 0:s.scrollHeight)||0;this.Dr.lastScrollY=Math.ceil(a),this.Dr.maxScrollY=Math.max(a,(t=this.Dr.maxScrollY)!==null&&t!==void 0?t:0),this.Dr.maxScrollHeight=Math.max(c,(n=this.Dr.maxScrollHeight)!==null&&n!==void 0?n:0),this.Dr.lastContentY=l,this.Dr.maxContentY=Math.max(l,(r=this.Dr.maxContentY)!==null&&r!==void 0?r:0),this.Dr.maxContentHeight=Math.max(u,(o=this.Dr.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Dr}resetContext(){var e=this.Dr;return setTimeout(this.Ar,0),e}startMeasuringScrollPosition(){Bv(Mo,"scroll",this.Ar,{capture:!0}),Bv(Mo,"scrollend",this.Ar,{capture:!0}),Bv(Mo,"resize",this.Ar)}scrollElement(){if(!this._instance.config.scroll_root_selector)return Mo==null?void 0:Mo.document.documentElement;var e=$1(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var n=Mo==null?void 0:Mo.document.querySelector(t);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Mo&&(Mo.scrollY||Mo.pageYOffset||Mo.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Mo&&(Mo.scrollX||Mo.pageXOffset||Mo.document.documentElement.scrollLeft)||0}}var hgt=i=>Mbe(i==null?void 0:i.config.mask_personal_data_properties,i==null?void 0:i.config.custom_personal_data_properties);class fgt{constructor(e,t,n,r){this.Lr=o=>{var s=this.jr();if(!s||s.sessionId!==o){var a={sessionId:o,props:this.Nr(this._instance)};this.zr.register({[HZ]:a})}},this._instance=e,this.Ur=t,this.zr=n,this.Nr=r||hgt,this.Ur.onSessionId(this.Lr)}jr(){return this.zr.props[HZ]}getSetOnceProps(){var e,t=(e=this.jr())==null?void 0:e.props;return t?"r"in t?Rbe(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Q_(PZ(this.getSetOnceProps()),(t,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+TZ(n)]=t}),e}}var Ube=BC("[SessionId]");class pgt{constructor(e,t,n){var r;if(this.qr=[],this.Br=(u,A)=>Math.abs(u-A)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.zr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Hr=t||s3,this.Wr=n||s3;var o=this.S.persistence_name||this.S.token,s=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Qb(s,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Gr(),this.Jr="ph_"+o+"_window_id",this.Vr="ph_"+o+"_primary_window_exists",this.Kr()){var a=KC.L(this.Jr),c=KC.L(this.Vr);a&&!c?this.fi=a:KC.N(this.Jr),KC.j(this.Vr,!0)}if((r=this.S.bootstrap)!=null&&r.sessionID)try{var l=(u=>{var A=u.replace(/-/g,"");if(A.length!==32)throw new Error("Not a valid UUID");if(A[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(A.substring(0,12),16)})(this.S.bootstrap.sessionID);this.Yr(this.S.bootstrap.sessionID,new Date().getTime(),l)}catch(u){Ube.error("Invalid sessionID in bootstrap",u)}this.Xr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ol(this.qr)&&(this.qr=[]),this.qr.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.qr=this.qr.filter(t=>t!==e)}}Kr(){return this.S.persistence!=="memory"&&!this.zr.Ae&&KC.O()}Qr(e){e!==this.fi&&(this.fi=e,this.Kr()&&KC.j(this.Jr,e))}Zr(){return this.fi?this.fi:this.Kr()?KC.L(this.Jr):null}Yr(e,t,n){e===this.Ct&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Ct=e,this.zr.register({[uF]:[t,e,n]}))}ts(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.zr.props[uF];return $1(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Yr(null,null,null)}Xr(){Bv(Mo,"beforeunload",()=>{this.Kr()&&KC.N(this.Vr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||new Date().getTime(),[r,o,s]=this.ts(),a=this.Zr(),c=Tx(s)&&s>0&&Math.abs(n-s)>864e5,l=!1,u=!o,A=!e&&this.Br(n,r);u||A||c?(o=this.Hr(),a=this.Wr(),Ube.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:c}}),s=n,l=!0):a||(a=this.Wr(),l=!0);var d=r===0||!e||c?n:r,h=s===0?new Date().getTime():s;return this.Qr(a),this.Yr(o,d,h),e||this.Gr(),l&&this.qr.forEach(f=>f(o,a,l?{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:c}:void 0)),{sessionId:o,windowId:a,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:r}}Gr(){clearTimeout(this.es),this.es=setTimeout(()=>{var[e]=this.ts();this.Br(new Date().getTime(),e)&&this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var ggt=["$set_once","$set"],u3=BC("[SiteApps]");class mgt{constructor(e){this._instance=e,this.rs=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ss(e,t){if(t){var n=this.globalsForEvent(t);this.rs.push(n),this.rs.length>1e3&&(this.rs=this.rs.slice(10))}}get siteAppLoaders(){var e;return(e=jh._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ve(this.ss.bind(this));this.ns=()=>{e(),this.rs=[],this.ns=void 0}}}globalsForEvent(e){var t,n,r,o,s,a,c;if(!e)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],A=this._instance.get_property("$stored_group_properties")||{};for(var[d,h]of Object.entries(A))l[d]={id:u[d],type:d,properties:h};var{$set_once:f,$set:y}=e;return{event:jl({},Gxe(e,ggt),{properties:jl({},e.properties,y?{$set:jl({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},y)}:{},f?{$set_once:jl({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},f)}:{}),elements_chain:(s=(a=e.properties)==null?void 0:a.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(c=e.properties)==null?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var a;!t.errored&&this.rs.length&&(u3.info("Processing "+this.rs.length+" events for site app with id "+e.id),this.rs.forEach(c=>t.processEvent==null?void 0:t.processEvent(c)),t.processedBuffer=!0),Object.values(this.apps).every(c=>c.processedBuffer||c.errored)&&((a=this.ns)==null||a.call(this))},r=!1,o=a=>{t.errored=!a,t.loaded=!0,u3.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:a=>{o(a)}});s&&(t.processEvent=s),r=!0}catch(a){u3.error("Error while initializing PostHog app with config id "+e.id,a),o(!1)}if(r&&t.loaded)try{n()}catch(a){u3.error("Error while processing buffered events PostHog app with config id "+e.id,a),t.errored=!0}}os(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ls(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){u3.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.os(),void this._instance.on("eventCaptured",l=>this.ls(l))):void u3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.ns)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(l){var u;jh["__$$ph_site_app_"+l]=o._instance,(u=jh.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,c,A=>{if(A)return u3.error("Error while initializing PostHog app with config id "+l,A)})};for(var{id:a,url:c}of e.siteApps)s(a)}else u3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var ygt=["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","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Gbe=function(i,e){if(!i)return!1;var t=i.toLowerCase();return ygt.concat(e||[]).some(n=>{var r=n.toLowerCase();return t.indexOf(r)!==-1})},Obe=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&Gbe(t,e))return!0;try{var n=i==null?void 0:i.userAgentData;if(n!=null&&n.brands&&n.brands.some(r=>Gbe(r==null?void 0:r.brand,e)))return!0}catch{}return!!i.webdriver},d8=function(i){return i.US="us",i.EU="eu",i.CUSTOM="custom",i}({}),zbe="i.posthog.com";class _gt{constructor(e){this.us={},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 uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+zbe,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.us[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.us[this.apiHost]=d8.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.us[this.apiHost]=d8.EU:this.us[this.apiHost]=d8.CUSTOM),this.us[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(this.region===d8.CUSTOM)return this.apiHost+t;var n=zbe+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var vgt={icontains:(i,e)=>!!Mo&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!Mo&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!Mo&&fM(e.href,i),not_regex:(i,e)=>!!Mo&&!fM(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i};class Fx{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),t.getWebExperiments(r=>{Fx.hs("retrieved web experiments from the server"),t.ds=new Map,r.forEach(o=>{if(o.feature_flag_key){var s;t.ds&&(Fx.hs("setting flag key ",o.feature_flag_key," to web experiment ",o),(s=t.ds)==null||s.set(o.feature_flag_key,o));var a=t._instance.getFeatureFlag(o.feature_flag_key);nI(a)&&o.variants[a]&&t.vs(o.name,a,o.variants[a].transforms)}else if(o.variants)for(var c in o.variants){var l=o.variants[c];Fx.cs(l)&&t.vs(o.name,c,l.transforms)}})},n)},this._instance=e,this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}onFeatureFlags(e){if(this._is_bot())Fx.hs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(py(this.ds))return this.ds=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Fx.hs("applying feature flags",e),e.forEach(t=>{var n;if(this.ds&&(n=this.ds)!=null&&n.has(t)){var r,o=this._instance.getFeatureFlag(t),s=(r=this.ds)==null?void 0:r.get(t);o&&s!=null&&s.variants[o]&&this.vs(s.name,o,s.variants[o].transforms)}})}}previewWebExperiment(){var e=Fx.getWindowLocation();if(e!=null&&e.search){var t=_F(e==null?void 0:e.search,"__experiment_id"),n=_F(e==null?void 0:e.search,"__experiment_variant");t&&n&&(Fx.hs("previewing web experiments "+t+" && "+n),this.getWebExperiments(r=>{this.fs(parseInt(t),n,r)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var s=o.json.experiments||[];return e(s)}})}fs(e,t,n){var r=n.filter(o=>o.id===e);r&&r.length>0&&(Fx.hs("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.vs(r[0].name,t,r[0].variants[t].transforms))}static cs(e){return!py(e.conditions)&&Fx.ps(e)&&Fx._s(e)}static ps(e){var t;if(py(e.conditions)||py((t=e.conditions)==null?void 0:t.url))return!0;var n,r,o,s=Fx.getWindowLocation();return!!s&&((n=e.conditions)==null||!n.url||vgt[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,s))}static getWindowLocation(){return Mo==null?void 0:Mo.location}static _s(e){var t;if(py(e.conditions)||py((t=e.conditions)==null?void 0:t.utm))return!0;var n=bbe();if(n.utm_source){var r,o,s,a,c,l,u,A,d=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==n.utm_campaign,h=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==n.utm_source,f=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_medium)==n.utm_medium,y=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((A=e.conditions)==null||(A=A.utm)==null?void 0:A.utm_term)==n.utm_term;return d&&f&&y&&h}return!1}static hs(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Mu.info("[WebExperiments] "+e,n)}vs(e,t,n){this._is_bot()?Fx.hs("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?n.forEach(r=>{if(r.selector){var o;Fx.hs("applying transform of variant "+t+" for experiment "+e+" ",r);var s=(o=document)==null?void 0:o.querySelectorAll(r.selector);s==null||s.forEach(a=>{var c=a;r.html&&(c.innerHTML=r.html),r.css&&c.setAttribute("style",r.css)})}}):Fx.hs("Control variants leave the page unmodified.")}_is_bot(){return Sb&&this._instance?Obe(Sb,this._instance.config.custom_blocked_useragents):void 0}}var Igt=BC("[PostHog ExternalIntegrations]"),Cgt={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class xgt{constructor(e){this._instance=e}J(e,t){var n;(n=jh.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,r=>{if(r)return Igt.error("failed to load script",r);t()})}startIfEnabledOrStop(){var e=this,t=function(s){var a,c,l;!r||(a=jh.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[s]||e.J(Cgt[s],()=>{var u;(u=jh.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[s])==null||u.start(e._instance)}),!r&&(c=jh.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[s]&&((l=jh.__PosthogExtensions__)==null||(l=l.integrations)==null||(l=l[s])==null||l.stop())};for(var[n,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;t(n)}}}var h8={},PX=()=>{},_M="posthog",Ybe=!Ppt&&(VE==null?void 0:VE.indexOf("MSIE"))===-1&&(VE==null?void 0:VE.indexOf("Mozilla"))===-1,Hbe=i=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:fft(lu==null?void 0:lu.location),persistence:"localStorage+cookie",persistence_name:"",loaded:PX,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:i!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:i??"unset",debug:HE&&nI(HE==null?void 0:HE.search)&&HE.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(Mo==null||(e=Mo.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",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;Mu.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:kX},error_tracking:{},_onCapture:PX}},Vbe=i=>{var e={};ol(i.process_person)||(e.person_profiles=i.process_person),ol(i.xhr_headers)||(e.request_headers=i.xhr_headers),ol(i.cookie_name)||(e.persistence_name=i.cookie_name),ol(i.disable_cookie)||(e.disable_persistence=i.disable_cookie),ol(i.store_google)||(e.save_campaign_params=i.store_google),ol(i.verbose)||(e.debug=i.verbose);var t=MI({},e,i);return $1(i.property_blacklist)&&(ol(i.property_denylist)?t.property_denylist=i.property_blacklist:$1(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:Mu.error("Invalid value for property_denylist config: "+i.property_denylist)),t};class Egt{constructor(){this.__forceAllowLocalhost=!1}get gs(){return this.__forceAllowLocalhost}set gs(e){Mu.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class LF{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Egt,this.bs=!1,this.version=P5.LIB_VERSION,this.ys=new Pbe,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Hbe(),this.SentryIntegration=Bpt,this.sentryIntegration=e=>function(t,n){var r=qEe(t,n);return{name:XEe,processEvent:o=>r(o)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.ws=!1,this.Ss=null,this.$s=null,this.xs=null,this.featureFlags=new tgt(this),this.toolbar=new Spt(this),this.scrollManager=new dgt(this),this.pageViewManager=new Tpt(this),this.surveys=new sgt(this),this.experiments=new Fx(this),this.exceptions=new Lpt(this),this.rateLimiter=new agt(this),this.requestRouter=new _gt(this),this.consent=new Pft(this),this.externalIntegrations=new xgt(this),this.people={set:(e,t,n)=>{var r=nI(e)?{[e]:t}:e;this.setPersonProperties(r),n==null||n({})},set_once:(e,t,n)=>{var r=nI(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n==null||n({})}},this.on("eventCaptured",e=>Mu.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,t,n){if(n&&n!==_M){var r,o=(r=h8[n])!==null&&r!==void 0?r:new LF;return o._init(e,t,n),h8[n]=o,h8[_M][n]=o,o}return this._init(e,t,n)}_init(e,t,n){var r,o;if(t===void 0&&(t={}),ol(e)||kZ(e))return Mu.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 Mu.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.ks=t,this.Es=[],t.person_profiles&&(this.$s=t.person_profiles),this.set_config(MI({},Hbe(t.defaults),Vbe(t),{name:n,token:e})),this.config.on_xhr_error&&Mu.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:F5.GZipJS;var s=this.Is();this.persistence=new RX(this.config,s),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new RX(jl({},this.config,{persistence:"sessionStorage"}),s);var a=jl({},this.persistence.props),c=jl({},this.sessionPersistence.props);if(this.register({$initialization_time:new Date().toISOString()}),this.Ps=new lgt(E=>this.Rs(E),this.config.request_queue_config),this.Ts=new Agt(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new pgt(this),this.sessionPropsManager=new fgt(this,this.sessionManager,this.persistence)),new Mpt(this).startIfEnabledOrStop(),this.siteApps=new mgt(this),(r=this.siteApps)==null||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Ept(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Sft(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Npt(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Rpt(this),this.exceptionObserver=new Uft(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new CEe(this,Lft),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new $ft(this),this.historyAutocapture.startIfEnabled(),P5.DEBUG=P5.DEBUG||this.config.debug,P5.DEBUG&&Mu.info("Starting in debug mode",{this:this,config:t,thisC:jl({},this.config),p:a,s:c}),((o=t.bootstrap)==null?void 0:o.distinctID)!==void 0){var l,u,A=this.config.get_device_id(s3()),d=(l=t.bootstrap)!=null&&l.isIdentifiedID?A:t.bootstrap.distinctID;this.persistence.set_property(L5,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.Ms()){var h,f,y=Object.keys(((h=t.bootstrap)==null?void 0:h.featureFlags)||{}).filter(E=>{var b;return!((b=t.bootstrap)==null||(b=b.featureFlags)==null||!b[E])}).reduce((E,b)=>{var M;return E[b]=((M=t.bootstrap)==null||(M=M.featureFlags)==null?void 0:M[b])||!1,E},{}),_=Object.keys(((f=t.bootstrap)==null?void 0:f.featureFlagPayloads)||{}).filter(E=>y[E]).reduce((E,b)=>{var M,z;return(M=t.bootstrap)!=null&&(M=M.featureFlagPayloads)!=null&&M[b]&&(E[b]=(z=t.bootstrap)==null||(z=z.featureFlagPayloads)==null?void 0:z[b]),E},{});this.featureFlags.receivedFeatureFlags({featureFlags:y,featureFlagPayloads:_})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:pF,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(s3());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(L5,"anonymous")}return Bv(Mo,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?bpt(this,()=>this.Cs()):this.Cs(),n2(this.config._onCapture)&&this.config._onCapture!==PX&&(Mu.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",E=>this.config._onCapture(E.event,E))),this.config.ip&&Mu.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}Re(e){var t,n,r,o,s,a,c,l;if(!lu||!lu.body)return Mu.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Re(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=bg(e.supportedCompression,F5.GZipJS)?F5.GZipJS:bg(e.supportedCompression,F5.Base64)?F5.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.$s?this.$s:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(s=this.heatmaps)==null||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(a=this.webVitalsAutocapture)==null||a.onRemoteConfig(e),(c=this.exceptionObserver)==null||c.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(l=this.deadClicksAutocapture)==null||l.onRemoteConfig(e)}Cs(){try{this.config.loaded(this)}catch(e){Mu.critical("`loaded` function failed",e)}this.Fs(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Os()},1),new cgt(this).load(),this.featureFlags.flags()}Fs(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this.Ps)==null||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||r3(this.__request_queue,e=>this.Rs(e)),this.__request_queue=[],this.Fs()}_handle_unload(){var e,t;this.config.request_batching?(this.As()&&this.capture("$pageleave"),(e=this.Ps)==null||e.unload(),(t=this.Ts)==null||t.unload()):this.As()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Pe(e){this.__loaded&&(Ybe?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=NF(e.url,{ip:this.config.ip?1:0}),e.headers=jl({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var n,r,o,s=jl({},t);s.timeout=s.timeout||6e4,s.url=NF(s.url,{_:new Date().getTime().toString(),ver:P5.LIB_VERSION,compression:s.compression});var a=(n=s.transport)!==null&&n!==void 0?n:"fetch",c=(r=(o=zxe(o8,l=>l.transport===a))==null?void 0:o.method)!==null&&r!==void 0?r:o8[0].method;if(!c)throw new Error("No available transport method");c(s)})(jl({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(r=this.config).on_request_error)==null||n.call(r,t)),e.callback==null||e.callback(t)}}))))}Rs(e){this.Ts?this.Ts.retriableRequest(e):this.Pe(e)}_execute_array(e){var t,n=[],r=[],o=[];r3(e,a=>{a&&(t=a[0],$1(t)?o.push(a):n2(a)?a.call(this):$1(a)&&t==="alias"?n.push(a):$1(a)&&t.indexOf("capture")!==-1&&n2(this[t])?o.push(a):r.push(a))});var s=function(a,c){r3(a,function(l){if($1(l[0])){var u=c;Q_(l,function(A){u=u[A[0]].apply(u,A.slice(1))})}else this[l[0]].apply(this,l.slice(1))},c)};s(n,this),s(r,this),s(o,this)}Ms(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ps){if(!this.consent.isOptedOut())if(!ol(e)&&nI(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){t!=null&&t.$current_url&&!nI(t==null?void 0:t.$current_url)&&(Mu.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,a=(n==null?void 0:n.timestamp)||s,c=s3(),l={uuid:c,event:e,properties:this.calculateEventProperties(e,t||{},a,c)};o&&(l.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),n!=null&&n.$set&&(l.$set=n==null?void 0:n.$set);var u,A,d=this.Ds(n==null?void 0:n.$set_once);if(d&&(l.$set_once=d),(l=dft(l,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,ol(n==null?void 0:n.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=s),e===NX.DISMISSED||e===NX.SENT){var h=t==null?void 0:t[Fbe.SURVEY_ID],f=t==null?void 0:t[Fbe.SURVEY_ITERATION];localStorage.setItem((A=""+TX+(u={id:h,current_iteration:f}).id,u.current_iteration&&u.current_iteration>0&&(A=""+TX+u.id+"_"+u.current_iteration),A),"true"),l.$set=jl({},l.$set,{[igt({id:h,current_iteration:f},e===NX.SENT?"responded":"dismissed")]:!0})}var y=jl({},l.properties.$set,l.$set);if(aM(y)||this.setPersonPropertiesForFlags(y),!py(this.config.before_send)){var _=this.Ls(l);if(!_)return;l=_}this.ys.emit("eventCaptured",l);var v={method:"POST",url:(r=n==null?void 0:n._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:n==null?void 0:n._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Rs(v):this.Ps.enqueue(v),l}Mu.critical("This capture call is ignored due to client rate limiting.")}}else Mu.error("No event name provided to posthog.capture")}else Mu.uninitializedWarning("posthog.capture")}Ve(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,n,r,o){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var s=o?void 0:this.persistence.remove_event_timer(e),a=jl({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(a.$cookieless_mode=!0),e==="$snapshot"){var c=jl({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=c.distinct_id,(!nI(a.distinct_id)&&!Tx(a.distinct_id)||kZ(a.distinct_id))&&Mu.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,u=qpt(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:A,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,n.getTime());a.$session_id=A,a.$window_id=d}this.sessionPropsManager&&MI(a,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&MI(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(h=this.Ts)==null?void 0:h.length}catch(v){a.$sdk_debug_error_capturing_properties=String(v)}if(this.requestRouter.region===d8.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),a=MI(a,l),e==="$pageview"&&lu&&(a.title=lu.title),!ol(s)){var f=n.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}VE&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=MI({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),$1(this.config.property_denylist)?Q_(this.config.property_denylist,function(v){delete a[v]}):Mu.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(Mu.error("sanitize_properties is deprecated. Use before_send instead"),a=y(a,e));var _=this.js();return a.$process_person_profile=_,_&&!o&&this.Ns("_calculate_event_properties"),a}Ds(e){var t;if(!this.persistence||!this.js()||this.bs)return e;var n=this.persistence.get_initial_props(),r=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),o=MI({},n,r||{},e||{}),s=this.config.sanitize_properties;return s&&(Mu.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),this.bs=!0,aM(o)?void 0:o}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}zs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.ys.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,n){if(!this.__loaded||!this.persistence)return Mu.uninitializedWarning("posthog.identify");if(Tx(e)&&(e=e.toString(),Mu.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Mu.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.');else if(e!==pF){if(this.Ns("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(JN)&&(this.unregister(JN),this.register({distinct_id:e}));var s=(this.persistence.get_property(L5)||"anonymous")==="anonymous";e!==r&&s?(this.persistence.set_property(L5,"identified"),this.setPersonPropertiesForFlags(jl({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.xs=rbe(e,t,n),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(dF))}}else Mu.critical('The string "'+pF+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Mu.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ns("posthog.setPersonProperties")){var n=rbe(this.get_distinct_id(),e,t);this.xs!==n?(this.setPersonPropertiesForFlags(jl({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.xs=n):Mu.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,n){if(e&&t){if(this.Ns("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:jl({},r,{[e]:t})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===t||n||this.reloadFeatureFlags()}}else Mu.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Ns("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,o;if(Mu.info("reset"),!this.__loaded)return Mu.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(L5,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.xs=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:pF,$device_id:null},"");else{var a=this.config.get_device_id(s3());this.register_once({distinct_id:a,$device_id:e?a:s},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&n){var o,s=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!n)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-s,0)}return r}alias(e,t){return e===this.get_property(Yxe)?(Mu.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ns("posthog.alias")?(ol(t)&&(t=this.get_distinct_id()),e!==t?(this.zs(JN,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Mu.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=jl({},this.config);if(tI(e)){var n,r,o,s,a;MI(this.config,Vbe(e));var c=this.Is();(n=this.persistence)==null||n.update_config(this.config,t,c),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new RX(jl({},this.config,{persistence:"sessionStorage"}),c),N9.O()&&N9.D("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(P5.DEBUG=!0,Mu.info("set_config",{config:e,oldConfig:t,newConfig:jl({},this.config)})),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.Us(),(a=this.externalIntegrations)==null||a.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,n={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,o,s,a,c;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),n.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),n.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),n.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),n.event_trigger&&((c=this.sessionRecording)==null||c.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var n=new Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(jl({},qft((r=>r instanceof Error)(e)?{error:e,event:e.message}:{event:e},{syntheticException:n}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:_M;return t!==_M&&(t=_M+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(L5))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(L5))==="identified"}js(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&aM(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[JN])&&((t=this.persistence)==null||(t=t.props)==null||!t[fF]))}As(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.js()||this.Ns("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ns(e){return this.config.person_profiles==="never"?(Mu.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.zs(fF,!0),!0)}Is(){var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default;return this.config.disable_persistence||e&&!!t}Us(){var e,t,n,r,o=this.Is();return((e=this.persistence)==null?void 0:e.Ae)!==o&&((n=this.persistence)==null||n.set_disabled(o)),((t=this.sessionPersistence)==null?void 0:t.Ae)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Us(),(ol(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e==null?void 0:e.captureEventName)!==null&&t!==void 0?t:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Os()}opt_out_capturing(){this.consent.optInOut(!1),this.Us()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Us()}_is_bot(){return Sb?Obe(Sb,this.config.custom_blocked_useragents):void 0}Os(){lu&&(lu.visibilityState==="visible"?this.ws||(this.ws=!0,this.capture("$pageview",{title:lu.title},{send_instantly:!0}),this.Ss&&(lu.removeEventListener("visibilitychange",this.Ss),this.Ss=null)):this.Ss||(this.Ss=this.Os.bind(this),Bv(lu,"visibilitychange",this.Ss)))}debug(e){e===!1?(Mo==null||Mo.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(Mo==null||Mo.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var e,t,n,r,o,s,a,c=this.ks||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Mu.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):(n="advanced_disable_decide",r=!1,o=Mu,s=(t="advanced_disable_flags")in(e=c)&&!ol(e[t]),a=n in e&&!ol(e[n]),s?e[t]:a?(o&&o.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n]):r)}Ls(e){if(py(this.config.before_send))return e;var t=$1(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),py(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return lft(e.event)?Mu.warn(o+". This can cause unexpected behavior."):Mu.info(o),null}n.properties&&!aM(n.properties)||Mu.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;return(e=this.pageViewManager.ce)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}}(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=Aft(i.prototype[e[t]])})(LF,["identify"]);var Kbe,UF=(Kbe=h8[_M]=new LF,function(){function i(){i.done||(i.done=!0,Ybe=!1,Q_(h8,function(e){e._dom_loaded()}))}lu!=null&&lu.addEventListener?lu.readyState==="complete"?i():Bv(lu,"DOMContentLoaded",i,{capture:!1}):Mo&&Mu.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Kbe);!window.location.hostname.includes("localhost")&&!window.location.hostname.includes("127.0.0.1")&&(UF.__loaded||UF.init("phc_htd8AQjSfVEsFCLQMAiUooG4Q0DKBCjqYuQglc9V3Wo",{api_host:"https://postpig.tscircuit.com",person_profiles:"always"}));function bgt(i){const e=String.fromCodePoint(...i);return btoa(e)}var Mb=Uint8Array,Rb=Uint16Array,FX=Int32Array,LX=new Mb([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]),UX=new Mb([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]),jbe=new Mb([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Jbe=function(i,e){for(var t=new Rb(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var r=new FX(t[30]),n=1;n<30;++n)for(var o=t[n];o<t[n+1];++o)r[o]=o-t[n]<<5|n;return{b:t,r}},Wbe=Jbe(LX,2),Bgt=Wbe.b,GX=Wbe.r;Bgt[28]=258,GX[258]=28;for(var wgt=Jbe(UX,0),Zbe=wgt.r,OX=new Rb(32768),tv=0;tv<32768;++tv){var A3=(tv&43690)>>1|(tv&21845)<<1;A3=(A3&52428)>>2|(A3&13107)<<2,A3=(A3&61680)>>4|(A3&3855)<<4,OX[tv]=((A3&65280)>>8|(A3&255)<<8)>>1}for(var f8=function(i,e,t){for(var n=i.length,r=0,o=new Rb(e);r<n;++r)i[r]&&++o[i[r]-1];var s=new Rb(e);for(r=1;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;var a;if(t){a=new Rb(1<<e);var c=15-e;for(r=0;r<n;++r)if(i[r])for(var l=r<<4|i[r],u=e-i[r],A=s[i[r]-1]++<<u,d=A|(1<<u)-1;A<=d;++A)a[OX[A]>>c]=l}else for(a=new Rb(n),r=0;r<n;++r)i[r]&&(a[r]=OX[s[i[r]-1]++]>>15-i[r]);return a},JS=new Mb(288),tv=0;tv<144;++tv)JS[tv]=8;for(var tv=144;tv<256;++tv)JS[tv]=9;for(var tv=256;tv<280;++tv)JS[tv]=7;for(var tv=280;tv<288;++tv)JS[tv]=8;for(var GF=new Mb(32),tv=0;tv<32;++tv)GF[tv]=5;var Sgt=f8(JS,9,0),Qgt=f8(GF,5,0),Xbe=function(i){return(i+7)/8|0},qbe=function(i,e,t){return(t==null||t>i.length)&&(t=i.length),new Mb(i.subarray(e,t))},O5=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8},p8=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8,i[n+2]|=t>>16},zX=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var r=t.length,o=t.slice();if(!r)return{t:n2e,l:0};if(r==1){var s=new Mb(t[0].s+1);return s[t[0].s]=1,{t:s,l:1}}t.sort(function(z,U){return z.f-U.f}),t.push({s:-1,f:25001});var a=t[0],c=t[1],l=0,u=1,A=2;for(t[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=r-1;)a=t[t[l].f<t[A].f?l++:A++],c=t[l!=u&&t[l].f<t[A].f?l++:A++],t[u++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=o[0].s,n=1;n<r;++n)o[n].s>d&&(d=o[n].s);var h=new Rb(d+1),f=YX(t[u-1],h,0);if(f>e){var n=0,y=0,_=f-e,v=1<<_;for(o.sort(function(U,L){return h[L.s]-h[U.s]||U.f-L.f});n<r;++n){var E=o[n].s;if(h[E]>e)y+=v-(1<<f-h[E]),h[E]=e;else break}for(y>>=_;y>0;){var b=o[n].s;h[b]<e?y-=1<<e-h[b]++-1:++n}for(;n>=0&&y;--n){var M=o[n].s;h[M]==e&&(--h[M],++y)}f=e}return{t:new Mb(h),l:f}},YX=function(i,e,t){return i.s==-1?Math.max(YX(i.l,e,t+1),YX(i.r,e,t+1)):e[i.s]=t},$be=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new Rb(++e),n=0,r=i[0],o=1,s=function(c){t[n++]=c},a=1;a<=e;++a)if(i[a]==r&&a!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=i[a]}return{c:t.subarray(0,n),n:e}},g8=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},e2e=function(i,e,t){var n=t.length,r=Xbe(e+2);i[r]=n&255,i[r+1]=n>>8,i[r+2]=i[r]^255,i[r+3]=i[r+1]^255;for(var o=0;o<n;++o)i[r+o+4]=t[o];return(r+4+n)*8},t2e=function(i,e,t,n,r,o,s,a,c,l,u){O5(e,u++,t),++r[256];for(var A=zX(r,15),d=A.t,h=A.l,f=zX(o,15),y=f.t,_=f.l,v=$be(d),E=v.c,b=v.n,M=$be(y),z=M.c,U=M.n,L=new Rb(19),F=0;F<E.length;++F)++L[E[F]&31];for(var F=0;F<z.length;++F)++L[z[F]&31];for(var Y=zX(L,7),G=Y.t,ee=Y.l,j=19;j>4&&!G[jbe[j-1]];--j);var ie=l+5<<3,he=g8(r,JS)+g8(o,GF)+s,ge=g8(r,d)+g8(o,y)+s+14+3*j+g8(L,G)+2*L[16]+3*L[17]+7*L[18];if(c>=0&&ie<=he&&ie<=ge)return e2e(e,u,i.subarray(c,c+l));var le,me,pe,Be;if(O5(e,u,1+(ge<he)),u+=2,ge<he){le=f8(d,h,0),me=d,pe=f8(y,_,0),Be=y;var Re=f8(G,ee,0);O5(e,u,b-257),O5(e,u+5,U-1),O5(e,u+10,j-4),u+=14;for(var F=0;F<j;++F)O5(e,u+3*F,G[jbe[F]]);u+=3*j;for(var De=[E,z],we=0;we<2;++we)for(var Je=De[we],F=0;F<Je.length;++F){var qe=Je[F]&31;O5(e,u,Re[qe]),u+=G[qe],qe>15&&(O5(e,u,Je[F]>>5&127),u+=Je[F]>>12)}}else le=Sgt,me=JS,pe=Qgt,Be=GF;for(var F=0;F<a;++F){var rt=n[F];if(rt>255){var qe=rt>>18&31;p8(e,u,le[qe+257]),u+=me[qe+257],qe>7&&(O5(e,u,rt>>23&31),u+=LX[qe]);var yt=rt&31;p8(e,u,pe[yt]),u+=Be[yt],yt>3&&(p8(e,u,rt>>5&8191),u+=UX[yt])}else p8(e,u,le[rt]),u+=me[rt]}return p8(e,u,le[256]),u+me[256]},Mgt=new FX([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),n2e=new Mb(0),Rgt=function(i,e,t,n,r,o){var s=o.z||i.length,a=new Mb(n+s+5*(1+Math.ceil(s/7e3))+r),c=a.subarray(n,a.length-r),l=o.l,u=(o.r||0)&7;if(e){u&&(c[0]=o.r>>3);for(var A=Mgt[e-1],d=A>>13,h=A&8191,f=(1<<t)-1,y=o.p||new Rb(32768),_=o.h||new Rb(f+1),v=Math.ceil(t/3),E=2*v,b=function(gt){return(i[gt]^i[gt+1]<<v^i[gt+2]<<E)&f},M=new FX(25e3),z=new Rb(288),U=new Rb(32),L=0,F=0,Y=o.i||0,G=0,ee=o.w||0,j=0;Y+2<s;++Y){var ie=b(Y),he=Y&32767,ge=_[ie];if(y[he]=ge,_[ie]=he,ee<=Y){var le=s-Y;if((L>7e3||G>24576)&&(le>423||!l)){u=t2e(i,c,0,M,z,U,F,G,j,Y-j,u),G=L=F=0,j=Y;for(var me=0;me<286;++me)z[me]=0;for(var me=0;me<30;++me)U[me]=0}var pe=2,Be=0,Re=h,De=he-ge&32767;if(le>2&&ie==b(Y-De))for(var we=Math.min(d,le)-1,Je=Math.min(32767,Y),qe=Math.min(258,le);De<=Je&&--Re&&he!=ge;){if(i[Y+pe]==i[Y+pe-De]){for(var rt=0;rt<qe&&i[Y+rt]==i[Y+rt-De];++rt);if(rt>pe){if(pe=rt,Be=De,rt>we)break;for(var yt=Math.min(De,rt-2),wt=0,me=0;me<yt;++me){var mt=Y-De+me&32767,ke=y[mt],Xe=mt-ke&32767;Xe>wt&&(wt=Xe,ge=mt)}}}he=ge,ge=y[he],De+=he-ge&32767}if(Be){M[G++]=268435456|GX[pe]<<18|Zbe[Be];var et=GX[pe]&31,ht=Zbe[Be]&31;F+=LX[et]+UX[ht],++z[257+et],++U[ht],ee=Y+pe,++L}else M[G++]=i[Y],++z[i[Y]]}}for(Y=Math.max(Y,ee);Y<s;++Y)M[G++]=i[Y],++z[i[Y]];u=t2e(i,c,l,M,z,U,F,G,j,Y-j,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=_,o.p=y,o.i=Y,o.w=ee)}else{for(var Y=o.w||0;Y<s+l;Y+=65535){var Bt=Y+65535;Bt>=s&&(c[u/8|0]=l,Bt=s),u=e2e(c,u+1,i.subarray(Y,Bt))}o.i=s}return qbe(a,0,n+Xbe(u)+r)},Dgt=function(){for(var i=new Int32Array(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(t&1&&-306674912)^t>>>1;i[e]=t}return i}(),Ngt=function(){var i=-1;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=Dgt[t&255^e[n]]^t>>>8;i=t},d:function(){return~i}}},Tgt=function(i,e,t,n,r){if(!r&&(r={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),s=new Mb(o.length+i.length);s.set(o),s.set(i,o.length),i=s,r.w=o.length}return Rgt(i,e.level==null?6:e.level,e.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(i.length)))*1.5):20:12+e.mem,t,n,r)},HX=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},kgt=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&HX(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var n=0;n<=t.length;++n)i[n+10]=t.charCodeAt(n)}},Pgt=function(i){return 10+(i.filename?i.filename.length+1:0)};function i2e(i,e){e||(e={});var t=Ngt(),n=i.length;t.p(i);var r=Tgt(i,e,Pgt(e),8),o=r.length;return kgt(r,e),HX(r,o-8,t.d()),HX(r,o-4,n),r}var r2e=typeof TextEncoder<"u"&&new TextEncoder,Fgt=typeof TextDecoder<"u"&&new TextDecoder,Lgt=0;try{Fgt.decode(n2e,{stream:!0}),Lgt=1}catch{}function o2e(i,e){var t;if(r2e)return r2e.encode(i);for(var n=i.length,r=new Mb(i.length+(i.length>>1)),o=0,s=function(l){r[o++]=l},t=0;t<n;++t){if(o+5>r.length){var a=new Mb(o+8+(n-t<<1));a.set(r),r=a}var c=i.charCodeAt(t);c<128||e?s(c):c<2048?(s(192|c>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|i.charCodeAt(++t)&1023,s(240|c>>18),s(128|c>>12&63),s(128|c>>6&63),s(128|c&63)):(s(224|c>>12),s(128|c>>6&63),s(128|c&63))}return qbe(r,0,o)}function Ugt(i,e){const t=JSON.stringify(i),n=i2e(o2e(t));return`https://tscircuit.com/editor?#data:application/gzip;base64,${bgt(n)}`}function o1(...i){return rft(xB(i))}const s2e=i=>i.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),Ggt=wht,a2e=vt.forwardRef(({className:i,...e},t)=>ut.jsx(Ixe,{ref:t,className:o1("rf-inline-flex rf-h-9 rf-items-center rf-justify-center rf-rounded-lg rf-bg-zinc-100 rf-p-1 rf-text-zinc-500 dark:rf-bg-zinc-800 dark:rf-text-zinc-400",i),...e}));a2e.displayName=Ixe.displayName;const vM=vt.forwardRef(({className:i,...e},t)=>ut.jsx(Cxe,{ref:t,className:o1("rf-inline-flex rf-items-center rf-justify-center rf-whitespace-nowrap rf-rounded-md rf-px-3 rf-py-1 rf-text-sm rf-font-medium rf-ring-offset-white rf-transition-all focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 disabled:rf-pointer-events-none disabled:rf-opacity-50 data-[state=active]:rf-bg-white data-[state=active]:rf-text-zinc-950 data-[state=active]:rf-shadow dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=active]:rf-bg-zinc-950 dark:data-[state=active]:rf-text-zinc-50",i),...e}));vM.displayName=Cxe.displayName;const MB=vt.forwardRef(({className:i,...e},t)=>ut.jsx(xxe,{ref:t,className:o1("rf-h-full rf-mt-2 rf-ring-offset-white focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300",i),...e}));MB.displayName=xxe.displayName;var Um;(function(i){i.assertEqual=r=>{};function e(r){}i.assertIs=e;function t(r){throw new Error}i.assertNever=t,i.arrayToEnum=r=>{const o={};for(const s of r)o[s]=s;return o},i.getValidEnumValues=r=>{const o=i.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),s={};for(const a of o)s[a]=r[a];return i.objectValues(s)},i.objectValues=r=>i.objectKeys(r).map(function(o){return r[o]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},i.find=(r,o)=>{for(const s of r)if(o(s))return s},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}i.joinValues=n,i.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Um||(Um={}));var c2e;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(c2e||(c2e={}));const uu=Um.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),d3=i=>{switch(typeof i){case"undefined":return uu.undefined;case"string":return uu.string;case"number":return Number.isNaN(i)?uu.nan:uu.number;case"boolean":return uu.boolean;case"function":return uu.function;case"bigint":return uu.bigint;case"symbol":return uu.symbol;case"object":return Array.isArray(i)?uu.array:i===null?uu.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?uu.promise:typeof Map<"u"&&i instanceof Map?uu.map:typeof Set<"u"&&i instanceof Set?uu.set:typeof Date<"u"&&i instanceof Date?uu.date:uu.object;default:return uu.unknown}},xa=Um.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let RB=class pdt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(o){return o.message},n={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let a=n,c=0;for(;c<s.path.length;){const l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return r(this),n}static assert(e){if(!(e instanceof pdt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Um.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};RB.create=i=>new RB(i);const m8=(i,e)=>{let t;switch(i.code){case xa.invalid_type:i.received===uu.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case xa.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,Um.jsonStringifyReplacer)}`;break;case xa.unrecognized_keys:t=`Unrecognized key(s) in object: ${Um.joinValues(i.keys,", ")}`;break;case xa.invalid_union:t="Invalid input";break;case xa.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Um.joinValues(i.options)}`;break;case xa.invalid_enum_value:t=`Invalid enum value. Expected ${Um.joinValues(i.options)}, received '${i.received}'`;break;case xa.invalid_arguments:t="Invalid function arguments";break;case xa.invalid_return_type:t="Invalid function return type";break;case xa.invalid_date:t="Invalid date";break;case xa.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:Um.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case xa.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case xa.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case xa.custom:t="Invalid input";break;case xa.invalid_intersection_types:t="Intersection results could not be merged";break;case xa.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case xa.not_finite:t="Number must be finite";break;default:t=e.defaultError,Um.assertNever(i)}return{message:t}};let Ogt=m8;function VX(){return Ogt}const KX=i=>{const{data:e,path:t,errorMaps:n,issueData:r}=i,o=[...t,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let a="";const c=n.filter(l=>!!l).slice().reverse();for(const l of c)a=l(s,{data:e,defaultError:a}).message;return{...r,path:o,message:a}};function _l(i,e){const t=VX(),n=KX({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===m8?void 0:m8].filter(r=>!!r)});i.common.issues.push(n)}let Db=class gdt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if(r.status==="aborted")return K0;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const o=await r.key,s=await r.value;n.push({key:o,value:s})}return gdt.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return K0;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}};const K0=Object.freeze({status:"aborted"}),y8=i=>({status:"dirty",value:i}),jE=i=>({status:"valid",value:i}),l2e=i=>i.status==="aborted",u2e=i=>i.status==="dirty",IM=i=>i.status==="valid",OF=i=>typeof Promise<"u"&&i instanceof Promise;var QA;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(QA||(QA={}));let DB=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const A2e=(i,e)=>{if(IM(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new RB(i.common.issues);return this._error=t,this._error}}};function Zf(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:r}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(s,a)=>{const{message:c}=i;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??t??a.defaultError}},description:r}}let Bg=class{get description(){return this._def.description}_getType(e){return d3(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:d3(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Db,ctx:{common:e.parent.common,data:e.data,parsedType:d3(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(OF(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d3(e)},r=this._parseSync({data:e,path:n.path,parent:n});return A2e(n,r)}"~validate"(e){var n,r;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d3(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:t});return IM(o)?{value:o.value}:{issues:t.common.issues}}catch(o){(r=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(o=>IM(o)?{value:o.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d3(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(OF(r)?r:Promise.resolve(r));return A2e(n,o)}refine(e,t){const n=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,o)=>{const s=e(r),a=()=>o.addIssue({code:xa.custom,...n(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new ZS({schema:this,typeName:rh.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return H5.create(this,this._def)}nullable(){return XS.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xM.create(this)}promise(){return v8.create(this,this._def)}or(e){return HF.create([this,e],this._def)}and(e){return VF.create(this,e,this._def)}transform(e){return new ZS({...Zf(this._def),schema:this,typeName:rh.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new JF({...Zf(this._def),innerType:this,defaultValue:t,typeName:rh.ZodDefault})}brand(){return new C2e({typeName:rh.ZodBranded,type:this,...Zf(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new WF({...Zf(this._def),innerType:this,catchValue:t,typeName:rh.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return hmt.create(this,e)}readonly(){return ZF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const zgt=/^c[^\s-]{8,}$/i,Ygt=/^[0-9a-z]+$/,Hgt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vgt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Kgt=/^[a-z0-9_-]{21}$/i,jgt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Jgt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Wgt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zgt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let jX;const Xgt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qgt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$gt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,emt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tmt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nmt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,d2e="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",imt=new RegExp(`^${d2e}$`);function h2e(i){let e="[0-5]\\d";i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`);const t=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function rmt(i){return new RegExp(`^${h2e(i)}$`)}function omt(i){let e=`${d2e}T${h2e(i)}`;const t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function smt(i,e){return!!((e==="v4"||!e)&&Xgt.test(i)||(e==="v6"||!e)&&$gt.test(i))}function amt(i,e){if(!jgt.test(i))return!1;try{const[t]=i.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function cmt(i,e){return!!((e==="v4"||!e)&&qgt.test(i)||(e==="v6"||!e)&&emt.test(i))}let zF=class YP extends Bg{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==uu.string){const o=this._getOrReturnCtx(e);return _l(o,{code:xa.invalid_type,expected:uu.string,received:o.parsedType}),K0}const n=new Db;let r;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(r=this._getOrReturnCtx(e,r),s?_l(r,{code:xa.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&_l(r,{code:xa.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Wgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"email",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")jX||(jX=new RegExp(Zgt,"u")),jX.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"emoji",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Vgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"uuid",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Kgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"nanoid",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")zgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"cuid",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Ygt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"cuid2",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Hgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"ulid",code:xa.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),_l(r,{validation:"url",code:xa.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"regex",code:xa.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?omt(o).test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?imt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?rmt(o).test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Jgt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"duration",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?smt(e.data,o.version)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"ip",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?amt(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"jwt",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?cmt(e.data,o.version)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"cidr",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?tmt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"base64",code:xa.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?nmt.test(e.data)||(r=this._getOrReturnCtx(e,r),_l(r,{validation:"base64url",code:xa.invalid_string,message:o.message}),n.dirty()):Um.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:xa.invalid_string,...QA.errToObj(n)})}_addCheck(e){return new YP({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...QA.errToObj(e)})}url(e){return this._addCheck({kind:"url",...QA.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...QA.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...QA.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...QA.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...QA.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...QA.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...QA.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...QA.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...QA.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...QA.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...QA.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...QA.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...QA.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...QA.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...QA.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...QA.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...QA.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...QA.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...QA.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...QA.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...QA.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...QA.errToObj(t)})}nonempty(e){return this.min(1,QA.errToObj(e))}trim(){return new YP({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new YP({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new YP({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};zF.create=i=>new zF({checks:[],typeName:rh.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...Zf(i)});function lmt(i,e){const t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n,o=Number.parseInt(i.toFixed(r).replace(".","")),s=Number.parseInt(e.toFixed(r).replace(".",""));return o%s/10**r}let JX=class uCe extends Bg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==uu.number){const o=this._getOrReturnCtx(e);return _l(o,{code:xa.invalid_type,expected:uu.number,received:o.parsedType}),K0}let n;const r=new Db;for(const o of this._def.checks)o.kind==="int"?Um.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?lmt(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.not_finite,message:o.message}),r.dirty()):Um.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,QA.toString(t))}gt(e,t){return this.setLimit("min",e,!1,QA.toString(t))}lte(e,t){return this.setLimit("max",e,!0,QA.toString(t))}lt(e,t){return this.setLimit("max",e,!1,QA.toString(t))}setLimit(e,t,n,r){return new uCe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:QA.toString(r)}]})}_addCheck(e){return new uCe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:QA.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:QA.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:QA.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:QA.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:QA.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:QA.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:QA.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:QA.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:QA.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Um.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};JX.create=i=>new JX({checks:[],typeName:rh.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...Zf(i)});let f2e=class ACe extends Bg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==uu.bigint)return this._getInvalidInput(e);let n;const r=new Db;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),_l(n,{code:xa.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):Um.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return _l(t,{code:xa.invalid_type,expected:uu.bigint,received:t.parsedType}),K0}gte(e,t){return this.setLimit("min",e,!0,QA.toString(t))}gt(e,t){return this.setLimit("min",e,!1,QA.toString(t))}lte(e,t){return this.setLimit("max",e,!0,QA.toString(t))}lt(e,t){return this.setLimit("max",e,!1,QA.toString(t))}setLimit(e,t,n,r){return new ACe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:QA.toString(r)}]})}_addCheck(e){return new ACe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:QA.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:QA.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:QA.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:QA.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:QA.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};f2e.create=i=>new f2e({checks:[],typeName:rh.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...Zf(i)});let WX=class extends Bg{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==uu.boolean){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.boolean,received:n.parsedType}),K0}return jE(e.data)}};WX.create=i=>new WX({typeName:rh.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...Zf(i)});let p2e=class mdt extends Bg{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==uu.date){const o=this._getOrReturnCtx(e);return _l(o,{code:xa.invalid_type,expected:uu.date,received:o.parsedType}),K0}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return _l(o,{code:xa.invalid_date}),K0}const n=new Db;let r;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),_l(r,{code:xa.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Um.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new mdt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:QA.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:QA.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};p2e.create=i=>new p2e({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:rh.ZodDate,...Zf(i)});let g2e=class extends Bg{_parse(e){if(this._getType(e)!==uu.symbol){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.symbol,received:n.parsedType}),K0}return jE(e.data)}};g2e.create=i=>new g2e({typeName:rh.ZodSymbol,...Zf(i)});let ZX=class extends Bg{_parse(e){if(this._getType(e)!==uu.undefined){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.undefined,received:n.parsedType}),K0}return jE(e.data)}};ZX.create=i=>new ZX({typeName:rh.ZodUndefined,...Zf(i)});let YF=class extends Bg{_parse(e){if(this._getType(e)!==uu.null){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.null,received:n.parsedType}),K0}return jE(e.data)}};YF.create=i=>new YF({typeName:rh.ZodNull,...Zf(i)});let _8=class extends Bg{constructor(){super(...arguments),this._any=!0}_parse(e){return jE(e.data)}};_8.create=i=>new _8({typeName:rh.ZodAny,...Zf(i)});let CM=class extends Bg{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jE(e.data)}};CM.create=i=>new CM({typeName:rh.ZodUnknown,...Zf(i)});let h3=class extends Bg{_parse(e){const t=this._getOrReturnCtx(e);return _l(t,{code:xa.invalid_type,expected:uu.never,received:t.parsedType}),K0}};h3.create=i=>new h3({typeName:rh.ZodNever,...Zf(i)});let m2e=class extends Bg{_parse(e){if(this._getType(e)!==uu.undefined){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.void,received:n.parsedType}),K0}return jE(e.data)}};m2e.create=i=>new m2e({typeName:rh.ZodVoid,...Zf(i)});let xM=class aZ extends Bg{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==uu.array)return _l(t,{code:xa.invalid_type,expected:uu.array,received:t.parsedType}),K0;if(r.exactLength!==null){const s=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(s||a)&&(_l(t,{code:s?xa.too_big:xa.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(_l(t,{code:xa.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(_l(t,{code:xa.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((s,a)=>r.type._parseAsync(new DB(t,s,t.path,a)))).then(s=>Db.mergeArray(n,s));const o=[...t.data].map((s,a)=>r.type._parseSync(new DB(t,s,t.path,a)));return Db.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new aZ({...this._def,minLength:{value:e,message:QA.toString(t)}})}max(e,t){return new aZ({...this._def,maxLength:{value:e,message:QA.toString(t)}})}length(e,t){return new aZ({...this._def,exactLength:{value:e,message:QA.toString(t)}})}nonempty(e){return this.min(1,e)}};xM.create=(i,e)=>new xM({type:i,minLength:null,maxLength:null,exactLength:null,typeName:rh.ZodArray,...Zf(e)});function EM(i){if(i instanceof z5){const e={};for(const t in i.shape){const n=i.shape[t];e[t]=H5.create(EM(n))}return new z5({...i._def,shape:()=>e})}else return i instanceof xM?new xM({...i._def,type:EM(i.element)}):i instanceof H5?H5.create(EM(i.unwrap())):i instanceof XS?XS.create(EM(i.unwrap())):i instanceof WS?WS.create(i.items.map(e=>EM(e))):i}let z5=class mB extends Bg{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Um.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==uu.object){const l=this._getOrReturnCtx(e);return _l(l,{code:xa.invalid_type,expected:uu.object,received:l.parsedType}),K0}const{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof h3&&this._def.unknownKeys==="strip"))for(const l in r.data)s.includes(l)||a.push(l);const c=[];for(const l of s){const u=o[l],A=r.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new DB(r,A,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof h3){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(l==="strict")a.length>0&&(_l(r,{code:xa.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const A=r.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new DB(r,A,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const A=await u.key,d=await u.value;l.push({key:A,value:d,alwaysSet:u.alwaysSet})}return l}).then(l=>Db.mergeObjectSync(n,l)):Db.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return QA.errToObj,new mB({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var o,s;const r=((s=(o=this._def).errorMap)==null?void 0:s.call(o,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:QA.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new mB({...this._def,unknownKeys:"strip"})}passthrough(){return new mB({...this._def,unknownKeys:"passthrough"})}extend(e){return new mB({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new mB({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:rh.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new mB({...this._def,catchall:e})}pick(e){const t={};for(const n of Um.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new mB({...this._def,shape:()=>t})}omit(e){const t={};for(const n of Um.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new mB({...this._def,shape:()=>t})}deepPartial(){return EM(this)}partial(e){const t={};for(const n of Um.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new mB({...this._def,shape:()=>t})}required(e){const t={};for(const n of Um.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof H5;)o=o._def.innerType;t[n]=o}return new mB({...this._def,shape:()=>t})}keyof(){return v2e(Um.objectKeys(this.shape))}};z5.create=(i,e)=>new z5({shape:()=>i,unknownKeys:"strip",catchall:h3.create(),typeName:rh.ZodObject,...Zf(e)}),z5.strictCreate=(i,e)=>new z5({shape:()=>i,unknownKeys:"strict",catchall:h3.create(),typeName:rh.ZodObject,...Zf(e)}),z5.lazycreate=(i,e)=>new z5({shape:i,unknownKeys:"strip",catchall:h3.create(),typeName:rh.ZodObject,...Zf(e)});let HF=class extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new RB(a.ctx.common.issues));return _l(t,{code:xa.invalid_union,unionErrors:s}),K0}if(t.common.async)return Promise.all(n.map(async o=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(r);{let o;const s=[];for(const c of n){const l={...t,common:{...t.common,issues:[]},parent:null},u=c._parseSync({data:t.data,path:t.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(c=>new RB(c));return _l(t,{code:xa.invalid_union,unionErrors:a}),K0}}get options(){return this._def.options}};HF.create=(i,e)=>new HF({options:i,typeName:rh.ZodUnion,...Zf(e)});const Y5=i=>i instanceof qX?Y5(i.schema):i instanceof ZS?Y5(i.innerType()):i instanceof KF?[i.value]:i instanceof jF?i.options:i instanceof $X?Um.objectValues(i.enum):i instanceof JF?Y5(i._def.innerType):i instanceof ZX?[void 0]:i instanceof YF?[null]:i instanceof H5?[void 0,...Y5(i.unwrap())]:i instanceof XS?[null,...Y5(i.unwrap())]:i instanceof C2e||i instanceof ZF?Y5(i.unwrap()):i instanceof WF?Y5(i._def.innerType):[];let umt=class ydt extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==uu.object)return _l(t,{code:xa.invalid_type,expected:uu.object,received:t.parsedType}),K0;const n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(_l(t,{code:xa.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),K0)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const o of t){const s=Y5(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,o)}}return new ydt({typeName:rh.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Zf(n)})}};function XX(i,e){const t=d3(i),n=d3(e);if(i===e)return{valid:!0,data:i};if(t===uu.object&&n===uu.object){const r=Um.objectKeys(e),o=Um.objectKeys(i).filter(a=>r.indexOf(a)!==-1),s={...i,...e};for(const a of o){const c=XX(i[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(t===uu.array&&n===uu.array){if(i.length!==e.length)return{valid:!1};const r=[];for(let o=0;o<i.length;o++){const s=i[o],a=e[o],c=XX(s,a);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return t===uu.date&&n===uu.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}let VF=class extends Bg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if(l2e(o)||l2e(s))return K0;const a=XX(o.value,s.value);return a.valid?((u2e(o)||u2e(s))&&t.dirty(),{status:t.value,value:a.data}):(_l(n,{code:xa.invalid_intersection_types}),K0)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};VF.create=(i,e,t)=>new VF({left:i,right:e,typeName:rh.ZodIntersection,...Zf(t)});let WS=class _dt extends Bg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==uu.array)return _l(n,{code:xa.invalid_type,expected:uu.array,received:n.parsedType}),K0;if(n.data.length<this._def.items.length)return _l(n,{code:xa.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K0;!this._def.rest&&n.data.length>this._def.items.length&&(_l(n,{code:xa.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...n.data].map((s,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new DB(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Db.mergeArray(t,s)):Db.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new _dt({...this._def,rest:e})}};WS.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new WS({items:i,typeName:rh.ZodTuple,rest:null,...Zf(e)})};let Amt=class dCe extends Bg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==uu.object)return _l(n,{code:xa.invalid_type,expected:uu.object,received:n.parsedType}),K0;const r=[],o=this._def.keyType,s=this._def.valueType;for(const a in n.data)r.push({key:o._parse(new DB(n,a,n.path,a)),value:s._parse(new DB(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Db.mergeObjectAsync(t,r):Db.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof Bg?new dCe({keyType:e,valueType:t,typeName:rh.ZodRecord,...Zf(n)}):new dCe({keyType:zF.create(),valueType:e,typeName:rh.ZodRecord,...Zf(t)})}},y2e=class extends Bg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==uu.map)return _l(n,{code:xa.invalid_type,expected:uu.map,received:n.parsedType}),K0;const r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,c],l)=>({key:r._parse(new DB(n,a,n.path,[l,"key"])),value:o._parse(new DB(n,c,n.path,[l,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of s){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return K0;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const c of s){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return K0;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}}}};y2e.create=(i,e,t)=>new y2e({valueType:e,keyType:i,typeName:rh.ZodMap,...Zf(t)});let _2e=class hCe extends Bg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==uu.set)return _l(n,{code:xa.invalid_type,expected:uu.set,received:n.parsedType}),K0;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(_l(n,{code:xa.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(_l(n,{code:xa.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function s(c){const l=new Set;for(const u of c){if(u.status==="aborted")return K0;u.status==="dirty"&&t.dirty(),l.add(u.value)}return{status:t.value,value:l}}const a=[...n.data.values()].map((c,l)=>o._parse(new DB(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,t){return new hCe({...this._def,minSize:{value:e,message:QA.toString(t)}})}max(e,t){return new hCe({...this._def,maxSize:{value:e,message:QA.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};_2e.create=(i,e)=>new _2e({valueType:i,minSize:null,maxSize:null,typeName:rh.ZodSet,...Zf(e)});let dmt=class cZ extends Bg{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==uu.function)return _l(t,{code:xa.invalid_type,expected:uu.function,received:t.parsedType}),K0;function n(a,c){return KX({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,VX(),m8].filter(l=>!!l),issueData:{code:xa.invalid_arguments,argumentsError:c}})}function r(a,c){return KX({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,VX(),m8].filter(l=>!!l),issueData:{code:xa.invalid_return_type,returnTypeError:c}})}const o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof v8){const a=this;return jE(async function(...c){const l=new RB([]),u=await a._def.args.parseAsync(c,o).catch(h=>{throw l.addIssue(n(c,h)),l}),A=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(A,o).catch(h=>{throw l.addIssue(r(A,h)),l})})}else{const a=this;return jE(function(...c){const l=a._def.args.safeParse(c,o);if(!l.success)throw new RB([n(c,l.error)]);const u=Reflect.apply(s,this,l.data),A=a._def.returns.safeParse(u,o);if(!A.success)throw new RB([r(u,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new cZ({...this._def,args:WS.create(e).rest(CM.create())})}returns(e){return new cZ({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new cZ({args:e||WS.create([]).rest(CM.create()),returns:t||CM.create(),typeName:rh.ZodFunction,...Zf(n)})}},qX=class extends Bg{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};qX.create=(i,e)=>new qX({getter:i,typeName:rh.ZodLazy,...Zf(e)});let KF=class extends Bg{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return _l(t,{received:t.data,code:xa.invalid_literal,expected:this._def.value}),K0}return{status:"valid",value:e.data}}get value(){return this._def.value}};KF.create=(i,e)=>new KF({value:i,typeName:rh.ZodLiteral,...Zf(e)});function v2e(i,e){return new jF({values:i,typeName:rh.ZodEnum,...Zf(e)})}let jF=class fCe extends Bg{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return _l(t,{expected:Um.joinValues(n),received:t.parsedType,code:xa.invalid_type}),K0}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return _l(t,{received:t.data,code:xa.invalid_enum_value,options:n}),K0}return jE(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return fCe.create(e,{...this._def,...t})}exclude(e,t=this._def){return fCe.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};jF.create=v2e;let $X=class extends Bg{_parse(e){const t=Um.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==uu.string&&n.parsedType!==uu.number){const r=Um.objectValues(t);return _l(n,{expected:Um.joinValues(r),received:n.parsedType,code:xa.invalid_type}),K0}if(this._cache||(this._cache=new Set(Um.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=Um.objectValues(t);return _l(n,{received:n.data,code:xa.invalid_enum_value,options:r}),K0}return jE(e.data)}get enum(){return this._def.values}};$X.create=(i,e)=>new $X({values:i,typeName:rh.ZodNativeEnum,...Zf(e)});let v8=class extends Bg{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==uu.promise&&t.common.async===!1)return _l(t,{code:xa.invalid_type,expected:uu.promise,received:t.parsedType}),K0;const n=t.parsedType===uu.promise?t.data:Promise.resolve(t.data);return jE(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};v8.create=(i,e)=>new v8({type:i,typeName:rh.ZodPromise,...Zf(e)});let ZS=class extends Bg{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===rh.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:s=>{_l(n,s),s.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const s=r.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(t.value==="aborted")return K0;const c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?K0:c.status==="dirty"||t.value==="dirty"?y8(c.value):c});{if(t.value==="aborted")return K0;const a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?K0:a.status==="dirty"||t.value==="dirty"?y8(a.value):a}}if(r.type==="refinement"){const s=a=>{const c=r.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?K0:(a.status==="dirty"&&t.dirty(),s(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?K0:(a.status==="dirty"&&t.dirty(),s(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!IM(s))return K0;const a=r.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>IM(s)?Promise.resolve(r.transform(s.value,o)).then(a=>({status:t.value,value:a})):K0);Um.assertNever(r)}};ZS.create=(i,e,t)=>new ZS({schema:i,typeName:rh.ZodEffects,effect:e,...Zf(t)}),ZS.createWithPreprocess=(i,e,t)=>new ZS({schema:e,effect:{type:"preprocess",transform:i},typeName:rh.ZodEffects,...Zf(t)});let H5=class extends Bg{_parse(e){return this._getType(e)===uu.undefined?jE(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};H5.create=(i,e)=>new H5({innerType:i,typeName:rh.ZodOptional,...Zf(e)});let XS=class extends Bg{_parse(e){return this._getType(e)===uu.null?jE(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};XS.create=(i,e)=>new XS({innerType:i,typeName:rh.ZodNullable,...Zf(e)});let JF=class extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===uu.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};JF.create=(i,e)=>new JF({innerType:i,typeName:rh.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Zf(e)});let WF=class extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return OF(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new RB(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new RB(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};WF.create=(i,e)=>new WF({innerType:i,typeName:rh.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Zf(e)});let I2e=class extends Bg{_parse(e){if(this._getType(e)!==uu.nan){const n=this._getOrReturnCtx(e);return _l(n,{code:xa.invalid_type,expected:uu.nan,received:n.parsedType}),K0}return{status:"valid",value:e.data}}};I2e.create=i=>new I2e({typeName:rh.ZodNaN,...Zf(i)});let C2e=class extends Bg{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},hmt=class vdt extends Bg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?K0:o.status==="dirty"?(t.dirty(),y8(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?K0:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new vdt({in:e,out:t,typeName:rh.ZodPipeline})}},ZF=class extends Bg{_parse(e){const t=this._def.innerType._parse(e),n=r=>(IM(r)&&(r.value=Object.freeze(r.value)),r);return OF(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}};ZF.create=(i,e)=>new ZF({innerType:i,typeName:rh.ZodReadonly,...Zf(e)});function x2e(i,e){const t=typeof i=="function"?i(e):typeof i=="string"?{message:i}:i;return typeof t=="string"?{message:t}:t}function NB(i,e={},t){return i?_8.create().superRefine((n,r)=>{const o=i(n);if(o instanceof Promise)return o.then(s=>{if(!s){const a=x2e(e,n),c=a.fatal??t??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!o){const s=x2e(e,n),a=s.fatal??t??!0;r.addIssue({code:"custom",...s,fatal:a})}}):_8.create()}var rh;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(rh||(rh={}));const Pe=zF.create,Ci=JX.create,go=WX.create,fmt=YF.create,pE=_8.create;CM.create,h3.create;const uo=xM.create,Un=z5.create,Bd=HF.create,f3=umt.create;VF.create,WS.create;const nv=Amt.create,pmt=dmt.create,Sn=KF.create,ya=jF.create,gmt=v8.create;H5.create,XS.create;const mmt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let eq=(i=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(i|=0));for(;i--;)e+=mmt[t[i]&63];return e};var E2e={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1e3,Hz:1}},g:{baseUnit:"g",variants:{kg:1e3,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:.001,Ω:1,kΩ:1e3,KΩ:1e3,kohm:1e3,MΩ:1e6,GΩ:1e9,TΩ:1e12}},V:{baseUnit:"V",variants:{mV:.001,V:1,kV:1e3,KV:1e3,MV:1e6,GV:1e9,TV:1e12}},A:{baseUnit:"A",variants:{µA:1e-6,mA:.001,ma:.001,A:1,kA:1e3,MA:1e6}},F:{baseUnit:"F",variants:{pF:1e-12,nF:1e-9,µF:1e-6,uF:1e-6,mF:.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1e3,L:1e3}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{s:1e3}},mm:{baseUnit:"mm",variants:{nm:1e-6,µm:.001,um:.001,mm:1,cm:10,dm:100,m:1e3,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:.0254}}},tq=new Set;for(const[i,e]of Object.entries(E2e)){tq.add(i);for(const t of Object.keys(e.variants))tq.add(t)}function ymt(i){for(const[e,t]of Object.entries(E2e))if(i in t.variants)return{baseUnit:t.baseUnit,conversionFactor:t.variants[i]};return{baseUnit:i,conversionFactor:1}}var b2e={tera:1e12,T:1e12,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1e3,k:1e3,deci:.1,d:.1,centi:.01,c:.01,milli:.001,m:.001,micro:1e-6,u:1e-6,µ:1e-6,nano:1e-9,n:1e-9,pico:1e-12,p:1e-12},P2=i=>{var a;if(typeof i>"u")return{parsedUnit:null,unitOfValue:null,value:null};if(typeof i=="string"&&i.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(i),parsedUnit:null,unitOfValue:null};if(typeof i=="number")return{value:i,parsedUnit:null,unitOfValue:null};if(typeof i=="object"&&"x"in i&&"y"in i){const{parsedUnit:c,unitOfValue:l}=P2(i.x);return{parsedUnit:c,unitOfValue:l,value:{x:P2(i.x).value,y:P2(i.y).value}}}const t=(a=i.toString().split("").reverse().join("").match(/[^\d\s]+/))==null?void 0:a[0];if(!t)throw new Error(`Could not determine unit: "${i}"`);const n=t.split("").reverse().join(""),r=i.slice(0,-n.length);if(n in b2e&&!tq.has(n)){const c=b2e[n];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*c}}const{baseUnit:o,conversionFactor:s}=ymt(n);return{parsedUnit:n,unitOfValue:o,value:s*Number.parseFloat(r)}},bM=Pe().or(Ci()).transform(i=>P2(i).value),BM=Pe().or(Ci()).transform(i=>P2(i).value).transform(i=>Number.parseFloat(i.toPrecision(12))),nq=Pe().or(Ci()).transform(i=>P2(i).value),qS=Pe().or(Ci()).transform(i=>P2(i).value),on=Pe().or(Ci()).transform(i=>P2(i).value),XF=Pe().or(Ci()).transform(i=>P2(i).value),Fi=on,_mt=Pe().or(Ci()).transform(i=>P2(i).value),vmt=Pe().or(Ci()).transform(i=>P2(i).value),Lx=Pe().or(Ci()).transform(i=>typeof i=="number"?i:i.endsWith("deg")?Number.parseFloat(i.split("deg")[0]):i.endsWith("rad")?Number.parseFloat(i.split("rad")[0])*180/Math.PI:Number.parseFloat(i)),B2e=Ci().or(Pe().endsWith("mAh")).transform(i=>{if(typeof i=="string"){const e=i.replace("mAh",""),t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error("Invalid capacity");return t}return i}).describe("Battery capacity in mAh"),dg=Un({x:Fi,y:Fi}),Imt=dg,wM=Un({x:Fi,y:Fi,z:Fi}),Cmt=wM,iq=Un({width:Ci(),height:Ci()}),ad=i=>Pe().optional().default(()=>`${i}_${eq(10)}`),qF=ya(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),$F=ya(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),k9=Un({type:Sn("source_component"),ftype:Pe().optional(),source_component_id:Pe(),name:Pe(),manufacturer_part_number:Pe().optional(),supplier_part_numbers:nv($F,uo(Pe())).optional(),display_value:Pe().optional(),are_pins_interchangeable:go().optional(),internally_connected_source_port_ids:uo(uo(Pe())).optional(),source_group_id:Pe().optional(),subcircuit_id:Pe().optional()}),rq=k9.extend({ftype:Sn("simple_capacitor"),capacitance:BM,max_voltage_rating:qS.optional(),display_capacitance:Pe().optional(),max_decoupling_trace_length:Fi.optional()}),oq=k9.extend({ftype:Sn("simple_resistor"),resistance:bM,display_resistance:Pe().optional()}),eL=k9.extend({ftype:Sn("simple_diode")}),sq=eL.extend({ftype:Sn("simple_led"),color:Pe().optional(),wavelength:Pe().optional()}),w2e=k9.extend({ftype:Sn("simple_ground")}),aq=k9.extend({ftype:Sn("simple_chip")}),cq=k9.extend({ftype:Sn("simple_power_source"),voltage:qS}),xmt=k9.extend({ftype:Sn("simple_fuse"),current_rating_amps:Ci().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:Ci().describe("Voltage rating in volts, e.g. ±5V would be 5")}),lq=k9.extend({ftype:Sn("simple_battery"),capacity:B2e}),uq=k9.extend({ftype:Sn("simple_inductor"),inductance:nq,max_current_rating:Ci().optional()}),Aq=k9.extend({ftype:Sn("simple_push_button")}),dq=k9.extend({ftype:Sn("simple_potentiometer"),max_resistance:bM}),S2e=k9.extend({ftype:Sn("simple_crystal"),frequency:Ci().describe("Frequency in Hz"),load_capacitance:Ci().optional().describe("Load capacitance in pF")}),hq=k9.extend({ftype:Sn("simple_pin_header"),pin_count:Ci(),gender:ya(["male","female"]).optional().default("male")}),fq=k9.extend({ftype:Sn("simple_resonator"),load_capacitance:BM,equivalent_series_resistance:bM.optional(),frequency:XF}),pq=k9.extend({ftype:Sn("simple_transistor"),transistor_type:ya(["npn","pnp"])}),gq=k9.extend({ftype:Sn("simple_test_point"),footprint_variant:ya(["pad","through_hole"]).optional(),pad_shape:ya(["rect","circle"]).optional(),pad_diameter:Bd([Ci(),Pe()]).optional(),hole_diameter:Bd([Ci(),Pe()]).optional(),width:Bd([Ci(),Pe()]).optional(),height:Bd([Ci(),Pe()]).optional()}),mq=k9.extend({ftype:Sn("simple_mosfet"),channel_type:ya(["n","p"]),mosfet_mode:ya(["enhancement","depletion"])}),yq=k9.extend({ftype:Sn("simple_switch")}),_q=Un({type:Sn("source_project_metadata"),name:Pe().optional(),software_used_string:Pe().optional(),project_url:Pe().optional(),created_at:Pe().datetime().optional()}),Q2e=Un({type:Sn("source_missing_property_error"),source_missing_property_error_id:ad("source_missing_property_error"),source_component_id:Pe(),property_name:Pe(),subcircuit_id:Pe().optional(),error_type:Sn("source_missing_property_error").default("source_missing_property_error"),message:Pe()}).describe("The source code is missing a property"),M2e=Un({type:Sn("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:ad("source_failed_to_create_component_error"),error_type:Sn("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:Pe().optional(),subcircuit_id:Pe().optional(),parent_source_component_id:Pe().optional(),message:Pe(),pcb_center:Un({x:Ci().optional(),y:Ci().optional()}).optional(),schematic_center:Un({x:Ci().optional(),y:Ci().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),vq=Un({type:Sn("source_trace_not_connected"),source_trace_not_connected_id:ad("source_trace_not_connected"),error_type:Sn("source_trace_not_connected").default("source_trace_not_connected"),message:Pe(),subcircuit_id:Pe().optional(),source_group_id:Pe().optional(),source_trace_id:Pe().optional(),connected_source_port_ids:uo(Pe()).optional(),selectors_not_found:uo(Pe()).optional()}).describe("Occurs when a source trace selector does not match any ports"),R2e=Bd([oq,rq,eL,sq,w2e,aq,cq,lq,uq,Aq,dq,S2e,hq,fq,yq,pq,gq,mq,xmt,_q,Q2e,M2e,vq]),D2e=Un({type:Sn("source_port"),pin_number:Ci().optional(),port_hints:uo(Pe()).optional(),name:Pe(),source_port_id:Pe(),source_component_id:Pe(),subcircuit_id:Pe().optional(),subcircuit_connectivity_map_key:Pe().optional()}),N2e=Un({type:Sn("source_trace"),source_trace_id:Pe(),connected_source_port_ids:uo(Pe()),connected_source_net_ids:uo(Pe()),subcircuit_id:Pe().optional(),subcircuit_connectivity_map_key:Pe().optional(),max_length:Ci().optional(),min_trace_thickness:Ci().optional(),display_name:Pe().optional()}),T2e=Un({type:Sn("source_group"),source_group_id:Pe(),subcircuit_id:Pe().optional(),parent_subcircuit_id:Pe().optional(),parent_source_group_id:Pe().optional(),is_subcircuit:go().optional(),name:Pe().optional()}),k2e=Un({type:Sn("source_net"),source_net_id:Pe(),name:Pe(),member_source_group_ids:uo(Pe()),is_power:go().optional(),is_ground:go().optional(),is_digital_signal:go().optional(),is_analog_signal:go().optional(),trace_width:Ci().optional(),subcircuit_id:Pe().optional(),subcircuit_connectivity_map_key:Pe().optional()}),P2e=Un({type:Sn("source_pcb_ground_plane"),source_pcb_ground_plane_id:Pe(),source_group_id:Pe(),source_net_id:Pe(),subcircuit_id:Pe().optional()}).describe("Defines a ground plane in the source domain"),F2e=Un({type:Sn("schematic_box"),schematic_component_id:Pe().optional(),width:Fi,height:Fi,is_dashed:go().default(!1),x:Fi,y:Fi,subcircuit_id:Pe().optional()}).describe("Draws a box on the schematic"),L2e=Un({type:Sn("schematic_path"),schematic_component_id:Pe(),fill_color:ya(["red","blue"]).optional(),is_filled:go().optional(),points:uo(dg),subcircuit_id:Pe().optional()}),U2e=nv(Un({left_margin:on.optional(),right_margin:on.optional(),top_margin:on.optional(),bottom_margin:on.optional()})),G2e=Un({left_size:Ci(),right_size:Ci(),top_size:Ci().optional(),bottom_size:Ci().optional()}),O2e=Un({left_side:Un({pins:uo(Ci()),direction:ya(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:Un({pins:uo(Ci()),direction:ya(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:Un({pins:uo(Ci()),direction:ya(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:Un({pins:uo(Ci()),direction:ya(["left-to-right","right-to-left"]).optional()}).optional()}),z2e=Bd([G2e,O2e]),Y2e=Un({type:Sn("schematic_component"),size:iq,center:dg,source_component_id:Pe(),schematic_component_id:Pe(),pin_spacing:on.optional(),pin_styles:U2e.optional(),box_width:on.optional(),symbol_name:Pe().optional(),port_arrangement:z2e.optional(),port_labels:nv(Pe()).optional(),symbol_display_value:Pe().optional(),subcircuit_id:Pe().optional(),schematic_group_id:Pe().optional()}),H2e=Un({type:Sn("schematic_line"),schematic_component_id:Pe(),x1:Fi,x2:Fi,y1:Fi,y2:Fi,subcircuit_id:Pe().optional()}),V2e=Un({type:Sn("schematic_trace"),schematic_trace_id:Pe(),source_trace_id:Pe(),junctions:uo(Un({x:Ci(),y:Ci()})),edges:uo(Un({from:Un({x:Ci(),y:Ci()}),to:Un({x:Ci(),y:Ci()}),is_crossing:go().optional(),from_schematic_port_id:Pe().optional(),to_schematic_port_id:Pe().optional()})),subcircuit_id:Pe().optional()}),Emt=ya(["center","left","right","top","bottom"]),K2e=Un({type:Sn("schematic_text"),schematic_component_id:Pe().optional(),schematic_text_id:Pe(),text:Pe(),font_size:Ci().default(.18),position:Un({x:Fi,y:Fi}),rotation:Ci().default(0),anchor:Bd([Emt.describe("legacy"),qF]).default("center"),color:Pe().default("#000000"),subcircuit_id:Pe().optional()}),j2e=Un({type:Sn("schematic_port"),schematic_port_id:Pe(),source_port_id:Pe(),schematic_component_id:Pe().optional(),center:dg,facing_direction:ya(["up","down","left","right"]).optional(),distance_from_component_edge:Ci().optional(),side_of_component:ya(["top","bottom","left","right"]).optional(),true_ccw_index:Ci().optional(),pin_number:Ci().optional(),display_pin_label:Pe().optional(),subcircuit_id:Pe().optional(),is_connected:go().optional()}).describe("Defines a port on a schematic component"),J2e=Un({type:Sn("schematic_net_label"),schematic_net_label_id:ad("schematic_net_label"),schematic_trace_id:Pe().optional(),source_trace_id:Pe().optional(),source_net_id:Pe(),center:dg,anchor_position:dg.optional(),anchor_side:ya(["top","bottom","left","right"]),text:Pe(),symbol_name:Pe().optional(),is_movable:go().optional(),subcircuit_id:Pe().optional()}),W2e=Un({type:Sn("schematic_error"),schematic_error_id:Pe(),error_type:Sn("schematic_port_not_found").default("schematic_port_not_found"),message:Pe(),subcircuit_id:Pe().optional()}).describe("Defines a schematic error on the schematic"),Z2e=Un({type:Sn("schematic_layout_error"),schematic_layout_error_id:ad("schematic_layout_error"),error_type:Sn("schematic_layout_error").default("schematic_layout_error"),message:Pe(),source_group_id:Pe(),schematic_group_id:Pe(),subcircuit_id:Pe().optional()}).describe("Error emitted when schematic layout fails for a group"),tL=Un({type:Sn("schematic_debug_object"),label:Pe().optional(),subcircuit_id:Pe().optional()}),X2e=tL.extend({shape:Sn("rect"),center:dg,size:iq}),q2e=tL.extend({shape:Sn("line"),start:dg,end:dg}),$2e=tL.extend({shape:Sn("point"),center:dg}),eBe=f3("shape",[X2e,q2e,$2e]),tBe=Un({type:Sn("schematic_voltage_probe"),schematic_voltage_probe_id:Pe(),position:dg,schematic_trace_id:Pe(),voltage:qS.optional(),subcircuit_id:Pe().optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),Iq=Un({type:Sn("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:ad("schematic_manual_edit_conflict_warning"),warning_type:Sn("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:Pe(),schematic_component_id:Pe(),schematic_group_id:Pe().optional(),subcircuit_id:Pe().optional(),source_component_id:Pe()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),nBe=Un({type:Sn("schematic_group"),schematic_group_id:ad("schematic_group"),source_group_id:Pe(),is_subcircuit:go().optional(),subcircuit_id:Pe().optional(),width:on,height:on,center:dg,schematic_component_ids:uo(Pe()),name:Pe().optional(),description:Pe().optional()}).describe("Defines a group of components on the schematic"),iBe=Un({type:Sn("schematic_table"),schematic_table_id:ad("schematic_table"),anchor_position:dg,column_widths:uo(Fi),row_heights:uo(Fi),cell_padding:Fi.optional(),border_width:Fi.optional(),subcircuit_id:Pe().optional(),schematic_component_id:Pe().optional(),anchor:qF.optional()}).describe("Defines a table on the schematic"),rBe=Un({type:Sn("schematic_table_cell"),schematic_table_cell_id:ad("schematic_table_cell"),schematic_table_id:Pe(),start_row_index:Ci(),end_row_index:Ci(),start_column_index:Ci(),end_column_index:Ci(),text:Pe().optional(),center:dg,width:Fi,height:Fi,horizontal_align:ya(["left","center","right"]).optional(),vertical_align:ya(["top","middle","bottom"]).optional(),font_size:Fi.optional(),subcircuit_id:Pe().optional()}).describe("Defines a cell within a schematic_table"),I8=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],Cq=ya(I8),wg=Cq.or(Un({name:Cq})).transform(i=>typeof i=="string"?i:i.name),SM=ya(["top","bottom"]),oBe=Un({x:Fi,y:Fi,via:go().optional(),via_to_layer:wg.optional()}),bmt=uo(oBe),V5=Un({x:Fi,y:Fi,via:go().optional(),to_layer:wg.optional(),trace_width:Fi.optional()}),sBe=Un({type:Sn("pcb_component"),pcb_component_id:ad("pcb_component"),source_component_id:Pe(),center:dg,layer:wg,rotation:Lx,width:on,height:on,subcircuit_id:Pe().optional(),pcb_group_id:Pe().optional()}).describe("Defines a component on the PCB"),aBe=Un({type:Sn("pcb_hole"),pcb_hole_id:ad("pcb_hole"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:ya(["circle","square"]),hole_diameter:Ci(),x:Fi,y:Fi}),Bmt=aBe.describe("Defines a circular or square hole on the PCB"),cBe=Un({type:Sn("pcb_hole"),pcb_hole_id:ad("pcb_hole"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:Sn("oval"),hole_width:Ci(),hole_height:Ci(),x:Fi,y:Fi}),wmt=cBe.describe("Defines an oval hole on the PCB"),lBe=aBe.or(cBe),Smt=Un({type:Sn("pcb_plated_hole"),shape:Sn("circle"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),outer_diameter:Ci(),hole_diameter:Ci(),x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),Qmt=Un({type:Sn("pcb_plated_hole"),shape:ya(["oval","pill"]),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),outer_width:Ci(),outer_height:Ci(),hole_width:Ci(),hole_height:Ci(),x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),Mmt=Un({type:Sn("pcb_plated_hole"),shape:Sn("circular_hole_with_rect_pad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:Sn("circle"),pad_shape:Sn("rect"),hole_diameter:Ci(),rect_pad_width:Ci(),rect_pad_height:Ci(),x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),Rmt=Un({type:Sn("pcb_plated_hole"),shape:Sn("pill_hole_with_rect_pad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:Sn("pill"),pad_shape:Sn("rect"),hole_width:Ci(),hole_height:Ci(),rect_pad_width:Ci(),rect_pad_height:Ci(),x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),Dmt=Un({type:Sn("pcb_plated_hole"),shape:Sn("rotated_pill_hole_with_rect_pad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),hole_shape:Sn("rotated_pill"),pad_shape:Sn("rect"),hole_width:Ci(),hole_height:Ci(),hole_ccw_rotation:Lx,rect_pad_width:Ci(),rect_pad_height:Ci(),rect_ccw_rotation:Lx,x:Fi,y:Fi,layers:uo(wg),port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional(),pcb_plated_hole_id:ad("pcb_plated_hole")}),uBe=Bd([Smt,Qmt,Mmt,Rmt,Dmt]),ABe=Un({type:Sn("pcb_port"),pcb_port_id:ad("pcb_port"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),source_port_id:Pe(),pcb_component_id:Pe(),x:Fi,y:Fi,layers:uo(wg)}).describe("Defines a port on the PCB"),Nmt=Un({type:Sn("pcb_smtpad"),shape:Sn("circle"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,radius:Ci(),layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),Tmt=Un({type:Sn("pcb_smtpad"),shape:Sn("rect"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),kmt=Un({type:Sn("pcb_smtpad"),shape:Sn("rotated_rect"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),ccw_rotation:Lx,layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),dBe=Un({type:Sn("pcb_smtpad"),shape:Sn("pill"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),radius:Ci(),layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),Pmt=Un({type:Sn("pcb_smtpad"),shape:Sn("rotated_pill"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),radius:Ci(),ccw_rotation:Lx,layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),Fmt=Un({type:Sn("pcb_smtpad"),shape:Sn("polygon"),pcb_smtpad_id:ad("pcb_smtpad"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),points:uo(dg),layer:wg,port_hints:uo(Pe()).optional(),pcb_component_id:Pe().optional(),pcb_port_id:Pe().optional()}),hBe=f3("shape",[Nmt,Tmt,kmt,Pmt,dBe,Fmt]).describe("Defines an SMT pad on the PCB"),Lmt=Un({type:Sn("pcb_solder_paste"),shape:Sn("circle"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,radius:Ci(),layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),Umt=Un({type:Sn("pcb_solder_paste"),shape:Sn("rect"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),Gmt=Un({type:Sn("pcb_solder_paste"),shape:Sn("pill"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),radius:Ci(),layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),Omt=Un({type:Sn("pcb_solder_paste"),shape:Sn("rotated_rect"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),ccw_rotation:Fi,layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),zmt=Un({type:Sn("pcb_solder_paste"),shape:Sn("oval"),pcb_solder_paste_id:ad("pcb_solder_paste"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,width:Ci(),height:Ci(),layer:wg,pcb_component_id:Pe().optional(),pcb_smtpad_id:Pe().optional()}),fBe=Bd([Lmt,Umt,Gmt,Omt,zmt]).describe("Defines solderpaste on the PCB"),pBe=Un({type:Sn("pcb_text"),pcb_text_id:ad("pcb_text"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),text:Pe(),center:dg,layer:wg,width:on,height:on,lines:Ci(),align:ya(["bottom-left"])}).describe("Defines text on the PCB"),gBe=Un({route_type:Sn("wire"),x:Fi,y:Fi,width:Fi,start_pcb_port_id:Pe().optional(),end_pcb_port_id:Pe().optional(),layer:wg}),mBe=Un({route_type:Sn("via"),x:Fi,y:Fi,hole_diameter:Fi.optional(),outer_diameter:Fi.optional(),from_layer:Pe(),to_layer:Pe()}),xq=Bd([gBe,mBe]),yBe=Un({type:Sn("pcb_trace"),source_trace_id:Pe().optional(),pcb_component_id:Pe().optional(),pcb_trace_id:ad("pcb_trace"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),route_thickness_mode:ya(["constant","interpolated"]).default("constant").optional(),route_order_index:Ci().optional(),should_round_corners:go().optional(),trace_length:Ci().optional(),route:uo(xq)}).describe("Defines a trace on the PCB"),_Be=Un({type:Sn("pcb_trace_error"),pcb_trace_error_id:ad("pcb_trace_error"),error_type:Sn("pcb_trace_error").default("pcb_trace_error"),message:Pe(),center:dg.optional(),pcb_trace_id:Pe(),source_trace_id:Pe(),pcb_component_ids:uo(Pe()),pcb_port_ids:uo(Pe()),subcircuit_id:Pe().optional()}).describe("Defines a trace error on the PCB"),vBe=Un({type:Sn("pcb_port_not_matched_error"),pcb_error_id:ad("pcb_error"),error_type:Sn("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),message:Pe(),pcb_component_ids:uo(Pe()),subcircuit_id:Pe().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),IBe=Un({type:Sn("pcb_via"),pcb_via_id:ad("pcb_via"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),x:Fi,y:Fi,outer_diameter:Fi.default("0.6mm"),hole_diameter:Fi.default("0.25mm"),from_layer:wg.optional(),to_layer:wg.optional(),layers:uo(wg),pcb_trace_id:Pe().optional()}).describe("Defines a via on the PCB"),CBe=Un({type:Sn("pcb_board"),pcb_board_id:ad("pcb_board"),is_subcircuit:go().optional(),subcircuit_id:Pe().optional(),width:on,height:on,center:dg,thickness:on.optional().default(1.4),num_layers:Ci().optional().default(4),outline:uo(dg).optional(),material:ya(["fr4","fr1"]).default("fr4")}).describe("Defines the board outline of the PCB"),xBe=Un({type:Sn("pcb_placement_error"),pcb_placement_error_id:ad("pcb_placement_error"),error_type:Sn("pcb_placement_error").default("pcb_placement_error"),message:Pe(),subcircuit_id:Pe().optional()}).describe("Defines a placement error on the PCB"),EBe=Un({type:Sn("pcb_trace_hint"),pcb_trace_hint_id:ad("pcb_trace_hint"),pcb_port_id:Pe(),pcb_component_id:Pe(),route:uo(V5),subcircuit_id:Pe().optional()}).describe("A hint that can be used during generation of a PCB trace"),bBe=Un({type:Sn("pcb_silkscreen_line"),pcb_silkscreen_line_id:ad("pcb_silkscreen_line"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),stroke_width:Fi.default("0.1mm"),x1:Fi,y1:Fi,x2:Fi,y2:Fi,layer:SM}).describe("Defines a silkscreen line on the PCB"),BBe=Un({type:Sn("pcb_silkscreen_path"),pcb_silkscreen_path_id:ad("pcb_silkscreen_path"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),layer:SM,route:uo(dg),stroke_width:on}).describe("Defines a silkscreen path on the PCB"),wBe=Un({type:Sn("pcb_silkscreen_text"),pcb_silkscreen_text_id:ad("pcb_silkscreen_text"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),font:Sn("tscircuit2024").default("tscircuit2024"),font_size:Fi.default("0.2mm"),pcb_component_id:Pe(),text:Pe(),ccw_rotation:Ci().optional(),layer:wg,is_mirrored:go().default(!1).optional(),anchor_position:dg.default({x:0,y:0}),anchor_alignment:qF.default("center")}).describe("Defines silkscreen text on the PCB"),SBe=Un({type:Sn("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:ad("pcb_silkscreen_rect"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,width:on,height:on,layer:wg,stroke_width:on.default("1mm"),is_filled:go().default(!0).optional(),has_stroke:go().optional(),is_stroke_dashed:go().optional()}).describe("Defines a silkscreen rect on the PCB"),QBe=Un({type:Sn("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:ad("pcb_silkscreen_circle"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,radius:on,layer:SM,stroke_width:on.default("1mm")}).describe("Defines a silkscreen circle on the PCB"),MBe=Un({type:Sn("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:ad("pcb_silkscreen_oval"),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,radius_x:Fi,radius_y:Fi,layer:SM}).describe("Defines a silkscreen oval on the PCB"),RBe=Un({type:Sn("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:ad("pcb_fabrication_note_text"),subcircuit_id:Pe().optional(),pcb_group_id:Pe().optional(),font:Sn("tscircuit2024").default("tscircuit2024"),font_size:Fi.default("1mm"),pcb_component_id:Pe(),text:Pe(),layer:SM,anchor_position:dg.default({x:0,y:0}),anchor_alignment:ya(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:Pe().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),DBe=Un({type:Sn("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:ad("pcb_fabrication_note_path"),pcb_component_id:Pe(),subcircuit_id:Pe().optional(),layer:wg,route:uo(dg),stroke_width:on,color:Pe().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),NBe=Un({type:Sn("pcb_footprint_overlap_error"),pcb_error_id:ad("pcb_error"),error_type:Sn("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),message:Pe(),pcb_smtpad_ids:uo(Pe()).optional(),pcb_plated_hole_ids:uo(Pe()).optional(),pcb_hole_ids:uo(Pe()).optional(),pcb_keepout_ids:uo(Pe()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),TBe=Un({type:Sn("pcb_keepout"),shape:Sn("rect"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,width:Fi,height:Fi,pcb_keepout_id:Pe(),layers:uo(Pe()),description:Pe().optional()}).or(Un({type:Sn("pcb_keepout"),shape:Sn("circle"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),center:dg,radius:Fi,pcb_keepout_id:Pe(),layers:uo(Pe()),description:Pe().optional()})),Eq=Un({type:Sn("pcb_cutout"),pcb_cutout_id:ad("pcb_cutout"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional()}),kBe=Eq.extend({shape:Sn("rect"),center:dg,width:on,height:on,rotation:Lx.optional()}),PBe=Eq.extend({shape:Sn("circle"),center:dg,radius:on}),FBe=Eq.extend({shape:Sn("polygon"),points:uo(dg)}),LBe=f3("shape",[kBe,PBe,FBe]).describe("Defines a cutout on the PCB, removing board material."),UBe=Un({type:Sn("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:ad("pcb_missing_footprint_error"),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),error_type:Sn("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:Pe(),message:Pe()}).describe("Defines a missing footprint error on the PCB"),GBe=Un({type:Sn("pcb_group"),pcb_group_id:ad("pcb_group"),source_group_id:Pe(),is_subcircuit:go().optional(),subcircuit_id:Pe().optional(),width:on,height:on,center:dg,pcb_component_ids:uo(Pe()),name:Pe().optional(),description:Pe().optional(),layout_mode:Pe().optional(),autorouter_configuration:Un({trace_clearance:on}).optional(),autorouter_used_string:Pe().optional()}).describe("Defines a group of components on the PCB"),OBe=Un({type:Sn("pcb_autorouting_error"),pcb_error_id:ad("pcb_autorouting_error"),error_type:Sn("pcb_autorouting_error").default("pcb_autorouting_error"),message:Pe(),subcircuit_id:Pe().optional()}).describe("The autorouting has failed to route a portion of the board"),bq=Un({type:Sn("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:ad("pcb_manual_edit_conflict_warning"),warning_type:Sn("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:Pe(),pcb_component_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),source_component_id:Pe()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),zBe=Un({type:Sn("pcb_breakout_point"),pcb_breakout_point_id:ad("pcb_breakout_point"),pcb_group_id:Pe(),subcircuit_id:Pe().optional(),source_trace_id:Pe().optional(),source_port_id:Pe().optional(),source_net_id:Pe().optional(),x:Fi,y:Fi}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),YBe=Un({type:Sn("pcb_ground_plane"),pcb_ground_plane_id:ad("pcb_ground_plane"),source_pcb_ground_plane_id:Pe(),source_net_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional()}).describe("Defines a ground plane on the PCB"),HBe=Un({type:Sn("pcb_ground_plane_region"),pcb_ground_plane_region_id:ad("pcb_ground_plane_region"),pcb_ground_plane_id:Pe(),pcb_group_id:Pe().optional(),subcircuit_id:Pe().optional(),layer:wg,points:uo(dg)}).describe("Defines a polygon region of a ground plane"),VBe=Un({type:Sn("pcb_thermal_spoke"),pcb_thermal_spoke_id:ad("pcb_thermal_spoke"),pcb_ground_plane_id:Pe(),shape:Pe(),spoke_count:Ci(),spoke_thickness:Fi,spoke_inner_diameter:Fi,spoke_outer_diameter:Fi,pcb_plated_hole_id:Pe().optional(),subcircuit_id:Pe().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),KBe=Un({type:Sn("cad_component"),cad_component_id:Pe(),pcb_component_id:Pe(),source_component_id:Pe(),position:wM,rotation:wM.optional(),size:wM.optional(),layer:wg.optional(),subcircuit_id:Pe().optional(),footprinter_string:Pe().optional(),model_obj_url:Pe().optional(),model_stl_url:Pe().optional(),model_3mf_url:Pe().optional(),model_jscad:pE().optional()}).describe("Defines a component on the PCB"),jBe=Un({type:Sn("simulation_voltage_source"),simulation_voltage_source_id:ad("simulation_voltage_source"),positive_source_port_id:Pe(),negative_source_port_id:Pe(),positive_source_net_id:Pe(),negative_source_net_id:Pe(),voltage:qS}).describe("Defines a voltage source for simulation"),JBe=Bd([N2e,D2e,R2e,k2e,T2e,aq,rq,eL,sq,oq,cq,lq,uq,hq,fq,yq,pq,gq,mq,dq,Aq,P2e,_q,vq,sBe,lBe,UBe,bq,uBe,TBe,ABe,pBe,yBe,IBe,hBe,fBe,CBe,GBe,EBe,bBe,BBe,wBe,SBe,QBe,MBe,_Be,xBe,vBe,DBe,RBe,OBe,NBe,zBe,LBe,YBe,HBe,VBe,F2e,K2e,H2e,Y2e,j2e,V2e,L2e,W2e,Z2e,J2e,eBe,tBe,Iq,nBe,iBe,rBe,KBe,jBe]),nL=JBe;const Bq=Object.freeze(Object.defineProperty({__proto__:null,all_layers:I8,any_circuit_element:JBe,any_soup_element:nL,any_source_component:R2e,battery_capacity:B2e,cad_component:KBe,capacitance:BM,current:_mt,distance:Fi,frequency:XF,getZodPrefixedIdWithDefault:ad,inductance:nq,layer_ref:wg,layer_string:Cq,length:on,ninePointAnchor:qF,pcb_autorouting_error:OBe,pcb_board:CBe,pcb_breakout_point:zBe,pcb_component:sBe,pcb_cutout:LBe,pcb_cutout_circle:PBe,pcb_cutout_polygon:FBe,pcb_cutout_rect:kBe,pcb_fabrication_note_path:DBe,pcb_fabrication_note_text:RBe,pcb_footprint_overlap_error:NBe,pcb_ground_plane:YBe,pcb_ground_plane_region:HBe,pcb_group:GBe,pcb_hole:lBe,pcb_hole_circle_or_square_shape:Bmt,pcb_hole_oval_shape:wmt,pcb_keepout:TBe,pcb_manual_edit_conflict_warning:bq,pcb_missing_footprint_error:UBe,pcb_placement_error:xBe,pcb_plated_hole:uBe,pcb_port:ABe,pcb_port_not_matched_error:vBe,pcb_route_hint:oBe,pcb_route_hints:bmt,pcb_silkscreen_circle:QBe,pcb_silkscreen_line:bBe,pcb_silkscreen_oval:MBe,pcb_silkscreen_path:BBe,pcb_silkscreen_rect:SBe,pcb_silkscreen_text:wBe,pcb_smtpad:hBe,pcb_smtpad_pill:dBe,pcb_solder_paste:fBe,pcb_text:pBe,pcb_thermal_spoke:VBe,pcb_trace:yBe,pcb_trace_error:_Be,pcb_trace_hint:EBe,pcb_trace_route_point:xq,pcb_trace_route_point_via:mBe,pcb_trace_route_point_wire:gBe,pcb_via:IBe,point:dg,point3:wM,port_arrangement:z2e,position:Imt,position3:Cmt,resistance:bM,rotation:Lx,route_hint_point:V5,schematic_box:F2e,schematic_component:Y2e,schematic_component_port_arrangement_by_sides:O2e,schematic_component_port_arrangement_by_size:G2e,schematic_debug_line:q2e,schematic_debug_object:eBe,schematic_debug_object_base:tL,schematic_debug_point:$2e,schematic_debug_rect:X2e,schematic_error:W2e,schematic_group:nBe,schematic_layout_error:Z2e,schematic_line:H2e,schematic_manual_edit_conflict_warning:Iq,schematic_net_label:J2e,schematic_path:L2e,schematic_pin_styles:U2e,schematic_port:j2e,schematic_table:iBe,schematic_table_cell:rBe,schematic_text:K2e,schematic_trace:V2e,schematic_voltage_probe:tBe,simulation_voltage_source:jBe,size:iq,source_component_base:k9,source_failed_to_create_component_error:M2e,source_group:T2e,source_missing_property_error:Q2e,source_net:k2e,source_pcb_ground_plane:P2e,source_port:D2e,source_project_metadata:_q,source_simple_battery:lq,source_simple_capacitor:rq,source_simple_chip:aq,source_simple_crystal:S2e,source_simple_diode:eL,source_simple_ground:w2e,source_simple_inductor:uq,source_simple_led:sq,source_simple_mosfet:mq,source_simple_pin_header:hq,source_simple_potentiometer:dq,source_simple_power_source:cq,source_simple_push_button:Aq,source_simple_resistor:oq,source_simple_resonator:fq,source_simple_switch:yq,source_simple_test_point:gq,source_simple_transistor:pq,source_trace:N2e,source_trace_not_connected:vq,supplier_name:$F,time:vmt,visible_layer:SM,voltage:qS},Symbol.toStringTag,{value:"Module"}));function Li(i,e){return Array.isArray(e)?[i.a*e[0]+i.c*e[1]+i.e,i.b*e[0]+i.d*e[1]+i.f]:{x:i.a*e.x+i.c*e.y+i.e,y:i.b*e.x+i.d*e.y+i.f}}function Ymt(i,e){return e.map(t=>Li(i,t))}function WBe(i){return{a:parseFloat(i.a),b:parseFloat(i.b),c:parseFloat(i.c),d:parseFloat(i.d),e:parseFloat(i.e),f:parseFloat(i.f)}}const Hmt=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function wq(i){const e=i.match(Hmt);if(e===null||e.length<7)throw new Error(`'${i}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function Oy(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function F2(i){const{a:e,b:t,c:n,d:r,e:o,f:s}=i,a=e*r-t*n;return{a:r/a,b:t/-a,c:n/-a,d:e/a,e:(r*o-n*s)/-a,f:(t*o-e*s)/a}}function C8(i){return typeof i>"u"}function QM(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Vmt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Kmt(i){return Vmt(i)&&"a"in i&&QM(i.a)&&"b"in i&&QM(i.b)&&"c"in i&&QM(i.c)&&"d"in i&&QM(i.d)&&"e"in i&&QM(i.e)&&"f"in i&&QM(i.f)}function wd(i,e=0){return{a:1,c:0,e:i,b:0,d:1,f:e}}function TB(...i){i=Array.isArray(i[0])?i[0]:i;const e=(t,n)=>({a:t.a*n.a+t.c*n.b,c:t.a*n.c+t.c*n.d,e:t.a*n.e+t.c*n.f+t.e,b:t.b*n.a+t.d*n.b,d:t.b*n.c+t.d*n.d,f:t.b*n.e+t.d*n.f+t.f});switch(i.length){case 0:throw new Error("no matrices provided");case 1:return i[0];case 2:return e(i[0],i[1]);default:{const[t,n,...r]=i,o=e(t,n);return TB(o,...r)}}}function Xu(...i){return TB(...i)}const{cos:jmt,sin:Jmt,PI:Wmt}=Math;function gE(i,e,t){const n=jmt(i),r=Jmt(i),o={a:n,c:-r,e:0,b:r,d:n,f:0};return C8(e)||C8(t)?o:TB([wd(e,t),o,wd(-e,-t)])}function Sq(i,e=void 0,t=void 0){return gE(i*Wmt/180,e,t)}function P9(i,e=void 0,t=void 0,n=void 0){C8(e)&&(e=i);const r={a:i,c:0,e:0,b:0,d:e,f:0};return C8(t)||C8(n)?r:TB([wd(t,n),r,wd(-t,-n)])}function ZBe(i,e){return{a:1,c:i,e:0,b:e,d:1,f:0}}const{tan:XBe}=Math;function qBe(i,e){return{a:1,c:XBe(i),e:0,b:XBe(e),d:1,f:0}}function Qq(i,e){return qBe(i*Math.PI/180,e*Math.PI/180)}function Zmt(i){return p3(i)}function $Be(i){return p3(i)}function p3(i){return`matrix(${i.a},${i.b},${i.c},${i.d},${i.e},${i.f})`}function e5e(i,e=1e10){return{a:Math.round(i.a*e)/e,b:Math.round(i.b*e)/e,c:Math.round(i.c*e)/e,d:Math.round(i.d*e)/e,e:Math.round(i.e*e)/e,f:Math.round(i.f*e)/e}}function t5e(i,e){const t=i[0].x!=null?i[0].x:i[0][0],n=i[0].y!=null?i[0].y:i[0][1],r=e[0].x!=null?e[0].x:e[0][0],o=e[0].y!=null?e[0].y:e[0][1],s=i[1].x!=null?i[1].x:i[1][0],a=i[1].y!=null?i[1].y:i[1][1],c=e[1].x!=null?e[1].x:e[1][0],l=e[1].y!=null?e[1].y:e[1][1],u=i[2].x!=null?i[2].x:i[2][0],A=i[2].y!=null?i[2].y:i[2][1],d=e[2].x!=null?e[2].x:e[2][0],h=e[2].y!=null?e[2].y:e[2][1],f={a:t-u,b:n-A,c:s-u,d:a-A,e:u,f:A},y={a:r-d,b:o-h,c:c-d,d:l-h,e:d,f:h},_=F2(f),v=TB([y,_]);return e5e(v)}function Xmt(i){return Array.isArray(i)?i.map(e):e(i);function e(t){switch(t.type){case"matrix":if("a"in t&&"b"in t&&"c"in t&&"d"in t&&"e"in t&&"f"in t)return WBe(t);throw new Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"ty"in t?wd(t.tx,t.ty):wd(t.tx);case"scale":if(!("sx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"sy"in t?P9(t.sx,t.sy):P9(t.sx);case"rotate":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return"cx"in t&&"cy"in t?Sq(t.angle,t.cx,t.cy):Sq(t.angle);case"skewX":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return Qq(t.angle,0);case"skewY":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return Qq(0,t.angle);case"shear":if(!("shx"in t&&"shy"in t))throw new Error("MISSING_MANDATORY_PARAM");return ZBe(t.shx,t.shy);default:throw new Error("UNSUPPORTED_DESCRIPTOR")}}}function qmt(i,e){function t(){this.constructor=i}t.prototype=e.prototype,i.prototype=new t}function MM(i,e,t,n){var r=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(r,MM.prototype),r.expected=e,r.found=t,r.location=n,r.name="SyntaxError",r}qmt(MM,Error);function Mq(i,e,t){return t=t||" ",i.length>e?i:(e-=i.length,t+=t.repeat(e),i+t.slice(0,e))}MM.prototype.format=function(i){var e="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<i.length;n++)if(i[n].source===this.location.source){t=i[n].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,o=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,s=this.location.source+":"+o.line+":"+o.column;if(t){var a=this.location.end,c=Mq("",o.line.toString().length," "),l=t[r.line-1],u=r.line===a.line?a.column:l.length+1,A=u-r.column||1;e+=`
|
|
245
245
|
--> `+s+`
|
|
246
246
|
`+c+` |
|
|
247
247
|
`+o.line+" | "+l+`
|
|
@@ -13823,7 +13823,7 @@ ${n.stack}`),t.complete=!0,"root"in this&&this.root&&this.root.emit("asyncEffect
|
|
|
13823
13823
|
* Copyright (c) 2013-2015, 2017, Jon Schlinkert.
|
|
13824
13824
|
* Released under the MIT License.
|
|
13825
13825
|
*)
|
|
13826
|
-
*/const oPn=({containerClassName:i,...e})=>{const t=vt.useRef(null),[n,r]=vt.useState(620);return vt.useLayoutEffect(()=>{const o=()=>{if(t.current){const a=t.current.clientHeight,c=window.innerHeight;r(Math.min(Math.max(a,620),c))}};o();const s=new ResizeObserver(o);return t.current&&s.observe(t.current),window.addEventListener("resize",o),()=>{s.disconnect(),window.removeEventListener("resize",o)}},[]),ut.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:ut.jsx(rPn,{...e,height:n})})},sPn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-1{right:.25rem}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-4{margin-left:1rem;margin-right:1rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline-block{display:inline-block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-7{height:1.75rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[200px\\]{max-height:200px}.rf-max-h-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-20{width:5rem}.rf-w-28{width:7rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-40{width:10rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-w-screen{width:100vw}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-max-w-xs{max-width:20rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.rf-origin-\\[--radix-popover-content-transform-origin\\]{transform-origin:var(--radix-popover-content-transform-origin)}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf--translate-x-1\\/2{--tw-translate-x:-50%}.rf--translate-x-1\\/2,.rf--translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-y-1{--tw-translate-y:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-items-stretch{align-items:stretch}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-2{border-width:2px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-400{--tw-border-opacity:1;border-color:rgb(248 113 113/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-transparent{background-color:transparent}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-6{padding-bottom:1.5rem;padding-top:1.5rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-0{padding-top:0}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.\\!rf-font-normal{font-weight:400!important}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-100{opacity:1}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\=true\\]\\:rf-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[selected\\=true\\]\\:rf-bg-zinc-100[data-selected=true]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[selected\\=true\\]\\:rf-text-zinc-900[data-selected=true]{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\=true\\]\\:rf-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-bg-zinc-800[data-selected=true]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-text-zinc-50[data-selected=true]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-py-1\\.5 [cmdk-group-heading]{padding-bottom:.375rem;padding-top:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-500 [cmdk-group-heading]{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.dark\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-400 [cmdk-group-heading]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:rf-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:rf-px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:rf-h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-py-3 [cmdk-item]{padding-bottom:.75rem;padding-top:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-w-5 [cmdk-item] svg{width:1.25rem}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',aPn=()=>{vt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=sPn,document.head.appendChild(e)},[])},cPn=i=>{vt.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},Qut=i=>`hsl(${y2.indexOf(i)*137.5%360}, 70%, 50%)`,lPn=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return ut.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[ut.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:y2.map(t=>{const n=i[t]||0,r=n/e*100;return ut.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:Qut(t)},children:ut.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),ut.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},uPn=({renderLog:i})=>{const[e,t]=vt.useState("chronological");if(!i)return ut.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((o,s)=>y2.indexOf(o[0])-y2.indexOf(s[0])):n.sort((o,s)=>s[1]-o[1]);const r=n.reduce((o,[s,a])=>o+a,0);return ut.jsxs("div",{className:"rf-bg-white",children:[ut.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[ut.jsx("div",{children:"Render Logs"}),ut.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[ut.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),ut.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[ut.jsx("option",{value:"chronological",children:"Phase Order"}),ut.jsx("option",{value:"longest",children:"Duration"})]})]})]}),ut.jsx(lPn,{phaseTimings:i.phaseTimings}),ut.jsxs("table",{className:"rf-w-full rf-text-xs",children:[ut.jsx("thead",{children:ut.jsxs("tr",{children:[ut.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),ut.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),ut.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),ut.jsx("tbody",{children:n.map(([o,s])=>ut.jsxs("tr",{children:[ut.jsx("td",{className:"rf-p-2",children:y2.indexOf(o)}),ut.jsx("td",{className:"rf-p-2",children:o}),ut.jsx("td",{className:"rf-p-2",children:ut.jsx("div",{className:"rf-w-8",children:ut.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:Qut(o),width:`${s/r*100}%`}})})}),ut.jsx("td",{className:"rf-p-2",children:ut.jsxs("div",{className:"rf-flex w-full",children:[ut.jsxs("span",{className:"rf-flex-grow",children:[s,"ms"]}),ut.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(s/r*100).toFixed(1),"%"]})]})})]},o))})]})]})},APn=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{vt.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{UF.captureException(n)}catch{}}},[i,e]),vt.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{UF.captureException(r,{error_type:n.type})}catch{}}},[t])},dPn="0.0.769";function hPn(i,e){const[t,n]=vt.useState(()=>{try{const r=window.localStorage.getItem(i);return r?JSON.parse(r):e}catch(r){return console.error("Error reading from localStorage:",r),e}});return vt.useEffect(()=>{try{window.localStorage.setItem(i,JSON.stringify(t))}catch(r){console.error("Error writing to localStorage:",r)}},[i,t]),[t,n]}const A9e={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},d9e=new Map,UW=i=>{const e=d9e.get(i);return e?Object.fromEntries(Object.entries(e.stores).map(([t,n])=>[t,n.getState()])):{}},fPn=(i,e,t)=>{if(i===void 0)return{type:"untracked",connection:e.connect(t)};const n=d9e.get(t.name);if(n)return{type:"tracked",store:i,...n};const r={connection:e.connect(t),stores:{}};return d9e.set(t.name,r),{type:"tracked",store:i,...r}},pPn=(i,e={})=>(t,n,r)=>{const{enabled:o,anonymousActionType:s,store:a,...c}=e;let l;try{l=(o??(A9e?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return(A9e?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),i(t,n,r);const{connection:u,...A}=fPn(a,l,c);let d=!0;r.setState=(y,_,v)=>{const E=t(y,_);if(!d)return E;const b=v===void 0?{type:s||"anonymous"}:typeof v=="string"?{type:v}:v;return a===void 0?(u==null||u.send(b,n()),E):(u==null||u.send({...b,type:`${a}/${b.type}`},{...UW(c.name),[a]:r.getState()}),E)};const h=(...y)=>{const _=d;d=!1,t(...y),d=_},f=i(r.setState,n,r);if(A.type==="untracked"?u==null||u.init(f):(A.stores[A.store]=r,u==null||u.init(Object.fromEntries(Object.entries(A.stores).map(([y,_])=>[y,y===A.store?f:_.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let y=!1;const _=r.dispatch;r.dispatch=(...v)=>{(A9e?"production":void 0)!=="production"&&v[0].type==="__setState"&&!y&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),y=!0),_(...v)}}return u.subscribe(y=>{var _;switch(y.type){case"ACTION":if(typeof y.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return h9e(y.payload,v=>{if(v.type==="__setState"){if(a===void 0){h(v.state);return}Object.keys(v.state).length!==1&&console.error(`
|
|
13826
|
+
*/const oPn=({containerClassName:i,...e})=>{const t=vt.useRef(null),[n,r]=vt.useState(620);return vt.useLayoutEffect(()=>{const o=()=>{if(t.current){const a=t.current.clientHeight,c=window.innerHeight;r(Math.min(Math.max(a,620),c))}};o();const s=new ResizeObserver(o);return t.current&&s.observe(t.current),window.addEventListener("resize",o),()=>{s.disconnect(),window.removeEventListener("resize",o)}},[]),ut.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:ut.jsx(rPn,{...e,height:n})})},sPn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-1{right:.25rem}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-4{margin-left:1rem;margin-right:1rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline-block{display:inline-block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-7{height:1.75rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[200px\\]{max-height:200px}.rf-max-h-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-20{width:5rem}.rf-w-28{width:7rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-40{width:10rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-w-screen{width:100vw}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-max-w-xs{max-width:20rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.rf-origin-\\[--radix-popover-content-transform-origin\\]{transform-origin:var(--radix-popover-content-transform-origin)}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf--translate-x-1\\/2{--tw-translate-x:-50%}.rf--translate-x-1\\/2,.rf--translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-y-1{--tw-translate-y:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-items-stretch{align-items:stretch}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-2{border-width:2px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-400{--tw-border-opacity:1;border-color:rgb(248 113 113/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-transparent{background-color:transparent}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-6{padding-bottom:1.5rem;padding-top:1.5rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-0{padding-top:0}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.\\!rf-font-normal{font-weight:400!important}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-100{opacity:1}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\=true\\]\\:rf-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[selected\\=true\\]\\:rf-bg-zinc-100[data-selected=true]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[selected\\=true\\]\\:rf-text-zinc-900[data-selected=true]{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\=true\\]\\:rf-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-bg-zinc-800[data-selected=true]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-text-zinc-50[data-selected=true]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-py-1\\.5 [cmdk-group-heading]{padding-bottom:.375rem;padding-top:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-500 [cmdk-group-heading]{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.dark\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-400 [cmdk-group-heading]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:rf-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:rf-px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:rf-h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-py-3 [cmdk-item]{padding-bottom:.75rem;padding-top:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-w-5 [cmdk-item] svg{width:1.25rem}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',aPn=()=>{vt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=sPn,document.head.appendChild(e)},[])},cPn=i=>{vt.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},Qut=i=>`hsl(${y2.indexOf(i)*137.5%360}, 70%, 50%)`,lPn=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return ut.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[ut.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:y2.map(t=>{const n=i[t]||0,r=n/e*100;return ut.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:Qut(t)},children:ut.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),ut.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},uPn=({renderLog:i})=>{const[e,t]=vt.useState("chronological");if(!i)return ut.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((o,s)=>y2.indexOf(o[0])-y2.indexOf(s[0])):n.sort((o,s)=>s[1]-o[1]);const r=n.reduce((o,[s,a])=>o+a,0);return ut.jsxs("div",{className:"rf-bg-white",children:[ut.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[ut.jsx("div",{children:"Render Logs"}),ut.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[ut.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),ut.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[ut.jsx("option",{value:"chronological",children:"Phase Order"}),ut.jsx("option",{value:"longest",children:"Duration"})]})]})]}),ut.jsx(lPn,{phaseTimings:i.phaseTimings}),ut.jsxs("table",{className:"rf-w-full rf-text-xs",children:[ut.jsx("thead",{children:ut.jsxs("tr",{children:[ut.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),ut.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),ut.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),ut.jsx("tbody",{children:n.map(([o,s])=>ut.jsxs("tr",{children:[ut.jsx("td",{className:"rf-p-2",children:y2.indexOf(o)}),ut.jsx("td",{className:"rf-p-2",children:o}),ut.jsx("td",{className:"rf-p-2",children:ut.jsx("div",{className:"rf-w-8",children:ut.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:Qut(o),width:`${s/r*100}%`}})})}),ut.jsx("td",{className:"rf-p-2",children:ut.jsxs("div",{className:"rf-flex w-full",children:[ut.jsxs("span",{className:"rf-flex-grow",children:[s,"ms"]}),ut.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(s/r*100).toFixed(1),"%"]})]})})]},o))})]})]})},APn=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{vt.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{UF.captureException(n)}catch{}}},[i,e]),vt.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{UF.captureException(r,{error_type:n.type})}catch{}}},[t])},dPn="0.0.771";function hPn(i,e){const[t,n]=vt.useState(()=>{try{const r=window.localStorage.getItem(i);return r?JSON.parse(r):e}catch(r){return console.error("Error reading from localStorage:",r),e}});return vt.useEffect(()=>{try{window.localStorage.setItem(i,JSON.stringify(t))}catch(r){console.error("Error writing to localStorage:",r)}},[i,t]),[t,n]}const A9e={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},d9e=new Map,UW=i=>{const e=d9e.get(i);return e?Object.fromEntries(Object.entries(e.stores).map(([t,n])=>[t,n.getState()])):{}},fPn=(i,e,t)=>{if(i===void 0)return{type:"untracked",connection:e.connect(t)};const n=d9e.get(t.name);if(n)return{type:"tracked",store:i,...n};const r={connection:e.connect(t),stores:{}};return d9e.set(t.name,r),{type:"tracked",store:i,...r}},pPn=(i,e={})=>(t,n,r)=>{const{enabled:o,anonymousActionType:s,store:a,...c}=e;let l;try{l=(o??(A9e?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return(A9e?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),i(t,n,r);const{connection:u,...A}=fPn(a,l,c);let d=!0;r.setState=(y,_,v)=>{const E=t(y,_);if(!d)return E;const b=v===void 0?{type:s||"anonymous"}:typeof v=="string"?{type:v}:v;return a===void 0?(u==null||u.send(b,n()),E):(u==null||u.send({...b,type:`${a}/${b.type}`},{...UW(c.name),[a]:r.getState()}),E)};const h=(...y)=>{const _=d;d=!1,t(...y),d=_},f=i(r.setState,n,r);if(A.type==="untracked"?u==null||u.init(f):(A.stores[A.store]=r,u==null||u.init(Object.fromEntries(Object.entries(A.stores).map(([y,_])=>[y,y===A.store?f:_.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let y=!1;const _=r.dispatch;r.dispatch=(...v)=>{(A9e?"production":void 0)!=="production"&&v[0].type==="__setState"&&!y&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),y=!0),_(...v)}}return u.subscribe(y=>{var _;switch(y.type){case"ACTION":if(typeof y.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return h9e(y.payload,v=>{if(v.type==="__setState"){if(a===void 0){h(v.state);return}Object.keys(v.state).length!==1&&console.error(`
|
|
13827
13827
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
13828
13828
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
13829
13829
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|