PageSourceSearch

https://pika.style/_next/static/chunks/pages/_app-3d7f838c8b143fdc.js

js pika.style collected 2026-10-03 21:21:25 UTC 1,073,723 bytes, 68 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[636],{605:(e,t,r)=>{"use strict";function n(e,t,r){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let n=document;t&&(n=t.current);let i=r?.[e]??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>null!=e)}r.d(t,{K:()=>n})},799:(e,t,r)=>{"use strict";r.d(t,{l:()=>n});let n=e=>e},1433:(e,t,r)=>{"use strict";let n,i;r.d(t,{l$:()=>ee,Ay:()=>et,oR:()=>$});var s,o=r(76430);let a={data:""},l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,u=/\/\*[^]*?\*\/|  +/g,c=/\n+/g,h=(e,t)=>{let r="",n="",i="";for(let s in e){let o=e[s];"@"==s[0]?"i"==s[1]?r=s+" "+o+";":n+="f"==s[1]?h(o,s):s+"{"+h(o,"k"==s[1]?"":t)+"}":"object"==typeof o?n+=h(o,t?t.replace(/([^,])+/g,e=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):s):null!=o&&(s="-"==s[1]?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=h.p?h.p(s,o):s+":"+o+";")}return r+(t&&i?t+"{"+i+"}":i)+n},d={},p=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+p(e[r]);return t}return e};function f(e){let t,r,n=this||{},i=e.call?e(n.p):e;return((e,t,r,n,i)=>{var s;let o=p(e),a=d[o]||(d[o]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(o));if(!d[a]){let t=o!==e?e:(e=>{let t,r,n=[{}];for(;t=l.exec(e.replace(u,""));)t[4]?n.shift():t[3]?(r=t[3].replace(c," ").trim(),n.unshift(n[0][r]=n[0][r]||{})):n[0][t[1]]=t[2].replace(c," ").trim();return n[0]})(e);d[a]=h(i?{["@keyframes "+a]:t}:t,r?"":"."+a)}let f=r&&d.g;return r&&(d.g=d[a]),s=d[a],f?t.data=t.data.replace(f,s):-1===t.data.indexOf(s)&&(t.data=n?s+t.data:t.data+s),a})(i.unshift?i.raw?(t=[].slice.call(arguments,1),r=n.p,i.reduce((e,n,i)=>{let s=t[i];if(s&&s.call){let e=s(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;s=t?"."+t:e&&"object"==typeof e?e.props?"":h(e,""):!1===e?"":e}return e+n+(null==s?"":s)},"")):i.reduce((e,t)=>Object.assign(e,t&&t.call?t(n.p):t),{}):i,(e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||a})(n.target),n.g,n.o,n.k)}f.bind({g:1});let g,m,v,y=f.bind({k:1});function b(e,t){let r=this||{};return function(){let n=arguments;function i(s,o){let a=Object.assign({},s),l=a.className||i.className;r.p=Object.assign({theme:m&&m()},a),r.o=/go\d/.test(l),a.className=f.apply(r,n)+(l?" "+l:""),t&&(a.ref=o);let u=e;return e[0]&&(u=a.as||e,delete a.as),v&&u[0]&&v(a),g(u,a)}return t?t(i):i}}var _=(e,t)=>
vendor: 4,227 bytes, line 1
1"function"==typeof e?e(t):e,w=(n=0,()=>(++n).toString()),k=()=>{if(void 0===i&&"u">typeof window){let e=matchMedia("(prefers-reduced-motion: reduce)");i=!e||e.matches}return i},x="default",E=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:n}=t;return E(e,{type:+!!e.toasts.find(e=>e.id===n.id),toast:n});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(e=>e.id===i||void 0===i?{...e,dismissed:!0,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+s}))}}},S=[],P={toasts:[],pausedAt:void 0,settings:{toastLimit:20}},R={},T=(e,t=x)=>{R[t]=E(R[t]||P,e),S.forEach(([e,r])=>{e===t&&r(R[t])})},A=e=>Object.keys(R).forEach(t=>T(e,t)),C=(e=x)=>t=>{T(t,e)},j={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},O=e=>(t,r)=>{let n,i=((e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(null==r?void 0:r.id)||w()}))(t,e,r);return C(i.toasterId||(n=i.id,Object.keys(R).find(e=>R[e].toasts.some(e=>e.id===n))))({type:2,toast:i}),i.id},$=(e,t)=>O("blank")(e,t);$.error=O("error"),$.success=O("success"),$.loading=O("loading"),$.custom=O("custom"),$.dismiss=(e,t)=>{let r={type:3,toastId:e};t?C(t)(r):A(r)},$.dismissAll=e=>$.dismiss(void 0,e),$.remove=(e,t)=>{let r={type:4,toastId:e};t?C(t)(r):A(r)},$.removeAll=e=>$.remove(void 0,e),$.promise=(e,t,r)=>{let n=$.loading(t.loading,{...r,...null==r?void 0:r.loading});return"function"==typeof e&&(e=e()),e.then(e=>{let i=t.success?_(t.success,e):void 0;return i?$.success(i,{id:n,...r,...null==r?void 0:r.success}):$.dismiss(n),e}).catch(e=>{let i=t.error?_(t.error,e):void 0;i?$.error(i,{id:n,...r,...null==r?void 0:r.error}):$.dismiss(n)}),e};var I=1e3,L=y` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,M=y` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,D=y` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,N=b("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${L} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${M} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${e=>e.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${D} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,F=y` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,B=b("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${e=>e.secondary||"#e0e0e0"}; border-right-color: ${e=>e.primary||"#616161"}; animation: ${F} 1s linear infinite; `,U=y` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,V=y` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,W=b("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${U} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${V} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${e=>e.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,H=b("div")` position: absolute; `,q=b("div")` position: relative; display: flex; justify-content: center; align-items: center;
1 min-width: 20px; min-height: 20px; `,G=y` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,z=b("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${G} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,K=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return void 0!==t?"string"==typeof t?o.createElement(z,null,t):t:"blank"===r?null:o.createElement(q,null,o.createElement(B,{...n}),"loading"!==r&&o.createElement(H,null,"error"===r?o.createElement(N,{...n}):o.createElement(W,{...n})))},J=b("div")` :where(&) { display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; } `,Y=b("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,X=o.memo(({toast:e,position:t,style:r,children:n})=>{let i=e.height?((e,t)=>{let r=e.includes("top")?1:-1,[n,i]=k()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[` 0% {transform: translate3d(0,${-200*r}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${-150*r}%,-1px) scale(.6); opacity:0;} `];return{animation:t?`${y(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${y(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}})(e.position||t||"top-center",e.visible):{opacity:0},s=o.createElement(K,{toast:e}),a=o.createElement(Y,{...e.ariaProps},_(e.message,e));return o.createElement(J,{className:e.className,style:{...i,...r,...e.style}},"function"==typeof n?n({icon:s,message:a}):o.createElement(o.Fragment,null,s,a))});s=o.createElement,h.p=void 0,g=s,m=void 0,v=void 0;var Z=({id:e,className:t,style:r,onHeightUpdate:n,children:i})=>{let s=o.useCallback(t=>{if(t){let r=()=>{n(e,t.getBoundingClientRect().height)};r(),new MutationObserver(r).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return o.createElement("div",{ref:s,className:t,style:r},i)},Q=f` z-index: 9999; > * { pointer-events: auto; } `,ee=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:i,toasterId:s,containerStyle:a,containerClassName:l})=>{let{toasts:u,handlers:c}=((e,t="default")=>{let{toasts:r,pausedAt:n}=((e={},t=x)=>{let[r,n]=(0,o.useState)(R[t]||P),i=(0,o.useRef)(R[t]);(0,o.useEffect)(()=>(i.current!==R[t]&&n(R[t]),S.push([t,n]),()=>{let e=S.findIndex(([e])=>e===t);e>-1&&S.splice(e,1)}),[t]);let s=r.toasts.map(t=>{var r,n,i;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(r=e[t.type])?void 0:r.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(n=e[t.type])?void 0:n.duration)||(null==e?void 0:e.duration)||j[t.type],style:{...e.style,...null==(i=e[t.type])?void 0:i.style,...t.style}}});return{...r,toasts:s}})(e,t),i=(0,o.useRef)(new Map).current,s=(0,o.useCallback)((e,t=I)=>{if(i.has(e))return;let r=setTimeout(()=>{i.delete(e),a({type:4,toastId:e})},t);i.set(e,r)},[]);(0,o.useEffect)(()=>{if(n)return;let e=Date.now(),i=r.map(r=>{if(r.duration===1/0)return;let n=(r.duration||0)+r.pauseDuration-(e-r.createdAt);if(n<0){r.visible&&$.dismiss(r.id);return}return setTimeout(()=>$.dismiss(r.id,t),n)});return()=>{i.forEach(e=>e&&clearTimeout(e))}},[r,n,t]);let a=(0,o.useCallback)(C(t),[t]),l=(0,o.useCallback)(()=>{a({type:5,time:Date.now()})},[a]),u=(0,o.useCallback)((e,t)=>{a({type:1,toast:{id:e,height:t}})},[a]),c=(0,o.useCallback)(()=>{n&&a({type:6,time:Date.now()})},[n,a]),h=(0,o.useCallback)((e,t)=>{let{reverseOrder:n=!1,gutter:i=8,defaultPosition:s}=t||{},o=r.filter(t=>(t.position||s)===(e.position||s)&&t.height),a=o.findIndex(t=>t.id===e.id),l=o.filter((e,t)=>t<a&&e.visible).length;return o.filter(e=>e.visible).slice(...n?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+i,0)},[r]);return(0,o.useEffect)(()=>{r.forEach(e=>{if(e.dismissed)s(e.id,e.removeDelay);else{let t=i.get(e.id);t&&(clearTimeout(t),i.delete(e.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:u,startPause:l,endPause:c,calculateOffset:h}}})(r,s);return o.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...a},className:l,onMouseEnter:c.startPause,onMouseLeave:c.endPause},u.map(r=>{let s,a,l=r.position||t,u=c.calculateOffset(r,{reverseOrder:e,gutter:n,defaultPosition:t}),h=(s=l.includes("top"),a=l.includes("center")?{justifyContent:"center"}:l.includes("right")?{justifyContent:"flex-end"}:{},{left:0,right:0,display:"flex",position:"absolute",transition:k()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${u*(s?1:-1)}px)`,...s?{top:0}:{bottom:0},...a}
1);return o.createElement(Z,{id:r.id,key:r.id,onHeightUpdate:c.updateHeight,className:r.visible?Q:"",style:h},"custom"===r.type?_(r.message,r):i?i(r):o.createElement(X,{toast:r,position:l}))}))},et=$},1688:()=>{},1867:(e,t,r)=>{"use strict";r.d(t,{L:()=>n});let n=(0,r(76430).createContext)({})},2272:(e,t,r)=>{"use strict";r.d(t,{Q:()=>eh,A:()=>ec});var n=r(75038),i=r(76430),s=r(67938),o=r.n(s),a=r(19977),l=r(72651),u=r(34530),c=r(1433),h=r(92376),d=r(25393),p=r(20142),f=new Map;f.set("bold",function(e){return i.createElement(i.Fragment,null,i.createElement("rect",{x:"40",y:"88",width:"176",height:"128",rx:"8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),i.createElement("path",{d:"M92,88V52a36,36,0,0,1,71.8-4",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),i.createElement("circle",{cx:"128",cy:"152",r:"16"}))}),f.set("duotone",function(e){return i.createElement(i.Fragment,null,i.createElement("rect",{x:"40",y:"88",width:"176",height:"128",rx:"8",opacity:"0.2"}),i.createElement("rect",{x:"40",y:"88",width:"176",height:"128",rx:"8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),i.createElement("path",{d:"M92,88V52a36,36,0,0,1,72,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),i.createElement("circle",{cx:"128",cy:"152",r:"12"}))}),f.set("fill",function(){return i.createElement(i.Fragment,null,i.createElement("path",{d:"M208,80H100V52a28,28,0,0,1,56,0,8,8,0,0,0,16,0,44,44,0,0,0-88,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80Zm-80,84a12,12,0,1,1,12-12A12,12,0,0,1,128,164Z"}))}),f.set("light",function(e){return i.createElement(i.Fragment,null,i.createElement("rect",{x:"40",y:"88",width:"176",height:"128",rx:"8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),i.createElement("path",{d:"M92,88V52a36,36,0,0,1,72,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),i.createElement("circle",{cx:"128",cy:"152",r:"10"}))}),f.set("thin",function(e){return i.createElement(i.Fragment,null,i.createElement("rect",{x:"40",y:"88",width:"176",height:"128",rx:"8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),i.createElement("path",{d:"M92,88V52a36,36,0,0,1,72,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),i.createElement("circle",{cx:"128",cy:"152",r:"8"}))}),f.set("regular",function(e){return i.createElement(i.Fragment,null,i.createElement("rect",{x:"40",y:"88",width:"176",height:"128",rx:"8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),i.createElement("path",{d:"M92,88V52a36,36,0,0,1,72,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),i.createElement("circle",{cx:"128",cy:"152",r:"12"}))});var g=function(e,t){return(0,d.$)(e,t,f)},m=(0,i.forwardRef)(function(e,t){return i.createElement(p.A,Object.assign({ref:t},e,{renderPath:g}))});m.displayName="LockOpen";var v=r(79998),y=r(42098),b=r(18070),_=r(48765);let w=async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||"Something went wrong");return t},k=(e,{method:t="GET",body:r}={})=>fetch(e,{method:t,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0}).then(w);async function x(e){return[...new Uint8Array(await crypto.subtle.digest("SHA-256",await e.arrayBuffer()))].map(e=>e.toString(16).padStart(2,"0")).join("")}async function E(e){let t=await fetch(e).then(e=>e.blob()),r=await k("/api/presets/asset",{method:"POST",body:{sha256:await x(t),contentType:t.type}});if(r.uploadUrl){if(t.size>r.maxBytes)throw Error("Image is too large");if(!(await fetch(r.uploadUrl,{method:"PUT",headers:r.headers,body:t})).ok)throw Error("Could not upload an image in this preset")}return r.url}async function S(e,t=new Map){return"string"==typeof e?e.startsWith("data:")?e.startsWith("data:image/")?(t.has(e)||t.set(e,E(e)),t.get(e)):"":e:Array.isArray(e)?Promise.all(e.map(e=>S(e,t))):e&&"object"==typeof e?Object.fromEntries(await Promise.all(Object.entries(e).map(async([e,r])=>[e,await S(r,t)]))):e}async function P(e,t=640){let r=await (0,l.yN)({ref:e,customScale:1}),n=await createImageBitmap(r),i=Math.min(1,t/n.width),s=document.createElement("canvas");s.width=Math.round(n.width*i),s.height=Math.round(n.height*i),s.getContext("2d").drawImage(n,
10,0,s.width,s.height),n.close?.();let o=await new Promise(e=>s.toBlob(e,"image/webp",.85));return o?.type==="image/webp"?o:null}async function R(e,t,r){let n=await P(r);if(!n)throw Error("Could not render the preview");let i=await fetch(t.uploadUrl,{method:"PUT",headers:t.headers,body:n});if(!i.ok)throw Error(`Preview upload failed (${i.status})`);let{preset:s}=await k(`/api/presets/${e}`,{method:"PATCH",body:{preview:"uploaded",previewToken:t.token}});return s}async function T({template:e,name:t,data:r,previewElement:n,teamId:i,projectId:s}){let o=await S(r),{preset:a,previewUpload:l}=await k("/api/presets",{method:"POST",body:{template:e,name:t,data:o,teamId:i,projectId:s}}),u=n?R(a.id,l,n).catch(e=>(console.warn("Preset preview upload failed",e),null)):Promise.resolve(null);return{preset:a,preview:u}}let A=e=>k(`/api/presets/${e}`,{method:"DELETE"});var C=r(58891),j=r(43887),O=r(42530),$=r(50084);function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function L(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach(function(t){L(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s,o,a=[],l=!0,u=!1;try{if(s=(r=r.call(e)).next,0===t);else for(;!(l=(n=s.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var B=function(e,t,r){var n=!!r,s=i.useRef(r);i.useEffect(function(){s.current=r},[r]),i.useEffect(function(){if(!n||!e)return function(){};var r=function(){if(s.current)return s.current.apply(s,arguments)};return e.on(t,r),function(){e.off(t,r)}},[n,t,e,s])},U=function(e){var t=i.useRef(e);return i.useEffect(function(){t.current=e},[e]),t.current},V=function(e){return null!==e&&"object"===F(e)},W="[object Object]",H=function e(t,r){if(t===r)return!0;if(!V(t)||!V(r))return t===r;var n=Array.isArray(t);if(n!==Array.isArray(r))return!1;var i=Object.prototype.toString.call(t)===W;if(i!==(Object.prototype.toString.call(r)===W))return!1;if(!i&&!n)return t===r;var s=Object.keys(t),o=Object.keys(r);if(s.length!==o.length)return!1;for(var a={},l=0;l<s.length;l+=1)a[s[l]]=!0;for(var u=0;u<o.length;u+=1)a[o[u]]=!0;var c=Object.keys(a);return c.length===s.length&&c.every(function(n){return e(t[n],r[n])})},q=function(e,t,r){return V(e)?Object.keys(e).reduce(function(n,i){var s=!V(t)||!H(e[i],t[i]);return r.includes(i)?(s&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),n):s?D(D({},n||{}),{},L({},i,e[i])):n},null):null},G="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;if(null===e||V(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return e;throw Error(t)},K=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;if(V(e)&&"function"==typeof e.then)return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return z(e,t)})};var r=z(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},J=function(e){e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"6.11.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.11.0",url:"https://stripe.com/docs/stripe-js/react"}))},Y=i.createContext(null);Y.displayName="ElementsContext";var X=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},Z=function(e){var t=e.stripe,r=e.options,n=e.children,s=i.useMemo(function(){return K(t)},[t]),o=N(i.useState(function(){return{stripe:"sync"===s.tag?s.stripe:null,elements:"sync"===s.tag?s.stripe.elements(r):null}}),2),a=o[0],l=o[1];i.useEffect(function(){var e=!0,t=function(e){l(function(t){return t.stripe?t:{stripe:e,elements:e.elements(r)}})};return"async"!==s.tag||a.stripe?"sync"!==s.tag||a.stripe||t(s.stripe):s.stripePromise.then(function(r){r&&e&&t(r)}),function(){e=!1}},[s,a,r]);var u=U(t);
1i.useEffect(function(){null!==u&&u!==t&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[u,t]);var c=U(r);return i.useEffect(function(){if(a.elements){var e=q(r,c,["clientSecret","fonts"]);e&&a.elements.update(e)}},[r,c,a.elements]),i.useEffect(function(){J(a.stripe)},[a.stripe]),i.createElement(Y.Provider,{value:a},n)};Z.propTypes={stripe:$.any,options:$.object},$.func.isRequired,i.createContext(null).displayName="CheckoutContext";var Q=i.createContext(null);Q.displayName="CheckoutSdkContext";var ee=function(e){var t=i.useContext(Q),r=i.useContext(Y);if(!t)return X(r,e);if(!r)return t;throw Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."))},et=["mode"],er=function(e,t,r){var n="".concat(e.charAt(0).toUpperCase()+e.slice(1),"Element"),s=t?function(e){ee("mounts <".concat(n,">"));var t=e.id,r=e.className;return i.createElement("div",{id:t,className:r})}:function(t){var r,s=t.id,o=t.className,a=t.options,l=void 0===a?{}:a,u=t.onBlur,c=t.onFocus,h=t.onReady,d=t.onChange,p=t.onEscape,f=t.onClick,g=t.onLoadError,m=t.onLoaderStart,v=t.onNetworksChange,y=t.onConfirm,b=t.onCancel,_=t.onShippingAddressChange,w=t.onShippingRateChange,k=t.onSavedPaymentMethodRemove,x=t.onSavedPaymentMethodUpdate,E=t.onAvailablePaymentMethodsChange,S=ee("mounts <".concat(n,">")),P="elements"in S?S.elements:null,R="checkoutSdk"in S?S.checkoutSdk:null,T=N(i.useState(null),2),A=T[0],C=T[1],j=i.useRef(null),O=i.useRef(null);B(A,"blur",u),B(A,"focus",c),B(A,"escape",p),B(A,"click",f),B(A,"loaderror",g),B(A,"loaderstart",m),B(A,"networkschange",v),B(A,"confirm",y),B(A,"cancel",b),B(A,"shippingaddresschange",_),B(A,"shippingratechange",w),B(A,"savedpaymentmethodremove",k),B(A,"savedpaymentmethodupdate",x),B(A,"availablepaymentmethodschange",E),B(A,"change",d),h&&(r="expressCheckout"===e?h:function(){h(A)}),B(A,"ready",r),i.useLayoutEffect(function(){if(null===j.current&&null!==O.current&&(P||R)){var t=null;if(R)switch(e){case"paymentForm":t=R.createForm(l);break;case"payment":t=R.createPaymentElement(l);break;case"address":if("mode"in l){var r=l.mode,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(l,et);if("shipping"===r)t=R.createShippingAddressElement(i);else if("billing"===r)t=R.createBillingAddressElement(i);else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":t=R.createExpressCheckoutElement(l);break;case"currencySelector":t=R.createCurrencySelectorElement();break;case"taxId":t=R.createTaxIdElement(l);break;case"contactDetails":t=R.createContactDetailsElement();break;case"linkSignup":if("createLinkSignupElement"in R)t=R.createLinkSignupElement(l);else throw Error("<LinkSignupElement> requires <CheckoutElementsProvider> and is not supported inside <CheckoutFormProvider>.");break;case"terms":t=R.createTermsElement(l);break;default:throw Error("<".concat(n,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}else P&&(t=P.create(e,l));j.current=t,C(t),t&&t.mount(O.current)}},[P,R,l]);var $=U(l);return i.useEffect(function(){if(j.current){var e=q(l,$,["paymentRequest"]);e&&"update"in j.current&&j.current.update(e)}},[l,$]),i.useLayoutEffect(function(){return function(){if(j.current&&"function"==typeof j.current.destroy)try{j.current.destroy(),j.current=null}catch(e){}}},[]),i.createElement("div",{id:s,className:o,ref:O})};return s.propTypes={id:$.string,className:$.string,onChange:$.func,onBlur:$.func,onFocus:$.func,onReady:$.func,onEscape:$.func,onClick:$.func,onLoadError:$.func,onLoaderStart:$.func,onNetworksChange:$.func,onConfirm:$.func,onCancel:$.func,onShippingAddressChange:$.func,onShippingRateChange:$.func,onSavedPaymentMethodRemove:$.func,onSavedPaymentMethodUpdate:$.func,onAvailablePaymentMethodsChange:$.func,options:$.object},s.displayName=n,s.__elementType=e,s},en="u"<typeof window;i.createContext(null).displayName="EmbeddedCheckoutProviderContext",er("auBankAccount",en),er("card",en),er("cardNumber",en),er("cardExpiry",en),er("cardCvc",en),er("currencySelector",en),er("iban",en),er("payment",en),er("expressCheckout",en),er("paymentRequestButton",en),er("linkAuthentication",en),er("linkSignup",en),er("contactDetails",en),er("address",en),er("shippingAddress",en),er("paymentMethodMessaging",en),er("taxI
1d",en),er("issuingCardNumberDisplay",en),er("issuingCardCvcDisplay",en),er("issuingCardExpiryDisplay",en),er("issuingCardPinDisplay",en),er("issuingCardCopyButton",en),er("terms",en);var ei=r(75141);let es=o()(()=>Promise.all([r.e(804),r.e(330)]).then(r.bind(r,80330)),{loadableGenerated:{webpack:()=>[80330]}}),eo=o()(()=>r.e(1216).then(r.bind(r,21216)),{loadableGenerated:{webpack:()=>[21216]}}),ea=o()(()=>r.e(9681).then(r.bind(r,69681)),{loadableGenerated:{webpack:()=>[69681]}}),el=()=>fetch("/api/entitlements",{credentials:"same-origin"}).then(e=>e.ok?e.json():null).catch(e=>(console.log("Error loading entitlements",e),null)),eu=(0,i.createContext)({c_Session:[],c_SetSession:()=>{},c_Subscription:[],c_SetSubscription:()=>{},c_StripeSub:[],c_Presets:[],c_SetPresets:()=>{},c_Stats:[],c_SetStats:()=>{},c_Modals:[],c_SetModals:()=>{},c_Options:[],c_SetOptions:()=>{},c_TemplatePresets:[],c_SaveTemplatePreset:()=>{},c_RemoveTemplatePreset:()=>{},c_SavedBackgrounds:[],c_SetSavedBackgrounds:()=>{},c_TemplatesExplorer:!1,c_ToggleTemplatesExplorer:()=>{},c_CommunityPresets:[],c_SetCommunityPresets:()=>{},c_CloudLibrary:[],c_SetCloudLibrary:()=>{}}),ec=eu;function eh(e){let{theme:t,setTheme:r}=(0,y.D)(),s=(0,h.useRouter)(),[o,d]=(0,i.useState)(null),[p,f]=(0,i.useState)(null),[g,w]=(0,i.useState)(null),[x,E]=(0,i.useState)([]),[S,P]=(0,i.useState)([]),[R,$]=(0,i.useState)([]),[I,L]=(0,i.useState)({}),[M,D]=(0,i.useState)({}),[N,F]=(0,i.useState)(),[B,U]=(0,i.useState)(),[V,W]=(0,i.useState)(!1),[H,q]=(0,i.useState)(!1),[G,z]=(0,i.useState)([]),[K,J]=(0,i.useState)(!1),[Y,X]=(0,i.useState)(),[Q,ee]=(0,i.useState)(),et=(0,i.useRef)(null),er=(0,i.useRef)(null);(0,i.useEffect)(()=>{"/"===s.pathname&&o&&s.push("/templates/screenshot-editor")},[s,o]);let en=async({session:e})=>{try{let t=(0,a.U)(),{data:r,error:n}=await t.from("short_links").select("*").eq("user_id",e.id).order("created_at",{ascending:!1});r?.length,J(r)}catch(e){console.log("Error fetching cloud library",e)}},ec=async()=>{let e=(0,a.U)(),{data:{session:t}}=await e.auth.getSession();t?.user?d(t?.user):(d(!1),f(!1),w(!1),J(!1)),e.auth.onAuthStateChange(async(e,t)=>{"SIGNED_IN"==e&&d(t?.user??!1),("TOKEN_REFRESHED"==e||"USER_UPDATED"==e)&&d(t?.user??!1),"SIGNED_OUT"==e&&((0,v.oV)(),d(!1),f(!1),w(!1),X(!1),ee(void 0),J(!1),P([]),$([]),F({}),U({}),s.push("/templates/screenshot-editor"))})};(0,i.useEffect)(()=>{ec(),r("light");let e=(0,j.d4)();e&&((0,j.js)(),c.oR.error(e))},[]);let eh=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!o?.id||eh.current===o.id)return;eh.current=o.id;let e=(0,j.js)();if(!e)return;let t=(0,C.SM)(o);if(t&&"email"!==e.provider&&(0,j.yV)({user:o}),t||(0,v.sx)("logged_in",{key:o.email||"",provider:e.provider}),e.checkout){let t=c.oR.loading("Taking you to checkout…");(0,O.dT)(e.checkout,o).then(e=>{e.redirected||(0,c.oR)(e.message,{id:t})});return}c.oR.success(t?"Welcome to Pika!":"Logged in successfully")},[o?.id]),(0,i.useEffect)(()=>{o?.id&&(0,v.gm)({id:o.id,email:o.email,name:o.user_metadata?.name})},[o?.id]),(0,i.useEffect)(()=>{o?.id&&void 0!==Y&&(0,v.gm)({id:o.id,plan:Q?.plan??(Y?.paid?"pro":"free"),team_count:Q?.teams?.length,plan_interval:Y?.interval,subscription_status:Y?.status_text,stripe_account:Y?.stripe_account})},[o?.id,Y,Q]),(0,i.useEffect)(()=>{o?.id&&(eg(),em(),ef())},[s,o]),(0,i.useEffect)(()=>{o?.id&&en({session:o})},[o?.id]);let ed=()=>el().then(e=>e&&ee(e));(0,i.useEffect)(()=>{if(!o?.id)return;let e=()=>{"visible"===document.visibilityState&&ed()};return s.events.on("routeChangeComplete",e),document.addEventListener("visibilitychange",e),()=>{s.events.off("routeChangeComplete",e),document.removeEventListener("visibilitychange",e)}},[o?.id]);let ep=async e=>{var t;t=e?`project:${e}`:"personal","u">typeof document&&(document.cookie=`pika_workspace=${encodeURIComponent(t)}; path=/; max-age=31536000; samesite=lax`),await ed()};(0,i.useEffect)(()=>{o?.id&&el().then(e=>e&&ee(e))},[o?.id]);let ef=async()=>{if(o?.id)try{let e=(0,a.U)(),t=async e=>{let t=await e().is("team_id",null);return t.error?.code==="42703"?e():t},{data:r,error:n}=await t(()=>
1e.from("subscriptions").select("*").eq("user_id",o.id).eq("paid",!0).order("created_at",{ascending:!1}));if(r?.length)return void X(r.find(b.uR)??r.find(b.md)??r[0]);let{data:i,error:s}=await t(()=>e.from("subscriptions").select("*").eq("user_id",o.id).order("created_at",{ascending:!1}).limit(1));i?.length?X(i[0]):X(!1);let l=n||s;l&&console.log("Error fetching active subscription",l)}catch(e){console.log("Active Subscriptions error",e)}},eg=async()=>{if(o?.id){let e=(0,a.U)(),t=`created_at,
2subscription,
3user_id,
4email,
5id,
6stripe,
7settings,
8stats,
9savedBackgrounds`,{data:r}=await e.from("profiles").select(t);if(!r?.length&&et.current!==o.id){et.current=o.id;let n=await e.from("profiles").insert({user_id:o.id,email:o.email}).select(t);n.error&&console.log("Error creating profile",n.error),r=n.data}if(r?.length&&er.current!==o.id&&(er.current=o.id,(0,C.MN)(e,o)),eP(),r?.length){let{subscription:e,stripe:t}=r[0];U(r[0].savedBackgrounds),P(r[0].stats),D(r[0].settings),e?f(e):f(e=>null!==e&&e),t?w(t):w(e=>null!==e&&e);try{window.$crisp&&($crisp.push(["set","user:nickname",[o?.user_metadata?.name||"Pika User"]]),$crisp.push(["set","user:email",o?.email]),$crisp.push(["set","session:data",["EditorUsageTotal",r[0]?.stats?.length||"n/a"]])),(0,v.gm)({id:o?.id,editor_usage_total:r[0]?.stats?.length})}catch(e){console.log("Setting Identity error",e)}}else f(e=>null!==e&&e)}},em=async()=>{if(s?.query?.pro=="true"){let e=c.oR.loading("Processing your subscription");setTimeout(async()=>{c.oR.success("Successfully upgraded to Pika Pro!",{id:e}),(0,l.u4)({event:"\uD83D\uDCB5 New Pro User",meta:o?.email}),s.replace("/")},2e3)}};(0,i.useEffect)(()=>{window?.$crisp&&($crisp.push(["set","session:data",["Paid",g?.paid||""]]),$crisp.push(["set","session:data",["Plan",g?.planType||""]]),$crisp.push(["set","session:data",["EndingOn",g?.period_end?new Date(g?.period_end*1e3).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):""]]),$crisp.push(["set","session:data",["Duration",g?.plan_duration||""]]),$crisp.push(["set","session:data",["SubStatus",g?.subscriptionStatus||""]]))},[g]);let ev=async e=>{d(e)},ey=async e=>{f(e)},eb=async({type:e,exportType:t,isPro:r})=>{let n=[{created:+new Date,type:e,exportType:t,proExport:!!r||p?.status==="active"},...S||[]],i=(0,a.U)(),s=await i.from("profiles").update({stats:n},{returning:"minimal"}).match({user_id:o?.id});s?.status===204&&P(n)},e_=({newTab:e=!1}={})=>{e?window.open("/pricing","_blank","noopener"):s.push("/pricing")},ew=async({newSavedBackgrounds:e,type:t})=>{if(!eL)return void c.oR.error("Upgrade to Pro to save backgrounds");let r=(0,a.U)(),{data:n,error:i}=await r.from("profiles").update({savedBackgrounds:e}).eq("user_id",o?.id).select();n?.length&&(c.oR.success("remove"===t?"Removed Saved Background":"Background Saved"),U(e)),i&&c.oR.error("Something went wrong saving the background, please try again")},ek="screenshot-editor",ex=e=>({id:e.id,name:e.name,preview_url:e.preview_url,is_default:e.is_default,user_id:e.user_id,team_id:e.team_id??null,project_id:e.project_id??null}),eE=e=>({...ex(e),data:e.data}),eS=e=>({...ex(e),options:e.data}),eP=async()=>{try{let e=await k("/api/presets").then(e=>e.presets||[]);$(e.filter(e=>e.template===ek).map(eE));let t={};e.filter(e=>e.template!==ek).forEach(e=>{(t[e.template]||=[]).push(eS(e))}),F(t)}catch(e){console.log("Error loading presets",e)}},eR=async({newPreset:e,previewElement:t,scope:r})=>{let n=c.oR.loading("Saving preset...");try{let{preset:i,preview:s}=await T({template:ek,name:e.name,data:e.data,previewElement:t,teamId:r?.teamId,projectId:r?.projectId});return $(e=>[eE(i),...e||[]]),c.oR.success("Successfully saved preset",{id:n}),s.then(e=>{e&&$(t=>(t||[]).map(t=>t.id===e.id?eE(e):t))}),i}catch(e){return c.oR.error(e.message||"Could not save the preset, please try again",{id:n}),null}},eT=async({template:e,name:t,options:r,previewElement:n,scope:i})=>{let s=c.oR.loading("Saving preset...");try{let{preset:o,preview:a}=await T({template:e,name:t,data:r,previewElement:n,teamId:i?.teamId,projectId:i?.projectId});return F(t=>({...t||{},[e]:[eS(o),...t?.[e]||[]]})),a.then(t=>{t&&F(r=>({...r||{},[e]:(r?.[e]||[]).map(e=>e.id===t.id?eS(t):e)}))}),c.oR.success("Successfully saved preset",{id:s}),o}catch(e){return c.oR.error(e.message||"Could not save the preset, please try again",{id:s}),null}},eA=async({template:e,id:t})=>{try{await A(t),F(r=>({...r||{},[e]:(r?.[e]||[]).filter(e=>e.id!==t)})),c.oR.success("Removed preset")}catch(e){c.oR.error("Could not remove the preset, please try again")}},eC=async e=>{let t={...M,...e},r=(0,a.U)(),{error:n}=await r.from("profiles").update({settings:t}).match({user_id:o?.id});n||D(t)},ej=async({id:e})=>{try{await A(e),$(t=>(t||[]).filter(t=>t.id!==e)),c.oR.success("Removed preset")}catch(e){c.oR.error(e.message||"Could not remove the preset, please try again")}},eO=async({id:e,mode:t,target:r={},template:n=ek})=>{let i="move"===t,s=c.oR.loading(i?"Moving preset...":"Copying preset...");try{let o=await ((e,t,r={})=>k(`/api/presets/${e}/transfer`,{method:"POST",body:{mode:t,teamId:r.teamId,projectId:r.projectId}}).then(e=>e.preset))(e,t,r),a=n===ek?eE:eS,l=(e=[])=>i?[a(o),...e.filter(e=>e.id!==o.id)]:[a(o),...e];return n===ek?$(e=>l(e||[])):F(e=>({...e||{},[n]:l(e?.[n]||[])})),c.oR.success(i?"Preset moved":"Preset copied",{id:s}),(0,v.sx)(i?"preset_moved":"preset_copied",{template:n,to:r.projectId?"project":r.teamId?"team":"personal"}),o}catch(e){return c.oR.error(e.message||"Could not do that, please try again",{id:s}),null}},e$=Q?.plan==="team",eI=async({preset:e})=>{let t=(0,a.U)(),{data:r}=await t.from("community_presets").insert([{...e,user_id:o?.id}])},eL=(()=>
9{if(e$)return!0;if(Y&&!1!==Y)return(0,b.md)(Y);if("boolean"==typeof g?.paid)if(!g?.paid)return!1;else if(!("string"==typeof g?.subscriptionStatus||g?.subscriptionStatus instanceof String))return!0;else if(g?.subscriptionStatus==="active")return!0;else return!1;return p?.status==="active"&&p?.invoice_status==="paid"})(),eM=(0,b.uR)(Y),eD=Q?.teams||[];return(0,n.jsx)(eu.Provider,{value:{c_AddCommunityPreset:eI,c_Session:o,c_SetSession:ev,c_Subscription:p,c_SetSubscription:ey,c_Modals:x,c_SetModals:e=>{E(e)},c_Options:I,c_SetOptions:e=>{L(e)},c_Presets:R,c_SetPresets:e=>{$(e)},c_Stats:S,c_SetStats:eb,c_OpenLoginOrSignupModal:({type:e="Signup",checkout:t}={})=>{let r=(0,ei.loadStripe)("pk_live_51KPYspSH5D6ivmf6RaQBZnEHOfzDq8Bn91UQLNh3SAvLn2UeWRkdmwanRaYGJ8wYV9AYAhHsJnKujwIZVElaI7KP006fHnlzAs");E(()=>[{active:!0,width:"max-w-[550px]",content:r?(0,n.jsx)(Z,{stripe:r,children:(0,n.jsx)(es,{show:e||"Login",checkout:t})}):"",id:"signupModal"}])},c_OpenPricing:e_,c_OpenFailedPaymentModal:()=>{let e=(0,ei.loadStripe)("pk_live_51KPYspSH5D6ivmf6RaQBZnEHOfzDq8Bn91UQLNh3SAvLn2UeWRkdmwanRaYGJ8wYV9AYAhHsJnKujwIZVElaI7KP006fHnlzAs");E(()=>[{active:!0,width:"max-w-[720px]",content:e?(0,n.jsx)(Z,{stripe:e,children:(0,n.jsx)(ea,{})}):"",id:"failedPaymentModal"}])},c_OpenResetPasswordModal:()=>{E(()=>[{active:!0,width:"max-w-[550px]",content:(0,n.jsx)(eo,{}),id:"resetPasswordModal"}])},c_OpenSettings:e=>s.push((0,_.xj)(e)),c_SavePreset:eR,c_TransferPreset:eO,c_RemovePreset:ej,isPro:eL,isLifetime:eM,c_Entitlements:Q,c_Teams:eD,c_RefreshEntitlements:ed,c_Workspace:Q?.workspace||{projectId:null},c_SwitchWorkspace:ep,c_HandleNonPro:({text:e,showModal:t}={})=>{e&&c.oR.success((0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("div",{children:e||"Upgrade to paid plan to use this feature"}),t?"":(0,n.jsx)(u.$n,{onClick:()=>{c.oR.dismiss(),e_({newTab:!0})},className:"bg-black/90 px-2 py-1 text-sm font-medium text-white ml-3 rounded-lg hover:scale-[1.05] duration-200 whitespace-nowrap shadow-[0_0_12px_rgba(0,0,0,0.4)]",children:"View pricing →"})]}),{duration:4e3,icon:(0,n.jsx)(m,{size:20,weight:"bold"})}),t&&e_({newTab:!0})},c_ActiveSubscription:Y,c_RefreshActiveSubscription:ef,c_StripeSub:g,c_ShowCommandCentre:V,c_SetShowCommandCentre:W,c_Settings:M,c_SetSettings:eC,c_SavedBackgrounds:B,c_SetSavedBackgrounds:ew,c_TemplatePresets:N,c_SaveTemplatePreset:eT,c_RemoveTemplatePreset:eA,c_ReloadPresets:eP,c_TemplatesExplorer:H,c_ToggleTemplatesExplorer:q,c_CommunityPresets:G,c_SetCommunityPresets:z,c_CloudLibrary:K,c_SetCloudLibrary:J},children:e.children})}},4719:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return i}});let n=r(76430);function i(e,t){let r=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=s(e,n)),t&&(i.current=s(t,n))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5701:(e,t,r)=>{"use strict";r.d(t,{s:()=>l,t:()=>a});var n=r(76430),i=Object.defineProperty,s=(e,t)=>i(e,"name",{value:t,configurable:!0});function o(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function a(...e){return t=>{let r=!1,n=e.map(e=>{let n=o(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():o(e[t],null)}}}}function l(...e){return n.useCallback(a(...e),e)}s(o,"setRef"),s(a,"composeRefs"),s(l,"useComposedRefs")},6363:(e,t,r)=>{"use strict";r.d(t,{E:()=>i});var n=r(76430);let i="u">typeof window?n.useLayoutEffect:n.useEffect},6926:(e,t,r)=>{"use strict";r.d(t,{G:()=>c});var n=r(96151),i=r(799),s=r(86955),o=r(37022),a=r(56802),l=r(41502),u=r(65911);function c(e,t,{clamp:r=!0,ease:h,mixer:d}={}){let p=e.length;if((0,o.V)(p===t.length,"Both input and output ranges must be the same length","range-length"),1===p)return()=>t[0];if(2===p&&t[0]===t[1])return()=>t[1];let f=e[0]===e[1];e[0]>e[p-1]&&(e=[...e].reverse(),t=[...t].reverse());let g=function(e,t,r){let o=[],a=r||n.W.mix||u.j,l=e.length-1;for(let r=0;r<l;r++){let n=a(e[r],e[r+1]);if(t){let e=Array.isArray(t)?t[r]||i.l:t;n=(0,s.F)(e,n)}o.push(n)}return o}(t,h,d),m=g.length,v=r=>{if(f&&r<e[0])return t[0];let n=0;if(m>1)for(;n<e.length-2&&!(r<e[n+1]);n++);let i=(0,a.q)(e[n],e[n+1],r);return g[n](i)};return r?t=>v((0,l.q)(e[0],e[p-1],t)):v}},7269:(e,t,r)=>{"use strict";function n(e){let t;return()=>(void 0===t&&(t=e()),t)}r.d(t,{p:()=>n})},8282:()=>{},11212:(e,t,r)=>{"use strict";r.d(t,{c:()=>i});var n=r(76430);function i(e){let t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}(0,Object.defineProperty)(i,"name",{value:"useCallbackRef",configurable:!0})},11608:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(56802),i=r(39445);function s(e){let t=[0];return!function(e,t){let r=e[e.length-1];for(let s=1;s<=t;s++){let o=(0,n.q)(0,t,s);e.push((0,i.k)(r,1,o))}}(t,e.length-1),t}},11828:(e,t,r)=>{"use strict";
9Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return u},noSSR:function(){return l}};for(var i in n)Object.defineProperty(t,i,{enumerable:!0,get:n[i]});let s=r(75591);r(75038),r(76430);let o=s._(r(74883));function a(e){return{default:e?.default||e}}function l(e,t){return delete t.webpack,delete t.modules,e(t)}function u(e,t){let r=o.default,n={loading:({error:e,isLoading:t,pastDelay:r})=>null};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let i=(n={...n,...t}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?r({...n,loader:()=>null!=i?i().then(a):Promise.resolve(a(()=>null))}):(delete n.webpack,delete n.modules,l(r,n))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},12425:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(65511)}])},13814:(e,t,r)=>{"use strict";r.d(t,{i:()=>p});var n=r(76430),i=r.t(n,2),s=r(52652),o=Object.defineProperty,a=i[" useEffectEvent ".trim().toString()],l=i[" useInsertionEffect ".trim().toString()];function u(e){if("function"==typeof a)return a(e);let t=n.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof l?l(()=>{t.current=e}):(0,s.N)(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}o(u,"name",{value:"useEffectEvent",configurable:!0});var c=Object.defineProperty,h=(e,t)=>c(e,"name",{value:t,configurable:!0}),d=i[" useInsertionEffect ".trim().toString()]||s.N;function p({prop:e,defaultProp:t,onChange:r=h(()=>{},"onChange"),caller:i}){let[s,o,a]=f({defaultProp:t,onChange:r}),l=void 0!==e,u=l?e:s;return[u,n.useCallback(t=>{if(l){let r=g(t)?t(e):t;r!==e&&a.current?.(r)}else o(t)},[l,e,o,a])]}function f({defaultProp:e,onChange:t}){let[r,i]=n.useState(e),s=n.useRef(r),o=n.useRef(t);return d(()=>{o.current=t},[t]),n.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,i,o]}function g(e){return"function"==typeof e}h(p,"useControllableState"),h(f,"useUncontrolledState"),h(g,"isFunction");var m=Symbol("RADIX:SYNC_STATE");h(function(e,t,r,i){let{prop:s,defaultProp:o,onChange:a,caller:l}=t,c=void 0!==s,h=u(a),d=[{...r,state:o}];i&&d.push(i);let[p,f]=n.useReducer((t,r)=>{if(r.type===m)return{...t,state:r.state};let n=e(t,r);return c&&!Object.is(n.state,t.state)&&h(n.state),n},...d),g=p.state,v=n.useRef(g);n.useEffect(()=>{v.current!==g&&(v.current=g,c||h(g))},[g,v,c]);let y=n.useMemo(()=>void 0!==s?{...p,state:s}:p,[p,s]);return n.useEffect(()=>{c&&!Object.is(s,p.state)&&f({type:m,state:s})},[s,p.state,c]),[y,f]},"useControllableStateReducer")},15212:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(76430),i=r(25393),s=r(20142),o=new Map;o.set("bold",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"216 72 104 184 48 128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}))}),o.set("duotone",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"216 72 104 184 48 128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))}),o.set("fill",function(){return n.createElement(n.Fragment,null,n.createElement("path",{d:"M104,192a8.5,8.5,0,0,1-5.7-2.3l-56-56a8.1,8.1,0,0,1,11.4-11.4L104,172.7,210.3,66.3a8.1,8.1,0,0,1,11.4,11.4l-112,112A8.5,8.5,0,0,1,104,192Z"}))}),o.set("light",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"216 72 104 184 48 128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}))}),o.set("thin",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"216 72 104 184 48 128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}))}),o.set("regular",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"216 72 104 184 48 128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))});var a=function(e,t){return(0,i.$)(e,t,o)},l=(0,n.forwardRef)(function(e,t){return n.createElement(s.A,Object.assign({ref:t},e,{renderPath:a}))});l.displayName="Check";let u=l},15275:(e,t,r)=>{"use strict";r.d(t,{KN:()=>s,gQ:()=>u,px:()=>o,uj:()=>i,vh:()=>a,vw:()=>l});let n=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),i=n("deg"),s=n("%"),o=n("px"),a=n("vh"),l=n("vw"),u={...s,parse:e=>s.parse(e)/100,transform:e=>s.transform(100*e)}},17440:(e,t,r)=>{"use strict";r.d(t,{mK:()=>o});var n=Object.defineProperty,i=(e,t)=>n(e,"name",{value:t,configurable:!0}),s=!!("u">typeof window&&window.document&&window.document.createElement);function o(e,t,{checkForDefaultPrevented:r=!0}={}){return i(function(n){if(e?.(n),!1===r||!n||!n.defaultPrevented)return t?.(n)},"handleEvent")}function a(e){if(!s)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function l(e){return"IFRAME"===e.tagName}i(o,"composeEventHandlers"),i(function(e){if(!s)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),i(a,"getOwnerDocument"),i(function e(t,r=!1){let{activeElement:n}=a(t);if(!n?.nodeName)return null;if(l(n)&&n.contentDocument)return e(n.contentDocument.body,r);if(r){let e=n.getAttribute("aria-activedescendant");if(e){let t=a(n).getElementById(e);if(t)return t}}return n},"getActiveElement"),i(l,"isFrame")},17531:(e,t,r)=>{e.exports=r(76713)},17607:(e,t,r)=>{"use strict";r.d(t,{f:()=>n});let n=(e,t)=>t?1e3/t*e:0},17655:(e,t,r)=>{"use strict";r.d(t,{M:()=>i});var n=r(76430);function i(e){let t=(0,n.useRef)(null);return null===t.current&&(t.current=e()),t.current}},18070:(e,t,r)=>{"use strict";r.d(t,{EE:()=>o,Gw:()=>s,NB:()=>n,Q4:()=>g,Uj:()=>l,eq:()=>u,iJ:()=>a,md:()=>m,sM:()=>i,uG:()=>c,uR:()=>h,wf:()=>d,yf:()=>f});let n=[{title:"Free",type:"free",description:"Try Pika with the basics",amountUsd:{monthly:0,annually:0},priceId:{monthly:null,annually:null},features:{}},{title:"Pro",type:"pro",description:"Get the most out of Pika",amountUsd:{monthly:15,annually:150},priceId:{monthly:"price_1RqsrvCZ1xrStLFhQrMe6tER",annually:"price_1RqssBCZ1xrStLFhodsQlv8l"},features:{}}],i=2,s={title:"Lifetime",type:"lifetime",description:"Pay once, keep Pro forever",amountUsd:299,priceId:"price_1UIw8KCZ1xrStLFhXLYUKV9N"},o={title:"Team",type:"team",description:"Pro for your whole team, with shared projects",minSeats:2,maxSeats:500,amountUsd:{monthly:12,annually:120},priceId:{monthly:"price_1UJ8r3CZ1xrStLFhfdsq9LKD",annually:"price_1UJ8sFCZ1xrStLFhUyR3idWf"}},a=()=>!!(o.priceId.monthly&&o.priceId.annually),l=[{value:"member",title:"Member",description:"Uses and copies shared presets"},{value:"admin",title:"Admin",description:"Also invites people and edits shared presets"}],u=e=>"owner"===e||"admin"===e,c=()=>!!s.priceId,h=e=>e?.interval==="lifetime"&&m(e);function d(e){if(!e?.current_period_start)return null;let t=new Date(e.current_period_start);return t.setUTCFullYear(t.getUTCFullYear()+i),t}function p(e){return n.find(t=>t.type===e)??n[0]}p("free");let f=p("pro");function g(e){let t=p("pro").amountUsd[e];return"monthly"===e?`$${t} a month`:`$${t} a year`}function m(e){if(!e||!0!==e.paid)return!1;let t=!0===e.cancel_at_period_end||["cancel_pending","canceled"].includes(e.status_text),r=e.current_period_end?new Date(e.current_period_end).getTime():null;return!(t&&r&&r+2592e5<Date.now())}},18138:(e,t,r)=>{"use strict";r.d(t,{X4:()=>s,ai:()=>i,hs:()=>o});var n=r(41502);let i={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},s={...i,transform:e=>(0,n.q)(0,1,e)},o={...i,default:1}},18791:(e,t,r)=>{"use strict";let n;r.d(t,{OQ:()=>u});var i=r(61362),s=r(17607),o=r(98648),a=r(38554);class l{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>
9{let t=o.k.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=o.k.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){var r;return"change"===e?this.onChangeSubscribe(t):((r=this.events)[e]||(r[e]=new i.v)).add(t)}onChangeSubscribe(e){let{events:t}=this;return t.change||this.changeSubscriber?(t.change||(t.change=new i.v,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)):this.changeSubscriber=e,()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){a.Gt.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){for(let e in this.changeSubscriber=void 0,this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return n&&n.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=o.k.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return(0,s.f)(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{let r;this.hasAnimated=!0;let n=!1;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function u(e,t){return new l(e,t)}},19977:(e,t,r)=>{"use strict";let n;r.d(t,{U:()=>E});var i=r(73234),s=r(54775);let o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),a=" 	\n\r=".split(""),l=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<a.length;t+=1)e[a[t].charCodeAt(0)]=-2;for(let t=0;t<o.length;t+=1)e[o[t].charCodeAt(0)]=t;return e})();function u(e){let t=[],r=0,n=0;if(function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(e,e=>{for(r=r<<8|e,n+=8;n>=6;){let e=r>>n-6&63;t.push(o[e]),n-=6}}),n>0)for(r<<=6-n,n=6;n>=6;){let e=r>>n-6&63;t.push(o[e]),n-=6}return t.join("")}function c(){return"u">typeof window&&void 0!==window.document}s.qg,s.lK;let h=/^(.*)[.](0|[1-9][0-9]*)$/;function d(e,t){if(e===t)return!0;let r=e.match(h);return!!r&&r[1]===t}function p(e,t,r){let n=r??3180,i=encodeURIComponent(t);if(i.length<=n)return[{name:e,value:t}];let s=[];for(;i.length>0;){let e=i.slice(0,n),t=e.lastIndexOf("%");t>n-3&&(e=e.slice(0,t));let r="";for(;e.length>0;)try{r=decodeURIComponent(e);break}catch(t){if(t instanceof URIError&&"%"===e.at(-3)&&e.length>3)e=e.slice(0,e.length-3);else throw t}s.push(r),i=i.slice(e.length)}return s.map((t,r)=>({name:`${e}.${r}`,value:t}))}async function f(e,t){let r=await t(e);if(r)return r;let n=[];for(let r=0;;r++){let i=`${e}.${r}`,s=await t(i);if(!s)break;n.push(s)}return n.length>0?n.join(""):null}let g={path:"/",sameSite:"lax",httpOnly:!1,maxAge:3456e4},m="base64-",v=/-flow-[A-Za-z0-9_-]{8,64}-code-verifier$/;function y(e){let t;if(!e.startsWith(m))return e;try{t=function(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},i=0,s=0;for(let t=0;t<e.length;t+=1){let o=l[e.charCodeAt(t)];if(o>-1)for(i=i<<6|o,s+=6;s>=8;)(function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}})(i>>s-8&255,n,r),s-=8;else if(-2===o)continue;else throw Error(`Invalid Base64-URL character "${e.at(t)}" at position ${t}`)}return t.join("")}(e.substring(m.length))}catch(e){return console.warn("@supabase/ssr: could not base64url-decode chunked cookie value, treating as absent. Cookie chunks may have been written partially across responses.",e),null}try{JSON.parse(t)}catch{return console.warn("@supabase/ssr: chunked cookie decoded to invali
9d JSON, treating as absent. This usually indicates that cookie chunks from different writes were combined (e.g. response committed before all Set-Cookie headers were sent)."),null}return t}async function b({getAll:e,setAll:t,setItems:r,removedItems:n},i){let s=i.cookieEncoding,o=i.cookieOptions??null,a=await e([...r?Object.keys(r):[],...n?Object.keys(n):[]]),l=a?.map(({name:e})=>e)||[],c=new Map(a?.map(({name:e,value:t})=>[e,t])||[]),h=Object.keys(n).flatMap(e=>l.filter(t=>d(t,e))),f=Object.keys(r).flatMap(e=>{let t=new Set(l.filter(t=>d(t,e))),n=r[e];"base64url"===s&&(n=m+u(n));let i=p(e,n);return i.forEach(e=>{t.delete(e.name)}),h.push(...t),i}).filter(({name:e,value:t})=>c.get(e)!==t),v=h.filter(e=>c.has(e)),y={...g,...o,maxAge:0},_={...g,...o,maxAge:g.maxAge};delete y.name,delete _.name;let w=y.domain&&v.length>0?(()=>{let{domain:e,...t}=y;return t})():null;(0!==v.length||0!==f.length)&&await t([...w?v.map(e=>({name:e,value:"",options:w})):[],...v.map(e=>({name:e,value:"",options:y})),...f.map(({name:e,value:t})=>({name:e,value:t,options:_}))],{"Cache-Control":"private, no-cache, no-store, must-revalidate, max-age=0",Expires:"0",Pragma:"no-cache"})}let _=new Set;var w=r(31075);let k=!1,x=["@supabase/auth-helpers-nextjs","@supabase/auth-helpers-react","@supabase/auth-helpers-remix","@supabase/auth-helpers-sveltekit"];function E(){return function(e,t,r){var o;!function(){if(k||void 0===w||!w.env?.npm_package_name)return;let e=w.env.npm_package_name;x.includes(e)&&(k=!0,console.warn(`
10╔════════════════════════════════════════════════════════════════════════════╗
11║ ⚠️  IMPORTANT: Package Consolidation Notice                                ║
12║                                                                            ║
13║ The ${e.padEnd(35)} package name is deprecated.  ║
14║                                                                            ║
15║ You are now using @supabase/ssr - a unified solution for all frameworks.  ║
16║                                                                            ║
17║ The auth-helpers packages have been consolidated into @supabase/ssr       ║
18║ to provide better maintenance and consistent APIs across frameworks.      ║
19║                                                                            ║
20║ Please update your package.json to use @supabase/ssr directly:            ║
21║   npm uninstall ${e.padEnd(42)} ║
22║   npm install @supabase/ssr                                               ║
23║                                                                            ║
24║ For more information, visit:                                              ║
25║ https://supabase.com/docs/guides/auth/server-side                         ║
26╚════════════════════════════════════════════════════════════════════════════╝
27    `))}();let a=r?.isSingleton===!0||(!r||!("isSingleton"in r))&&c();if(a&&n)return n;if(!e||!t)throw Error(`@supabase/ssr: Your project's URL and API key are required to create a Supabase client!
28
29Check your Supabase project's API settings to find these values
30
31https://supabase.com/dashboard/project/_/settings/api`);r?.auth?.storage&&(o="@supabase/ssr: createBrowserClient always manages the session via cookies, so the `auth.storage` option you passed is ignored. If you don't need the session to be readable on the server, use @supabase/supabase-js's createClient directly with your own `storage` instead.",_.has(o)||(_.add(o),console.warn(o)));let{storage:l}=function(e,t){let r,n,i=e.cookies&&("get"in e.cookies||"getAll"in e.cookies)?e.cookies:null,o=e.cookieEncoding,a={},l={};if(i)if("get"in i){let e=async e=>{let t=e.flatMap(e=>[e,...Array.from({length:5}).map((t,r)=>`${e}.${r}`)]),r=[];for(let e=0;e<t.length;e+=1){let n=await i.get(t[e]);(n||"string"==typeof n)&&r.push({name:t[e],value:n})}return r};if(r=async t=>await e(t),"set"in i&&"remove"in i)n=async e=>{for(let t=0;t<e.length;t+=1){let{name:r,value:n,options:s}=e[t];n?await i.set(r,n,s):await i.remove(r,s)}};else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without set and remove cookie methods, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for c
31orrectness. Consider switching to the getAll and setAll cookie methods instead of get, set and remove which are deprecated and can be difficult to use correctly.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring a getAll and setAll cookie method (deprecated: alternatively both get, set and remove can be used)")}else if("getAll"in i)if(r=async()=>await i.getAll(),"setAll"in i)n=i.setAll;else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without the setAll cookie method, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring both getAll and setAll cookie methods (deprecated: alternatively both get, set and remove can be used)");else throw Error(`@supabase/ssr: ${t?"createServerClient":"createBrowserClient"} requires configuring getAll and setAll cookie methods (deprecated: alternatively use get, set and remove).${c()?" As this is called in a browser runtime, consider removing the cookies option object to use the document.cookie API automatically.":""}`);else if(!t&&c())r=()=>{let e;return Object.keys(e=(0,s.qg)(document.cookie)).map(t=>({name:t,value:e[t]??""}))},n=e=>{e.forEach(({name:e,value:t,options:r})=>{document.cookie=(0,s.lK)(e,t,r)})};else if(t)throw Error("@supabase/ssr: createServerClient must be initialized with cookie options that specify getAll and setAll functions (deprecated, not recommended: alternatively use get, set and remove)");else r=()=>[],n=()=>{throw Error("@supabase/ssr: createBrowserClient in non-browser runtimes (including Next.js pre-rendering mode) was not initialized cookie options that specify getAll and setAll functions (deprecated: alternatively use get, set and remove), but they were needed")};if(!t)return{getAll:r,setAll:n,setItems:a,removedItems:l,storage:{isServer:!1,getItem:async e=>{let t=await r([e]),n=await f(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});return n?y(n):null},setItem:async(t,i)=>{let s=await r([t]),a=new Set((s?.map(({name:e})=>e)||[]).filter(e=>d(e,t))),l=i;"base64url"===o&&(l=m+u(i));let c=p(t,l);c.forEach(({name:e})=>{a.delete(e)});let h={...g,...e?.cookieOptions,maxAge:0},f={...g,...e?.cookieOptions,maxAge:g.maxAge};delete h.name,delete f.name;let v=h.domain?(()=>{let{domain:e,...t}=h;return t})():null,y=[...v?[...a].map(e=>({name:e,value:"",options:v})):[],...[...a].map(e=>({name:e,value:"",options:h})),...c.map(({name:e,value:t})=>({name:e,value:t,options:f}))];y.length>0&&await n(y,{})},removeItem:async t=>{let i=await r([t]),s=(i?.map(({name:e})=>e)||[]).filter(e=>d(e,t));if(0===s.length)return;let o={...g,...e?.cookieOptions,maxAge:0};delete o.name;let a=o.domain?(()=>{let{domain:e,...t}=o;return t})():null,l=[...a?s.map(e=>({name:e,value:"",options:a})):[],...s.map(e=>({name:e,value:"",options:o}))];await n(l,{})}}};let h=n,_=!1;return{getAll:r,setAll:n=async(e,t)=>{let r=!_&&Object.keys(t).length>0;await h(e,r?t:{}),r&&(_=!0)},setItems:a,removedItems:l,storage:{isServer:!0,getItem:async e=>{if("string"==typeof a[e])return a[e];if(l[e])return null;let t=await r([e]),n=await f(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});return n?"string"!=typeof n?n:y(n):null},setItem:async(t,i)=>{t.endsWith("-code-verifier")&&await b({getAll:r,setAll:n,setItems:{[t]:i},removedItems:{}},{cookieOptions:e?.cookieOptions??null,cookieEncoding:o}),a[t]=i,delete l[t]},removeItem:async t=>{(v.test(t)||t.endsWith("-flows-code-verifier"))&&await b({getAll:r,setAll:n,setItems:{},removedItems:{[t]:!0}},{cookieOptions:e?.cookieOptions??null,cookieEncoding:o}),delete a[t],l[t]=!0}}}}({...r,cookieEncoding:r?.cookieEncoding??"base64url"},!1),h=(0,i.UU)(e,t,{...r,global:{...r?.global,headers:{...r?.global?.headers,"X-Client-Info":"supabase-ssr/0.12.7 createBrowserClient"}},auth:{...r?.auth,...r?.cookieOptions?.name?{storageKey:r.cookieOptions.name}:null,flowType:"pkce",autoRefreshToken:r?.auth?.autoRefreshToken??c(),detectSessionInUrl:r?.auth?.detectSessionInUrl??c(),persistSession:r?.auth?.persistSession??!0,storage:l,...r?.cookies&&"encode"in r.cookies&&"tokens-only"===r.cookies.encode?{userStorage:r?.auth?.userStorage??(c()?window.localStorage:function(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}())}:null}});return a&&(n=h),h}("https://feeyaroruqlpnacnuyqt.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTY0NDAwNTc5NiwiZXhwIjoxOTU5NTgxNzk2fQ.IrgHK7nbn0pE4y8CFuajODgkeRzD574gt2mFMR7dZa8",{auth:{experimental:{passkey:!0}}})}},20142:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(76430),i=r(25393);function s(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}var o=(0,n.forwardRef)(function(e,t){var r=e.alt,o=e.color,a=e.size,l=e.weight,u=e.mirrored,c=e.children,h=e.renderPath,d=s(e,["alt","color","size","weight","mirrored","children","renderPath"]),p=(0,n.useContext)(i.V),f=p.color,g=void 0===f?"currentColor":f,m=p.size,v=p.weight,y=p.mirrored,b=s(p,["color","size","weight","mirrored"]);return n.createElement("svg",Object.assign({ref:t,xmlns:"http://www.w3.org/2000/svg",width:null!=a?a:m,height:null!=a?a:m,fill:null!=o?o:g,viewBox:"0 0 256 256",transform:u||void 0!==y&&y?"scale(-1, 1)":void 0},b,d),!!r&&n.createElement("title",null,r),c,n.createElement("rect",{width:"256",height:"256",fill:"none"}),h(null!=l?l:void 0===v?"regular":v,null!=o?o:g))});o.displayName="IconBase";let a=o},21606:()=>{},22609:(e,t,r)=>{"use strict";
31Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=r(75591)._(r(76430)).default.createContext(null)},23694:(e,t,r)=>{"use strict";r.d(t,{s:()=>i});var n=r(64971);function i(e){return(0,n.G)(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}},24943:(e,t,r)=>{"use strict";r.d(t,{t:()=>n});let n=(0,r(76430).createContext)(null)},25393:(e,t,r)=>{"use strict";r.d(t,{$:()=>i,V:()=>n});var n=(0,r(76430).createContext)({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),i=function(e,t,r){var n=r.get(e);return n?n(t):(console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'),null)}},27889:(e,t,r)=>{"use strict";r.d(t,{UC:()=>N,VY:()=>W,ZL:()=>O,bL:()=>R,bm:()=>H,hE:()=>V,hJ:()=>I,l9:()=>T});var n=r(76430),i=r(17440),s=r(5701),o=r(63675),a=r(40544),l=r(13814),u=r(76242),c=r(63282),h=r(71934),d=r(71837),p=r(73846),f=r(72022),g=r(52652),m=r(79335),v=r(60644),y=r(36859),b=r(75038),_=Object.defineProperty,w=(e,t)=>_(e,"name",{value:t,configurable:!0}),k="Dialog",[x,E]=(0,o.A)(k),[S,P]=x(k),R=w(e=>{let{__scopeDialog:t,children:r,open:i,defaultOpen:s,onOpenChange:o,modal:u=!0}=e,c=n.useRef(null),h=n.useRef(null),[d,p]=(0,l.i)({prop:i,defaultProp:s??!1,onChange:o,caller:k}),[f,g]=n.useState(0),[m,v]=n.useState(0);return(0,b.jsx)(S,{scope:t,triggerRef:c,contentRef:h,contentId:(0,a.B)(),titleId:(0,a.B)(),descriptionId:(0,a.B)(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:g,setDescriptionCount:v,open:d,onOpenChange:p,onOpenToggle:n.useCallback(()=>p(e=>!e),[p]),modal:u,children:r})},"Dialog"),T=n.forwardRef(w(function(e,t){let{__scopeDialog:r,...n}=e,o=P("DialogTrigger",r),a=(0,s.s)(t,o.triggerRef);return(0,b.jsx)(p.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":q(o.open),...n,ref:a,onClick:(0,i.mK)(e.onClick,o.onOpenToggle)})},"DialogTrigger")),A="DialogPortal",[C,j]=x(A,{forceMount:void 0}),O=w(e=>{let{__scopeDialog:t,forceMount:r,children:i,container:s}=e,o=P(A,t);return(0,b.jsx)(C,{scope:t,forceMount:r,children:n.Children.map(i,e=>(0,b.jsx)(d.C,{present:r||o.open,children:(0,b.jsx)(h.Z,{asChild:!0,container:s,children:e})}))})},"DialogPortal"),$="DialogOverlay",I=n.forwardRef(w(function(e,t){let r=j($,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=P($,e.__scopeDialog);return s.modal?(0,b.jsx)(d.C,{present:n||s.open,children:(0,b.jsx)(M,{...i,ref:t})}):null},"DialogOverlay")),L=(0,y.TL)("DialogOverlay.RemoveScroll"),M=n.forwardRef(w(function(e,t){let{__scopeDialog:r,...n}=e,i=P($,r),o=(0,u.e0)(),a=(0,s.s)(t,o);return(0,b.jsx)(m.A,{as:L,allowPinchZoom:!0,shards:[i.contentRef],children:(0,b.jsx)(p.sG.div,{"data-state":q(i.open),...n,ref:a,style:{pointerEvents:"auto",...n.style}})})},"DialogOverlayImpl")),D="DialogContent",N=n.forwardRef(w(function(e,t){let r=j(D,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=P(D,e.__scopeDialog);return(0,b.jsx)(d.C,{present:n||s.open,children:s.modal?(0,b.jsx)(F,{...i,ref:t}):(0,b.jsx)(B,{...i,ref:t})})},"DialogContent")),F=n.forwardRef(w(function(e,t){let r=P(D,e.__scopeDialog),o=n.useRef(null),a=(0,s.s)(t,r.contentRef,o);return n.useEffect(()=>{let e=o.current;
31if(e)return(0,v.Eq)(e)},[]),(0,b.jsx)(U,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:(0,i.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,i.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,i.mK)(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),B=n.forwardRef(w(function(e,t){let r=P(D,e.__scopeDialog),i=n.useRef(!1),s=n.useRef(!1);return(0,b.jsx)(U,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})},"DialogContentNonModal")),U=n.forwardRef(w(function(e,t){let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=P(D,r);return(0,f.Oh)(),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(c.n,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:(0,b.jsx)(u.qW,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionPresent?a.descriptionId:void 0,"aria-labelledby":a.titlePresent?a.titleId:void 0,"data-state":q(a.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>a.onOpenChange(!1)})})})},"DialogContentImpl")),V=n.forwardRef(w(function(e,t){let{__scopeDialog:r,...n}=e,i=P("DialogTitle",r),{setTitleCount:s}=i;return(0,g.N)(()=>(s(e=>e+1),()=>s(e=>e-1)),[s]),(0,b.jsx)(p.sG.h2,{id:i.titleId,...n,ref:t})},"DialogTitle")),W=n.forwardRef(w(function(e,t){let{__scopeDialog:r,...n}=e,i=P("DialogDescription",r),{setDescriptionCount:s}=i;return(0,g.N)(()=>(s(e=>e+1),()=>s(e=>e-1)),[s]),(0,b.jsx)(p.sG.p,{id:i.descriptionId,...n,ref:t})},"DialogDescription")),H=n.forwardRef(w(function(e,t){let{__scopeDialog:r,...n}=e,s=P("DialogClose",r);return(0,b.jsx)(p.sG.button,{type:"button",...n,ref:t,onClick:(0,i.mK)(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function q(e){return e?"open":"closed"}w(q,"getState")},28920:(e,t,r)=>{"use strict";let n,i;r.d(t,{X:()=>f});var s=r(56477),o=r(605);let a=new WeakMap,l=(e,t,r)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:(0,s.x)(n)&&"getBBox"in n?n.getBBox()[t]:n[r],u=l("inline","width","offsetWidth"),c=l("block","height","offsetHeight");function h({target:e,borderBoxSize:t}){a.get(e)?.forEach(r=>{r(e,{get width(){return u(e,t)},get height(){return c(e,t)}})})}function d(e){e.forEach(h)}let p=new Set;function f(e,t){let r;return"function"==typeof e?(p.add(e),i||(i=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};p.forEach(t=>t(e))},window.addEventListener("resize",i)),()=>{p.delete(e),p.size||"function"!=typeof i||(window.removeEventListener("resize",i),i=void 0)}):(!n&&"u">typeof ResizeObserver&&(n=new ResizeObserver(d)),(r=(0,o.K)(e)).forEach(e=>{let r=a.get(e);r||(r=new Set,a.set(e,r)),r.add(t),n?.observe(e)}),()=>{r.forEach(e=>{let r=a.get(e);r?.delete(t),r?.size||n?.unobserve(e)})})}},29993:(e,t,r)=>{"use strict";r.d(t,{y:()=>o});var n=r(63506),i=r(48439),s=r(41731);let o={test:e=>s.B.test(e)||n.u.test(e)||i.V.test(e),parse:e=>s.B.test(e)?s.B.parse(e):i.V.test(e)?i.V.parse(e):n.u.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?s.B.transform(e):i.V.transform(e),getAnimatableNone:e=>{let t=o.parse(e);return t.alpha=0,o.transform(t)}}},30448:(e,t,r)=>{"use strict";function n(e,t){-1===e.indexOf(t)&&e.push(t)}function i(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}r.d(t,{Ai:()=>i,Kq:()=>n})},31246:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(76430),i=r(25393),s=r(20142),o=new Map;o.set("bold",function(e){return n.createElement(n.Fragment,null,n.createElement("circle",{cx:"128",cy:"140",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),n.createElement("path",{d:"M70.4,216a64.1,64.1,0,0,1,115.2,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),n.createElement("path",{d:"M204.5,116.6A60.1,60.1,0,0,1,244,140",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),n.createElement("path",{d:"M167.1,70.2A32,32,0,1,1,204,115",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),n.createElement("path",{d:"M52,115A32,32,0,1,1,88.9,70.2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),n.createElement("path",{d:"M12,140a60.1,60.1,0,0,1,39.5-23.4",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}))}),o.set("duotone",function(e){return n.createElement(n.Fragment,null,n.createElement("circle",{cx:"128",cy:"140",r:"40",opacity:"0.2"}),n.createElement("circle",{cx:"60",cy:"84",r:"32",opacity:"0.2"}),n.createElement("circle",{cx:"196",cy:"84",r:"32",opacity:"0.2"}),n.createElement("circle",{cx:"128",cy:"140",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M196,116a59.8,59.8,0,0,1,48,24",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M12,140a59.8,59.8,0,0,1,48-24",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M70.4,216a64.1,64.1,0,0,1,115.2,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M60,116A32,32,0,1,1,91.4,78",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M164.6,78A32,32,0,1,1,196,116",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))}),o.set("fill",function(){return n.createElement(n.Fragment,null,n.createElement("path",{d:"M64,140a7.9,7.9,0,0,1-8,8H12a8.2,8.2,0,0,1-7.2-4.4,8.2,8.2,0,0,1,.8-8.4A67.8,67.8,0,0,1,33,113.5a40,40,0,1,1,66.3-37,8.1,8.1,0,0,1-3.8,8.4,64.3,64.3,0,0,0-27.8,33.8A61.6,61.6,0,0,0,64,140Zm186.4-4.8A67.8,67.8,0,0,0,223,113.5a40,40,0,1,0-66.3-37,8.1,8.1,0,0,0,3.8,8.4,64,64,0,0,1,27.8,33.8A61.6,61.6,0,0,1,192,140a7.9,7.9,0,0,0,8,8h44a8,8,0,0,0,6.4-12.8Zm-93.2,42.9a48,48,0,1,0-58.4,0,72.1,72.1,0,0,0-35.6,34.4,7.8,7.8,0,0,0,.5,7.7,7.8,7.8,0,0,0,6.7,3.8H185.6a7.8,7.8,0,0,0,6.7-3.8,7.8,7.8,0,0,0,.5-7.7A72.1,72.1,0,0,0,157.2,178.1Z"}))}),o.set("light",function(e){return n.createElement(n.Fragment,null,n.createElement("circle",{cx:"128",cy:"140",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),n.createElement("path",{d:"M196,116a59.8,59.8,0,0,1,48,24",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),n.createElement("path",{d:"M12,140a59.8,59.8,0,0,1,48-24",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),n.createElement("path",{d:"M70.4,216a64.1,64.1,0,0,1,115.2,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),n.createElement("path",{d:"M60,116A32,32,0,1,1,91.4,78",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),n.createElement("path",{d:"M164.6,78A32,32,0,1,1,196,116",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}))}),o.set("thin",function(e){return n.createElement(n.Fragment,null,n.createElement("circle",{cx:"128",cy:"140",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),n.createElement("path",{d:"M196,116a59.8,59.8,0,0,1,48,24",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),n.createElement("path",{d:"M12,140a59.8,59.8,0,0,1,48-24",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),n.createElement("path",{d:"M70.4,216a64.1,64.1,0,0,1,115.2,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),n.createElement("path",{d:"M60,116A32,32,0,1,1,91.4,78",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),n.createElement("path",{d:"M164.6,78A32,32,0,1,1,196,116",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}))}),o.set("regular",function(e){return n.createElement(n.Fragment,null,n.createElement("circle",{cx:"128",cy:"140",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M196,116a59.8,59.8,0,0,1,48,24",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M12,140a59.8,59.8,0,0,1,48-24",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M70.4,216a64.1,64.1,0,0,1,115.2,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M60,116A32,32,0,1,1,91.4,78",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M164.6,78A32,32,0,1,1,196,116",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))});var a=function(e,t){return(0,i.$)(e,t,o)},l=(0,n.forwardRef)(function(e,t){return n.createElement(s.A,Object.assign({ref:t},e,{renderPath:a}))});l.displayName="UsersThree";let u=l},32863:(e,t,r)=>{"use strict";r.d(t,{Vf:()=>d,f:()=>f,nK:()=>h});var n=r(29993),i=r(39643),s=r(62682);let o=new RegExp(i.S.source),a=RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i"),l="number",u="color",c=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function h(e){let t=e.toString();return o.test(t)||a.test(t)}function d(e){let t=e.toString(),r=[],i={color:[],number:[],var:[]},s=[],o=0,a=t.replace(c,e=>(n.y.test(e)?(i.color.push(o),s.push(u),r.push(n.y.parse(e))):e.startsWith("var(")?(i.var.push(o),s.push("var"),r.push(e)):(i.number.push(o),s.push(l),r.push(parseFloat(e))),++o,"${}")).split("${}");return{values:r,split:a,indexes:i,types:s}}function p({split:e,types:t}){let r=e.length;return i=>{let o="";for(let a=0;a<r;a++)if(o+=e[a],void 0!==i[a]){let e=t[a];e===l?o+=(0,s.a)(i[a]):e===u?o+=n.y.transform(i[a]):o+=i[a]}return o}}let f={test:function(e){return isNaN(e)&&"string"==typeof e&&(o.test(e)||a.test(e))},parse:function(e){return d(e).values},createTransformer:function(e){return p(d(e))},getAnimatableNone:function(e){let t=d(e);return p(t)(t.values.map((e,r)=>((e,t)=>"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof e?0:n.y.test(e)?n.y.getAnimatableNone(e):e)(e,t.split[r])))}}},33152:(e,t,r)=>{"use strict";var n=r(58619);function i(){}function s(){}s.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,s,o){if(o!==n){var a=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol
31:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:i};return r.PropTypes=r,r}},34530:(e,t,r)=>{"use strict";let n,i;r.d(t,{$n:()=>d,Sc:()=>rz,sk:()=>i4,mc:()=>ot,ms:()=>oe,pd:()=>a,T8:()=>nV,Zv:()=>v,QM:()=>g,AM:()=>rG,zb:()=>nB,l6:()=>p,s3:()=>iL,iM:()=>rK,EA:()=>oz,fh:()=>oK,Ap:()=>e$,D7:()=>or,dO:()=>eY,tU:()=>iX,TM:()=>iM,m_:()=>ig,Tr:()=>oG});var s=r(75038),o=r(71623);function a(e){return(0,s.jsxs)("div",{className:"w-full",children:[e?.label?(0,s.jsx)("label",{className:"flex mb-px text-sm font-semibold dark:text-white",children:e?.label}):"",(0,s.jsx)("input",{...e,type:e.type||"text",className:(0,o.A)("duration-200 shadow dark:bg-gray-900 dark:text-white dark:border-gray-600 border border-gray-200 px-3 py-[6px] rounded-lg my-1 outline-none w-full dark:placeholder-gray-500 dark:hover:border-pink-700 dark:focus:border-pink-700 hover:border-pink-400 focus:border-pink-400 ",e.className,e?.disabled?"opacity-60":""),ref:t=>{e.passref&&(e.passref.current=t)}}),e.error&&(0,s.jsxs)("div",{className:"flex items-center text-sm font-semibold text-red-400",children:[(0,s.jsx)("i",{className:"mr-1 ri-error-warning-line"}),e.error]})]})}var l=r(46001),u=r.n(l),c=r(45609),h=r.n(c);function d(e){let{className:t,prefix:r,disabled:n,suffix:i,children:a,variant:l,onClick:c,as:d,href:p,active:f,target:g}=e,m=({active:e}={})=>{switch(l){case"side":return"px-[5px] text-[0.7rem] bg-gray-50 rounded-md dark:bg-gray-900 dark:text-gray-400/70 text-gray-600/80 font-normal border border-gray-300 dark:border-gray-800 font-code leading-normal flex items-center justify-center duration-100 cursor-default";case"primary":return"px-4 py-2 md:py-[8px] text-white rounded-lg bg-linear-to-br from-red-400 to-pink-600 hover:scale-[0.98] active:scale-[0.95] border border-transparent dark:border-transparent shadow-lg flex items-center justify-center duration-100 cursor-pointer";case"secondary":return"relative flex items-center justify-center px-2 py-[3px] rounded-lg cursor-pointer group text-sm text-gray-900 shadow-sm border border-gray-300 min-h-[28px] dark:border-gray-700 dark:text-gray-200 hover:scale-[0.98] bg-white dark:bg-gray-900 duration-100";case"ternary":return(0,o.A)("py-[2.4px] px-3 flex items-center relative rounded-[7px] cursor-pointer",e?"dark:text-black dark:border-white text-black border-gray-300 bg-gray-200/80 dark:bg-white":"text-gray-600 dark:hover:text-gray-200 border-transparent hover:text-gray-800 dark:text-gray-400 hover:bg-gray-200/50 dark:hover:bg-gray-700/80");default:return""}};return"a"===d?(0,s.jsxs)(h(),{href:p,target:g??"",className:u()(m({active:f}),{[t]:t}),active:"false",children:[r&&r,a,i&&i]}):"div"===d?(0,s.jsxs)("div",{...e,onClick:c,className:u()(m({active:f}),{[t]:t},{"opacity-60 cursor-not-allowed":n}),children:[r&&r,a,i&&i]}):(0,s.jsxs)("button",{...e,active:"false",onClick:c,className:u()(m({active:f}),{[t]:t},{"opacity-60 cursor-not-allowed":n}),children:[r&&r,a,i&&i]})}function p({onChange:e,label:t,value:r,options:n,className:i,inputClassName:a}){return(0,s.jsxs)("div",{className:"flex flex-col w-full",children:[t?(0,s.jsx)("label",{className:"flex mb-1 text-sm font-semibold md:text-base dark:text-white",children:t}):"",(0,s.jsx)("div",{className:(0,o.A)("duration-200 shadow text-base cursor-pointer dark:bg-gray-900 dark:text-white dark:border-gray-700 border border-gray-200 rounded-lg appearance-none outline-none leading-normal w-full dark:placeholder-gray-600 dark:hover:border-pink-700 dark:focus:border-pink-700 hover:border-pink-400 focus:border-pink-400 max-w-full overflow-hidden",i||""),children:(0,s.jsx)("select",{value:r,className:(0,o.A)("appearance-none bg-white dark:bg-gray-900 focus:outline-none cursor-pointer px-3 py-[6px] rounded w-full",a),onChange:e,children:n.map((e,t)=>(0,s.jsx)("option",{value:e.value,children:e.title},e.value+t))})})]})}var f=r(88061);let g=({title:e,onBack:t,className:r})=>(0,s.jsxs)("h2",{className:`flex items-center pb-3 mb-4 text-lg font-semibold border-b border-gray-200 dark:border-gray-800 dark:text-white ${r??""}`,children:[t?(0,s.jsx)("span",{className:"w-6 h-6 bg-white p-1 ring-1 ring-gray-300 rounded-full mr-2 rotate-180 flex cursor-pointer dark:bg-gray-800 dark:text-gray-400 duration-200 hover:scale-[1.2] text-gray-500 dark:shadow-black/60 dark:ring-gray-700",onClick:t,children:f.HK}):"",e]});var m=r(61869);let v=({children:e,show:t})=>(0,s.jsx)(m.N,{children:t&&(0,s.jsx)(nV,{className:"absolute right-0 bottom-0 w-full h-full flex items-center z-20",type:"custom",initial:{opacity:1,x:30}
31,animate:{opacity:1,x:0},exit:{opacity:0,x:30},children:(0,s.jsx)("div",{className:"h-full w-full",children:e})})});r(76902);var y=r(76430),b=r.t(y,2);function _(e,[t,r]){return Math.min(r,Math.max(t,e))}(0,Object.defineProperty)(_,"name",{value:"clamp",configurable:!0});var w=r(17440),k=r(5701),x=r(63675),E=r(13814),S=Object.defineProperty,P=y.createContext(void 0);function R(e){let t=y.useContext(P);return e||t||"ltr"}function T(e){let t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}S(R,"name",{value:"useDirection",configurable:!0}),(0,Object.defineProperty)(T,"name",{value:"usePrevious",configurable:!0});var A=r(52652);function C(e){let[t,r]=y.useState(void 0);return(0,A.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,i;if(!Array.isArray(t)||!t.length)return;let s=t[0];if("borderBoxSize"in s){let e=s.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,i=t.blockSize}else n=e.offsetWidth,i=e.offsetHeight;r({width:n,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(0,Object.defineProperty)(C,"name",{value:"useSize",configurable:!0});var j=r(73846),O=r(36859),$=Object.defineProperty,I=(e,t)=>$(e,"name",{value:t,configurable:!0});function L(e){let t=e+"CollectionProvider",[r,n]=(0,x.A)(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=I(e=>{let{scope:t,children:r}=e,n=y.useRef(null),o=y.useRef(new Map).current;return(0,s.jsx)(i,{scope:t,itemMap:o,collectionRef:n,children:r})},"CollectionProvider");a.displayName=t;let l=e+"CollectionSlot",u=(0,O.TL)(l),c=y.forwardRef((e,t)=>{let{scope:r,children:n}=e,i=o(l,r),a=(0,k.s)(t,i.collectionRef);return(0,s.jsx)(u,{ref:a,children:n})});c.displayName=l;let h=e+"CollectionItemSlot",d="data-radix-collection-item",p=(0,O.TL)(h),f=y.forwardRef((e,t)=>{let{scope:r,children:n,...i}=e,a=y.useRef(null),l=(0,k.s)(t,a),u=o(h,r);return y.useEffect(()=>(u.itemMap.set(a,{ref:a,...i}),()=>void u.itemMap.delete(a))),(0,s.jsx)(p,{...{[d]:""},ref:l,children:n})});function g(t){let r=o(e+"CollectionConsumer",t);return y.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])}return f.displayName=h,I(g,"useCollection"),[{Provider:a,Slot:c,ItemSlot:f},g,n]}I(L,"createCollection");var M=new WeakMap,D=class e extends Map{static{I(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],M.set(this,!0)}set(e,t){return M.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,i=this.has(t),s=this.#e.length,o=B(e),a=o>=0?o:s+o,l=a<0||a>=s?-1:a;if(l===this.size||i&&l===this.size-1||-1===l)return this.set(t,r),this;let u=this.size+ +!i;o<0&&a++;let c=[...this.#e],h=!1;for(let e=a;e<u;e++)if(a===e){let s=c[e];c[e]===t&&(s=c[e+1]),i&&this.delete(t),n=this.get(s),this.set(t,r)}else{h||c[e-1]!==t||(h=!0);let r=c[h?e:e-1],i=n;n=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,n){let i=new e(this);return i.insert(t,r,n),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=N(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=N(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return N(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&n.push(e),i++;return new e(n)}map(t,r){let n=[],i=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(n)}reduce(...e){let[t,r]=e,n=0,i=r??this.at(0);for(let r of this)i=0===n&&1===e.length?r:Reflect.apply(t,this,[i,r,n,this]),n++;return i}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);
31n=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[n,i,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,i=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}};function N(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=F(e,t);return -1===r?void 0:e[r]}function F(e,t){let r=e.length,n=B(t),i=n>=0?n:r+n;return i<0||i>=r?-1:i}function B(e){return e!=e||0===e?0:Math.trunc(e)}function U(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||e[n]!==t[n])return!1;return!0}function V(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function W(e,t){return e[1].element&&t[1].element?V(e[1].element,t[1].element)?-1:1:0}function H(e){return new MutationObserver(t=>{for(let r of t)if("childList"===r.type)return void e()})}I(N,"at"),I(F,"toSafeIndex"),I(B,"toSafeInteger"),I(function(e){let t=e+"CollectionProvider",[r,n]=(0,x.A)(t),[i,o]=r(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new D,setItemMap:I(()=>void 0,"setItemMap")}),a=I(({state:e,...t})=>e?(0,s.jsx)(u,{...t,state:e}):(0,s.jsx)(l,{...t}),"CollectionProvider");a.displayName=t;let l=I(e=>{let t=m();return(0,s.jsx)(u,{...e,state:t})},"CollectionInit");l.displayName=t+"Init";let u=I(e=>{let{scope:t,children:r,state:n}=e,o=y.useRef(null),[a,l]=y.useState(null),u=(0,k.s)(o,l),[c,h]=n;return y.useEffect(()=>{if(!a)return;let e=H(()=>{});return e.observe(a,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[a]),(0,s.jsx)(i,{scope:t,itemMap:c,setItemMap:h,collectionRef:u,collectionRefObject:o,collectionElement:a,children:r})},"CollectionProviderImpl");u.displayName=t+"Impl";let c=e+"CollectionSlot",h=(0,O.TL)(c),d=y.forwardRef((e,t)=>{let{scope:r,children:n}=e,i=o(c,r),a=(0,k.s)(t,i.collectionRef);return(0,s.jsx)(h,{ref:a,children:n})});d.displayName=c;let p=e+"CollectionItemSlot",f=(0,O.TL)(p),g=y.forwardRef((e,t)=>{let{scope:r,children:n,...i}=e,a=y.useRef(null),[l,u]=y.useState(null),c=(0,k.s)(t,a,u),{setItemMap:h}=o(p,r),d=y.useRef(i);U(d.current,i)||(d.current=i);let g=d.current;return y.useEffect(()=>(h(e=>l?e.has(l)?e.set(l,{...g,element:l}).toSorted(W):(e.set(l,{...g,element:l}),e.toSorted(W)):e),()=>{h(e=>l&&e.has(l)?(e.delete(l),new D(e)):e)}),[l,g,h]),(0,s.jsx)(f,{"data-radix-collection-item":"",ref:c,children:n})});function m(){return y.useState(new D)}function v(t){let{itemMap:r}=o(e+"CollectionConsumer",t);return r}return g.displayName=p,I(m,"useInitCollection"),I(v,"useCollection"),[{Provider:a,Slot:d,ItemSlot:g},{createCollectionScope:n,useCollection:v,useInitCollection:m}]},"createCollection"),I(U,"shallowEqual"),I(V,"isElementPreceding"),I(W,"sortByDocumentPosition"),I(H,"getChildListObserver");var q=Object.defineProperty,G=(e,t)=>q(e,"name",{value:t,configurable:!0}),z=["PageUp","PageDown"],K=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],J={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Y="Slider",[X,Z,Q]=L(Y),[ee,et]=(0,x.A)(Y,[Q]),[er,en]=ee(Y),ei=y.forwardRef(G(function(e,t){let{name:r,min:n=0,max:i=100,step:o=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:c=[n],value:h,onValueChange:d=G(()=>{},"onValueChange"),onValueCommit:p=G(()=>{},"onValueCommit"),inverted:f=!1,form:g,...m}=e,v=y.useRef(new Set),b=y.useRef(0),x=y.useRef(!1),S="horizontal"===a,[P,R]=y.useState(null),T=(0,k.s)(t,R),[A=[],C]=(0,E.i)({prop:h,defaultProp:c,onChange:G(e=>{let t=[...v.current];t[b.current]?.focus({preventScroll:!0,focusVisible:x.current}),x.current=!1,d(e)}
31,"onChange")}),j=y.useRef(A),O=y.useRef(A);function $(e){let t=ex(A,e);M(e,t)}function I(e){M(e,b.current)}function L(){String(A)!==String(j.current)&&p(A)}function M(e,t,{commit:r}={commit:!1}){let s=eT(o),a=_(eA(Math.round((e-n)/o)*o+n,s),[n,i]);C((e=[])=>{let n=e_(e,a,t);if(!eP(n,u*o))return e;{b.current=n.indexOf(a);let t=String(n)!==String(e);return t&&r&&p(n),t?n:e}})}return y.useEffect(()=>{let e=g?P?.ownerDocument.getElementById(g):P?.closest("form");if(e instanceof HTMLFormElement){let t=G(()=>C(O.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[P,g,C]),G($,"handleSlideStart"),G(I,"handleSlideMove"),G(L,"handleSlideEnd"),G(M,"updateValues"),(0,s.jsx)(er,{scope:e.__scopeSlider,name:r,disabled:l,min:n,max:i,valueIndexToChangeRef:b,thumbs:v.current,values:A,orientation:a,form:g,children:(0,s.jsx)(X.Provider,{scope:e.__scopeSlider,children:(0,s.jsx)(X.Slot,{scope:e.__scopeSlider,children:(0,s.jsx)(S?ea:el,{"aria-disabled":l,"data-disabled":l?"":void 0,...m,ref:T,onPointerDown:(0,w.mK)(m.onPointerDown,()=>{l||(j.current=A,x.current=!1)}),min:n,max:i,inverted:f,onSlideStart:l?void 0:$,onSlideMove:l?void 0:I,onSlideEnd:l?void 0:L,onHomeKeyDown:()=>{l||(x.current=!0,M(n,0,{commit:!0}))},onEndKeyDown:()=>{l||(x.current=!0,M(i,A.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){x.current=!0;let r=z.includes(e.key)||e.shiftKey&&K.includes(e.key),i=b.current;M(eC(A[i],{min:n,step:o,direction:t,multiplier:r?10:1}),i,{commit:!0})}}})})})})},"Slider")),[es,eo]=ee(Y,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ea=y.forwardRef(G(function(e,t){let{min:r,max:n,dir:i,inverted:o,onSlideStart:a,onSlideMove:l,onSlideEnd:u,onStepKeyDown:c,...h}=e,[d,p]=y.useState(null),f=(0,k.s)(t,p),g=y.useRef(void 0),m=R(i),v="ltr"===m,b=v&&!o||!v&&o;function _(e){let t=g.current||d.getBoundingClientRect(),i=eR([0,t.width],b?[r,n]:[n,r]);return g.current=t,i(e-t.left)}return G(_,"getValueFromPointer"),(0,s.jsx)(es,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:(0,s.jsx)(eu,{dir:m,"data-orientation":"horizontal",...h,ref:f,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=_(e.clientX);a?.(t)},onSlideMove:e=>{let t=_(e.clientX);l?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=J[b?"from-left":"from-right"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})},"SliderHorizontal")),el=y.forwardRef(G(function(e,t){let{min:r,max:n,inverted:i,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:u,...c}=e,h=y.useRef(null),d=(0,k.s)(t,h),p=y.useRef(void 0),f=!i;function g(e){let t=p.current||h.current.getBoundingClientRect(),i=eR([0,t.height],f?[n,r]:[r,n]);return p.current=t,i(e-t.top)}return G(g,"getValueFromPointer"),(0,s.jsx)(es,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:(0,s.jsx)(eu,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=g(e.clientY);o?.(t)},onSlideMove:e=>{let t=g(e.clientY);a?.(t)},onSlideEnd:()=>{p.current=void 0,l?.()},onStepKeyDown:e=>{let t=J[f?"from-bottom":"from-top"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},"SliderVertical")),eu=y.forwardRef(G(function(e,t){let{__scopeSlider:r,onSlideStart:n,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:u,...c}=e,h=en(Y,r);return(0,s.jsx)(j.sG.span,{...c,ref:t,onKeyDown:(0,w.mK)(e.onKeyDown,e=>{"Home"===e.key?(a(e),e.preventDefault()):"End"===e.key?(l(e),e.preventDefault()):z.concat(K).includes(e.key)&&(u(e),e.preventDefault())}),onPointerDown:(0,w.mK)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),h.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):n(e)}),onPointerMove:(0,w.mK)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:(0,w.mK)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},"SliderImpl")),ec=y.forwardRef(G(function(e,t){let{__scopeSlider:r,...n}=e,i=en("SliderTrack",r);return(0,s.jsx)(j.sG.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...n,ref:t})},"SliderTrack")),eh="SliderRange",ed=y.forwardRef(G(function(e,t){let{__scopeSlider:r,...n}=e,i=en(eh,r),o=eo(eh,r),a=y.useRef(null),l=(0,k.s)(t,a),u=i.values.length,c=i.values.map(e=>ew(e,i.min,i.max)),h=u>1?Math.min(...c):0,d=100-Math.max(...c);return(0,s.jsx)(j.sG.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...n,ref:l,style:{...e.style,[o.startEdge]:h+"%",[o.endEdge]:d+"%"}})}
31,"SliderRange")),[ep,ef]=ee("SliderThumb");function eg(e){let{__scopeSlider:t,name:r,children:n,internal_do_not_use_render:i}=e,o=en("SliderThumbProvider",t),a=Z(t),[l,u]=y.useState(null),c=y.useMemo(()=>l?a().findIndex(e=>e.ref.current===l):-1,[a,l]),h=C(l),d=!l||!!o.form||!!l.closest("form"),p=o.values[c],f=r??(o.name?o.name+(o.values.length>1?"[]":""):void 0),g=void 0===p?0:ew(p,o.min,o.max);y.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]);let m={value:p,name:f,form:o.form,isFormControl:d,index:c,thumb:l,onThumbChange:u,percent:g,size:h};return(0,s.jsx)(ep,{scope:t,...m,children:ej(i)?i(m):n})}G(eg,"SliderThumbProvider");var em="SliderThumbTrigger",ev=y.forwardRef(G(function(e,t){let{__scopeSlider:r,...n}=e,i=en(em,r),o=eo(em,r),{index:a,value:l,percent:u,size:c,onThumbChange:h}=ef(em,r),d=(0,k.s)(t,h),p=ek(a,i.values.length),f=c?.[o.size],g=f?eE(f,u,o.direction):0;return(0,s.jsx)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${u}% + ${g}px)`},children:(0,s.jsx)(X.ItemSlot,{scope:r,children:(0,s.jsx)(j.sG.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":i.min,"aria-valuenow":l,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...n,ref:d,style:void 0===l?{display:"none"}:e.style,onFocus:(0,w.mK)(e.onFocus,()=>{i.valueIndexToChangeRef.current=a})})})})},"SliderThumbTrigger")),ey=y.forwardRef(G(function(e,t){let{__scopeSlider:r,name:n,...i}=e;return(0,s.jsx)(eg,{__scopeSlider:r,name:n,internal_do_not_use_render:({index:e,isFormControl:n})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ev,{...i,ref:t,__scopeSlider:r}),n?(0,s.jsx)(eb,{__scopeSlider:r},e):null]})})},"SliderThumb")),eb=y.forwardRef(G(function({__scopeSlider:e,...t},r){let{value:n,name:i,form:o}=ef("SliderBubbleInput",e),a=y.useRef(null),l=(0,k.s)(a,r),u=T(n);return y.useEffect(()=>{let e=a.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(u!==n&&t){let r=new Event("input",{bubbles:!0});t.call(e,n),e.dispatchEvent(r)}},[u,n]),(0,s.jsx)(j.sG.input,{style:{display:"none"},name:i,form:o,...t,ref:l,defaultValue:n})},"SliderBubbleInput"));function e_(e=[],t,r){let n=[...e];return n[r]=t,n.sort((e,t)=>e-t)}function ew(e,t,r){return _(100/(r-t)*(e-t),[0,100])}function ek(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}function ex(e,t){if(1===e.length)return 0;let r=e.map(e=>Math.abs(e-t)),n=Math.min(...r);return r.indexOf(n)}function eE(e,t,r){let n=e/2,i=eR([0,50],[0,n]);return(n-i(t)*r)*r}function eS(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function eP(e,t){return!(t>0)||Math.min(...eS(e))>=t}function eR(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function eT(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes("e")){let[e,r]=t.split("e"),n=e.split(".")[1]||"",i=Number(r);return Math.max(0,n.length-i)}let r=t.split(".")[1];return r?r.length:0}function eA(e,t){let r=Math.pow(10,t);return Math.round(e*r)/r}function eC(e,{min:t,step:r,direction:n,multiplier:i}){let s,o=eT(r),a=(e-t)/r,l=Math.round(a);return s=eA(l*r+t,o)===eA(e,o)?l+i*n:n>0?Math.ceil(a):Math.floor(a),eA(s*r+t,o)}function ej(e){return"function"==typeof e}G(e_,"getNextSortedValues"),G(ew,"convertValueToPercentage"),G(ek,"getLabel"),G(ex,"getClosestValueIndex"),G(eE,"getThumbInBoundsOffset"),G(eS,"getStepsBetweenValues"),G(eP,"hasMinStepsBetweenValues"),G(eR,"linearScale"),G(eT,"getDecimalCount"),G(eA,"roundValue"),G(eC,"getNextStepValue"),G(ej,"isFunction");let eO=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ec,{className:"h-[12px] w-full bg-gray-100 dark:bg-gray-900 rounded-full relative border border-gray-300 dark:border-gray-600 shadow-[0_0_2px_rgba(0,0,0,0.1)] flex items-center",children:(0,s.jsx)(ed,{className:"bg-linear-to-br bg-white dark:bg-gray-700/80 absolute h-full rounded-full"})}),(0,s.jsx)(ey,{className:"bg-linear-to-br from-[#737373] to-[#262626] dark:from-[#e5e5e5] dark:to-[#a3a3a3] cursor-pointer duration-100 focus:border-black hover:border-black focus:scale-[1.05] dark:border-gray-500 dark:hover:border-gray-200 dark:focus:border-gray-200 hover:scale-[1.05] h-[20px] w-[16px] border border-gray-500 rounded-[5px] flex focus:outline-none ease-linear shadow-[0_0_12px_rgba(0,0,0,0.15)] relative group",children:(0,s.jsxs)("span",{className:"flex w-full absolute inset-0 h-full items-center justify-around px-[3px]",children:[(0,s.jsx)("span",{className:"w-[1.2px] rounded h-[55%] bg-gray-400 dark:bg-gray-500 group-focus:bg-gray-100 group-hover:bg-gray-100 dark:group-hover:bg-gray-900 dark:group-focus:bg-gray-900"}),(0,s.jsx)("span",{className:"w-[1.2px] rounded h-[55%] bg-gray-400 dark:bg-gray-500 group-focus:bg-gray-100 group-hover:bg-gray-100 dark:group-hover:bg-gray-900 dark:group-focus:bg-gray-900"})]})})]}),e$=({min:e,max:t,value:r,name:n,steps:i,defaultValue:a,stepValue:l,onCh
31ange:u,label:c,noSpacing:h,disabled:p})=>c?(0,s.jsxs)("div",{className:(0,o.A)("flex items-center justify-between w-full",!h&&"px-4 py-2"),children:[c?(0,s.jsxs)("div",{className:"text-sm font-semibold dark:text-white flex items-center whitespace-nowrap",children:[c??"Y-Axis Position ",parseInt(l)?(0,s.jsx)(d,{variant:"side",as:"div",className:"ml-2",children:(0,s.jsx)("span",{className:"font-mono",children:l})}):""]}):"",(0,s.jsx)("div",{className:"w-full max-w-[50%]",children:(0,s.jsx)(ei,{disabled:p,asChild:!0,min:e,max:t,step:i??1,defaultValue:[a],onValueChange:e=>{u(e[0])},value:[r],name:n??"",children:(0,s.jsx)("div",{className:(0,o.A)("w-full flex items-center justify-center relative py-3",p&&"opacity-50"),children:(0,s.jsx)(eO,{})})})})]}):(0,s.jsx)(ei,{className:"w-full flex duration-100 ease-linear",asChild:!0,disabled:p,min:e,max:t,step:i??1,defaultValue:[a],onValueChange:e=>{u(e[0])},value:[r],name:n??"",children:(0,s.jsx)("div",{className:(0,o.A)("w-full flex items-center justify-center relative py-4",p&&"opacity-50"),children:(0,s.jsx)(eO,{})})});var eI=r(62260),eL=r(15212),eM=Object.defineProperty,eD=(e,t)=>eM(e,"name",{value:t,configurable:!0}),eN="Switch",[eF,eB]=(0,x.A)(eN),[eU,eV]=eF(eN);function eW(e){let{__scopeSwitch:t,checked:r,children:n,defaultChecked:i,disabled:o,form:a,name:l,onCheckedChange:u,required:c,value:h="on",internal_do_not_use_render:d}=e,[p,f]=(0,E.i)({prop:r,defaultProp:i??!1,onChange:u,caller:eN}),[g,m]=y.useState(null),[v,b]=y.useState(null),_=y.useRef(!1),[w,k]=y.useReducer(e=>e+1,0),x=!g||!!a||!!g.closest("form"),S={checked:p,setChecked:f,disabled:o,control:g,setControl:m,name:l,form:a,value:h,hasConsumerStoppedPropagationRef:_,userInteractionCount:w,onUserInteraction:k,required:c,defaultChecked:i,isFormControl:x,bubbleInput:v,setBubbleInput:b};return(0,s.jsx)(eU,{scope:t,...S,children:eK(d)?d(S):n})}eD(eW,"SwitchProvider");var eH=y.forwardRef(eD(function({__scopeSwitch:e,onClick:t,...r},n){let{control:i,form:o,value:a,disabled:l,checked:u,required:c,setControl:h,setChecked:d,hasConsumerStoppedPropagationRef:p,onUserInteraction:f,isFormControl:g,bubbleInput:m}=eV("SwitchTrigger",e),v=(0,k.s)(n,h),b=y.useRef(u);return y.useEffect(()=>{let e=o?i?.ownerDocument.getElementById(o):i?.form;if(e instanceof HTMLFormElement){let t=eD(()=>d(b.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,o,d]),(0,s.jsx)(j.sG.button,{type:"button",role:"switch","aria-checked":u,"aria-required":c,"data-state":eJ(u),"data-disabled":l?"":void 0,disabled:l,value:a,...r,ref:v,onClick:(0,w.mK)(t,e=>{f(),d(e=>!e),m&&g&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})},"SwitchTrigger")),eq=y.forwardRef(eD(function(e,t){let{__scopeSwitch:r,name:n,checked:i,defaultChecked:o,required:a,disabled:l,value:u,onCheckedChange:c,form:h,...d}=e;return(0,s.jsx)(eW,{__scopeSwitch:r,checked:i,defaultChecked:o,disabled:l,required:a,onCheckedChange:c,name:n,form:h,value:u,internal_do_not_use_render:({isFormControl:e})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eH,{...d,ref:t,__scopeSwitch:r}),e&&(0,s.jsx)(ez,{__scopeSwitch:r})]})})},"Switch")),eG=y.forwardRef(eD(function(e,t){let{__scopeSwitch:r,...n}=e,i=eV("SwitchThumb",r);return(0,s.jsx)(j.sG.span,{"data-state":eJ(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})},"SwitchThumb")),ez=y.forwardRef(eD(function({__scopeSwitch:e,onClick:t,...r},n){let{control:i,hasConsumerStoppedPropagationRef:o,userInteractionCount:a,checked:l,defaultChecked:u,required:c,disabled:h,name:d,value:p,form:f,bubbleInput:g,setBubbleInput:m}=eV("SwitchBubbleInput",e),v=(0,k.s)(n,m),b=C(i),_=y.useRef(!1),x=y.useRef(l),E=y.useRef(a);y.useEffect(()=>{if(!g)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=a!==E.current;E.current=a;let r=x.current!==l;x.current=l;let n=!(t&&o.current);if(r&&e){_.current=!t;let r=new Event("click",{bubbles:n});e.call(g,l),g.dispatchEvent(r),_.current=!1}},[g,l,o,a]);let S=y.useRef(l);return(0,s.jsx)(j.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:c,disabled:h,name:d,value:p,form:f,...r,tabIndex:-1,ref:v,onClick:(0,w.mK)(t,e=>{_.current&&e.stopPropagation()}),style:{...r.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})}
31,"SwitchBubbleInput"));function eK(e){return"function"==typeof e}function eJ(e){return e?"checked":"unchecked"}eD(eK,"isFunction"),eD(eJ,"getState");let eY=({label:e,info:t,value:r,onChange:n,labelClass:i,disabled:a}={})=>(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(eq,{checked:r||!1,onCheckedChange:n,className:(0,o.A)("w-[40px]  dark:bg-gray-800 dark:border-gray-700 rounded-full border border-gray-300 h-[24px] p-[3px] group",!1===r?"bg-gray-200 dark:bg-gray-700":"bg-white dark:bg-gray-800"),children:(0,s.jsx)(eG,{className:(0,o.A)(" rounded-full bg-linear-to-br from-gray-500 to-gray-800 ring-1 ring-gray-800 dark:from-gray-200 dark:to-gray-400 dark:ring-gray-200 h-full group-hover:scale-[0.9] aspect-square flex duration-100 ease-in-out items-center justify-center",!1===r?"opacity-40":"translate-x-full bg-white"),children:!1===r?(0,s.jsx)(eI.A,{size:12,className:"text-white dark:text-black",weight:"bold"}):(0,s.jsx)(eL.A,{size:12,className:"text-white dark:text-black",weight:"bold"})})}),(0,s.jsxs)("div",{className:"ml-2",children:[e&&(0,s.jsx)("h4",{className:(0,o.A)("text-sm font-semibold dark:text-gray-200",i),children:e}),t&&(0,s.jsx)("p",{className:"leading-tight font-normal text-gray-500 dark:text-gray-400",children:t})]})]});var eX=r(76242),eZ=r(72022),eQ=r(63282),e0=r(40544);let e1=["top","right","bottom","left"],e2=Math.min,e8=Math.max,e6=Math.round,e3=Math.floor,e5=e=>({x:e,y:e}),e4={left:"right",right:"left",bottom:"top",top:"bottom"};function e9(e,t){return"function"==typeof e?e(t):e}function e7(e){return e.split("-")[0]}function te(e){return e.split("-")[1]}function tt(e){return"x"===e?"y":"x"}function tr(e){return"y"===e?"height":"width"}function tn(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function ti(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let ts=["left","right"],to=["right","left"],ta=["top","bottom"],tl=["bottom","top"];function tu(e){let t=e7(e);return e4[t]+e.slice(t.length)}function tc(e){var t,r,n,i;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(r=e.right)?r:0,bottom:null!=(n=e.bottom)?n:0,left:null!=(i=e.left)?i:0}:{top:e,right:e,bottom:e,left:e}}function th(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function td(e,t,r){let n,{reference:i,floating:s}=e,o=tn(t),a=tt(tn(t)),l=tr(a),u=e7(t),c=i.x+i.width/2-s.width/2,h=i.y+i.height/2-s.height/2,d=i[l]/2-s[l]/2;switch(u){case"top":n={x:c,y:i.y-s.height};break;case"bottom":n={x:c,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:h};break;case"left":n={x:i.x-s.width,y:h};break;default:n={x:i.x,y:i.y}}let p=te(t);return p&&(n[a]+=d*("end"===p?1:-1)*(r&&"y"===o?-1:1)),n}async function tp(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:d=!1,padding:p=0}=e9(t,e),f=tc(p),g=a[d?"floating"===h?"reference":"floating":h],m=th(await s.getClippingRect({element:null==(r=await (null==s.isElement?void 0:s.isElement(g)))||r?g:g.contextElement||await (null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v="floating"===h?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await (null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),b=await (null==s.isElement?void 0:s.isElement(y))&&await (null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},_=th(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-_.top+f.top)/b.y,bottom:(_.bottom-m.bottom+f.bottom)/b.y,left:(m.left-_.left+f.left)/b.x,right:(_.right-m.right+f.right)/b.x}}let tf=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=o.detectOverflow?o:{...o,detectOverflow:tp},l=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:h}=td(u,n,l),d=n,p=0,f={};for(let r=0;r<s.length;r++){let g=s[r];if(!g)continue;let{name:m,fn:v}=g,{x:y,y:b,data:_,reset:w}=await v({x:c,y:h,initialPlacement:n,placement:d,strategy:i,middlewareData:f,re
31cts:u,platform:a,elements:{reference:e,floating:t}});c=null!=y?y:c,h=null!=b?b:h,f[m]={...f[m],..._},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(u=!0===w.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:c,y:h}=td(u,d,l)),r=-1)}return{x:c,y:h,placement:d,strategy:i,middlewareData:f}};function tg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tm(e){return e1.some(t=>e[t]>=0)}let tv=new Set(["left","top"]);async function ty(e,t){let{placement:r,platform:n,elements:i}=e,s=await (null==n.isRTL?void 0:n.isRTL(i.floating)),o=e7(r),a=te(r),l="y"===tn(r),u=tv.has(o)?-1:1,c=s&&l?-1:1,h=e9(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*c,y:d*u}:{x:d*u,y:p*c}}function tb(){return"u">typeof window}function t_(e){return tx(e)?(e.nodeName||"").toLowerCase():"#document"}function tw(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function tk(e){var t;return null==(t=(tx(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function tx(e){return!!tb()&&(e instanceof Node||e instanceof tw(e).Node)}function tE(e){return!!tb()&&(e instanceof Element||e instanceof tw(e).Element)}function tS(e){return!!tb()&&(e instanceof HTMLElement||e instanceof tw(e).HTMLElement)}function tP(e){return!(!tb()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof tw(e).ShadowRoot)}function tR(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=tL(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==i&&"contents"!==i}function tT(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let tA=/transform|translate|scale|rotate|perspective|filter/,tC=/paint|layout|strict|content/,tj=e=>!!e&&"none"!==e;function tO(e){let t=tE(e)?tL(e):e;return tj(t.transform)||tj(t.translate)||tj(t.scale)||tj(t.rotate)||tj(t.perspective)||!t$()&&(tj(t.backdropFilter)||tj(t.filter))||tA.test(t.willChange||"")||tC.test(t.contain||"")}function t$(){return null==n&&(n="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),n}function tI(e){return/^(html|body|#document)$/.test(t_(e))}function tL(e){return tw(e).getComputedStyle(e)}function tM(e){return tE(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tD(e){if("html"===t_(e))return e;let t=e.assignedSlot||e.parentNode||tP(e)&&e.host||tk(e);return tP(t)?t.host:t}function tN(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let i=function e(t){let r=tD(t);return tI(r)?(t.ownerDocument||t).body:tS(r)&&tR(r)?r:e(r)}(e),s=i===(null==(n=e.ownerDocument)?void 0:n.body),o=tw(i);if(!s)return t.concat(i,tN(i,[],r));{let e=tF(o);return t.concat(o,o.visualViewport||[],tR(i)?i:[],e&&r?tN(e):[])}}function tF(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tB(e){let t=tL(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=tS(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=e6(r)!==s||e6(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function tU(e){return tE(e)?e:e.contextElement}function tV(e){let t=tU(e);if(!tS(t))return e5(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:s}=tB(t),o=(s?e6(r.width):r.width)/n,a=(s?e6(r.height):r.height)/i;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}let tW=e5(0);function tH(e){let t=tw(e);return t$()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:tW}function tq(e,t,r,n){var i;void 0===t&&(t=!1),void 0===r&&(r=!1);let s=e.getBoundingClientRect(),o=tU(e),a=e5(1);t&&(n?tE(n)&&(a=tV(n)):a=tV(e));let l=(void 0===(i=r)&&(i=!1),n&&i&&n===tw(o))?tH(o):e5(0),u=(s.left+l.x)/a.x,c=(s.top+l.y)/a.y,h=s.width/a.x,d=s.height/a.y;if(o&&n){let e=tw(o),t=tE(n)?tw(n):n,r=e,i=tF(r);for(;i&&t!==r;){let e=tV(i),t=i.getBoundingClientRect(),n=tL(i),s=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.to
31p+(i.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,c*=e.y,h*=e.x,d*=e.y,u+=s,c+=o,i=tF(r=tw(i))}}return th({width:h,height:d,x:u,y:c})}function tG(e,t){let r=tM(e).scrollLeft;return t?t.left+r:tq(tk(e)).left+r}function tz(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-tG(e,r),y:r.top+t.scrollTop}}function tK(e,t,r){var n;let i;if("viewport"===t||"layoutViewport"===t)i=function(e,t,r){void 0===r&&(r="viewport");let n="layoutViewport"===r,i=tw(e),s=tk(e),o=i.visualViewport,a=s.clientWidth,l=s.clientHeight,u=0,c=0;if(o){let e=!t$()||"fixed"===t;n?e||(u=-o.offsetLeft,c=-o.offsetTop):(a=o.width,l=o.height,e&&(u=o.offsetLeft,c=o.offsetTop))}if(0>=tG(s)){let e=s.ownerDocument,t=e.body,r=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,i=Math.abs(s.clientWidth-t.clientWidth-n),o="stable both-edges"===getComputedStyle(s).scrollbarGutter?i/2:i;o<=25&&(a-=o)}return{width:a,height:l,x:u,y:c}}(e,r,t);else if("document"===t){let t,r,s,o,a,l;t=tM(n=tk(e)),r=n.ownerDocument.body,s=e8(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),o=e8(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight),a=-t.scrollLeft+tG(n),l=-t.scrollTop,"rtl"===tL(r).direction&&(a+=e8(n.clientWidth,r.clientWidth)-s),i={width:s,height:o,x:a,y:l}}else if(tE(t)){let e,n,s,o,a,l;n=(e=tq(t,!0,"fixed"===r)).top+t.clientTop,s=e.left+t.clientLeft,o=tV(t),a=t.clientWidth*o.x,l=t.clientHeight*o.y,i={width:a,height:l,x:s*o.x,y:n*o.y}}else{let r=tH(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return th(i)}function tJ(e){return"static"===tL(e).position}function tY(e,t){if(!tS(e)||"fixed"===tL(e).position)return null;if(t)return t(e);let r=e.offsetParent;return tk(e)===r&&(r=r.ownerDocument.body),r}function tX(e,t){var r;let n=tw(e);if(tT(e))return n;if(!tS(e)){let t=tD(e);for(;t&&!tI(t);){if(tE(t)&&!tJ(t))return t;t=tD(t)}return n}let i=tY(e,t);for(;i&&(r=i,/^(table|td|th)$/.test(t_(r)))&&tJ(i);)i=tY(i,t);return i&&tI(i)&&tJ(i)&&!tO(i)?n:i||function(e){let t=tD(e);for(;tS(t)&&!tI(t);){if(tO(t))return t;if(tT(t))break;t=tD(t)}return null}(e)||n}let tZ=async function(e){let t=this.getOffsetParent||tX,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=tS(t),i=tk(t),s="fixed"===r,o=tq(e,!0,s,t),a={scrollLeft:0,scrollTop:0},l=e5(0);if((n||!s)&&(("body"!==t_(t)||tR(i))&&(a=tM(t)),n)){let e=tq(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!n&&i&&(l.x=tG(i));let u=!i||n||s?e5(0):tz(i,a);return{x:o.left+a.scrollLeft-l.x-u.x,y:o.top+a.scrollTop-l.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},tQ={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,s="fixed"===i,o=tk(n),a=!!t&&tT(t.floating);if(n===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},u=e5(1),c=e5(0),h=tS(n);if((h||!s)&&(("body"!==t_(n)||tR(o))&&(l=tM(n)),h)){let e=tq(n);u=tV(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}let d=!o||h||s?e5(0):tz(o,l);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:r.y*u.y-l.scrollTop*u.y+c.y+d.y}},getDocumentElement:tk,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,s=[..."clippingAncestors"===r?tT(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=tN(e,[],!1).filter(e=>tE(e)&&"body"!==t_(e)),i=null,s="fixed"===tL(e).position,o=s?tD(e):e;for(;tE(o)&&!tI(o);){let e=tL(o),t=tO(o),r=i?i.position:s?"fixed":"";t||"fixed"!==r&&("absolute"!==r||"static"!==e.position)?i=e:n=n.filter(e=>e!==o),o=tD(o)}return t.set(e,n),n}(t,this._c):[].concat(r),n],o=tK(t,s[0],i),a=o.top,l=o.right,u=o.bottom,c=o.left;for(let e=1;e<s.length;e++){let r=tK(t,s[e],i);a=e8(r.top,a),l=e2(r.right,l),u=e2(r.bottom,u),c=e8(r.left,c)}return{width:l-c,height:u-a,x:c,y:a}},getOffsetParent:tX,getElementRects:tZ,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:r}=tB(e);return{width:t,height:r}},getScale:tV,isElement:tE,isRTL:function(e){return"rtl"===tL(e).direction}};function t0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let t1=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=e9(e,t)||{};if(null==u)return{};let h=tc(c),d={x:r,y:n},p=tt(tn(i)),f=tr(p),g=await o.getDimensions(u),m="y"===p,v=m?"clientHeight":"clientWidth",y=s.reference[f]+s.reference[p]-d[p]-s.floating[f],b=d[p]-s.reference[p],_=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),w=_?_[v]:0;w&&await (null==o.isElement?void 0:o.isElement(_))||(w=a.floating[v]||s.floating[f]);let k=w/2-g[f]/2-1,x=e2(h[m?"top":"left"],k),E=e2(h[m?"bottom":"right"],k),S=w-g[f]-E,P=w/2-g[f]/2+(y/2-b/2),R=e8(x,e2(P,S)),T=!l.arrow&&null!=te(i)&&P!==R&&s.reference[f]/2-(P<x?x:E)-g[f]/2<0,A=T?P<x?P-x:P-S:0;return{[p]:d[p]+A,data:{[p]:R,centerOffset:P-R-A,...T&&{alignmentOffset:A}},reset:T}}});var t2=r(54569),t8="u">typeof document?y.useLayoutEffect:function(){};function t6(e,t){let r,n,i;if(e===t)return!0;
31if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!t6(e[n],t[n]))return!1;return!0}if((r=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,i[n]))return!1;for(n=r;0!=n--;){let r=i[n];if(("_owner"!==r||!e.$$typeof)&&!t6(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function t3(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function t5(e,t){let r=t3(e);return Math.round(t*r)/r}function t4(e){let t=y.useRef(e);return t8(()=>{t.current=e}),t}var t9=Object.defineProperty,t7=y.forwardRef(t9(function(e,t){let{children:r,width:n=10,height:i=5,...o}=e;return(0,s.jsx)(j.sG.svg,{...o,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,s.jsx)("polygon",{points:"0,0 30,0 15,10"})})},"name",{value:"Arrow",configurable:!0})),re=r(11212),rt=Object.defineProperty,rr=(e,t)=>rt(e,"name",{value:t,configurable:!0}),rn="Popper",[ri,rs]=(0,x.A)(rn),[ro,ra]=ri(rn),rl=rr(e=>{let{__scopePopper:t,children:r}=e,[n,i]=y.useState(null),[o,a]=y.useState(void 0);return(0,s.jsx)(ro,{scope:t,anchor:n,onAnchorChange:i,placementState:o,setPlacementState:a,children:r})},"Popper"),ru=y.forwardRef(rr(function(e,t){let{__scopePopper:r,virtualRef:n,...i}=e,o=ra("PopperAnchor",r),a=y.useRef(null),l=o.onAnchorChange,u=y.useCallback(e=>{a.current=e,e&&l(e)},[l]),c=(0,k.s)(t,u),h=y.useRef(null);y.useEffect(()=>{if(!n)return;let e=h.current;h.current=n.current,e!==h.current&&l(h.current)});let d=o.placementState&&ry(o.placementState),p=d?.[0],f=d?.[1];return n?null:(0,s.jsx)(j.sG.div,{"data-radix-popper-side":p,"data-radix-popper-align":f,...i,ref:c})},"PopperAnchor")),rc="PopperContent",[rh,rd]=ri(rc),rp=y.forwardRef(rr(function(e,t){var r,n,i,o,a,l,u,c,h,d,p,f,g;let m,v,b,_,w,x,{__scopePopper:E,side:S="bottom",sideOffset:P=0,align:R="center",alignOffset:T=0,arrowPadding:O=0,avoidCollisions:$=!0,collisionBoundary:I=[],collisionPadding:L=0,sticky:M="partial",hideWhenDetached:D=!1,updatePositionStrategy:N="optimized",onPlaced:F,...B}=e,U=ra(rc,E),[V,W]=y.useState(null),H=(0,k.s)(t,W),[q,G]=y.useState(null),z=C(q),K=z?.width??0,J=z?.height??0,Y="number"==typeof L?L:{top:0,right:0,bottom:0,left:0,...L},X=Array.isArray(I)?I:[I],Z=X.length>0,Q={padding:Y,boundary:X.filter(rm),altBoundary:Z},{refs:ee,floatingStyles:et,placement:er,isPositioned:en,middlewareData:ei}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,h]=y.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=y.useState(n);t6(d,n)||p(n);let[f,g]=y.useState(null),[m,v]=y.useState(null),b=y.useCallback(e=>{e!==x.current&&(x.current=e,g(e))},[]),_=y.useCallback(e=>{e!==E.current&&(E.current=e,v(e))},[]),w=s||f,k=o||m,x=y.useRef(null),E=y.useRef(null),S=y.useRef(c),P=null!=l,R=t4(l),T=t4(i),A=t4(u),C=y.useCallback(()=>{var e,n;let i,s,o;if(!x.current||!E.current)return;let a={placement:t,strategy:r,middleware:d};T.current&&(a.platform=T.current),(e=x.current,n=E.current,i=new Map,s=null!=a?a:{},o={...tQ,...s.platform,_c:i},tf(e,n,{...s,platform:o})).then(e=>{let t={...e,isPositioned:!1!==A.current};j.current&&!t6(S.current,t)&&(S.current=t,t2.flushSync(()=>{h(t)}))})},[d,t,r,T,A]);t8(()=>{!1===u&&S.current.isPositioned&&(S.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);let j=y.useRef(!1);t8(()=>(j.current=!0,()=>{j.current=!1}),[]),t8(()=>{if(w&&(x.current=w),k&&(E.current=k),w&&k){if(R.current)return R.current(w,k,C);C()}},[w,k,C,R,P]);let O=y.useMemo(()=>({reference:x,floating:E,setReference:b,setFloating:_}),[b,_]),$=y.useMemo(()=>({reference:w,floating:k}),[w,k]),I=y.useMemo(()=>{let e={position:r,left:0,top:0};if(!$.floating)return e;let t=t5($.floating,c.x),n=t5($.floating,c.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...t3($.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,a,$.floating,c.x,c.y]);return y.useMemo(()=>({...c,update:C,refs:O,elements:$,floatingStyles:I}),[c,C,O,$,I])}({strategy:"fixed",placement:S+("center"!==R?"-"+R:""),whileElementsMounted:rr((...e)=>(function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,c=tU(e),h=s||o?[...c?tN(c):[],...t?tN(t):[]]:[];
31h.forEach(e=>{s&&e.addEventListener("scroll",r),o&&e.addEventListener("resize",r)});let d=c&&l?function(e,t,r){let n,i=null,s=tk(e);function o(){var e;clearTimeout(n),null==(e=i)||e.disconnect(),i=null}function a(r,l){void 0===r&&(r=!1),void 0===l&&(l=1),o();let u=e.getBoundingClientRect(),{left:c,top:h,width:d,height:p}=u;if(r||t(),!d||!p)return;let f={rootMargin:-e3(h)+"px "+-e3(s.clientWidth-(c+d))+"px "+-e3(s.clientHeight-(h+p))+"px "+-e3(c)+"px",threshold:e8(0,e2(1,l))||1},g=!0;function m(t){let r=t[0].intersectionRatio;if(!t0(u,e.getBoundingClientRect()))return a();if(r!==l){if(!g)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}g=!1}try{i=new IntersectionObserver(m,{...f,root:s.ownerDocument})}catch(e){i=new IntersectionObserver(m,f)}i.observe(e)}let l=tw(e),u=()=>a(r);return l.addEventListener("resize",u),a(!0),()=>{l.removeEventListener("resize",u),o()}}(c,r,o):null,p=-1,f=null;a&&(f=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),r()}),c&&!u&&f.observe(c),t&&f.observe(t));let g=u?tq(e):null;return u&&function t(){let n=tq(e);g&&!t0(g,n)&&r(),g=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;h.forEach(e=>{s&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,u&&cancelAnimationFrame(i)}})(...e,{animationFrame:"always"===N}),"whileElementsMounted"),elements:{reference:U.anchor},middleware:[{name:(m={name:"offset",options:n=r={mainAxis:P+J,alignmentAxis:T},async fn(e){var t,r;let{x:i,y:s,placement:o,middlewareData:a}=e,l=await ty(e,n);return o===(null==(t=a.offset)?void 0:t.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}).name,fn:m.fn,options:[r,void 0]},$&&{name:(v={name:"shift",options:a=o={mainAxis:!0,crossAxis:!1,limiter:"partial"===M?{fn:(i=void 0,{options:i={},fn(e){var t,r,n,s;let{x:o,y:a,placement:l,rects:u,middlewareData:c}=e,{offset:h=0,mainAxis:d=!0,crossAxis:p=!0}=e9(i,e),f={x:o,y:a},g=tn(l),m=tt(g),v=f[m],y=f[g],b=e9(h,e),_="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:null!=(t=b.mainAxis)?t:0,crossAxis:null!=(r=b.crossAxis)?r:0};if(d){let e="y"===m?"height":"width",t=u.reference[m]-u.floating[e]+_.mainAxis,r=u.reference[m]+u.reference[e]-_.mainAxis;v<t?v=t:v>r&&(v=r)}if(p){let e="y"===m?"width":"height",t=tv.has(e7(l)),r=u.reference[g]-u.floating[e]+(t&&(null==(n=c.offset)?void 0:n[g])||0)+(t?0:_.crossAxis),i=u.reference[g]+u.reference[e]+(t?0:(null==(s=c.offset)?void 0:s[g])||0)-(t?_.crossAxis:0);y<r?y=r:y>i&&(y=i)}return{[m]:v,[g]:y}}}).fn,options:[void 0,void 0]}:void 0,...Q},async fn(e){let{x:t,y:r,placement:n,platform:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:l={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...u}=e9(a,e),c={x:t,y:r},h=await i.detectOverflow(e,u),d=tn(n),p=tt(d),f=c[p],g=c[d],m=(e,t)=>e8(t+h["y"===e?"top":"left"],e2(t,t-h["y"===e?"bottom":"right"]));s&&(f=m(p,f)),o&&(g=m(d,g));let v=l.fn({...e,[p]:f,[d]:g});return{...v,data:{x:v.x-t,y:v.y-r,enabled:{[p]:s,[d]:o}}}}}).name,fn:v.fn,options:[o,void 0]},$&&{name:(b={name:"flip",options:u=l={...Q},async fn(e){var t,r,n,i,s,o,a,l;
31let c,h,d,{placement:p,middlewareData:f,rects:g,initialPlacement:m,platform:v,elements:y}=e,{mainAxis:b=!0,crossAxis:_=!0,fallbackPlacements:w,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:E=!0,...S}=e9(u,e);if(null!=(t=f.arrow)&&t.alignmentOffset)return{};let P=e7(p),R=tn(m),T=e7(m)===m,A=await (null==v.isRTL?void 0:v.isRTL(y.floating)),C=w||(T||!E?[tu(m)]:(c=tu(m),[ti(m),c,ti(c)])),j="none"!==x;!w&&j&&C.push(...(h=te(m),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?to:ts;return t?ts:to;case"left":case"right":return t?ta:tl;default:return[]}}(e7(m),"start"===x,A),h&&(d=d.map(e=>e+"-"+h),E&&(d=d.concat(d.map(ti)))),d));let O=[m,...C],$=await v.detectOverflow(e,S),I=[],L=(null==(r=f.flip)?void 0:r.overflows)||[];if(b&&I.push($[P]),_){let e,t,r,n,i=(o=p,a=g,void 0===(l=A)&&(l=!1),e=te(o),r=tr(t=tt(tn(o))),n="x"===t?e===(l?"end":"start")?"right":"left":"start"===e?"bottom":"top",a.reference[r]>a.floating[r]&&(n=tu(n)),[n,tu(n)]);I.push($[i[0]],$[i[1]])}if(L=[...L,{placement:p,overflows:I}],!I.every(e=>e<=0)){let e=((null==(n=f.flip)?void 0:n.index)||0)+1,t=O[e];if(t&&("alignment"!==_||R===tn(t)||L.every(e=>tn(e.placement)!==R||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:t}};let r=null==(i=L.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!r)switch(k){case"bestFit":{let e=null==(s=L.filter(e=>{if(j){let t=tn(e.placement);return t===R||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:s[0];e&&(r=e);break}case"initialPlacement":r=m}if(p!==r)return{reset:{placement:r}}}return{}}}).name,fn:b.fn,options:[l,void 0]},{name:(_={name:"size",options:h=c={...Q,apply:rr(({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{let{width:i,height:s}=t.reference,o=e.floating.style;o.setProperty("--radix-popper-available-width",`${r}px`),o.setProperty("--radix-popper-available-height",`${n}px`),o.setProperty("--radix-popper-anchor-width",`${i}px`),o.setProperty("--radix-popper-anchor-height",`${s}px`)},"apply")},async fn(e){let t,r,{placement:n,rects:i,platform:s,elements:o}=e,{apply:a=()=>{},...l}=e9(h,e),u=await s.detectOverflow(e,l),c=e7(n),d=te(n),p="y"===tn(n),{width:f,height:g}=i.floating;"top"===c||"bottom"===c?(t=c,r=d===(await (null==s.isRTL?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(r=c,t="end"===d?"top":"bottom");let m=g-u.top-u.bottom,v=f-u.left-u.right,y=e2(g-u[t],m),b=e2(f-u[r],v),_=e.middlewareData.shift,w=!_,k=y,x=b;null!=_&&_.enabled.x&&(x=v),null!=_&&_.enabled.y&&(k=m),w&&!d&&(p?x=f-2*e8(u.left,u.right):k=g-2*e8(u.top,u.bottom)),await a({...e,availableWidth:x,availableHeight:k});let E=await s.getDimensions(o.floating);return f!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}).name,fn:_.fn,options:[c,void 0]},q&&{name:(w={name:"arrow",options:p=d={element:q,padding:O},fn(e){let{element:t,padding:r}="function"==typeof p?p(e):p;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?t1({element:t.current,padding:r}).fn(e):{}:t?t1({element:t,padding:r}).fn(e):{}}}).name,fn:w.fn,options:[d,void 0]},rv({arrowWidth:K,arrowHeight:J}),D&&{name:(x={name:"hide",options:g=f={strategy:"referenceHidden",...Q,boundary:Z?Q.boundary:void 0},async fn(e){let{rects:t,platform:r}=e,{strategy:n="referenceHidden",...i}=e9(g,e);switch(n){case"referenceHidden":{let n=tg(await r.detectOverflow(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:n,referenceHidden:tm(n)}}}case"escaped":{let n=tg(await r.detectOverflow(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:n,escaped:tm(n)}}}default:return{}}}}).name,fn:x.fn,options:[f,void 0]}]}),es=U.setPlacementState;(0,A.N)(()=>(es(er),()=>{es(void 0)}),[er,es]);let[eo,ea]=ry(er),el=(0,re.c)(F);(0,A.N)(()=>{en&&el?.()},[en,el]);let eu=ei.arrow?.x,ec=ei.arrow?.y,eh=ei.arrow?.centerOffset!==0,[ed,ep]=y.useState();return(0,A.N)(()=>{V&&ep(window.getComputedStyle(V).zIndex)},[V]),(0,s.jsx)("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...et,transform:en?et.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ed,"--radix-popper-transform-origin":[ei.transformOrigin?.x,ei.transformOrigin?.y].join(" "),...ei.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,s.jsx)(rh,{scope:E,placedSide:eo,placedAlign:ea,onArrowChange:G,arrowX:eu,arrowY:ec,shouldHideArrow:eh,children:(0,s.jsx)(j.sG.div,{"data-side":eo,"data-align":ea,...B,ref:H,style:{...B.style,animation:en?B.style?.animation:"none"}})})})},"PopperContent")),rf={top:"bottom",right:"left",bottom:"top",left:"r
31ight"},rg=y.forwardRef(rr(function(e,t){let{__scopePopper:r,...n}=e,i=rd("PopperArrow",r),o=rf[i.placedSide];return(0,s.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,s.jsx)(t7,{...n,ref:t,style:{...n.style,display:"block"}})})},"PopperArrow"));function rm(e){return null!==e}rr(rm,"isNotNull");var rv=rr(e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:i}=t,s=i.arrow?.centerOffset!==0,o=s?0:e.arrowWidth,a=s?0:e.arrowHeight,[l,u]=ry(r),c={start:"0%",center:"50%",end:"100%"}[u],h=(i.arrow?.x??0)+o/2,d=(i.arrow?.y??0)+a/2,p="",f="";return"bottom"===l?(p=s?c:`${h}px`,f=`${-a}px`):"top"===l?(p=s?c:`${h}px`,f=`${n.floating.height+a}px`):"right"===l?(p=`${-a}px`,f=s?c:`${d}px`):"left"===l&&(p=`${n.floating.width+a}px`,f=s?c:`${d}px`),{data:{x:p,y:f}}}}),"transformOrigin");function ry(e){let[t,r="center"]=e.split("-");return[t,r]}rr(ry,"getSideAndAlignFromPlacement");var rb=r(71934),r_=r(71837),rw=r(60644),rk=r(79335),rx=Object.defineProperty,rE=(e,t)=>rx(e,"name",{value:t,configurable:!0}),rS="Popover",[rP,rR]=(0,x.A)(rS,[rs]),rT=rs(),[rA,rC]=rP(rS),rj=rE(e=>{let{__scopePopover:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:a=!1}=e,l=rT(t),u=y.useRef(null),[c,h]=y.useState(!1),[d,p]=(0,E.i)({prop:n,defaultProp:i??!1,onChange:o,caller:rS});return(0,s.jsx)(rl,{...l,children:(0,s.jsx)(rA,{scope:t,contentId:(0,e0.B)(),triggerRef:u,open:d,onOpenChange:p,onOpenToggle:y.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:c,onCustomAnchorAdd:y.useCallback(()=>h(!0),[]),onCustomAnchorRemove:y.useCallback(()=>h(!1),[]),modal:a,children:r})})},"Popover"),rO=y.forwardRef(rE(function(e,t){let{__scopePopover:r,...n}=e,i=rC("PopoverTrigger",r),o=rT(r),a=(0,k.s)(t,i.triggerRef),l=(0,s.jsx)(j.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":rq(i.open),...n,ref:a,onClick:(0,w.mK)(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:(0,s.jsx)(ru,{asChild:!0,...o,children:l})},"PopoverTrigger")),r$="PopoverPortal",[rI,rL]=rP(r$,{forceMount:void 0}),rM=rE(e=>{let{__scopePopover:t,forceMount:r,children:n,container:i}=e,o=rC(r$,t);return(0,s.jsx)(rI,{scope:t,forceMount:r,children:(0,s.jsx)(r_.C,{present:r||o.open,children:(0,s.jsx)(rb.Z,{asChild:!0,container:i,children:n})})})},"PopoverPortal"),rD="PopoverContent",rN=y.forwardRef(rE(function(e,t){let r=rL(rD,e.__scopePopover),{forceMount:n=r.forceMount,...i}=e,o=rC(rD,e.__scopePopover);return(0,s.jsx)(r_.C,{present:n||o.open,children:o.modal?(0,s.jsx)(rB,{...i,ref:t}):(0,s.jsx)(rU,{...i,ref:t})})},"PopoverContent")),rF=(0,O.TL)("PopoverContent.RemoveScroll"),rB=y.forwardRef(rE(function(e,t){let r=rC(rD,e.__scopePopover),n=y.useRef(null),i=(0,k.s)(t,n),o=y.useRef(!1);return y.useEffect(()=>{let e=n.current;if(e)return(0,rw.Eq)(e)},[]),(0,s.jsx)(rk.A,{as:rF,allowPinchZoom:!0,children:(0,s.jsx)(rV,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,w.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:(0,w.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;o.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,w.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),rU=y.forwardRef(rE(function(e,t){let r=rC(rD,e.__scopePopover),n=y.useRef(!1),i=y.useRef(!1);return(0,s.jsx)(rV,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let s=t.target;r.triggerRef.current?.contains(s)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})},"PopoverContentNonModal")),rV=y.forwardRef(rE(function(e,t){let{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:h,...d}=e,p=rC(rD,r),f=rT(r);return(0,eZ.Oh)(),(0,s.jsx)(eQ.n,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,s.jsx)(eX.qW,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,s.jsx)(rp,{"data-state":rq(p.open),role:"dialog",id:p.contentId,...f,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),rW=y.forwardRef(rE(function(e,t){let{__scopePopover:r,...n}=e,i=rC("PopoverClose",r);return(0,s.jsx)(j.sG.button,{type:"button",...n,ref:t,onClick:(0,w.mK)(e.onClick,()=>i.onOpenChange(!1))})},"PopoverClose")),rH=y.forwardRef(rE(function(e,t){let{__scopePopover:r,...n}=e,i=rT(r);return(0,s.jsx)(rg,{...i,...n,ref:t})},"PopoverArrow"));function rq(e){return e?"open":"closed"}rE(rq,"getState");let rG=({trigger:e,content:t,align:r,side:n,showClose:i,noSpacing:a,open:l,onOpenChange:u,asModal:c})=>(0,s.jsxs)(rj,{onOpenChange:u,open:l,modal:c??!0,children:[(0,s.jsx)(rO,{asChild:!0,children:(0,s.jsx)("div",{children:e})}),(0,s.jsx)(rM,{asChild:!0,children:(0,s.jsx)(rN,{sideOffset:10,side:n??"bottom",align:r??"center",className:"z-200 relative focus:outline-none",children:(0,s.jsx)(nV,{className:(0,o.A)("shadow-[0_2px_20px_rgba(0,0,0,0.3)] dark:shadow-[0_2px_20px_rgba(0,0,0,0.5)] ring-1 ring-gray-400/20 dark:ring-gray-700 bg-white/80 backdrop-blur-xl dark:bg-gray-900/80 rounded-xl w-full relative z-10",!a&&"px-4 py-5"),initial:{opacity:0,scale:.8}
31,animate:{opacity:1,scale:1,transition:{duration:.1,type:"spring"}},exit:{opacity:0,scale:.8},children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(rH,{className:"fill-white/80 dark:fill-gray-700 w-3 h-2"}),i?(0,s.jsx)(rW,{}):"",t]})})})})]}),rz=({id:e,label:t,value:r,checked:n,onChange:i,labelClass:a,wrapperClass:l})=>(0,s.jsxs)("div",{className:(0,o.A)("flex justify-center items-center group",l),children:[(0,s.jsx)("input",{className:"hidden",type:"checkbox",checked:n,value:r,id:e,onChange:i}),(0,s.jsx)("div",{onClick:i,className:(0,o.A)(""),children:(0,s.jsx)(m.N,{children:n?(0,s.jsx)("div",{className:(0,o.A)("w-5 h-5 rounded-md flex items-center justify-center mr-2","bg-linear-to-br from-[#737373] to-[#262626] dark:from-[#e5e5e5] dark:to-[#a3a3a3] text-white dark:text-black border border-gray-800 dark:border-gray-200 cursor-pointer"),children:(0,s.jsx)(nV,{initial:{opacity:0,scale:1.5},animate:{opacity:1,scale:1},children:(0,s.jsx)(eL.A,{size:16,weight:"bold"})})}):(0,s.jsx)("div",{className:(0,o.A)("w-5 h-5 rounded-md flex items-center justify-center mr-2","border border-gray-400 bg-white dark:bg-gray-800 dark:border-gray-600 group-hover:border-gray-600 dark:group-hover:border-gray-500 cursor-pointer")})})}),t?(0,s.jsx)("label",{className:(0,o.A)("form-check-label inline-block text-gray-800 dark:text-gray-100 cursor-pointer text-sm",a),htmlFor:e,children:t}):""]}),rK=({children:e,fontSize:t,className:r})=>(0,s.jsx)("span",{title:`Shortcut Key: ${e}`,className:(0,o.A)("dark:bg-gray-800/90 font-code bg-white shadow-sm px-2 py-px rounded-md border dark:border-gray-600 text-gray-600 mx-px dark:text-gray-300 border-gray-300 border-b-[3px] dark:border-b-gray-700",t??"text-xs",r),children:e});var rJ=Object.defineProperty,rY=(e,t)=>rJ(e,"name",{value:t,configurable:!0}),rX=!1;function rZ(){let[e,t]=y.useState(rX);return y.useEffect(()=>{rX||(rX=!0,t(!0))},[]),e}rY(rZ,"useIsHydrated");var rQ=b[" useSyncExternalStore ".trim().toString()];function r0(){return()=>{}}function r1(){return rQ(r0,()=>!0,()=>!1)}rY(r0,"subscribe"),rY(r1,"useIsHydratedModern");var r2="function"==typeof rQ?r1:rZ,r8=Object.defineProperty,r6=(e,t)=>r8(e,"name",{value:t,configurable:!0}),r3="rovingFocusGroup.onEntryFocus",r5={bubbles:!1,cancelable:!0},r4="RovingFocusGroup",[r9,r7,ne]=L(r4),[nt,nr]=(0,x.A)(r4,[ne]),[nn,ni]=nt(r4),ns=y.forwardRef(r6(function(e,t){return(0,s.jsx)(r9.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(r9.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(no,{...e,ref:t})})})},"RovingFocusGroup")),no=y.forwardRef(r6(function(e,t){let{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,p=y.useRef(null),f=(0,k.s)(t,p),g=R(o),[m,v]=(0,E.i)({prop:a,defaultProp:l??null,onChange:u,caller:r4}),[b,_]=y.useState(!1),x=(0,re.c)(c),S=r7(r),P=y.useRef(!1),[T,A]=y.useState(0);return y.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(r3,x),()=>e.removeEventListener(r3,x)},[x]),(0,s.jsx)(nn,{scope:r,orientation:n,dir:g,loop:i,currentTabStopId:m,onItemFocus:y.useCallback(e=>v(e),[v]),onItemShiftTab:y.useCallback(()=>_(!0),[]),onFocusableItemAdd:y.useCallback(()=>A(e=>e+1),[]),onFocusableItemRemove:y.useCallback(()=>A(e=>e-1),[]),children:(0,s.jsx)(j.sG.div,{tabIndex:b||0===T?-1:0,"data-orientation":n,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:(0,w.mK)(e.onMouseDown,()=>{P.current=!0}),onFocus:(0,w.mK)(e.onFocus,e=>{let t=!P.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(r3,r5);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);nh([e.find(e=>e.active),e.find(e=>e.id===m),...e].filter(Boolean).map(e=>e.ref.current),h)}}P.current=!1}),onBlur:(0,w.mK)(e.onBlur,()=>_(!1))})})},"RovingFocusGroupImpl")),na=y.forwardRef(r6(function(e,t){let{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,children:a,...l}=e,u=(0,e0.B)(),c=o||u,h=ni("RovingFocusGroupItem",r),d=h.currentTabStopId===c,p=r7(r),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:m}=h,v=r2();return(0,A.N)(()=>
31{if(v&&n)return f(),()=>g()},[v,n,f,g]),y.useEffect(()=>{if(!v&&n)return f(),()=>g()},[v,n,f,g]),(0,s.jsx)(r9.ItemSlot,{scope:r,id:c,focusable:n,active:i,children:(0,s.jsx)(j.sG.span,{tabIndex:d?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:(0,w.mK)(e.onMouseDown,e=>{n?h.onItemFocus(c):e.preventDefault()}),onFocus:(0,w.mK)(e.onFocus,()=>h.onItemFocus(c)),onKeyDown:(0,w.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=nc(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=h.loop?nd(r,n+1):r.slice(n+1)}setTimeout(()=>nh(r))}}),children:"function"==typeof a?a({isCurrentTabStop:d,hasTabStop:null!=m}):a})})},"RovingFocusGroupItem")),nl={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nu(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function nc(e,t,r){let n=nu(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return nl[n]}function nh(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function nd(e,t){return e.map((r,n)=>e[(t+n)%e.length])}r6(nu,"getDirectionAwareKey"),r6(nc,"getFocusIntent"),r6(nh,"focusFirst"),r6(nd,"wrapArray");var np=Object.defineProperty,nf=(e,t)=>np(e,"name",{value:t,configurable:!0}),ng="Radio",[nm,nv]=(0,x.A)(ng),[ny,nb]=nm(ng);function n_(e){let{__scopeRadio:t,checked:r=!1,children:n,disabled:i,form:o,name:a,onCheck:l,required:u,value:c="on",internal_do_not_use_render:h}=e,[d,p]=y.useState(null),[f,g]=y.useState(null),m=y.useRef(!1),[v,b]=y.useReducer(e=>e+1,0),_=!d||!!o||!!d.closest("form"),w={checked:r,disabled:i,required:u,name:a,form:o,value:c,control:d,setControl:p,hasConsumerStoppedPropagationRef:m,userInteractionCount:v,onUserInteraction:b,isFormControl:_,bubbleInput:f,setBubbleInput:g,onCheck:nf(()=>l?.(),"onCheck")};return(0,s.jsx)(ny,{scope:t,...w,children:nE(h)?h(w):n})}nf(n_,"RadioProvider");var nw=y.forwardRef(nf(function({__scopeRadio:e,onClick:t,...r},n){let{checked:i,disabled:o,value:a,setControl:l,onCheck:u,hasConsumerStoppedPropagationRef:c,onUserInteraction:h,isFormControl:d,bubbleInput:p}=nb("RadioTrigger",e),f=(0,k.s)(n,l);return(0,s.jsx)(j.sG.button,{type:"button",role:"radio","aria-checked":i,"data-state":nS(i),"data-disabled":o?"":void 0,disabled:o,value:a,...r,ref:f,onClick:(0,w.mK)(t,e=>{i||(h(),u()),p&&d&&(c.current=e.isPropagationStopped(),c.current||e.stopPropagation())})})},"RadioTrigger")),nk=y.forwardRef(nf(function(e,t){let{__scopeRadio:r,forceMount:n,...i}=e,o=nb("RadioIndicator",r);return(0,s.jsx)(r_.C,{present:n||o.checked,children:(0,s.jsx)(j.sG.span,{"data-state":nS(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t})})},"RadioIndicator")),nx=y.forwardRef(nf(function({__scopeRadio:e,onClick:t,...r},n){let{control:i,checked:o,required:a,disabled:l,name:u,value:c,form:h,bubbleInput:d,setBubbleInput:p,hasConsumerStoppedPropagationRef:f,userInteractionCount:g}=nb("RadioBubbleInput",e),m=(0,k.s)(n,p),v=C(i),b=y.useRef(!1),_=y.useRef(o),x=y.useRef(g);y.useEffect(()=>{if(!d)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=g!==x.current;x.current=g;let r=_.current!==o;_.current=o;let n=!(t&&f.current);if(r&&e){b.current=!t;let r=new Event("click",{bubbles:n});e.call(d,o),d.dispatchEvent(r),b.current=!1}},[d,o,f,g]);let E=y.useRef(o);return(0,s.jsx)(j.sG.input,{type:"radio","aria-hidden":!0,defaultChecked:E.current,required:a,disabled:l,name:u,value:c,form:h,...r,tabIndex:-1,ref:m,onClick:(0,w.mK)(t,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function nE(e){return"function"==typeof e}function nS(e){return e?"checked":"unchecked"}nf(nE,"isFunction"),nf(nS,"getState");var nP=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],nR="RadioGroup",[nT,nA]=(0,x.A)(nR,[nr,nv]),nC=nr(),nj=nv(),[nO,n$]=nT(nR),nI=y.forwardRef(nf(function(e,t){let{__scopeRadioGroup:r,name:n,form:i,defaultValue:o,value:a,required:l=!1,disabled:u=!1,orientation:c,dir:h,loop:d=!0,onValueChange:p,...f}=e,g=nC(r),m=R(h),[v,b]=(0,E.i)({prop:a,defaultProp:o??null,onChange:p,caller:nR}),[_,w]=y.useState(null),x=(0,k.s)(t,w),S=y.useRef(v);return y.useEffect(()=>{let e=i?_?.ownerDocument.getElementById(i):_?.closest("form");if(e instanceof HTMLFormElement){let t=nf(()=>b(S.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[_,i,b]),(0,s.jsx)(nO,{scope:r,name:n,form:i,required:l,disabled:u,value:v,onValueChange:b,children:(0,s.jsx)(ns,{asChild:!0,...g,orientation:c,dir:m,loop:d,children:(0,s.jsx)(j.sG.div,{role:"radiogroup","aria-required":l,"aria-orientation":c,"data-disabled":u?"":void 0,dir:m,...f,ref:x})})})},"RadioGroup"));function nL(e){let{__scopeRadioGroup:t,value:r,disabled:n,children:i,internal_do_not_use_render:o}=e,a=n$("RadioGroupItemProvider",t),l=nj(t),u=a.disabled||n;return(0,s.jsx)(n_,{...l,checked:a.value===r,disabled:u,required:a.required,name:a.name,form:a.form,value:r,onCheck:()=>a.onValueChange(r),internal_do_not_use_render:o,children:i})}nf(nL,"RadioGroupItemProvider");var nM=y.forwardRef(nf(function(e,t){let{__scopeRadioGroup:r,...n}=e,i=nC(r),o=nj(r),{checked:a,disabled:l}=nb("RadioGroupItemTrigger",o.__scopeRadio),u=y.useRef(null),c=(0,k.s)(t,u),h=y.useRef(!1);return y.useEffect(()=>{let e=nf(e=>
31{nP.includes(e.key)&&(h.current=!0)},"handleKeyDown"),t=nf(()=>h.current=!1,"handleKeyUp");return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),(0,s.jsx)(na,{asChild:!0,...i,focusable:!l,active:a,children:(0,s.jsx)(nw,{...o,...n,ref:c,onKeyDown:(0,w.mK)(n.onKeyDown,e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:(0,w.mK)(n.onFocus,()=>{h.current&&u.current?.click()})})})},"RadioGroupItemTrigger")),nD=y.forwardRef(nf(function(e,t){let{__scopeRadioGroup:r,value:n,disabled:i,...o}=e;return(0,s.jsx)(nL,{__scopeRadioGroup:r,value:n,disabled:i,internal_do_not_use_render:({isFormControl:e})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nM,{...o,ref:t,__scopeRadioGroup:r}),e&&(0,s.jsx)(nN,{__scopeRadioGroup:r})]})})},"RadioGroupItem")),nN=y.forwardRef(nf(function(e,t){let{__scopeRadioGroup:r,...n}=e,i=nj(r);return(0,s.jsx)(nx,{...i,...n,ref:t})},"RadioGroupItemBubbleInput")),nF=y.forwardRef(nf(function(e,t){let{__scopeRadioGroup:r,...n}=e,i=nj(r);return(0,s.jsx)(nk,{...i,...n,ref:t})},"RadioGroupIndicator"));let nB=({items:e,selected:t,onChange:r,label:n,orientation:i,labelClass:a}={})=>{let l="vertical"===i;return(0,s.jsxs)("div",{className:"w-full",children:[n?(0,s.jsx)("div",{children:n}):"",(0,s.jsx)(nI,{value:t,onValueChange:r,className:(0,o.A)("flex items-start",l?"flex-col space-y-4":"space-x-6"),orientation:i,children:e?.map(e=>(0,s.jsxs)(nD,{value:e?.value,className:(0,o.A)("flex items-center group"),children:[(0,s.jsx)(m.N,{children:e?.value===t?(0,s.jsx)(nF,{className:(0,o.A)("w-5 h-5 rounded-md flex items-center justify-center mr-2","bg-linear-to-br from-[#737373] to-[#262626] dark:from-[#e5e5e5] dark:to-[#a3a3a3] text-white dark:text-black border border-gray-800 dark:border-gray-200"),children:(0,s.jsx)(nV,{initial:{opacity:0,scale:1.5},animate:{opacity:1,scale:1},children:(0,s.jsx)(eL.A,{size:16,weight:"bold"})})}):(0,s.jsx)("div",{className:(0,o.A)("w-5 h-5 rounded-md flex items-center justify-center mr-2","border border-gray-400 bg-white dark:bg-gray-800 dark:border-gray-600 group-hover:border-gray-600 dark:group-hover:border-gray-500")})}),(0,s.jsx)("div",{className:(0,o.A)("text-sm",a),children:e?.name}),e?.description?(0,s.jsx)("div",{children:e?.description}):""]},e.name))})]})};var nU=r(34981);let nV=e=>{let{children:t,initial:r,animate:n,variants:i,className:o,style:a,exit:l,type:u}=e;return"default"===u?(0,s.jsx)(nU.P.div,{...e,initial:r??"hidden",animate:n??"visible",exit:l??"exit",variants:{hidden:{opacity:0,scale:1.1,y:20},visible:{opacity:1,scale:1,y:0,transition:{duration:.25,delay:.1,type:"spring"}},exit:{opacity:0,scale:1.1,y:20,transition:{duration:.25,delay:.1,type:"spring"}}},className:o??"",style:a??"",children:t}):"custom"===u?(0,s.jsx)(nU.P.div,{...e,className:o??"",style:a??"",children:t}):(0,s.jsx)(nU.P.div,{...e,initial:r??"hidden",animate:n??"visible",variants:i,className:o??"",style:a??"",children:t})};var nW=Object.defineProperty,nH=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),nq=y.forwardRef(nW(function(e,t){return(0,s.jsx)(j.sG.span,{...e,ref:t,style:{...nH,...e.style}})},"name",{value:"VisuallyHidden",configurable:!0})),nG=Object.defineProperty,nz=(e,t)=>nG(e,"name",{value:t,configurable:!0}),[nK,nJ]=(0,x.A)("Tooltip",[rs]),nY=rs(),nX="tooltip.open",[nZ,nQ]=nK("TooltipProvider"),n0=nz(e=>{let{__scopeTooltip:t,delayDuration:r=700,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:o}=e,a=y.useRef(!0),l=y.useRef(!1),u=y.useRef(0);return y.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,s.jsx)(nZ,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:y.useCallback(()=>{n<=0||(window.clearTimeout(u.current),a.current=!1)},[n]),onClose:y.useCallback(()=>{n<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,n))},[n]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(e=>{l.current=e}
31,[]),disableHoverableContent:i,children:o})},"TooltipProvider"),n1="Tooltip",[n2,n8]=nK(n1),n6=nz(e=>{let{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,u=nQ(n1,e.__scopeTooltip),c=nY(t),[h,d]=y.useState(null),[p,f]=y.useState(void 0),g=(0,e0.B)(),m=y.useRef(0),v=a??u.disableHoverableContent,b=l??u.delayDuration,_=y.useRef(!1),[w,k]=(0,E.i)({prop:n,defaultProp:i??!1,onChange:nz(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(nX))):u.onClose(),o?.(e)},"onChange"),caller:n1}),x=y.useMemo(()=>w?_.current?"delayed-open":"instant-open":"closed",[w]),S=y.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_.current=!1,k(!0)},[k]),P=y.useCallback(()=>{window.clearTimeout(m.current),m.current=0,k(!1)},[k]),R=y.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{_.current=!0,k(!0),m.current=0},b)},[b,k]);return y.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),(0,s.jsx)(rl,{...c,children:(0,s.jsx)(n2,{scope:t,contentId:p??g,setContentId:f,open:w,stateAttribute:x,trigger:h,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{u.isOpenDelayedRef.current?R():S()},[u.isOpenDelayedRef,R,S]),onTriggerLeave:y.useCallback(()=>{v?P():(window.clearTimeout(m.current),m.current=0)},[P,v]),onOpen:S,onClose:P,disableHoverableContent:v,children:r})})},"Tooltip"),n3="TooltipTrigger",n5=y.forwardRef(nz(function(e,t){let{__scopeTooltip:r,...n}=e,i=n8(n3,r),o=nQ(n3,r),a=nY(r),l=y.useRef(null),u=(0,k.s)(t,l,i.onTriggerChange),c=y.useRef(!1),h=y.useRef(!1),d=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,s.jsx)(ru,{asChild:!0,...a,children:(0,s.jsx)(j.sG.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:u,onPointerMove:(0,w.mK)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(h.current||o.isPointerInTransitRef.current||(i.onTriggerEnter(),h.current=!0))}),onPointerLeave:(0,w.mK)(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:(0,w.mK)(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:(0,w.mK)(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:(0,w.mK)(e.onBlur,i.onClose),onClick:(0,w.mK)(e.onClick,i.onClose)})})},"TooltipTrigger")),n4="TooltipPortal",[n9,n7]=nK(n4,{forceMount:void 0}),ie=nz(e=>{let{__scopeTooltip:t,forceMount:r,children:n,container:i}=e,o=n8(n4,t);return(0,s.jsx)(n9,{scope:t,forceMount:r,children:(0,s.jsx)(r_.C,{present:r||o.open,children:(0,s.jsx)(rb.Z,{asChild:!0,container:i,children:n})})})},"TooltipPortal"),it="TooltipContent",ir=y.forwardRef(nz(function(e,t){let r=n7(it,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...o}=e,a=n8(it,e.__scopeTooltip);return(0,s.jsx)(r_.C,{present:n||a.open,children:a.disableHoverableContent?(0,s.jsx)(io,{side:i,...o,ref:t}):(0,s.jsx)(ii,{side:i,...o,ref:t})})},"TooltipContent")),ii=y.forwardRef(nz(function(e,t){let r=n8(it,e.__scopeTooltip),n=nQ(it,e.__scopeTooltip),i=y.useRef(null),o=(0,k.s)(t,i),[a,l]=y.useState(null),{trigger:u,onClose:c}=r,h=i.current,{onPointerInTransitChange:d}=n,p=y.useCallback(()=>{l(null),d(!1)},[d]),f=y.useCallback((e,t)=>{let r=e.currentTarget,n={x:e.clientX,y:e.clientY},i=il(n,r.getBoundingClientRect());l(id([...iu(n,i),...ic(t.getBoundingClientRect())])),d(!0)},[d]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(u&&h){let e=nz(e=>f(e,h),"handleTriggerLeave"),t=nz(e=>f(e,u),"handleContentLeave");return u.addEventListener("pointerleave",e),h.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),h.removeEventListener("pointerleave",t)}}},[u,h,f,p]),y.useEffect(()=>{if(a){let e=nz(e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=u?.contains(t)||h?.contains(t),i=!ih(r,a);n?p():i&&(p(),c())},"handleTrackPointerGrace");return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,h,a,c,p]),(0,s.jsx)(io,{...e,ref:o})},"TooltipContentHoverable")),is=(0,O.Dc)("TooltipContent"),io=y.forwardRef(nz(function(e,t){let{__scopeTooltip:r,children:n,"aria-label":i,id:o,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=e,c=n8(it,r),h=nY(r),{onClose:d}=c;y.useEffect(()=>(document.addEventListener(nX,d),()=>document.removeEventListener(nX,d)),[d]),y.useEffect(()=>{if(c.trigger){let e=nz(e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&d()},"handleScroll");return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,d]);let{setContentId:p}=c;return(0,A.N)(()=>(p(o),()=>{p(void 0)}),[o,p]),(0,s.jsx)(eX.qW,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,s.jsxs)(rp,{"data-state":c.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:c.contentId,...h,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,s.jsx)(is,{children:n}),i?(0,s.jsx)(nq,{id:c.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl")),ia=y.forwardRef(nz(function(e,t){let{__scopeTooltip:r,...n}=e,i=nY(r);return(0,s.jsx)(rg,{...i,...n,ref:t})},"TooltipArrow"));function il(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);
31switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}function iu(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}function ic(e){let{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function ih(e,t){let{x:r,y:n}=e,i=!1;for(let e=0,s=t.length-1;e<t.length;s=e++){let o=t[e],a=t[s],l=o.x,u=o.y,c=a.x,h=a.y;u>n!=h>n&&r<(c-l)*(n-u)/(h-u)+l&&(i=!i)}return i}function id(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),ip(t)}function ip(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r<e.length;r++){let n=e[r];for(;t.length>=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}nz(il,"getExitSideFromRect"),nz(iu,"getPaddedExitPoints"),nz(ic,"getPointsFromRect"),nz(ih,"isPointInPolygon"),nz(id,"getHull"),nz(ip,"getHullPresorted");let ig=({children:e,text:t,delay:r,align:n,side:i,hasShortcut:a,triggerClass:l,noSpacing:u,sideOffset:c,alignOffset:h,show:d=!0,arrowClass:p}={})=>(0,s.jsx)(n0,{children:(0,s.jsxs)(n6,{delayDuration:r??20,children:[(0,s.jsx)(n5,{className:`focus:outline-none ${l||""}`,asChild:!0,children:(0,s.jsx)("div",{children:e})}),d?(0,s.jsx)(ie,{className:"relative z-99999",children:(0,s.jsx)(ir,{side:i??"top",align:n??"center",sideOffset:c??5,alignOffset:h??5,className:"relative z-999999",children:(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(nV,{className:(0,o.A)("bg-gray-900 text-gray-200 text-[0.8rem] flex items-center rounded-lg dark:text-white dark:bg-gray-800 shadow-xl dark:shadow-black/20",u?"":"px-2 py-1"),initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1,transition:{duration:.2,type:"spring"}},exit:{opacity:0,scale:.8},children:[t,a?(0,s.jsx)("span",{className:"font-mono text-[0.84rem] leading-none py-px ml-1 bg-gray-700 dark:bg-gray-700 rounded px-2 shadow-black/40 text-white",children:a}):"",(0,s.jsx)(ia,{className:(0,o.A)(p??"dark:fill-gray-800")})]})})})}):""]})});var im=Object.defineProperty,iv=y.forwardRef(im(function(e,t){let{pressed:r,defaultPressed:n,onPressedCh
31ange:i,...o}=e,[a,l]=(0,E.i)({prop:r,onChange:i,defaultProp:n??!1,caller:"Toggle"});return(0,s.jsx)(j.sG.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:(0,w.mK)(e.onClick,()=>{e.disabled||l(!a)})})},"name",{value:"Toggle",configurable:!0})),iy=Object.defineProperty,ib=(e,t)=>iy(e,"name",{value:t,configurable:!0}),i_="ToggleGroup",[iw,ik]=(0,x.A)(i_,[nr]),ix=nr(),iE=y.forwardRef(ib(function(e,t){let{type:r,...n}=e;if("single"===r)return(0,s.jsx)(iR,{role:"radiogroup",...n,ref:t});if("multiple"===r)return(0,s.jsx)(iT,{role:"toolbar",...n,ref:t});throw Error(`Missing prop \`type\` expected on \`${i_}\``)},"ToggleGroup")),[iS,iP]=iw(i_),iR=y.forwardRef(ib(function(e,t){let{value:r,defaultValue:n,onValueChange:i=ib(()=>{},"onValueChange"),...o}=e,[a,l]=(0,E.i)({prop:r,defaultProp:n??"",onChange:i,caller:i_});return(0,s.jsx)(iS,{scope:e.__scopeToggleGroup,type:"single",value:y.useMemo(()=>a?[a]:[],[a]),onItemActivate:l,onItemDeactivate:y.useCallback(()=>l(""),[l]),children:(0,s.jsx)(ij,{...o,ref:t})})},"ToggleGroupImplSingle")),iT=y.forwardRef(ib(function(e,t){let{value:r,defaultValue:n,onValueChange:i=ib(()=>{},"onValueChange"),...o}=e,[a,l]=(0,E.i)({prop:r,defaultProp:n??[],onChange:i,caller:i_}),u=y.useCallback(e=>l((t=[])=>[...t,e]),[l]),c=y.useCallback(e=>l((t=[])=>t.filter(t=>t!==e)),[l]);return(0,s.jsx)(iS,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:u,onItemDeactivate:c,children:(0,s.jsx)(ij,{...o,ref:t})})},"ToggleGroupImplMultiple")),[iA,iC]=iw(i_),ij=y.forwardRef(ib(function(e,t){let{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:i=!0,orientation:o,dir:a,loop:l=!0,...u}=e,c=ix(r),h=R(a),d={dir:h,...u};return(0,s.jsx)(iA,{scope:r,rovingFocus:i,disabled:n,children:i?(0,s.jsx)(ns,{asChild:!0,...c,orientation:o,dir:h,loop:l,children:(0,s.jsx)(j.sG.div,{...d,ref:t})}):(0,s.jsx)(j.sG.div,{...d,ref:t})})},"ToggleGroupImpl")),iO="ToggleGroupItem",i$=y.forwardRef(ib(function(e,t){let r=iP(iO,e.__scopeToggleGroup),n=iC(iO,e.__scopeToggleGroup),i=ix(e.__scopeToggleGroup),o=r.value.includes(e.value),a=n.disabled||e.disabled,l={...e,pressed:o,disabled:a},u=y.useRef(null);return n.rovingFocus?(0,s.jsx)(na,{asChild:!0,...i,focusable:!a,active:o,ref:u,children:(0,s.jsx)(iI,{...l,ref:t})}):(0,s.jsx)(iI,{...l,ref:t})},"ToggleGroupItem")),iI=y.forwardRef(ib(function(e,t){let{__scopeToggleGroup:r,value:n,...i}=e,o=iP(iO,r),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l="single"===o.type?a:void 0;return(0,s.jsx)(iv,{...l,...i,ref:t,onPressedChange:e=>{e?o.onItemActivate(n):o.onItemDeactivate(n)}})},"ToggleGroupItemImpl"));let iL=({label:e,items:t,value:r,onChange:n,type:i})=>(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[e?(0,s.jsx)("div",{className:"text-sm font-semibold dark:text-gray-200 flex items-center whitespace-nowrap",children:e}):"",(0,s.jsx)("div",{className:(0,o.A)(e?"max-w-[50%] w-full":"w-full"),children:(0,s.jsx)(iE,{type:i??"single",value:r,onValueChange:n,className:"flex items-center border rounded-lg text-sm dark:border-gray-700 divide-x divide-gray-300 dark:divide-gray-700 overflow-hidden bg-white border-gray-300 shadow-[0_1px_6px_rgba(0,0,0,0.1)] dark:bg-gray-900 p-[2px]",children:t?.map(e=>(0,s.jsx)(i$,{value:e.value,"aria-label":e.value,className:(0,o.A)("h-[24px] w-full rounded-[6px] duration-100 ease-in-out",r===e.value?"bg-linear-to-br from-[#737373] to-[#262626] dark:from-[#e5e5e5] dark:to-[#a3a3a3] text-white dark:text-black border border-gray-900! px-2":"text-gray-500 dark:text-gray-400 border-none mx-[10px] opacity-70 hover:opacity-100"),children:e.content},e.value))})})]}),iM=e=>(0,s.jsxs)("div",{className:"w-full",children:[e?.label?(0,s.jsx)("label",{className:"flex mb-px text-sm font-semibold dark:text-white",children:e?.label}):"",(0,s.jsx)("textarea",{...e,type:e.type||"text",className:"shadow dark:bg-gray-900 dark:text-white dark:border-gray-600 border border-gray-200 px-4 py-[6px] rounded-lg my-1 outline-none w-full dark:placeholder-gray-500 dark:hover:border-pink-700 dark:focus:border-pink-700 hover:border-pink-400 focus:border-pink-400 "+(e.className?e.className:""),ref:t=>{e.passref&&(e.passref.current=t)}}),e.error&&(0,s.jsxs)("div",{className:"flex items-center text-sm font-semibold text-red-400",children:[(0,s.jsx)("i",{className:"mr-1 ri-error-warning-line"}),e.error]})]});var iD=Object.defineProperty,iN=(e,t)=>iD(e,"name",{value:t,configurable:!0}),iF="Tabs",[iB,iU]=(0,x.A)(iF,[nr]),iV=nr(),[iW,iH]=iB(iF),iq=y.forwardRef(iN(function(e,t){let{__scopeTabs:r,value:n,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:l,activationMode:u="automatic",...c}=e,h=R(l),[d,p]=(0,E.i)({prop:n,onChange:i,defaultProp:o??"",caller:iF});return(0,s.jsx)(iW,{scope:r,baseId:(0,e0.B)(),value:d,onValueChange:p,orientation:a,dir:h,activationMode:u,children:(0,s.jsx)(j.sG.div,{dir:h,"data-orientation":a,...c,ref:t})})},"Tabs")),iG=y.forwardRef(iN(function(e,t){let{__scopeTabs:r,loop:n=!0,...i}=e,o=iH("TabsList",r),a=iV(r);return(0,s.jsx)(ns,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:n,children:(0,s.jsx)(j.sG.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})},"TabsList")),iz=y.forwardRef(iN(function(e,t){let{__scopeTabs:r,value:n,disabled:i=!1,...o}=e,a=iH("TabsTrigger",r),l=iV(r),u=iJ(a.baseId,n),c=iY(a.baseId,n),h=n===a.value;return(0,s.jsx)(na,{asChild:!0,...l,focusable:!i,active:h,children:(0,s.jsx)(j.sG.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":c,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:(0,w.mK)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(n)}),onKeyDown:(0,w.mK)(e.onKeyDown,e=>
31{!i&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&a.onValueChange(n)}),onFocus:(0,w.mK)(e.onFocus,()=>{let e="manual"!==a.activationMode;h||i||!e||a.onValueChange(n)})})})},"TabsTrigger")),iK=y.forwardRef(iN(function(e,t){let{__scopeTabs:r,value:n,forceMount:i,children:o,...a}=e,l=iH("TabsContent",r),u=iJ(l.baseId,n),c=iY(l.baseId,n),h=n===l.value,d=y.useRef(h);return y.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,s.jsx)(r_.C,{present:i||h,children:({present:r})=>(0,s.jsx)(j.sG.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:r&&o})})},"TabsContent"));function iJ(e,t){return`${e}-trigger-${t}`}function iY(e,t){return`${e}-content-${t}`}iN(iJ,"makeTriggerId"),iN(iY,"makeContentId");let iX=({items:e,value:t,defaultValue:r,onTabChange:n}={})=>{let[i,a]=(0,y.useState)(t??r);return(0,s.jsxs)(iq,{defaultValue:r,value:t,onValueChange:e=>{a(e),n&&n(e)},className:"w-full",children:[(0,s.jsx)(iG,{className:"bg-gray-200/50 dark:bg-gray-800/90 mb-1 rounded-lg p-[3px] text-sm text-center cursor-pointer whitespace-nowrap grid gap-x-3 border border-gray-200 dark:border-gray-800 overflow-auto justify-between w-full",style:{gridTemplateColumns:`repeat(${e?.length}, 1fr)`},children:e?.map((e,t)=>(0,s.jsx)(iz,{value:e.key,className:(0,o.A)("md:w-full px-2 py-1 font-medium",e.key===i?"dark:bg-gray-900 bg-white rounded-[6px] shadow-[0_0_2px_rgba(0,0,0,0.2)] border-gray-300 dark:border-gray-600":"hover:opacity-100 opacity-50 border-transparent"),children:e?.trigger},e.key))}),e?.map((e,t)=>(0,s.jsx)(iK,{value:e.key,children:e.content},e.key))]})};r(62091);var iZ=r(67938),iQ=r.n(iZ),i0=r(25393),i1=r(20142),i2=new Map;i2.set("bold",function(e){return y.createElement(y.Fragment,null,y.createElement("path",{d:"M158.6,142.6l-56,56a31.7,31.7,0,0,1-30.9,8.3L48.3,217.1a8,8,0,0,1-8.8-1.6h0a5.7,5.7,0,0,1-1.2-6.4l10.8-24.8a31.7,31.7,0,0,1,8.3-30.9l56-56",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),y.createElement("path",{d:"M187.8,107.8l4.9,4.9a16.1,16.1,0,0,1,0,22.6l-15,15a8,8,0,0,1-11.4,0L105.7,89.7a8,8,0,0,1,0-11.4l15-15a16.1,16.1,0,0,1,22.6,0l4.9,4.9,19.6-19.6c10.8-10.8,28.4-11.4,39.4-.9a28,28,0,0,1,.6,40.1Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}))}),i2.set("duotone",function(e){return y.createElement(y.Fragment,null,y.createElement("path",{d:"M179.8,115.8l4.9,4.9a16.1,16.1,0,0,1,0,22.6l-7,7a8,8,0,0,1-11.4,0L105.7,89.7a8,8,0,0,1,0-11.4l7-7a16.1,16.1,0,0,1,22.6,0l4.9,4.9,27.6-27.6c10.8-10.8,28.4-11.4,39.4-.9a28,28,0,0,1,.6,40.1Z",opacity:"0.2"}),y.createElement("path",{d:"M179.8,115.8l4.9,4.9a16.1,16.1,0,0,1,0,22.6l-7,7a8,8,0,0,1-11.4,0L105.7,89.7a8,8,0,0,1,0-11.4l7-7a16.1,16.1,0,0,1,22.6,0l4.9,4.9,27.6-27.6c10.8-10.8,28.4-11.4,39.4-.9a28,28,0,0,1,.6,40.1Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),y.createElement("path",{d:"M158.6,142.6l-56,56a31.7,31.7,0,0,1-30.9,8.3L48.3,217.1a8,8,0,0,1-8.8-1.6h0a5.7,5.7,0,0,1-1.2-6.4l10.8-24.8a31.7,31.7,0,0,1,8.3-30.9l56-56",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))}),i2.set("fill",function(){return y.createElement(y.Fragment,null,y.createElement("path",{d:"M224,67.5a35.5,35.5,0,0,0-11.3-25.7c-14-13.2-36.7-12.7-50.6,1.2L140.2,64.9a24.1,24.1,0,0,0-33.2.8l-7,7a16.1,16.1,0,0,0,0,22.6l2.1,2.1L51.7,147.7a40.3,40.3,0,0,0-11,35.8l-9.8,22.4a13.6,13.6,0,0,0,2.9,15.2,15.8,15.8,0,0,0,11.3,4.7,16.3,16.3,0,0,0,6.4-1.3l21-9.2a40.3,40.3,0,0,0,35.8-11l50.3-50.4,2.1,2.1a15.9,15.9,0,0,0,22.6,0l7-7a24.1,24.1,0,0,0,.8-33.2l22.4-22.3A36.2,36.2,0,0,0,224,67.5ZM97,193a24.3,24.3,0,0,1-23.2,6.2,8,8,0,0,0-5.3.4L47,209l9.4-21.5a8,8,0,0,0,.4-5.3A24.3,24.3,0,0,1,63,159l50.4-50.3,33.9,33.9Z"}))}),i2.set("light",function(e){return y.createElement(y.Fragment,null,y.createElement("path",{d:"M179.8,115.8l4.9,4.9a16.1,16.1,0,0,1,0,22.6l-7,7a8,8,0,0,1-11.4,0L105.7,89.7a8,8,0,0,1,0-11.4l7-7a16.1,16.1,0,0,1,22.6,0l4.9,4.9,27.6-27.6c10.8-10.8,28.4-11.4,39.4-.9a28,28,0,0,1,.6,40.1Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),y.createElement("path",{d:"M158.6,142.6l-56,56a31.7,31.7,0,0,1-30.9,8.3L48.3,217.1a8,8,0,0,1-8.8-1.6h0a5.7,5.7,0,0,1-1.2-6.4l10.8-24.8a31.7,31.7,0,0,1,8.3-30.9l56-56",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}))}),i2.set("thin",function(e){return y.createElement(y.Fragment,null,y.createElement("path",{d:"M179.8,115.8l4.9,4.9a16.1,16.1,0,0,1,0,22.6l-7,7a8,8,0,0,1-11.4,0L105.7,89.7a8,8,0,0,1,0-11.4l7-7a16.1,16.1,0,0,1,22.6,0l4.9,4.9,27.6-27.6c10.8-10.8,28.4-11.4,39.4-.9a28,28,0,0,1,.6,40.1Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),y.createElement("path",{d:"M158.6,142.6l-56,56a31.7,31.7,0,0,1-30.9,8.3L48.3,217.1a8,8,0,0,1-8.8-1.6h0a5.7,5.7,0,0,1-1.2-6.4l10.8-24.8a31.7,31.7,0,0,1,8.3-30.9l56-56",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}))}),i2.set("regular",function(e){return y.createElement(y.Fragment,null,y.createElement("path",{d:"M179.8,115.8l4.9,4.9a16.1,16.1,0,0,1,0,22.6l-7,7a8,8,0,0,1-11.4,0L105.7,89.7a8,8,0,0,1,0-11.4l7-7a16.1,16.1,0,0,1,22.6,0l4.9,4.9,27.6-27.6c10.8-10.8,28.4-11.4,39.4-.9a28,28,0,0,1,.6,40.1Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),y.createElement("path",{d:"M158.6,142.6l-56,56a31.7,31.7,0,0,1-30.9,8.3L48.3,217.1a8,8,0,0,1-8.8-1.6h0a5.7,5.7,0,0,1-1.2-6.4l10.8-24.8a31.7,31.7,0,0,1,8.3-30.9l56-56",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))});var i8=function(e,t){return(0,i0.$)(e,t,i2)},i6=(0,y.forwardRef)(function(e,t){return y.createElement(i1.A,Object.assign({ref:t},e,{renderPath:i8}))});i6.displayName="Eyedropper";let i3=()=>Promise.all([r.e(7435),r.e(6726),r.e(1594),r.e(6594)]).then(r.bind(r,36594)),i5=iQ()(i3,{ssr:!1,loading:()=>(0,s.jsx)("div",{className:"w-[240px] h-[360px]"})}),i4=({value:e,onPopoverOpen:t,onChange:r,triggerClass:n,popoverClass:i,popoverOpen:a,trigger:l,gradient:u})=>(0,s.jsx)(rG,{open:a,onOpenChange:t,noSpacing:!0,trigger:(0,s.jsx)("div",{onPointerEnter:i3,onFocus:i3,children:l??(0,s.jsx)("div",{className:(0,o.A)("p-[2px] border border-gray-300 dark:border-white/30 rounded-[10px] cursor-pointer hover:border-gray-600 dark:hover:border-white/60 group",n),children:(0,s.jsx)("div",{className:"w-[30px] h-[30px] rounded-[8px] flex items-center justify-center text-white/80 drop-shadow relative",style:{backgroundColor:`${e||"#111"}`},children:(0,s.jsx)("div",{className:"w-4 h-4 shadow-[0_0_12px_rgba(0,0,0,0.3)] rounded-full bg-white flex items-center justify-center text-gray-600 absolute top-[-5px] right-[-5px] dark:bg-gray-800 dark:text-white ring-1 ring-gray-200 dark:ring-gray-600 group-hover:scale-[1.1] duration-100",children:(0,s.jsx)(i6,{size:11})})})})}),content:(0,s.jsx)("div",{className:(0,o.A)("overflow-hidden rounded-xl",i),children:(0,s.jsx)(i5,{value:e||"#111",onChange:r,gradient:u})})});var i9=Object.defineProperty,i7=(e,t)=>i9(e,"name",{value:t,configurable:!0}),se=["Enter"," "],st=["ArrowUp","PageDown","End"],sr=["ArrowDown","PageUp","Home",...st];[...se],[...se];var sn="Menu",[si,ss,so]=L(sn),[sa,sl]=(0,x.A)(sn,[so,rs,nr]),su=rs(),sc=nr(),[sh,sd]=sa(sn),[sp,sf]=sa(sn),sg=i7(e=>{let{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:a=!0}=e,l=su(t),[u,c]=y.useState(null),h=y.useRef(!1),d=(0,re.c)(o),p=R(i);return y.useEffect(()=>{let e=i7(()=>{h.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},"handleKeyDown"),t=i7(()=>h.current=!1,"handlePointer");return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),y.useEffect(()=>{if(!r)return;let e=i7(()=>d(!1),"handleBlur");return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[r,d]),(0,s.jsx)(rl,{...l,children:(0,s.jsx)(sh,{scope:t,open:r,onOpenChange:d,content:u,onContentChange:c,children:(0,s.jsx)(sp,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:p,modal:a,children:n})})})},"Menu"),sm=y.forwardRef(i7(function(e,t){let{__scopeMenu:r,...n}=e,i=su(r);return(0,s.jsx)(ru,{...i,...n,ref:t})},"MenuAnchor")),sv="MenuPortal",[sy,sb]=sa(sv,{forceMount:void 0}),s_=i7(e=>{let{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=sd(sv,t);return(0,s.jsx)(sy,{scope:t,forceMount:r,children:(0,s.jsx)(r_.C,{present:r||o.open,children:(0,s.jsx)(rb.Z,{asChild:!0,container:i,children:n})})})},"MenuPortal"),sw="MenuContent",[sk,sx]=sa(sw),sE=y.forwardRef(i7(function(e,t){let r=sb(sw,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=sd(sw,e.__scopeMenu),a=sf(sw,e.__scopeMenu);return(0,s.jsx)(si.Provider,{scope:e.__scopeMenu,children:(0,s.jsx)(r_.C,{present:n||o.open,children:(0,s.jsx)(si.Slot,{scope:e.__scopeMenu,children:a.modal?(0,s.jsx)(sS,{...i,ref:t}):(0,s.jsx)(sP,{...i,ref:t})})})})},"MenuContent")),sS=y.forwardRef(i7(function(e,t){let r=sd(sw,e.__scopeMenu),n=y.useRef(null),i=(0,k.s)(t,n);return y.useEffect(()=>{let e=n.current;if(e)return(0,rw.Eq)(e)},[]),(0,s.jsx)(sT,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:(0,w.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),sP=y.forwardRef(i7(function(e,t){let r=sd(sw,e.__scopeMenu);return(0,s.jsx)(sT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),sR=(0,O.TL)("MenuContent.ScrollLock"),sT=y.forwardRef(i7(function(e,t){let{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:p,onDismiss:f,disableOutsideScroll:g,...m}=e,v=sd(sw,r),b=sf(sw,r),_=su(r),x=sc(r),E=ss(r),[S,P]=y.useState(null),R=y.useRef(null),T=(0,k.s)(t,R,v.onContentChange),A=y.useRef(0),C=y.useRef(""),j=y.useRef(0),O=y.useRef(null),$=y.useRef("right"),I=y.useRef(0),L=g?rk.A:y.Fragment,M=i7(e=>{let t=C.current+e,r=E().filter(e=>!e.disabled),n=document.activeElement,i=r.find(e=>e.ref.current===n)?.textValue,s=sH(r.map(e=>e.textValue),t,i),o=r.find(e=>e.textValue===s)?.ref.current;o&&setTimeout(()=>
31o.focus())},"handleTypeaheadSearch");y.useEffect(()=>()=>window.clearTimeout(A.current),[]),(0,eZ.Oh)();let D=y.useCallback(e=>$.current===O.current?.side&&sG(e,O.current?.area),[]);return(0,s.jsx)(sk,{scope:r,searchRef:C,onItemEnter:y.useCallback(e=>{D(e)&&e.preventDefault()},[D]),onItemLeave:y.useCallback(e=>{D(e)||(R.current?.focus(),P(null))},[D]),onTriggerLeave:y.useCallback(e=>{D(e)&&e.preventDefault()},[D]),pointerGraceTimerRef:j,onPointerGraceIntentChange:y.useCallback(e=>{O.current=e},[]),children:(0,s.jsx)(L,{...g?{as:sR,allowPinchZoom:!0}:void 0,children:(0,s.jsx)(eQ.n,{asChild:!0,trapped:i,onMountAutoFocus:(0,w.mK)(o,e=>{e.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:(0,s.jsx)(eX.qW,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:p,onDismiss:f,children:(0,s.jsx)(ns,{asChild:!0,...x,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:P,onEntryFocus:(0,w.mK)(u,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,s.jsx)(rp,{role:"menu","aria-orientation":"vertical","data-state":sB(v.open),"data-radix-menu-content":"",dir:b.dir,..._,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:(0,w.mK)(m.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&M(e.key));let i=R.current;if(e.target!==i||!sr.includes(e.key))return;e.preventDefault();let s=E().filter(e=>!e.disabled).map(e=>e.ref.current);st.includes(e.key)&&s.reverse(),sV(s)}),onBlur:(0,w.mK)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),C.current="")}),onPointerMove:(0,w.mK)(e.onPointerMove,sz(e=>{let t=e.target,r=I.current!==e.clientX;e.currentTarget.contains(t)&&r&&($.current=e.clientX>I.current?"right":"left",I.current=e.clientX)}))})})})})})})},"MenuContentImpl")),sA="MenuItem",sC="menu.itemSelect",sj=y.forwardRef(i7(function(e,t){let{disabled:r=!1,onSelect:n,...i}=e,o=y.useRef(null),a=sf(sA,e.__scopeMenu),l=sx(sA,e.__scopeMenu),u=(0,k.s)(t,o),c=y.useRef(!1),h=i7(()=>{let e=o.current;if(!r&&e){let t=new CustomEvent(sC,{bubbles:!0,cancelable:!0});e.addEventListener(sC,e=>n?.(e),{once:!0}),(0,j.hO)(e,t),t.defaultPrevented?c.current=!1:a.onClose()}},"handleSelect");return(0,s.jsx)(sO,{...i,ref:u,disabled:r,onClick:(0,w.mK)(e.onClick,h),onPointerDown:t=>{e.onPointerDown?.(t),c.current=!0},onPointerUp:(0,w.mK)(e.onPointerUp,e=>{c.current||e.currentTarget?.click()}),onKeyDown:(0,w.mK)(e.onKeyDown,e=>{r||e.target!==e.currentTarget||(""===l.searchRef.current||" "!==e.key)&&se.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},"MenuItem")),sO=y.forwardRef(i7(function(e,t){let{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,a=sx(sA,r),l=sc(r),u=y.useRef(null),c=(0,k.s)(t,u),[h,d]=y.useState(!1),[p,f]=y.useState("");return y.useEffect(()=>{let e=u.current;e&&f((e.textContent??"").trim())},[o.children]),(0,s.jsx)(si.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:(0,s.jsx)(na,{asChild:!0,...l,focusable:!n,children:(0,s.jsx)(j.sG.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:c,onPointerMove:(0,w.mK)(e.onPointerMove,sz(e=>{n?a.onItemLeave(e):(a.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,w.mK)(e.onPointerLeave,sz(e=>a.onItemLeave(e))),onFocus:(0,w.mK)(e.onFocus,()=>d(!0)),onBlur:(0,w.mK)(e.onBlur,()=>d(!1))})})})},"MenuItemImpl")),[s$,sI]=sa("MenuRadioGroup",{value:void 0,onValueChange:i7(()=>{},"onValueChange")}),[sL,sM]=sa("MenuItemIndicator",{checked:!1}),sD=y.forwardRef(i7(function(e,t){let{__scopeMenu:r,...n}=e,i=su(r);return(0,s.jsx)(rg,{...i,...n,ref:t})},"MenuArrow")),[sN,sF]=sa("MenuSub");function sB(e){return e?"open":"closed"}function sU(e){return"indeterminate"===e}function sV(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function sW(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function sH(e,t,r){let n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=r?e.indexOf(r):-1,s=sW(e,Math.max(i,0));1===n.length&&(s=s.filter(e=>e!==r));let o=s.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return o!==r?o:void 0}function sq(e,t){let{x:r,y:n}=e,i=!1;for(let e=0,s=t.length-1;e<t.length;s=e++){let o=t[e],a=t[s],l=o.x,u=o.y,c=a.x,h=a.y;u>n!=h>n&&r<(c-l)*(n-u)/(h-u)+l&&(i=!i)}return i}function sG(e,t){return!!t&&sq({x:e.clientX,y:e.clientY},t)}function sz(e){return t=>
31"mouse"===t.pointerType?e(t):void 0}i7(sB,"getOpenState"),i7(sU,"isIndeterminate"),i7(function(e){return sU(e)?"indeterminate":e?"checked":"unchecked"},"getCheckedState"),i7(sV,"focusFirst"),i7(sW,"wrapArray"),i7(sH,"getNextMatch"),i7(sq,"isPointInPolygon"),i7(sG,"isPointerInGraceArea"),i7(sz,"whenMouse");var sK=Object.defineProperty,sJ=(e,t)=>sK(e,"name",{value:t,configurable:!0}),sY="DropdownMenu",[sX,sZ]=(0,x.A)(sY,[sl]),sQ=sl(),[s0,s1]=sX(sY),s2=sJ(e=>{let{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,u=sQ(t),c=y.useRef(null),[h,d]=(0,E.i)({prop:i,defaultProp:o??!1,onChange:a,caller:sY});return(0,s.jsx)(s0,{scope:t,triggerId:(0,e0.B)(),triggerRef:c,contentId:(0,e0.B)(),open:h,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(e=>!e),[d]),modal:l,children:(0,s.jsx)(sg,{...u,open:h,onOpenChange:d,dir:n,modal:l,children:r})})},"DropdownMenu"),s8=y.forwardRef(sJ(function(e,t){let{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=s1("DropdownMenuTrigger",r),a=sQ(r),l=(0,k.s)(t,o.triggerRef);return(0,s.jsx)(sm,{asChild:!0,...a,children:(0,s.jsx)(j.sG.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:l,onPointerDown:(0,w.mK)(e.onPointerDown,e=>{!n&&0===e.button&&!1===e.ctrlKey&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:(0,w.mK)(e.onKeyDown,e=>{!n&&(["Enter"," "].includes(e.key)&&o.onOpenToggle(),"ArrowDown"===e.key&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})},"DropdownMenuTrigger")),s6=sJ(e=>{let{__scopeDropdownMenu:t,...r}=e,n=sQ(t);return(0,s.jsx)(s_,{...n,...r})},"DropdownMenuPortal"),s3=y.forwardRef(sJ(function(e,t){let{__scopeDropdownMenu:r,...n}=e,i=s1("DropdownMenuContent",r),o=sQ(r),a=y.useRef(!1);return(0,s.jsx)(sE,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...n,ref:t,onCloseAutoFocus:(0,w.mK)(e.onCloseAutoFocus,e=>{a.current||i.triggerRef.current?.focus(),a.current=!1,e.preventDefault()}),onInteractOutside:(0,w.mK)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!i.modal||n)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),s5=y.forwardRef(sJ(function(e,t){let{__scopeDropdownMenu:r,...n}=e,i=sQ(r);return(0,s.jsx)(sj,{...i,...n,ref:t})},"DropdownMenuItem")),s4=y.forwardRef(sJ(function(e,t){let{__scopeDropdownMenu:r,...n}=e,i=sQ(r);return(0,s.jsx)(sD,{...i,...n,ref:t})},"DropdownMenuArrow"));let s9="focus:outline-none ring-1 ring-transparent focus:bg-white dark:focus:bg-gray-100 cursor-pointer flex items-center px-2 py-[5px] text-sm hover:bg-white hover:shadow-[0_1px_2px_rgba(0,0,0,0.15)] focus:shadow-[0_1px_3px_rgba(0,0,0,0.15)] dark:focus:shadow-[0_1px_2px_rgba(0,0,0,0.9)] dark:hover:shadow-[0_1px_2px_rgba(0,0,0,0.9)] dark:hover:bg-white dark:hover:text-gray-800 dark:text-gray-200 dark:focus:text-gray-800 rounded-lg mb-[2px]",s7=({item:e})=>{switch(e?.as){case"divider":return(0,s.jsx)("hr",{className:"my-2 border-gray-300/50 dark:border-gray-700/50"});case"a":return(0,s.jsxs)(h(),{href:e?.href,passHref:!0,tabIndex:"1",role:"button",target:e?.newTab?"_blank":"",className:(0,o.A)(s9,e?.className,e?.disabled&&"opacity-50 cursor-default! hover:bg-transparent! dark:hover:text-gray-300! hover:shadow-none!"),children:[e?.icon?(0,s.jsx)("span",{className:"mr-2",children:e?.icon}):"",e?.title,e?.shortcuts?.length?(0,s.jsx)("div",{className:"ml-auto",children:e?.shortcuts?.map((e,t)=>(0,s.jsx)(rK,{className:"ml-2",children:e},e+t))}):""]});default:return(0,s.jsx)(s5,{asChild:!0,disabled:e?.disabled,children:(0,s.jsxs)("div",{className:(0,o.A)(s9,e?.className,e?.disabled&&"opacity-50 cursor-default! hover:bg-transparent! dark:hover:text-gray-300! hover:shadow-none!"),onClick:e?.onClick??{},children:[e?.icon?(0,s.jsx)("span",{className:"mr-2",children:e?.icon}):"",e?.title,e?.shortcuts?.length?(0,s.jsx)("div",{className:"ml-auto",children:e?.
31shortcuts?.map((e,t)=>(0,s.jsx)(rK,{className:"ml-2",children:e},e+t))}):""]})})}},oe=({trigger:e,side:t,align:r,items:n}={})=>(0,s.jsxs)(s2,{children:[(0,s.jsx)(s8,{asChild:!0,children:(0,s.jsx)("div",{children:e})}),(0,s.jsx)(s6,{asChild:!0,children:(0,s.jsx)(s3,{sideOffset:10,side:t??"bottom",align:r??"center",className:"z-200 relative focus:outline-none",children:(0,s.jsx)(nV,{className:(0,o.A)("shadow-[0_1px_10px_rgba(0,0,0,0.15)] dark:shadow-[0_2px_20px_rgba(0,0,0,0.5)] ring-1 ring-gray-400/20 dark:ring-gray-700 bg-gray-100/50 backdrop-blur-xl dark:bg-gray-900/80 rounded-xl relative z-10 px-2 py-[8px] min-w-[200px]"),initial:{opacity:0,scale:.8,y:-20},animate:{opacity:1,scale:1,y:0,transition:{duration:.25,type:"spring"}},exit:{opacity:0,scale:.8},children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"bg-linear-to-b from-transparent to-white/20 dark:to-black/10 absolute bottom-0 left-0 w-full h-[10px] rounded-b-lg z-0"}),(0,s.jsx)(s4,{className:"fill-white/80 dark:fill-gray-800 drop-shadow-[0_1px_0px_rgba(0,0,0,0.3)] dark:drop-shadow-[0_1px_0px_rgba(255,255,255,0.3)] w-3 h-2"}),n?.map((e,t)=>e?.hide?"":(0,s.jsx)(s7,{item:e},t+e?.title))]})})})})]}),ot=({children:e,className:t,width:r})=>(0,s.jsx)("section",{style:{maxWidth:r||"100%"},className:(0,o.A)("w-full mx-auto px-4 md:px-6",t),children:e}),or=({children:e})=>(0,s.jsx)("span",{className:"border-b-[3px] text-black dark:text-white border-indigo-500/20 dark:border-indigo-500/70",children:e});var on=r(88065);r(45127);let oi="[A-Za-z$_][0-9A-Za-z$_]*",os=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],oo=["true","false","null","undefined","NaN","Infinity"],oa=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ol=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ou=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],oc=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],oh=[].concat(ou,oa,ol),od={scope:"number",match:"([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",relevance:0};r(73789),on.registerLanguage("javascript",function(e){var t;let r=e.regex,n=/<[A-Za-z0-9\\._:-]+/,i=/\/[A-Za-z0-9\\._:-]+>|\/>/,s={$pattern:oi,keyword:os,literal:oo,built_in:oh,"variable.language":oc},o="[0-9](_?[0-9])*",a=`\\.(${o})`,l="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${l})((${a})|\\.)?|(${a}))[eE][+-]?(${o})\\b`},{begin:`\\b(${l})\\b((${a})\\b|\\.)?|(${a})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},c={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"xml"}},d={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"css"}},p={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"graphql"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,c]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0}
31,{className:"variable",begin:oi+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},m=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,d,p,f,{match:/\$\d+/},u];c.contains=m.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(m)});let v=[].concat(g,c.contains),y=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(v)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y},_={variants:[{match:[/class/,/\s+/,oi,/\s+/,/extends/,/\s+/,r.concat(oi,"(",r.concat(/\./,oi),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,oi],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...oa,...ol]}},k={match:r.concat(/\b/,(t=[...ou,"super","import","await"].map(e=>`${e}\\s*\\(`),r.concat("(?!",t.join("|"),")")),oi,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},x={begin:r.concat(/\./,r.lookahead(r.concat(oi,/(?![0-9A-Za-z$_(])/))),end:oi,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,oi,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:w},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,d,p,f,g,{match:/\$\d+/},u,w,{scope:"attr",match:oi+r.lookahead(":"),relevance:0},S,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:n,"on:begin":(e,t)=>{let r,n=e[0].length+e.index,i=e.input[n];if("<"===i||","===i)return void t.ignoreMatch();">"!==i||((e,{after:t})=>{let r="</"+e[0].slice(1);return -1!==e.input.indexOf(r,t)})(e,{after:n})||t.ignoreMatch();let s=e.input.substring(n);if((r=s.match(/^\s*=/))||(r=s.match(/^\s+extends\s+/))&&0===r.index)return void t.ignoreMatch()},end:i}],subLanguage:"xml",contains:[{begin:n,end:i,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,oi,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,e.inherit(e.TITLE_MODE,{begin:oi,className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$"+oi,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},_,{match:[/get|set/,/\s+/,oi,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},{match:/\$[(.]/}]}}),on.registerLanguage("ruby",function(e){let t=e.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(n,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepe
vendor: 7,414 bytes, line 31
31nd","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},c={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},h="[0-9](_?[0-9])*",d={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},p={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},f=[c,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[p]},{begin:"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[c,{begin:r}],relevance:0},d,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,l),relevance:0}].concat(a,l);u.contains=f,p.contains=f;let g=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:s,contains:f}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(g).concat(l).concat(f)}}),on.registerLanguage("python",function(e){let t=e.regex,r=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},s={className:"meta",begin:/^(>>>|\.\.\.) /},o={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,s,a,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s,a,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},u="[0-9](_?[0-9])*",c=`(\\b(${u}))?\\.(${u})|\\b(${u})\\.`,h=`\\b|${n.join("|")}`,d={className:"number",relevance:0,variants:[{begin:`(\\b(${u})|(${c}))[eE][+-]?(${u})[jJ]?(?=${h})`},{begin:`(${c})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${u})[jJ](?=${h})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",s,d,l,e.HASH_COMMENT_MODE]}]};return o.contains=[l,d,s],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[s,d,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[d,f,l]}]}}),on.registerLanguage("php",function(e){let t,r=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=r.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=r.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=r.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+i},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),h={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(e,t)=>
vendor: 6,584 bytes, line 31
31{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},d=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p="[ 	\n]",f={scope:"string",variants:[c,u,h,d]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},m=["false","null","true"],v=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],b={keyword:v,literal:(t=[],m.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t),built_in:y},_=e=>e.map(e=>e.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,r.concat(p,"+"),r.concat("(?!",_(y).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},k=r.concat(i,"\\b(?!\\()"),x={variants:[{match:[r.concat(/::/,r.lookahead(/(?!class\b)/)),k],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,r.concat(/::/,r.lookahead(/(?!class\b)/)),k],scope:{1:"title.class",3:"variable.constant"}},{match:[s,r.concat("::",r.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},E={scope:"attr",match:r.concat(i,r.lookahead(":"),r.lookahead(/(?!::)/))},S={relevance:0,begin:/\(/,end:/\)/,keywords:b,contains:[E,a,x,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,f,g,w]},P={relevance:0,match:[/\b/,r.concat("(?!fn\\b|function\\b|",_(v).join("\\b|"),"|",_(y).join("\\b|"),"\\b)"),i,r.concat(p,"*"),r.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[S]};S.contains.push(P);let R=[E,x,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,f,g,w],T={begin:r.concat(/#\[\s*\\?/,r.either(s,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:m,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:m,keyword:["new","array"]},contains:["self",...R]},...R,{scope:"meta",variants:[{match:s},{match:o}]}]};return{case_insensitive:!1,keywords:b,contains:[T,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},a,P,x,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:b,contains:["self",T,a,x,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,f,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},f,g]}}),on.registerLanguage("json",function(e){let t=["true","false","null"],r={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:t},contains:[{className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,od,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}),iQ()(()=>Promise.all([r.e(3020),r.e(4650)]).then(r.t.bind(r,79491,23)),{loadableGenerated:{webpack:()=>[79491]},ssr:!1}),r(1433);var op=r(27889);let of=y.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{}
31,openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),og=()=>{let e=y.useContext(of);if(!e)throw Error("useDrawerContext must be used within a Drawer.Root");return e};function om(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ov(){return oy(/^iPhone/)||oy(/^iPad/)||oy(/^Mac/)&&navigator.maxTouchPoints>1}function oy(e){return"u">typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}
31[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");let ob="u">typeof window?y.useLayoutEffect:y.useEffect;function o_(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}let ow="u">typeof document&&window.visualViewport;function ok(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ox(e){for(ok(e)&&(e=e.parentElement);e&&!ok(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}let oE=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),oS=0;function oP(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function oR(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=ox(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let r=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=n-r)}e=t.parentElement}}function oT(e){return e instanceof HTMLInputElement&&!oE.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function oA(...e){return y.useCallback(function(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}(...e),e)}let oC=new WeakMap;function oj(e,t,r=!1){if(!e||!(e instanceof HTMLElement))return;let n={};Object.entries(t).forEach(([t,r])=>{t.startsWith("--")?e.style.setProperty(t,r):(n[t]=e.style[t],e.style[t]=r)}),r||oC.set(e,n)}let oO=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function o$(e,t){if(!e)return null;let r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform,i=n.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(", ")[oO(t)?13:12]):(i=n.match(/^matrix\((.+)\)$/))?parseFloat(i[1].split(", ")[oO(t)?5:4]):null}function oI(e,t){if(!e)return()=>{};let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}let oL=[.32,.72,0,1],oM="vaul-dragging";function oD(e){let t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function oN({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,i]=function({defaultProp:e,onChange:t}){let r=y.useState(e),[n]=r,i=y.useRef(n),s=oD(t);return y.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}({defaultProp:t,onChange:r}),s=void 0!==e,o=s?e:n,a=oD(r);return[o,y.useCallback(t=>{if(s){let r="function"==typeof t?t(e):t;r!==e&&a(r)}else i(t)},[s,e,i,a])]}let oF=()=>()=>{},oB=null;function oU({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:s,snapPoints:o,shouldScaleBackgroun
31d:a=!1,setBackgroundColorOnScale:l=!0,closeThreshold:u=.25,scrollLockTimeout:c=100,dismissible:h=!0,handleOnly:d=!1,fadeFromIndex:p=o&&o.length-1,activeSnapPoint:f,setActiveSnapPoint:g,fixed:m,modal:v=!0,onClose:b,nested:_,noBodyStyles:w=!1,direction:k="bottom",defaultOpen:x=!1,disablePreventScroll:E=!0,snapToSequentialPoint:S=!1,preventScrollRestoration:P=!1,repositionInputs:R=!0,onAnimationEnd:T,container:A,autoFocus:C=!1}){var j,O;let[$=!1,I]=oN({defaultProp:x,prop:e,onChange:e=>{null==t||t(e),e||_||eh(),setTimeout(()=>{null==T||T(e)},500),e&&!v&&"u">typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[L,M]=y.useState(!1),[D,N]=y.useState(!1),[F,B]=y.useState(!1),U=y.useRef(null),V=y.useRef(null),W=y.useRef(null),H=y.useRef(null),q=y.useRef(null),G=y.useRef(!1),z=y.useRef(null),K=y.useRef(0),J=y.useRef(!1),Y=y.useRef(!x),X=y.useRef(0),Z=y.useRef(null),Q=y.useRef((null==(j=Z.current)?void 0:j.getBoundingClientRect().height)||0),ee=y.useRef((null==(O=Z.current)?void 0:O.getBoundingClientRect().width)||0),et=y.useRef(0),er=y.useCallback(e=>{o&&e===ea.length-1&&(V.current=new Date)},[]),{activeSnapPoint:en,activeSnapPointIndex:ei,setActiveSnapPoint:es,onRelease:eo,snapPointsOffset:ea,onDrag:el,shouldFade:eu,getPercentageDragged:ec}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:i,fadeFromIndex:s,onSnapPointChange:o,direction:a="bottom",container:l,snapToSequentialPoint:u}){let[c,h]=oN({prop:e,defaultProp:null==r?void 0:r[0],onChange:t}),[d,p]=y.useState("u">typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);y.useEffect(()=>{function e(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let f=y.useMemo(()=>c===(null==r?void 0:r[r.length-1])||null,[r,c]),g=y.useMemo(()=>{var e;return null!=(e=null==r?void 0:r.findIndex(e=>e===c))?e:null},[r,c]),m=r&&r.length>0&&(s||0===s)&&!Number.isNaN(s)&&r[s]===c||!r,v=y.useMemo(()=>{var e;let t=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:"u">typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return null!=(e=null==r?void 0:r.map(e=>{let r="string"==typeof e,n=0;if(r&&(n=parseInt(e,10)),oO(a)){let i=r?n:d?e*t.height:0;return d?"bottom"===a?t.height-i:-t.height+i:i}let i=r?n:d?e*t.width:0;return d?"right"===a?t.width-i:-t.width+i:i}))?e:[]},[r,d,l]),b=y.useMemo(()=>null!==g?null==v?void 0:v[g]:null,[v,g]),_=y.useCallback(e=>{var t;let l=null!=(t=null==v?void 0:v.findIndex(t=>t===e))?t:null;o(l),oj(n.current,{transition:`transform 0.5s cubic-bezier(${oL.join(",")})`,transform:oO(a)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&l!==v.length-1&&void 0!==s&&l!==s&&l<s?oj(i.current,{transition:`opacity 0.5s cubic-bezier(${oL.join(",")})`,opacity:"0"}):oj(i.current,{transition:`opacity 0.5s cubic-bezier(${oL.join(",")})`,opacity:"1"}),h(null==r?void 0:r[Math.max(l,0)])},[n.current,r,v,s,i,h]);return y.useEffect(()=>{if(c||e){var t;let n=null!=(t=null==r?void 0:r.findIndex(t=>t===e||t===c))?t:-1;v&&-1!==n&&"number"==typeof v[n]&&_(v[n])}},[c,e,r,v,_]),{isLastSnapPoint:f,activeSnapPoint:c,shouldFade:m,getPercentageDragged:function(e,t){if(!r||"number"!=typeof g||!v||void 0===s)return null;let n=g===s-1;if(g>=s&&t)return 0;if(n&&!t)return 1;if(!m&&!n)return null;let i=n?g+1:g-1,o=e/Math.abs(n?v[i]-v[i-1]:v[i+1]-v[i]);return n?1-o:o},setActiveSnapPoint:h,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:o}){if(void 0===s)return;let l="bottom"===a||"right"===a?(null!=b?b:0)-e:(null!=b?b:0)+e,c=g===s-1,h=0===g,d=e>0;if(c&&oj(i.current,{transition:`opacity 0.5s cubic-bezier(${oL.join(",")})`}),!u&&n>2&&!d)return void(o?t():_(v[0]));if(!u&&n>2&&d&&v&&r)return void _(v[r.length-1]);let p=null==v?void 0:v.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-l)<Math.abs(e-l)?t:e),m=oO(a)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*m){let e=d?1:-1;return e>0&&f&&r?void _(v[r.length-1]):void(h&&e<0&&o&&t(),null===g||_(v[g+e]))}_(p)},onDrag:function({draggedDistance:e}){if(null===b)return;let t="bottom"===a||"right"===a?b-e:b+e;("bottom"===a||"right"===a)&&t<v[v.length-1]||("top"===a||"left"===a)&&t>
31v[v.length-1]||oj(n.current,{transform:oO(a)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:o,activeSnapPointProp:f,setActiveSnapPointProp:g,drawerRef:Z,fadeFromIndex:p,overlayRef:U,onSnapPointChange:er,direction:k,container:A,snapToSequentialPoint:S});!function(e={}){let{isDisabled:t}=e;ob(()=>{if(!t){var e,r,n;let t,s,o,a,l,u,c;return 1==++oS&&ov()&&(o=0,a=window.pageXOffset,l=window.pageYOffset,u=o_((e=document.documentElement,r="paddingRight",n=`${window.innerWidth-document.documentElement.clientWidth}px`,t=e.style[r],e.style[r]=n,()=>{e.style[r]=t})),window.scrollTo(0,0),c=o_(oP(document,"touchstart",e=>{((s=ox(e.target))!==document.documentElement||s!==document.body)&&(o=e.changedTouches[0].pageY)},{passive:!1,capture:!0}),oP(document,"touchmove",e=>{if(!s||s===document.documentElement||s===document.body)return void e.preventDefault();let t=e.changedTouches[0].pageY,r=s.scrollTop,n=s.scrollHeight-s.clientHeight;0!==n&&((r<=0&&t>o||r>=n&&t<o)&&e.preventDefault(),o=t)},{passive:!1,capture:!0}),oP(document,"touchend",e=>{let t=e.target;oT(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),oP(document,"focus",e=>{let t=e.target;oT(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",ow&&(ow.height<window.innerHeight?requestAnimationFrame(()=>{oR(t)}):ow.addEventListener("resize",()=>oR(t),{once:!0}))}))},!0),oP(window,"scroll",()=>{window.scrollTo(0,0)})),i=()=>{u(),c(),window.scrollTo(a,l)}),()=>{0==--oS&&(null==i||i())}}},[t])}({isDisabled:!$||D||!v||F||!L||!R||!E});let{restorePositionSetting:eh}=function({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:i,noBodyStyles:s}){let[o,a]=y.useState(()=>"u">typeof window?window.location.href:""),l=y.useRef(0),u=y.useCallback(()=>{if(om()&&null===oB&&e&&!s){oB={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-e}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&l.current>=t&&(document.body.style.top=`${-(l.current+e)}px`)}),300)}},[e]),c=y.useCallback(()=>{if(om()&&null!==oB&&!s){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,oB),window.requestAnimationFrame(()=>{i&&o!==window.location.href?a(window.location.href):window.scrollTo(t,e)}),oB=null}},[o]);return y.useEffect(()=>{function e(){l.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),y.useEffect(()=>{if(t)return()=>{"u"<typeof document||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),y.useEffect(()=>{!r&&n&&(e?(window.matchMedia("(display-mode: standalone)").matches||u(),t||window.setTimeout(()=>{c()},500)):c())},[e,n,o,t,r,u,c]),{restorePositionSetting:c}}({isOpen:$,modal:v,nested:null!=_&&_,hasBeenOpened:L,preventScrollRestoration:P,noBodyStyles:w});function ed(){return(window.innerWidth-26)/window.innerWidth}function ep(e,t){var r;let n=e,i=null==(r=window.getSelection())?void 0:r.toString(),s=Z.current?o$(Z.current,k):null,o=new Date;if("SELECT"===n.tagName||n.hasAttribute("data-vaul-no-drag")||n.closest("[data-vaul-no-drag]"))return!1;if("right"===k||"left"===k)return!0;if(V.current&&o.getTime()-V.current.getTime()<500)return!1;if(null!==s&&("bottom"===k?s>0:s<0))return!0;if(i&&i.length>0)return!1;if(q.current&&o.getTime()-q.current.getTime()<c&&0===s||t)return q.current=o,!1;for(;n;){if(n.scrollHeight>n.clientHeight){if(0!==n.scrollTop)return q.current=new Date,!1;if("dialog"===n.getAttribute("role"))break}n=n.parentNode}return!0}function ef(e){D&&Z.current&&(Z.current.classList.remove(oM),G.current=!1,N(!1),H.current=ne
31w Date),null==b||b(),e||I(!1),setTimeout(()=>{o&&es(o[0])},500)}function eg(){if(!Z.current)return;let e=document.querySelector("[data-vaul-drawer-wrapper]"),t=o$(Z.current,k);oj(Z.current,{transform:"translate3d(0, 0, 0)",transition:`transform 0.5s cubic-bezier(${oL.join(",")})`}),oj(U.current,{transition:`opacity 0.5s cubic-bezier(${oL.join(",")})`,opacity:"1"}),a&&t&&t>0&&$&&oj(e,{borderRadius:"8px",overflow:"hidden",...oO(k)?{transform:`scale(${ed()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${ed()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${oL.join(",")})`},!0)}return y.useEffect(()=>{window.requestAnimationFrame(()=>{Y.current=!0})},[]),y.useEffect(()=>{var e;function t(){if(Z.current&&R&&(oT(document.activeElement)||J.current)){var e;let t=(null==(e=window.visualViewport)?void 0:e.height)||0,r=window.innerHeight,n=r-t,i=Z.current.getBoundingClientRect().height||0;et.current||(et.current=i);let s=Z.current.getBoundingClientRect().top;if(Math.abs(X.current-n)>60&&(J.current=!J.current),o&&o.length>0&&ea&&ei&&(n+=ea[ei]||0),X.current=n,i>t||J.current){let e=Z.current.getBoundingClientRect().height,o=e;e>t&&(o=t-(i>.8*r?s:26)),m?Z.current.style.height=`${e-Math.max(n,0)}px`:Z.current.style.height=`${Math.max(o,t-s)}px`}else{let e;e=navigator.userAgent,"u">typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))||(Z.current.style.height=`${et.current}px`)}o&&o.length>0&&!J.current?Z.current.style.bottom="0px":Z.current.style.bottom=`${Math.max(n,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[ei,o,ea]),y.useEffect(()=>($&&(oj(document.documentElement,{scrollBehavior:"auto"}),V.current=new Date),()=>{!function(e,t){if(!e||!(e instanceof HTMLElement))return;let r=oC.get(e);r&&(e.style[t]=r[t])}(document.documentElement,"scrollBehavior")}),[$]),y.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),y.createElement(op.bL,{defaultOpen:x,onOpenChange:e=>{(h||e)&&(e?M(!0):ef(!0),I(e))},open:$},y.createElement(of.Provider,{value:{activeSnapPoint:en,snapPoints:o,setActiveSnapPoint:es,drawerRef:Z,overlayRef:U,onOpenChange:t,onPress:function(e){var t,r;!h&&!o||(!Z.current||Z.current.contains(e.target))&&(Q.current=(null==(t=Z.current)?void 0:t.getBoundingClientRect().height)||0,ee.current=(null==(r=Z.current)?void 0:r.getBoundingClientRect().width)||0,N(!0),W.current=new Date,ov()&&window.addEventListener("touchend",()=>G.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=oO(k)?e.pageY:e.pageX)},onRelease:function(e){var t,r;if(!D||!Z.current)return;Z.current.classList.remove(oM),G.current=!1,N(!1),H.current=new Date;let n=o$(Z.current,k);
31if(!e||!ep(e.target,!1)||!n||Number.isNaN(n)||null===W.current)return;let i=H.current.getTime()-W.current.getTime(),a=K.current-(oO(k)?e.pageY:e.pageX),l=Math.abs(a)/i;if(l>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),o){eo({draggedDistance:a*("bottom"===k||"right"===k?1:-1),closeDrawer:ef,velocity:l,dismissible:h}),null==s||s(e,!0);return}if("bottom"===k||"right"===k?a>0:a<0){eg(),null==s||s(e,!0);return}if(l>.4){ef(),null==s||s(e,!1);return}let c=Math.min(null!=(t=Z.current.getBoundingClientRect().height)?t:0,window.innerHeight),d=Math.min(null!=(r=Z.current.getBoundingClientRect().width)?r:0,window.innerWidth);if(Math.abs(n)>=("left"===k||"right"===k?d:c)*u){ef(),null==s||s(e,!1);return}null==s||s(e,!0),eg()},onDrag:function(e){if(Z.current&&D){let t="bottom"===k||"right"===k?1:-1,r=(K.current-(oO(k)?e.pageY:e.pageX))*t,i=r>0,s=o&&!h&&!i;if(s&&0===ei)return;let l=Math.abs(r),u=document.querySelector("[data-vaul-drawer-wrapper]"),c=l/("bottom"===k||"top"===k?Q.current:ee.current),d=ec(l,i);if(null!==d&&(c=d),s&&c>=1||!G.current&&!ep(e.target,i))return;if(Z.current.classList.add(oM),G.current=!0,oj(Z.current,{transition:"none"}),oj(U.current,{transition:"none"}),o&&el({draggedDistance:r}),i&&!o){let e=Math.min(-(8*(Math.log(r+1)-2)*1),0)*t;oj(Z.current,{transform:oO(k)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`});return}let f=1-c;if((eu||p&&ei===p-1)&&(null==n||n(e,c),oj(U.current,{opacity:`${f}`,transition:"none"},!0)),u&&U.current&&a){let e=Math.min(ed()+c*(1-ed()),1),t=8-8*c,r=Math.max(0,14-14*c);oj(u,{borderRadius:`${t}px`,transform:oO(k)?`scale(${e}) translate3d(0, ${r}px, 0)`:`scale(${e}) translate3d(${r}px, 0, 0)`,transition:"none"},!0)}if(!o){let e=l*t;oj(Z.current,{transform:oO(k)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:h,shouldAnimate:Y,handleOnly:d,isOpen:$,isDragging:D,shouldFade:eu,closeDrawer:ef,onNestedDrag:function(e,t){if(t<0)return;let r=(window.innerWidth-16)/window.innerWidth,n=r+t*(1-r),i=-16+16*t;oj(Z.current,{transform:oO(k)?`scale(${n}) translate3d(0, ${i}px, 0)`:`scale(${n}) translate3d(${i}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){let t=e?(window.innerWidth-16)/window.innerWidth:1,r=e?-16:0;z.current&&window.clearTimeout(z.current),oj(Z.current,{transition:`transform 0.5s cubic-bezier(${oL.join(",")})`,transform:oO(k)?`scale(${t}) translate3d(0, ${r}px, 0)`:`scale(${t}) translate3d(${r}px, 0, 0)`}),!e&&Z.current&&(z.current=setTimeout(()=>{let e=o$(Z.current,k);oj(Z.current,{transition:"none",transform:oO(k)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){let r=oO(k)?window.innerHeight:window.innerWidth,n=t?(r-16)/r:1,i=t?-16:0;t&&oj(Z.current,{transition:`transform 0.5s cubic-bezier(${oL.join(",")})`,transform:oO(k)?`scale(${n}) translate3d(0, ${i}px, 0)`:`scale(${n}) translate3d(${i}px, 0, 0)`})},keyboardIsOpen:J,modal:v,snapPointsOffset:ea,activeSnapPointIndex:ei,direction:k,shouldScaleBackground:a,setBackgroundColorOnScale:l,noBodyStyles:w,container:A,autoFocus:C}},r))}let oV=y.forwardRef(function({...e},t){let{overlayRef:r,snapPoints:n,onRelease:i,shouldFade:s,isOpen:o,modal:a,shouldAnimate:l}=og(),u=oA(t,r),c=n&&n.length>0;if(!a)return null;let h=y.useCallback(e=>i(e),[i]);return y.createElement(op.hJ,{onMouseUp:h,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":o&&c?"true":"false","data-vaul-snap-points-overlay":o&&s?"true":"false","data-vaul-animate":(null==l?void 0:l.current)?"true":"false",...e})});oV.displayName="Drawer.Overlay";let oW=y.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},i){let{drawerRef:s,onPress:o,onRelease:a,onDrag:l,keyboardIsOpen:u,snapPointsOffset:c,activeSnapPointIndex:h,modal:d,isOpen:p,direction:f,snapPoints:g,container:m,handleOnly:v,shouldAnimate:b,autoFocus:_}=og(),[w,k]=y.useState(!1),x=oA(i,s),E=y.useRef(null),S=y.useRef(null),P=y.useRef(!1),R=g&&g.length>0;function T(e){E.current=null,P.current=!1,a(e)}return!function(){let{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:i}=og(),s=y.useRef(null),o=(0,y.useMemo)(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-26)/window.innerWidth}y.useEffect(()=>{if(t&&r){s.current&&clearTimeout(s.current);let t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;!function(...e){}(n&&!i?oI(document.body,{background:"black"}):oF,oI(t,{transformOrigin:oO(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${oL.join(",")})`}));let r=oI(t,{borderRadius:"8px",overflow:"hidden",...oO(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}}
31);return()=>{r(),s.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},500)}}},[t,r,o])}(),y.useEffect(()=>{R&&window.requestAnimationFrame(()=>{k(!0)})},[]),y.createElement(op.UC,{"data-vaul-drawer-direction":f,"data-vaul-drawer":"","data-vaul-delayed-snap-points":w?"true":"false","data-vaul-snap-points":p&&R?"true":"false","data-vaul-custom-container":m?"true":"false","data-vaul-animate":(null==b?void 0:b.current)?"true":"false",...n,ref:x,style:c&&c.length>0?{"--snap-point-height":`${c[null!=h?h:0]}px`,...t}:t,onPointerDown:e=>{v||(null==n.onPointerDown||n.onPointerDown.call(n,e),E.current={x:e.pageX,y:e.pageY},o(e))},onOpenAutoFocus:e=>{null==r||r(e),_||e.preventDefault()},onPointerDownOutside:t=>{(null==e||e(t),!d||t.defaultPrevented)?t.preventDefault():u.current&&(u.current=!1)},onFocusOutside:e=>{if(!d)return void e.preventDefault()},onPointerMove:e=>{if(S.current=e,v||(null==n.onPointerMove||n.onPointerMove.call(n,e),!E.current))return;let t=e.pageY-E.current.y,r=e.pageX-E.current.x,i="touch"===e.pointerType?10:2;((e,t,r=0)=>{if(P.current)return!0;let n=Math.abs(e.y),i=Math.abs(e.x),s=i>n,o=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*o<0)&&i>=0&&i<=r)return s}else if(!(e.y*o<0)&&n>=0&&n<=r)return!s;return P.current=!0,!0})({x:r,y:t},f,i)?l(e):(Math.abs(r)>i||Math.abs(t)>i)&&(E.current=null)},onPointerUp:e=>{null==n.onPointerUp||n.onPointerUp.call(n,e),E.current=null,P.current=!1,a(e)},onPointerOut:e=>{null==n.onPointerOut||n.onPointerOut.call(n,e),T(S.current)},onContextMenu:e=>{null==n.onContextMenu||n.onContextMenu.call(n,e),S.current&&T(S.current)}})});oW.displayName="Drawer.Content";let oH=y.forwardRef(function({preventCycle:e=!1,children:t,...r},n){let{closeDrawer:i,isDragging:s,snapPoints:o,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:u,handleOnly:c,isOpen:h,onPress:d,onDrag:p}=og(),f=y.useRef(null),g=y.useRef(!1);function m(){f.current&&window.clearTimeout(f.current),g.current=!1}return y.createElement("div",{onClick:function(){g.current?m():window.setTimeout(()=>{!function(){if(s||e||g.current)return m();if(m(),!o||0===o.length){u||i();return}if(a===o[o.length-1]&&u)return i();let t=o.findIndex(e=>e===a);-1===t||l(o[t+1])}()},120)},onPointerCancel:m,onPointerDown:e=>{c&&d(e),f.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{c&&p(e)},ref:n,"data-vaul-drawer-visible":h?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},y.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});oH.displayName="Drawer.Handle";let oq={Root:oU,NestedRoot:function({onDrag:e,onOpenChange:t,open:r,...n}){let{onNestedDrag:i,onNestedOpenChange:s,onNestedRelease:o}=og();if(!i)throw Error("Drawer.NestedRoot must be placed in another drawer");return y.createElement(oU,{nested:!0,open:r,onClose:()=>{s(!1)},onDrag:(t,r)=>{i(t,r),null==e||e(t,r)},onOpenChange:e=>{e&&s(e),null==t||t(e)},onRelease:o,...n})},Content:oW,Overlay:oV,Trigger:op.l9,Portal:function(e){let t=og(),{container:r=t.container,...n}=e;return y.createElement(op.ZL,{container:r,...n})},Handle:oH,Close:op.bm,Title:op.hE,Description:op.VY},oG=({open:e,onOpenChange:t,trigger:r,content:n,className:i,direction:a})=>(0,s.jsxs)(oq.Root,{modal:!0,open:e,onOpenChange:t,direction:a??"bottom",children:[(0,s.jsx)(oq.Trigger,{asChild:!0,children:r??""}),(0,s.jsxs)(oq.Portal,{children:[(0,s.jsx)(oq.Overlay,{className:"fixed inset-0 bg-black/40 z-999999"}),(0,s.jsx)(oq.Content,{className:(0,o.A)("flex flex-col rounded-t-[24px] mt-24 fixed bottom-0 left-0 right-0 z-9999999 overflow-hidden focus:outline-none shadow-[0_0_12px_rgba(0,0,0,0.2)]",i),children:n||""})]})]});function oz({className:e,...t}){return(0,s.jsx)("div",{"aria-hidden":"true",className:(0,o.A)("animate-pulse rounded-md bg-gray-200/70 dark:bg-gray-800",e),...t})}let oK=({lines:e=3,className:t})=>(0,s.jsx)("div",{className:(0,o.A)("flex flex-col gap-2",t),"aria-busy":"true",children:Array.from({length:e},(t,r)=>(0,s.jsx)(oz,{className:(0,o.A)("h-4",r===e-1?"w-2/3":"w-full")},r))})},34981:(e,t,r)=>{"use strict";r.d(t,{P:()=>iW});let n=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],i=new Set([...n,"pathRotation"]);var s=r(29993),o=r(32863),a=r(39643);let l=new Set(["brightness","contrast","saturate","opacity"]);function u(e){let[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[n]=r.match(a.S)||[];if(!n)return e;let i=r.replace(n,""),s=+!!l.has(t);return n!==r&&(s*=100),t+"("+s+i+")"}let c=/\b([a-z-]*)\(.*?\)/gu,h={...o.f,getAnimatableNone:e=>{let t=e.match(c);return t?t.map(u).join(" "):e}},d={...o.f,getAnimatableNone:e=>
31{let t=o.f.parse(e);return o.f.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}};var p=r(18138);let f={...p.ai,transform:Math.round};var g=r(15275);let m={rotate:g.uj,pathRotation:g.uj,rotateX:g.uj,rotateY:g.uj,rotateZ:g.uj,scale:p.hs,scaleX:p.hs,scaleY:p.hs,scaleZ:p.hs,skew:g.uj,skewX:g.uj,skewY:g.uj,distance:g.px,translateX:g.px,translateY:g.px,translateZ:g.px,x:g.px,y:g.px,z:g.px,perspective:g.px,transformPerspective:g.px,opacity:p.X4,originX:g.gQ,originY:g.gQ,originZ:g.px},v={borderWidth:g.px,borderTopWidth:g.px,borderRightWidth:g.px,borderBottomWidth:g.px,borderLeftWidth:g.px,borderRadius:g.px,borderTopLeftRadius:g.px,borderTopRightRadius:g.px,borderBottomRightRadius:g.px,borderBottomLeftRadius:g.px,width:g.px,maxWidth:g.px,height:g.px,maxHeight:g.px,top:g.px,right:g.px,bottom:g.px,left:g.px,inset:g.px,insetBlock:g.px,insetBlockStart:g.px,insetBlockEnd:g.px,insetInline:g.px,insetInlineStart:g.px,insetInlineEnd:g.px,padding:g.px,paddingTop:g.px,paddingRight:g.px,paddingBottom:g.px,paddingLeft:g.px,paddingBlock:g.px,paddingBlockStart:g.px,paddingBlockEnd:g.px,paddingInline:g.px,paddingInlineStart:g.px,paddingInlineEnd:g.px,margin:g.px,marginTop:g.px,marginRight:g.px,marginBottom:g.px,marginLeft:g.px,marginBlock:g.px,marginBlockStart:g.px,marginBlockEnd:g.px,marginInline:g.px,marginInlineStart:g.px,marginInlineEnd:g.px,fontSize:g.px,backgroundPositionX:g.px,backgroundPositionY:g.px,...m,zIndex:f,fillOpacity:p.X4,strokeOpacity:p.X4,numOctaves:f},y={...v,color:s.y,backgroundColor:s.y,outlineColor:s.y,fill:s.y,stroke:s.y,borderColor:s.y,borderTopColor:s.y,borderRightColor:s.y,borderBottomColor:s.y,borderLeftColor:s.y,filter:h,WebkitFilter:h,mask:d,WebkitMask:d},b=e=>y[e],_=()=>({translate:0,scale:1,origin:0,originPoint:0}),w=()=>({x:_(),y:_()}),k=()=>({min:0,max:0}),x=()=>({x:k(),y:k()}),E=e=>!!(e&&e.getVelocity),S=new Set(["width","height","top","left","right","bottom",...n]),P=[p.ai,g.px,g.KN,g.uj,g.vw,g.vh,{test:e=>"auto"===e,parse:e=>e}],R=e=>P.find(t=>t.test(e));var T=r(37022),A=r(75623);let C=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,j=new Set([h,d]);
31function O(e,t){let r=b(e);return j.has(r)||(r=o.f),r.getAnimatableNone?r.getAnimatableNone(t):void 0}let $=e=>180*e/Math.PI,I=e=>M($(Math.atan2(e[1],e[0]))),L={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:I,rotateZ:I,skewX:e=>$(Math.atan(e[1])),skewY:e=>$(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},M=e=>((e%=360)<0&&(e+=360),e),D=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),N=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),F={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:D,scaleY:N,scale:e=>(D(e)+N(e))/2,rotateX:e=>M($(Math.atan2(e[6],e[5]))),rotateY:e=>M($(Math.atan2(-e[2],e[0]))),rotateZ:I,rotate:I,skewX:e=>$(Math.atan(e[4])),skewY:e=>$(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function B(e){return+!!e.includes("scale")}function U(e,t){let r,n;if(!e||"none"===e)return B(t);let i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(i)r=F,n=i;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=L,n=t}if(!n)return B(t);let s=r[t],o=n[1].split(",").map(V);return"function"==typeof s?s(o):o[s]}function V(e){return parseFloat(e.trim())}let W=e=>e===p.ai||e===g.px,H=new Set(["x","y","z"]),q=n.filter(e=>!H.has(e)),G=new Set(["bottom","right"]);function z(e,t,r,n,i,s){let o=parseFloat(e);if(!isNaN(o))return o;let{min:a,max:l}=t()[r],u=l-a;return"border-box"===s?u:u-parseFloat(n)-parseFloat(i)}let K={width:({width:e,paddingLeft:t="0",paddingRight:r="0",boxSizing:n},i)=>z(e,i,"x",t,r,n),height:({height:e,paddingTop:t="0",paddingBottom:r="0",boxSizing:n},i)=>z(e,i,"y",t,r,n),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:r}=t();return parseFloat(e)+(r.max-r.min)},right:({left:e},t)=>{let{x:r}=t();return parseFloat(e)+(r.max-r.min)},x:({transform:e})=>U(e,"x"),y:({transform:e})=>U(e,"y")};K.translateX=K.x,K.translateY=K.y;var J=r(38554);let Y=new Set,X=!1,Z=!1,Q=!1;function ee(){if(Z){let e=[],t=new Set,r=new Set;Y.forEach(n=>{n.needsMeasurement&&(e.push(n),t.add(n.element),G.has(n.name)&&r.add(n.element))});let n=new Map;r.forEach(e=>{let t,r=(t=[],q.forEach(r=>{let n=e.getValue(r);if(void 0!==n){let e=n.get(),i=+!!r.startsWith("scale");if(e===i)return;t.push([r,e]),n.set(i)}}),t);r.length&&(n.set(e,r),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,r])=>{e.getValue(t)?.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Z=!1,X=!1,Y.forEach(e=>e.complete(Q)),Y.clear()}function et(){Y.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Z=!0)})}class er{constructor(e,t,r,n,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Y.add(this),X||(X=!0,J.Gt.read(et),J.Gt.resolveKeyframes(ee))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;if(null===e[0]){let i=n?.get(),s=e[e.length-1];if(void 0!==i)e[0]=i;else if(r&&t){let n=function(e,t,r){if("string"==typeof e){if(/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)||/^0[^.\s]+$/u.test(e))return parseFloat(e);if(!o.f.test(e)&&o.f.test(r))return O(t,r)}return e??void 0}(r.readValue(t,s),t,s);void 0!==n&&(e[0]=n)}void 0===e[0]&&(e[0]=s),n&&void 0===i&&n.set(e[0])}for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Y.delete(this)}cancel(){"scheduled"===this.state&&(Y.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}let en=new Set(["auto","none","0"]);class ei extends er{constructor(e,t,r,n,i){super(e,t,r,n,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let r=0;r<e.length;r++){let n=e[r];if("string"==typeof n&&(n=n.trim(),(0,A.pG)(n))){let i=function e(t,r,n=1){(0,T.V)(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[i,s]=function(e){let t=C.exec(e);if(!t)return[,];let[,r,n,i]=t;return[`--${r??n}`,i]}(t);if(!i)return;let o=window.getComputedStyle(r).getPropertyValue(i);if(o){let e=o.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)?parseFloat(e):e}return(0,A.pG)(s)?e(s,r,n+1):s}(n,t.current);void 0!==i&&(e[r]=i),r===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!S.has(r)||2!==e.length)return;let[n,i]=e;if("number"==typeof n&&"number"==typeof i)return;let s=R(n),o=R(i);if((0,A.rm)(n)!==(0,A.rm)(i)&&K[r]){this.needsMeasurement=!0;return}if(s!==o)if(W(s)&&W(o))for(let t=0;t<e.length;t++){let r=e[t];"string"==typeof r&&(e[t]=parseFloat(r))}else K[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,r=[];for(let t=0;t<e.length;t++)(null===e[t]||function(e){if("number"==typeof e)return 0===e;if(null===e)return!0;return"none"===e||"0"===e||/^0[^.\s]+$/u.test(e)}(e[t]))&&r.push(t);r.length&&function(e,t,r){let n,i=0;for(;i<e.length&&!n;){let t=e[i];"string"==typeof t&&!en.has(t)&&(0,o.nK)(t)&&(n=e[i]),i++}if(n&&r)for(let i of t)e[i]!==n&&(e[i]=O(r,n))}(e,r,t)}measure(){let{element:e,name:t}=this;return K[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;"height"===r&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let n=t[t.length-1];void 0!==n&&this.motionValue?.jump(n,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let r=t.length-1,n=t[r];t[r]=this.measure(),null!==n&&void 0===this.finalKeyframe&&(this.finalKeyframe=n),this.removedTransforms?.length&&this.removedTransforms.forEac
31h(([t,r])=>{e.getValue(t).set(r)}),this.resolveNoneKeyframes()}}let es=e=>1e3*e;var eo=r(61362),ea=r(799);function el(e,t,r){t.startsWith("--")?e.style.setProperty(t,r):e.style[t]=r}var eu=r(65779);let ec=e=>null!==e;function eh(e,{repeat:t,repeatType:r="loop"},n,i=1){let s=e.filter(ec),o=i<0||t&&"loop"!==r&&t%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}class ed{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}}var ep=r(98648);function ef(e,t){return{kind:e,animation:t,timestamp:ep.k.now(),frameTimestamp:J.uv.timestamp,frameIsProcessing:J.uv.isProcessing}}function eg(e,t,r){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...ef("animation-start",e),options:r?{...t,...r}:t})}catch{}}let em=e=>Array.isArray(e)&&"number"==typeof e[0],ev=(0,r(38721).J)(()=>{try{document.createElement("div").animate({opacity:0}
31,{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),ey=(e,t,r=10)=>{let n="",i=Math.max(Math.round(t/r),2);for(let t=0;t<i;t++)n+=Math.round(1e4*e(t/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},eb=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,e_={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:eb([0,.65,.55,1]),circOut:eb([.55,0,1,.45]),backIn:eb([.31,.01,.66,-.59]),backOut:eb([.33,1.53,.69,.99])};function ew(e){return"function"==typeof e&&"applyToOptions"in e}class ek extends ed{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:r,keyframes:n,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:o,onComplete:a}=e;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=e,(0,T.V)("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:e,...t}){return ew(e)&&ev()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=function(e,t,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u){let c={[t]:r};l&&(c.offset=l);let h=function e(t,r){if(t)return"function"==typeof t?ev()?ey(t,r):"ease-out":em(t)?eb(t):Array.isArray(t)?t.map(t=>e(t,r)||e_.easeOut):e_[t]}(a,i);Array.isArray(h)&&(c.easing=h);let d={delay:n,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:"reverse"===o?"alternate":"normal"};return u&&(d.pseudoElement=u),e.animate(c,d)}(t,r,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=eh(n,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),el(t,r,e),this.animation.cancel()}a?.(),this.notifyFinished()},eg(this,e,l)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(e){let t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=es(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:r,observe:n}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&(0,eu.J)())?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),r&&(this.animation.rangeEnd=r),ea.l):n(this)}}let ex=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);var eE=r(43138),eS=r(18791);let eP=new WeakMap;function eR(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function eT(e){return"string"==typeof e||Array.isArray(e)}let eA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],eC=["initial",...eA];function ej(e){if(eR(e.animate))return!0;for(let t=0;t<eC.length;t++)if(eT(e[eC[t]]))return!0;return!1}function eO(e){return!!(ej(e)||e.variants)}let e$={current:null},eI={current:!1},eL="u">typeof window;function eM(e){let t=[{},{}];return e?.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function eD(e,t,r,n){if("function"==typeof t){let[i,s]=eM(n);t=t(void 0!==r?r:e.custom,i,s)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[i,s]=eM(n);t=t(void 0!==r?r:e.custom,i,s)}return t}let eN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],eF={};class eB{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=er,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=ep.k.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,J.Gt.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=ej(t),this.isVariantNode=eO(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in h){const t=h[e];void 0!==l[e]&&E(t)&&t.set(l[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,eP.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
31h((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(eI.current||function(){if(eI.current=!0,eL)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>e$.current=e.matches;e.addEventListener("change",t),t()}else e$.current=!1}(),this.shouldReduceMotion=e$.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let e in this.projection&&this.projection.unmount(),(0,J.WG)(this.notifyUpdate),(0,J.WG)(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){let r;if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&ex.has(e)&&this.current instanceof HTMLElement){let{factory:r,keyframes:n,times:i,ease:s,duration:o}=t.accelerate,a=new ek({element:this.current,name:e,keyframes:n,times:i,ease:s,duration:es(o)}),l=r(a);this.valueSubscriptions.set(e,()=>{l(),a.cancel()});return}let n=i.has(e);n&&this.onBindTransform&&this.onBindTransform();let s=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&J.Gt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{s(),r&&r()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in eF){let t=eF[e];if(!t)continue;let{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):x()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<eN.length;t++){let r=eN[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);let n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){for(let n in t){let i=t[n],s=r[n];if(E(i))e.addValue(n,i);else if(E(s))e.addValue(n,(0,eS.OQ)(i,{owner:e}));else if(s!==i)if(e.hasValue(n)){let t=e.getValue(n);!0===t.liveStyle?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(n);e.addValue(n,(0,eS.OQ)(void 0!==t?t:i,{owner:e}))}}for(let n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=(0,eS.OQ)(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){let r=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=r){let n,i;"string"==typeof r&&(n=r,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n)||(i=r,/^0[^.\s]+$/u.test(i)))?r=parseFloat(r):"number"!=typeof r&&!o.f.test(r)&&o.f.test(t)&&(r=O(e,t)),this.setBaseTarget(e,E(r)?r.get():r)}return E(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t,{initial:r}=this.props;if("string"==typeof r||"object"==typeof r){let n=eD(this.props,r,this.presenceContext?.custom);n&&(t=n[e])}if(r&&void 0!==t)return t;let n=this.getBaseTargetFromProps(this.props,e);return void 0===n||E(n)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:n}on(e,t){return this.events[e]||(this.events[e]=new eo.v),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){eE.k.render(this.render)}}class eU extends eB{constructor(){super(...arguments),this.KeyframeResolver=ei}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){let r=e.style;return r?r[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;E(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function eV(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}let eW=(e,t)=>t&&"number"==typeof e?t.transform(e):e,eH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eq=n.length;function eG(e,t,r){let{style:s,vars:o,transformOrigin:a}=e,l=!1,u=!1;for(let e in t){let r=t[e];if(i.has(e)){l=!0;continue}if((0,A.j4)(e)){o[e]=r;continue}{let t=eW(r,v[e]);e.startsWith("origin")?(u=!0,a[e]=t):s[e]=t}}if(!t.transform&&(l||r?s.transform=function(e,t,r){let i="",s=!0;for(let o=0;o<eq;o++){let a=n[o],l=e[a];if(void 0===l)continue;let u=!0;
31if("number"==typeof l)u=l===+!!a.startsWith("scale");else{let e=parseFloat(l);u=a.startsWith("scale")?1===e:0===e}if(!u||r){let e=eW(l,v[a]);if(!u){s=!1;let t=eH[a]||a;i+=`${t}(${e}) `}r&&(t[a]=e)}}let o=e.pathRotation;return o&&(s=!1,i+=`rotate(${eW(o,v.pathRotation)}) `),i=i.trim(),r?i=r(t,s?"":i):s&&(i="none"),i}(t,e.transform,r):s.transform&&(s.transform="none")),u){let{originX:e="50%",originY:t="50%",originZ:r=0}=a;s.transformOrigin=`${e} ${t} ${r}`}}let ez={offset:"stroke-dashoffset",array:"stroke-dasharray"},eK={offset:"strokeDashoffset",array:"strokeDasharray"},eJ=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function eY(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},l,u,c){if(eG(e,a,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:h,style:d}=e;for(let e of eJ)void 0!==h[e]&&(d[e]=h[e],delete h[e]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),void 0!==t&&(h.x=t),void 0!==r&&(h.y=r),void 0!==n&&(h.scale=n),void 0!==i&&function(e,t,r=1,n=0,i=!0){e.pathLength=1;let s=i?ez:eK;e[s.offset]=`${-n}`,e[s.array]=`${t} ${r}`}(h,i,s,o,!1)}let eX=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),eZ=e=>"string"==typeof e&&"svg"===e.toLowerCase();function eQ(e,{style:t,vars:r},n,i){let s,o=e.style;for(s in t)o[s]=t[s];for(s in i?.applyProjectionStyles(o,n),r)o.setProperty(s,r[s])}let e0=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let e2={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!g.px.test(e))return e;else e=parseFloat(e);let r=e1(e,t.target.x),n=e1(e,t.target.y);return`${r}% ${n}%`}};var e8=r(39445);let e6={borderRadius:{...e2,applyTo:[...e0]},borderTopLeftRadius:e2,borderTopRightRadius:e2,borderBottomLeftRadius:e2,borderBottomRightRadius:e2,boxShadow:{correct:(e,{treeScale:t,projectionDelta:r})=>{let n=o.f.parse(e);if(n.length>5)return e;let i=o.f.createTransformer(e),s=+("number"!=typeof n[0]),a=r.x.scale*t.x,l=r.y.scale*t.y;n[0+s]/=a,n[1+s]/=l;let u=(0,e8.k)(a,l,.5);return"number"==typeof n[2+s]&&(n[2+s]/=u),"number"==typeof n[3+s]&&(n[3+s]/=u),i(n)}}};function e3(e,{layout:t,layoutId:r}){return i.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!e6[e]||"opacity"===e)}function e5(e,t,r){let n=e.style,i=t?.style,s={};if(!n)return s;for(let t in n)(E(n[t])||i&&E(i[t])||e3(t,e)||r?.getValue(t)?.liveStyle!==void 0)&&(s[t]=n[t]);return s}function e4(e,t,r){let i=e5(e,t,r);for(let r in e)(E(e[r])||E(t[r]))&&(i[-1!==n.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]);return i}class e9 extends eU{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=x}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(i.has(t)){let e=b(t);return e&&e.default||0}if(eJ.includes(t)){let r=getComputedStyle(e)[t];if("string"==typeof r&&r)return r.trim()}return t=eX.has(t)?t:eV(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return e4(e,t,r)}build(e,t,r){eY(e,t,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,t,r,n){for(let r in eQ(e,t,void 0,n),t.attrs)e.setAttribute(eX.has(r)?r:eV(r),t.attrs[r])}mount(e){this.isSVGTag=eZ(e.tagName),super.mount(e)}}function e7({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function te(e){return void 0===e||1===e}function tt({scale:e,scaleX:t,scaleY:r}){return!te(e)||!te(t)||!te(r)}function tr(e){return tt(e)||tn(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function tn(e){var t,r;return(t=e.x)&&"0%"!==t||(r=e.y)&&"0%"!==r}function ti(e,t,r,n,i){return void 0!==i&&(e=n+i*(e-n)),n+r*(e-n)+t}function ts(e,t=0,r=1,n,i){e.min=ti(e.min,t,r,n,i),e.max=ti(e.max,t,r,n,i)}function to(e,{x:t,y:r}){ts(e.x,t.translate,t.scale,t.originPoint),ts(e.y,r.translate,r.scale,r.originPoint)}function ta(e,t){e.min+=t,e.max+=t}function tl(e,t,r,n,i=.5){let s=(0,e8.k)(e.min,e.max,i);ts(e,t,r,s,n)}function tu(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function tc(e,t,r){let n=r??e;tl(e.x,tu(t.x,n.x),t.scaleX,t.scale,t.originX),tl(e.y,tu(t.y,n.y),t.scaleY,t.scale,t.originY)}function th(e,t){return e7(function(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}class td extends eU{constructor(){super(...arguments),this.type="html",this.renderInstance=eQ}mount(e){(0,T.V)(!!e.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(e,t){if(i.has(t))return this.projection?.isProjecting?B(t):((e,t)=>{let{transform:r="none"}=getComputedStyle(e);return U(r,t)})(e,t);{let r=window.getComputedStyle(e),n=((0,A.j4)(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return th(e,t)}build(e,t,r){eG(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return e5(e,t,r)}}var tp=r(76430);let tf=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function tg(e){if("string"!=typeof e||e.includes("-"));else if(tf.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}var tm=r(75038),tv=r(1867);let ty=(0,tp.createContext)({strict:!1});var tb=r(45890);let t_=(0,tp.createContext)({});function tw(e){return Array.isArray(e)?e.join(" "):e}let tk=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function tx(e,t,r){for(let n in t)E(t[n])||e3(n,r)||(e[n]=t[n])}let tE=()=>({...tk(),attrs:{}}),tS=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function tP(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||tS.has(e)}function tR(e){return E(e)?e.get():e}var tT=r(24943),tA=r(17655);let tC=e=>(t,r)=>{let n=(0,tp.useContext)(t_),i=(0,tp.useContext)(tT.t),s=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:function(e,t,r,n){let i={},s=n(e,{});for(let e in s)i[e]=tR(s[e]);let{initial:o,animate:a}=e,l=ej(e),u=eO(e);t&&u&&!l&&!1!==e.inherit&&(void 0===o&&(o=t.initial),void 0===a&&(a=t.animate));let c=!!r&&!1===r.initial,h=(c=c||!1===o)?a:o;if(h&&"boolean"!=typeof h&&!eR(h)){let t=Array.isArray(h)?h:[h];for(let r=0;r<t.length;r++){let n=eD(e,t[r]);if(n){let{transitionEnd:e,transition:t,...r}=n;for(let e in r){let t=r[e];if(Array.isArray(t)){let e=c?t.length-1:0;t=t[e]}null!==t&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}(r,n,i,e),renderState:t()}})(e,t,n,i);return r?s():(0,tA.M)(s)},tj=tC({scrapeMotionValuesFromProps:e5,createRenderState:tk}),tO=tC({scrapeMotionValuesFromProps:e4,createRenderState:tE}),t$={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},tI=!1;function tL(){return!function(){if(tI)return;let e={};for(let t in t$)e[t]={isEnabled:e=>t$[t].some(t=>!!e[t])};eF=e,tI=!0}(),eF}let tM=Symbol.for("motionComponentSymbol"),tD="data-"+eV("framerAppearId"),tN=(0,tp.createContext)({});function tF(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}var tB=r(6363);function tU(e,{forwardMotionProps:t=!1,type:r}={},n,i){n&&function(e){let t=tL();for(let r in e)t[r]={...t[r],...e[r]};eF=t}(n);let s=r?"svg"===r:tg(e),o=s?tO:tj;function a(r,n){var a;let l,u,c,h={...(0,tp.useContext)(tb.Q),...r,layoutId:function({layoutId:e}){let t=(0,tp.useContext)(tv.L).id;return t&&void 0!==e?t+"-"+e:e}(r)}
31,{isStatic:d,isValidProp:p}=h,f=function(e){let{initial:t,animate:r}=function(e,t){if(ej(e)){let{initial:t,animate:r}=e;return{initial:!1===t||eT(t)?t:void 0,animate:eT(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,(0,tp.useContext)(t_));return(0,tp.useMemo)(()=>({initial:t,animate:r}),[tw(t),tw(r)])}(r),g=o(r,d);if(!d&&"u">typeof window){(0,tp.useContext)(ty).strict;let t=function(e){let{drag:t,layout:r}=tL();if(!t&&!r)return{};let n={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(h);l=t.MeasureLayout,f.visualElement=function(e,t,r,n,i,s){let{visualElement:o}=(0,tp.useContext)(t_),a=(0,tp.useContext)(ty),l=(0,tp.useContext)(tT.t),u=(0,tp.useContext)(tb.Q),c=u.reducedMotion,h=u.skipAnimations,d=(0,tp.useRef)(null),p=(0,tp.useRef)(!1);n=n||a.renderer,!d.current&&n&&(d.current=n(e,{visualState:t,parent:o,props:r,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c,skipAnimations:h,isSVG:s}),p.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));let f=d.current,g=(0,tp.useContext)(tN);f&&!f.projection&&i&&("html"===f.type||"svg"===f.type)&&function(e,t,r,n){let{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:h}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&tF(a),visualElement:e,animationType:"string"==typeof s?s:"both",initialPromotionConfig:n,crossfade:h,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}(d.current,r,i,g);let m=(0,tp.useRef)(!1);(0,tp.useInsertionEffect)(()=>{f&&m.current&&f.update(r,l)});let v=r[tD],y=(0,tp.useRef)(!!v&&"u">typeof window&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return(0,tB.E)(()=>{p.current=!0,f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),y.current&&f.animationState&&f.animationState.animateChanges())}),(0,tp.useEffect)(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),y.current=!1),f.enteringChildren=void 0)}),f}(e,g,h,i,t.ProjectionNode,s)}return(0,tm.jsxs)(t_.Provider,{value:f,children:[l&&f.visualElement?(0,tm.jsx)(l,{visualElement:f.visualElement,...h}):null,function(e,t,r,{latestValues:n},i,s=!1,o,a){let l=(o??tg(e)?function(e,t,r,n){let i=(0,tp.useMemo)(()=>{let r=tE();return eY(r,t,eZ(n),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){let t={};tx(t,e.style,e),i.style={...t,...i.style}}return i}:function(e,t){let r,n,i={},s=(r=e.style||{},tx(n={},r,e),Object.assign(n,function({transformTemplate:e},t){return(0,tp.useMemo)(()=>{let r=tk();return eG(r,t,e),Object.assign({},r.vars,r.style)},[t])}(e,t)),n);return e.drag&&!1!==e.dragListener&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i})(t,n,i,e),u=function(e,t,r,n){let i={};for(let s in e)("values"!==s||"object"!=typeof e.values)&&!E(e[s])&&((s.startsWith("on")?!tP(s):n?.(s)??!tP(s))||!0===r&&tP(s)||!t&&!tP(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}(t,"string"==typeof e,s,a),c=e!==tp.Fragment?{...u,...l,ref:r}:{},{children:h}=t,d=(0,tp.useMemo)(()=>E(h)?h.get():h,[h]);return(0,tp.createElement)(e,{...c,children:d})}(e,r,(a=f.visualElement,u=(0,tp.useRef)(n),(0,tp.useInsertionEffect)(()=>{u.current=n}),c=(0,tp.useRef)(null),(0,tp.useCallback)(e=>{e&&g.onMount?.(e),a&&(e?a.mount(e):a.unmount());let t=u.current;if("function"==typeof t)if(e){let r=t(e);"function"==typeof r&&(c.current=r)}else c.current?(c.current(),c.current=null):t(e);else t&&(t.current=e)},[a])),g,d,t,s,p)]})}a.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;let l=(0,tp.forwardRef)(a);return l[tM]=e,l}class tV{constructor(e){this.isMounted=!1,this.node=e}update(){}}function tW(e,t,r){let n=e.getProps();return eD(n,t,void 0!==r?r:n.custom,e)}function tH(e,t){if(e?.inherit&&t){let{inherit:r,...n}=e;return{...t,...n}}return e}function tq(e,t){let r=e?.[t]??e?.default??e;return r!==e?tH(r,e):r}let tG=e=>Array.isArray(e);var tz=r(96151);function tK(e,t){let r=e.getValue("willChange");if(E(r)&&r.add)return r.add(t);
31if(!r&&tz.W.WillChange){let r=new tz.W.WillChange("auto");e.addValue("willChange",r),r.add(t)}}var tJ=r(86955),tY=r(41502),tX=r(65911);let tZ=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>J.Gt.update(t,e),stop:()=>(0,J.WG)(t),now:()=>J.uv.isProcessing?J.uv.timestamp:ep.k.now()}};function tQ(e,t=50,r=2e4,n){let i=0,s=e.next(i);for(n?.push(s.value);!s.done&&i<r;)i+=t,s=e.next(i),n?.push(s.value);return i>=r?1/0:i}let t0=.01,t1=2,t2=.005,t8=.5;function t6(e,t){return e*Math.sqrt(1-t*t)}let t3=["duration","bounce"],t5=["stiffness","damping","mass"];function t4(e,t){return t.some(t=>void 0!==e[t])}function t9(e=.3,t=.3){let r,n,i,s="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,o=s.keyframes[0],a=s.keyframes[s.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:c,mass:h,duration:d,velocity:p,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!t4(e,t5)&&t4(e,t3))if(t.velocity=0,e.visualDuration){let r=2*Math.PI/(1.2*e.visualDuration),n=r*r,i=2*(0,tY.q)(.05,1,1-(e.bounce||0))*Math.sqrt(n);t={...t,mass:1,stiffness:n,damping:i}}else{let r=function({duration:e=800,bounce:t=.3,velocity:r=0,mass:n=1}){let i,s;(0,T.$)(e<=es(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=(0,tY.q)(.05,1,o),e=(0,tY.q)(.01,10,e/1e3),o<1?(i=t=>{let n=t*o,i=n*e;return .001-(n-r)/t6(t,o)*Math.exp(-i)},s=t=>{let n=t*o*e,s=o*o*t*t*e,a=Math.exp(-n),l=t6(t*t,o);return(n*r+r-s)*a*(-i(t)+.001>0?-1:1)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-r)*e+1),s=t=>e*e*(r-t)*Math.exp(-t*e));let a=function(e,t,r){let n=r;for(let r=1;r<12;r++)n-=e(n)/t(n);return n}(i,s,5/e);if(e=es(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{let t=a*a*n;return{stiffness:t,damping:2*o*Math.sqrt(n*t),duration:e}}}({...e,velocity:0});(t={...t,...r,mass:1}).isResolvedFromDuration=!0}return t}({...s,velocity:-((s.velocity||0)/1e3)}),g=c/(2*Math.sqrt(u*h)),m=Math.sqrt(u/h)/1e3,v=g*m,y={target:a,delta:a-o,velocity:p||0,restSpeed:0,restDelta:0},b=()=>{let e=5>Math.abs(y.delta);y.restSpeed=s.restSpeed||(e?t0:t1),y.restDelta=s.restDelta||(e?t2:t8)};if(b(),g<1){let e=t6(m,g),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};i=()=>{t.A=(y.velocity+v*y.delta)/e,t.sinC=v*t.A+y.delta*e,t.cosC=v*y.delta-t.A*e};let s=r=>{r!==t.t&&(t.t=r,t.env=Math.exp(-v*r),t.sin=Math.sin(e*r),t.cos=Math.cos(e*r))};r=e=>(s(e),y.target-t.env*(t.A*t.sin+y.delta*t.cos)),n=e=>(s(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(1===g){r=e=>y.target-Math.exp(-m*e)*(y.delta+(y.velocity+m*y.delta)*e);let e={C:0};i=()=>{e.C=y.velocity+m*y.delta},n=t=>Math.exp(-m*t)*(m*e.C*t-y.velocity)}else{let e=m*Math.sqrt(g*g-1);r=t=>{let r=Math.exp(-v*t),n=Math.min(e*t,300);return y.target-r*((y.velocity+v*y.delta)*Math.sinh(n)+e*y.delta*Math.cosh(n))/e};let t={P:0,sinh:0,cosh:0};i=()=>{t.P=(y.velocity+v*y.delta)/e,t.sinh=v*t.P-y.delta*e,t.cosh=v*y.delta-t.P*e},n=r=>{let n=Math.exp(-v*r),i=Math.min(e*r,300);return n*(t.sinh*Math.sinh(i)+t.cosh*Math.cosh(i))}}i();let _=!t4(s,t5)&&t4(s,t3),w=f&&d||null,k={calculatedDuration:w,retarget:(e,t)=>{y.target=e[e.length-1],y.delta=y.target-e[0],y.velocity=_?0:-(t/1e3),s.restSpeed&&s.restDelta||b(),k.calculatedDuration=w,l.done=!1,i()},velocity:e=>es(n(e)),next:e=>{let t=r(e);return f?l.done=e>=d:l.done=Math.abs(es(n(e)))<=y.restSpeed&&Math.abs(y.target-t)<=y.restDelta,l.value=l.done?y.target:t,l},toString:()=>{let e=Math.min(tQ(k),2e4),t=ey(t=>k.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return k}function t7({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){let h,d,p=e[0],f={done:!1,value:p},g=r*t,m=p+g,v=void 0===o?m:o(m);v!==m&&(g=v-p);let y=e=>-g*Math.exp(-e/n),b=e=>{let t=y(e);f.done=Math.abs(t)<=u,f.value=f.done?v:v+t},_=e=>{let t;if((t=f.value)<a||t>l){var r;h=e,d=t9({keyframes:[f.value,(r=f.value,void 0===a?l:void 0===l||Math.abs(a-r)<Math.abs(l-r)?a:l)],velocity:-y(e)/n*1e3,damping:i,stiffness:s,restDelta:u,restSpeed:c})}};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return(d||void 0!==h||(t=!0,b(e),_(e)),void 0!==h&&e>
31=h)?d.next(e-h):(t||b(e),f)}}}t9.applyToOptions=e=>{let t=function(e,t=100,r){let n=r({...e,keyframes:[0,t]}),i=Math.min(tQ(n),2e4);return{type:"keyframes",ease:e=>n.next(i*e).value/t,duration:i/1e3}}(e,100,t9);return e.ease=t.ease,e.duration=es(t.duration),e.type="keyframes",e};let re=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function rt(e,t,r,n){return e===t&&r===n?ea.l:i=>0===i||1===i?i:re(function(e,t,r,n,i){let s,o,a=0;do(s=re(o=t+(r-t)/2,n,i)-e)>0?r=o:t=o;while(Math.abs(s)>1e-7&&++a<12);return o}(i,0,1,e,r),t,n)}let rr=rt(.42,0,1,1),rn=rt(0,0,.58,1),ri=rt(.42,0,.58,1),rs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ro=e=>t=>1-e(1-t),ra=rt(.33,1.53,.69,.99),rl=ro(ra),ru=rs(rl),rc=e=>e>=1?1:(e*=2)<1?.5*rl(e):.5*(2-Math.pow(2,-10*(e-1))),rh=e=>1-Math.sin(Math.acos(e)),rd=ro(rh),rp=rs(rh),rf={linear:ea.l,easeIn:rr,easeInOut:ri,easeOut:rn,circIn:rh,circInOut:rp,circOut:rd,backIn:rl,backInOut:ru,backOut:ra,anticipate:rc},rg=e=>{if(em(e)){(0,T.V)(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,i]=e;return rt(t,r,n,i)}return"string"==typeof e?((0,T.V)(void 0!==rf[e],`Invalid easing type '${e}'`,"invalid-easing-type"),rf[e]):e};var rm=r(6926),rv=r(11608);function ry({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){var i;let s=Array.isArray(n)&&"number"!=typeof n[0]?n.map(rg):rg(n),o={done:!1,value:t[0]};if(2===t.length&&!Array.isArray(s)&&(!r||2!==r.length||0===r[0]&&1===r[1])){let[r,n]=t,i=r===n?void 0:(tz.W.mix||tX.j)(r,n);return{calculatedDuration:e,next:t=>(o.value=i?i(s(e>0?(0,tY.q)(0,1,t/e):1)):n,o.done=t>=e,o)}}let a=(i=r&&r.length===t.length?r:(0,rv.Z)(t),i.map(t=>t*e)),l=(0,rm.G)(a,t,{ease:Array.isArray(s)?s:t.map(()=>s||ri).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(o.value=l(t),o.done=t>=e,o)}}var rb=r(17607);let r_={decay:t7,inertia:t7,tween:ry,keyframes:ry,spring:t9};function rw(e){"string"==typeof e.type&&(e.type=r_[e.type])}let rk=e=>e/100;class rx extends ed{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==ep.k.now()&&this.tick(ep.k.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause(),eg(this,this.options)}initAnimation(){let{options:e}=this;rw(e);let{type:t=ry,repeat:r=0,repeatDelay:n=0,repeatType:i,velocity:s=0}=e,{keyframes:o}=e,a=t||ry;a!==ry&&"number"!=typeof o[0]&&(this.mixKeyframes=(0,tJ.F)(rk,(0,tX.j)(o[0],o[1])),o=[0,100]);let l=a(o===e.keyframes?e:{...e,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...e,keyframes:[...o].reverse(),velocity:-s})),null===l.calculatedDuration&&(l.calculatedDuration=tQ(l));let{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+n,this.totalDuration=this.resolvedDuration*(r+1)-n,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){let r,{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);let{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:g,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let b=this.currentTime,_=n;if(h){let e=Math.min(this.currentTime,i)/a,t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,(t=Math.min(t,h+1))%2&&("reverse"===d?(r=1-r,p&&(r-=p/a)):"mirror"===d&&(_=o)),b=(0,tY.q)(0,1,r)*a}y?(this.delayState.value=c[0],r=this.delayState):r=_.next(b),s&&!y&&(r.value=s(r.value));let{done:w}=r;y||null===l||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&f!==t7&&(r.value=eh(c,this.options,m,this.speed)),g&&g(r.value),k&&this.finish(),r}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return this.currentTime/1e3}set time(e){e=es(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return function(e,t,r=0){var n,i;let s;return t<=0?r:e.velocity?e.velocity(t):(n=t=>e.next(t).value,i=e.next(t).value,s=Math.max(t-5,0),(0,rb.f)(i-n(s),t-s))}(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ep.k.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=tZ,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();let r=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=r):null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime||(this.startTime=t??r),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ep.k.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}let rE={anticipate:rc,backInOut:ru,circInOut:rp};class rS extends ek{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in rE&&(e.ease=rE[e.ease])}(e),rw(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:r,onComplete:n,element:i,...s}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);let o=new rx({...s,autoplay:!1}),a=Math.max(10,ep.k.now()-this.startTime),l=(0,tY.q)(0,10,a-10),u=o.sample(a).value,{name:c}=this.options;i&&c&&el(i,c,u),t.setWithVelocity(o.sample(Math.max(0,a-l)).value,u,l),o.stop()}}let rP=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(o.f.test(e)||"0"===e)&&!e.startsWith("url("));function rR(e){e.duration=0,e.type="keyframes"}var rT=r(7269);let rA=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/,rC=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),rj=(0,rT.p)(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class rO extends ed{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ep.k.now();const{keyframes:t,name:r,motionValue:n,element:i}=e;e.autoplay??(e.autoplay=!0),e.delay??(e.delay=0),e.type??(e.type="keyframes"),e.repeat??(e.repeat=0),e.repeatDelay??(e.repeatDelay=0),e.repeatType??(e.repeatType="loop");const s=i?.KeyframeResolver||er;this.keyframeResolver=new s(t,(t,r,n)=>this.onKeyframesResolved(t,r,e,!n),r,n,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,r,n){let i;this.keyframeResolver=void 0;let{name:s,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=r;this.resolvedAt=ep.k.now();let h=!0;!function(e,t,r,n){let i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;let s=e[e.length-1],o=rP(i,t),a=rP(s,t);return o&&a?function(e){let t=e[0];if(1===e.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}(e)||("spring"===r||ew(r))&&n:(o!==a&&(0,T.$)(!1,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!1)}(e,s,o,a)&&(h=!1,(tz.W.instantAnimations||!l)&&c?.(eh(e,r,t)),e[0]=e[e.length-1],rR(r),r.repeat=0);let d=n?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,{onComplete:p}=r;if(r.startTime??(r.startTime=d),r.finalKeyframe=t,r.keyframes=e,r.onComplete=()=>{p?.(),this.notifyFinished()},h&&!u&&function(e){let{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:s,type:o,keyframes:a}=e;if(!r||!(ex.has(r)||rC.has(r)))return!1;let l=t?.owner?.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;
31let{onUpdate:u,transformTemplate:c}=t.owner.getProps();return rj()&&(ex.has(r)||rC.has(r)&&function(e){for(let t=0;t<e.length;t++)if("string"==typeof e[t]&&rA.test(e[t]))return!0;return!1}(a))&&("transform"!==r||!c)&&!u&&!n&&"mirror"!==i&&0!==s&&"inertia"!==o}(r)){r.element=r.motionValue?.owner?.current;try{i=new rS(r)}catch{i=new rx(r)}}else i=new rx(r);this.pendingTimeline&&(this.stopTimeline=i.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=i}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Q=!0,et(),ee(),Q=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let r$={type:"spring",stiffness:500,damping:25,restSpeed:10},rI={type:"keyframes",duration:.8},rL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},rM=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]),rD=(e,t,r,n={},s,o)=>a=>{let l=tq(n,e)||{},u=l.delay||n.delay||0,{elapsed:c=0}=n;c-=es(u);let h={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:o?void 0:s};!function(e){for(let t in e)if(!rM.has(t))return!0;return!1}(l)&&Object.assign(h,((e,{keyframes:t})=>t.length>2?rI:i.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:r$:rL)(e,h)),h.duration&&(h.duration=es(h.duration)),h.repeatDelay&&(h.repeatDelay=es(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if(!1!==h.type&&(0!==h.duration||h.repeatDelay)||(rR(h),0===h.delay&&(d=!0)),(tz.W.instantAnimations||tz.W.skipAnimations||s?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,rR(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==t.get()){let e=eh(h.keyframes,l);if(void 0!==e)return void J.Gt.update(()=>{h.onUpdate(e),h.onComplete()})}return l.isSync?new rx(h):new rO(h)},rN="u">typeof window;function rF(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:s,transitionEnd:o,...a}=t,l=e.getDefaultTransition();s=s?tH(s,l):l;let u=s?.reduceMotion,c=s?.skipAnimations;n&&(s=n);let h=[],d=i&&e.animationState&&e.animationState.getState()[i],p=s?.path;for(let t in p&&p.animateVisualElement(e,a,s,r,h),a){let n=e.getValue(t,e.latestValues[t]??null),i=a[t];if(void 0===i||d&&function({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}(d,t))continue;let o={delay:r,...tq(s||{},t)};c&&(o.skipAnimations=!0);let l=n.get();if(void 0!==l&&!n.isAnimating()&&!Array.isArray(i)&&i===l&&!o.velocity){J.Gt.update(()=>n.set(i));continue}let p=!1;if(rN&&window.MotionHandoffAnimation){let r=e.props[tD];if(r){let e=window.MotionHandoffAnimation(r,t,J.Gt);null!==e&&(o.startTime=e,p=!0)}}tK(e,t);let f=u??e.shouldReduceMotion;n.start(rD(t,n,i,f&&S.has(t)?{type:!1}:o,e,p));let g=n.animation;g&&h.push(g)}if(o){let t=()=>J.Gt.update(()=>{o&&function(e,t){let{transitionEnd:r={},transition:n={},...i}=tW(e,t)||{};for(let t in i={...i,...r}){var s;let r=tG(s=i[t])?s[s.length-1]||0:s;e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,(0,eS.OQ)(r))}}(e,o)});h.length?Promise.all(h).then(t):t()}return h}function rB(e,t,r,n=0,i=1){let s=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,a=(o-1)*n;return"function"==typeof r?r(s,o):1===i?s*n:a-s*n}function rU(e,t,r={}){let n=tW(e,t,"exit"===r.type?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let s=n?()=>Promise.all(rF(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(n=0)=>{let{delayChildren:s=0,staggerChildren:o,staggerDirection:a}=i;return function(e,t,r=0,n=0,i=0,s=1,o){let a=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),a.push(rU(l,t,{...o,delay:r+("function"==typeof n?0:n)+rB(e.variantChildren,l,n,i,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}(e,t,n,s,o,a,r)}:()=>Promise.resolve(),{when:a}=i;if(!a)return Promise.all([s(),o(r.delay)]);{let[e,t]="beforeChildren"===a?[s,o]:[o,s];return e().then(()=>t())}}let rV=eC.length;function rW(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}let rH=[...eA].reverse(),rq=eA.length;function rG(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function rz(){return{animate:rG(!0),whileInView:rG(),whileHover:rG(),whileTap:rG(),whileDrag:rG(),whileFocus:rG(),exit:rG()}}class rK extends tV{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:r})=>(function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>rU(e,t,r)));else if("string"==typeof t)n=rU(e,t,r);else{let i="function"==typeof t?tW(e,t,r.custom):t;n=Promise.all(rF(e,i,r))}return n.then(()=>
31{e.notify("AnimationComplete",t)})})(e,t,r))),r=rz(),n=!0,i=!1,s=t=>(r,n)=>{let i=tW(e,n,"exit"===t?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...n}=i;r={...r,...n,...t}}return r};function o(o){let{props:a}=e,l=function e(t){if(!t)return;if(!t.isControllingVariants){let r=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(r.initial=t.props.initial),r}let r={};for(let e=0;e<rV;e++){let n=eC[e],i=t.props[n];(eT(i)||!1===i)&&(r[n]=i)}return r}(e.parent)||{},u=[],c=new Set,h={},d=1/0;for(let t=0;t<rq;t++){var p,f;let g=rH[t],m=r[g],v=void 0!==a[g]?a[g]:l[g],y=eT(v),b=g===o?m.isActive:null;!1===b&&(d=t);let _=v===l[g]&&v!==a[g]&&y;if(_&&(n||i)&&e.manuallyAnimateOnMount&&(_=!1),m.protectedKeys={...h},!m.isActive&&null===b||!v&&!m.prevProp||eR(v)||"boolean"==typeof v)continue;if("exit"===g&&m.isActive&&!0!==b){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}let w=(p=m.prevProp,"string"==typeof(f=v)?f!==p:!!Array.isArray(f)&&!rW(f,p)),k=w||g===o&&m.isActive&&!_&&y||t>d&&y,x=!1,E=Array.isArray(v)?v:[v],S=E.reduce(s(g),{});!1===b&&(S={});let{prevResolvedValues:P={}}=m,R={...P,...S},T=t=>{k=!0,c.has(t)&&(x=!0,c.delete(t)),m.needsAnimating[t]=!0;let r=e.getValue(t);r&&(r.liveStyle=!1)};for(let e in R){let t=S[e],r=P[e];if(!h.hasOwnProperty(e))(tG(t)&&tG(r)?!rW(t,r)||w:t!==r)?null!=t?T(e):c.add(e):void 0!==t&&c.has(e)?T(e):m.protectedKeys[e]=!0}m.prevProp=v,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(n||i)&&e.blockInitialAnimation&&(k=!1);let A=_&&w,C=!A||x;k&&C&&u.push(...E.map(t=>{let r={type:g};if("string"==typeof t&&(n||i)&&!A&&e.manuallyAnimateOnMount&&e.parent){let{parent:n}=e,i=tW(n,t);if(n.enteringChildren&&i){let{delayChildren:t}=i.transition||{};r.delay=rB(n.enteringChildren,e,t)}}return{animation:t,options:r}}))}if(c.size){let t={};if("boolean"!=typeof a.initial){let r=tW(e,Array.isArray(a.initial)?a.initial[0]:a.initial);r&&r.transition&&(t.transition=r.transition)}c.forEach(r=>{let n=e.getBaseTarget(r),i=e.getValue(r);i&&(i.liveStyle=!0),t[r]=n??null}),u.push({animation:t})}let g=!!u.length;return n&&(!1===a.initial||a.initial===a.animate)&&!e.manuallyAnimateOnMount&&(g=!1),n=!1,i=!1,g?t(u):Promise.resolve()}return{animateChanges:o,setActive:function(t,n){if(r[t].isActive===n)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,n)),r[t].isActive=n;let i=o(t);for(let e in r)r[e].protectedKeys={};return i},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=rz(),i=!0}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();eR(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let rJ=0;class rY extends tV{constructor(){super(...arguments),this.id=rJ++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&!1===r){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if("string"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)){let r=tW(this.node,e,t);if(r){let{transition:e,transitionEnd:t,...n}=r;for(let e in n)this.node.getValue(e)?.jump(n[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}let rX={x:!1,y:!1};function rZ(e){return[e("x"),e("y")]}function rQ(e){return e.max-e.min}function r0(e,t,r,n=.5){e.origin=n,e.originPoint=(0,e8.k)(t.min,t.max,e.origin),e.scale=rQ(r)/rQ(t),e.translate=(0,e8.k)(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function r1(e,t,r,n){r0(e.x,t.x,r.x,n?n.originX:void 0),r0(e.y,t.y,r.y,n?n.originY:void 0)}function r2(e,t,r,n=0){e.min=(n?(0,e8.k)(r.min,r.max,n):r.min)+t.min,e.max=e.min+rQ(t)}function r8(e,t,r,n=0){let i=n?(0,e8.k)(r.min,r.max,n):r.min;e.min=t.min-i,e.max=e.min+rQ(t)}function r6(e,t,r,n){r8(e.x,t.x,r.x,n?.x),r8(e.y,t.y,r.y,n?.y)}let r3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),r5=new Set(["INPUT","SELECT","TEXTAREA"]);function r4(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}var r9=r(28920);let r7=e=>
31"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function ne(e){return{point:{x:e.pageX,y:e.pageY}}}function nt(e,t,r,n){return r4(e,t,e=>r7(e)&&r(e,ne(e)),n)}let nr=({current:e})=>e?e.ownerDocument.defaultView:null,nn=(e,t)=>Math.abs(e-t),ni=new Set(["auto","scroll"]);class ns{constructor(e,t,{transformPagePoint:r,contextWindow:n=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=no(this.lastRawMoveEventInfo,this.transformPagePoint));let r=nl(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,i=(e=r.offset,t={x:0,y:0},Math.sqrt(nn(e.x,t.x)**2+nn(e.y,t.y)**2)>=this.distanceThreshold);if(!n&&!i)return;let{point:s}=r,{timestamp:o}=J.uv;this.history.push({...s,timestamp:o});let{onStart:a,onMove:l}=this.handlers;n||(a&&a(this.lastMoveEvent,r),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,r)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=no(t,this.transformPagePoint),J.Gt.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:r,onSessionEnd:n,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let s=nl("pointercancel"===e.type?this.lastMoveEventInfo:no(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,s),n&&n(e,s)},!r7(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=n||window;const a=no(ne(e),this.transformPagePoint),{point:l}=a,{timestamp:u}=J.uv;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=t;c&&c(e,nl(a,this.history));const h={passive:!0,capture:!0};this.removeListeners=(0,tJ.F)(nt(this.contextWindow,"pointermove",this.handlePointerMove,h),nt(this.contextWindow,"pointerup",this.handlePointerUp,h),nt(this.contextWindow,"pointercancel",this.handlePointerUp,h)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ni.has(e.overflowX)||ni.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let r=e===window,n=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:n.x-t.x,y:n.y-t.y};(0!==i.x||0!==i.y)&&(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,n),J.Gt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),(0,J.WG)(this.updatePoint)}}function no(e,t){return t?{point:t(e.point)}:e}function na(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nl({point:e},t){return{point:e,delta:na(e,nu(t)),offset:na(e,t[0]),velocity:function(e){if(e.length<2)return{x:0,y:0};let t=e.length-1,r=null,n=nu(e);for(;t>=0&&(r=e[t],!(n.timestamp-r.timestamp>es(.1)));)t--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&n.timestamp-r.timestamp>2*es(.1)&&(r=e[1]);let i=(n.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};let s={x:(n.x-r.x)/i,y:(n.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}(t)}}function nu(e){return e[e.length-1]}var nc=r(56802);function nh(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}
31function nd(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function np(e,t,r){return{min:nf(e,t),max:nf(e,r)}}function nf(e,t){return"number"==typeof e?e:e[t]||0}let ng=new WeakMap;class nm{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=x(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:r}={}){let{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;let i=e=>{t&&this.snapToCursor(ne(e).point),this.stopAnimation()},s=(e,t)=>{let{drag:r,dragPropagation:n,onDragStart:i}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(rX[e])return null;else return rX[e]=!0,()=>{rX[e]=!1};return rX.x||rX.y?null:(rX.x=rX.y=!0,()=>{rX.x=rX.y=!1})}(r),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rZ(e=>{let t=this.getAxisMotionValue(e).get()||0;if(g.KN.test(t)){let{projection:r}=this.visualElement;if(r&&r.layout){let n=r.layout.layoutBox[e];n&&(t=rQ(n)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&J.Gt.update(()=>i(e,t),!1,!0),tK(this.visualElement,"transform");let{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:r,dragDirectionLock:n,onDirectionLock:i,onDrag:s}=this.getProps();if(!r&&!this.openDragLock)return;let{offset:o}=t;if(n&&null===this.currentDirection){this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(o),null!==this.currentDirection&&i&&i(this.currentDirection);return}this.updateAxis("x",t.point,o),this.updateAxis("y",t.point,o),this.visualElement.render(),s&&J.Gt.update(()=>s(e,t),!1,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new ns(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:nr(this.visualElement),element:this.visualElement.current})}stop(e,t){let r=e||this.latestPointerEvent,n=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!n||!r)return;let{velocity:s}=n;this.startAnimation(s);let{onDragEnd:o}=this.getProps();o&&J.Gt.postRender(()=>o(r,n))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,r){let{drag:n}=this.getProps();if(!r||!ny(e,n,this.currentDirection))return;let i=this.getAxisMotionValue(e),s=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(s=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?(0,e8.k)(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?(0,e8.k)(r,e,n.max):Math.min(e,r)),e}(s,this.constraints[e],this.elastic[e])),i.set(s)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;e&&tF(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=function(e,{top:t,left:r,bottom:n,right:i}){return{x:nh(e.x,r,i),y:nh(e.y,t,n)}}(r.layoutBox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:np(e,"left","right"),y:np(e,"top","bottom")}}(t),n!==this.constraints&&!tF(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&rZ(e=>{var t,n;let i;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=r.layoutBox[e],n=this.constraints[e],i={},void 0!==n.min&&(i.min=n.min-t.min),void 0!==n.max&&(i.max=n.max-t.min),i))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!tF(t))return!1;let n=t.current;(0,T.V)(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());let s=function(e,t,r){let n=th(e,r),{scroll:i}=t;return i&&(ta(n.x,i.offset.x),ta(n.y,i.offset.y)),n}(n,i.root,this.visualElement.getTransformPagePoint()),o=(e=i.layout.layoutBox,{x:nd(e.x,s.x),y:nd(e.y,s.y)});if(r){let e=r(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=e7(e))}return o}startAnimation(e){let{drag:t,dragMomentum:r,dragElastic:n,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{};return Promise.all(rZ(o=>
31{if(!ny(o,t,this.currentDirection))return;let l=a&&a[o]||{};(!0===s||s===o)&&(l={min:0,max:0});let u={type:"inertia",velocity:r?e[o]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(o,u)})).then(o)}startAxisValueAnimation(e,t){let r=this.getAxisMotionValue(e);return tK(this.visualElement,e),r.start(rD(e,r,0,t,this.visualElement,!1))}stopAnimation(){rZ(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){rZ(t=>{let{drag:r}=this.getProps();if(!ny(t,r,this.currentDirection))return;let{projection:n}=this.visualElement,i=this.getAxisMotionValue(t);if(n&&n.layout){let{min:r,max:s}=n.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-(0,e8.k)(r,s,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!tF(t)||!r||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};rZ(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var r,i;let s,o,a,l=t.get();n[e]=(r={min:l,max:l},i=this.constraints[e],s=.5,o=rQ(r),(a=rQ(i))>o?s=(0,nc.q)(i.min,i.max-o,r.min):o>a&&(s=(0,nc.q)(r.min,r.max-a,i.min)),(0,tY.q)(0,1,s))}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),rZ(t=>{if(!ny(t,e,null))return;let r=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];r.set((0,e8.k)(i,s,n[t]))}),this.visualElement.render()}addListeners(){let e;if(!this.visualElement.current)return;ng.set(this.visualElement,this);let t=this.visualElement.current,r=nt(t,"pointerdown",e=>{let{drag:r,dragListener:n=!0}=this.getProps(),i=e.target,s=i!==t&&(r5.has(i.tagName)||!0===i.isContentEditable);r&&n&&!s&&this.start(e)}),n=()=>{var r,n,i;let s,o,{dragConstraints:a}=this.getProps();tF(a)&&a.current&&(this.constraints=this.resolveRefConstraints(),e||(r=t,n=a.current,i=()=>this.scalePositionWithinConstraints(),s=(0,r9.X)(r,nv(i)),o=(0,r9.X)(n,nv(i)),e=()=>{s(),o()}))},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),J.Gt.read(n);let o=r4(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(rZ(t=>{let r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),r(),s(),a&&a(),e&&e()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:s=.35,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:i,dragElastic:s,dragMomentum:o}}}function nv(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function ny(e,t,r){return(!0===t||t===e)&&(null===r||r===e)}class nb extends tV{constructor(e){super(e),this.removeGroupControls=ea.l,this.removeListeners=ea.l,this.controls=new nm(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ea.l}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}let n_=e=>(t,r)=>{e&&J.Gt.update(()=>e(t,r),!1,!0)};class nw extends tV{constructor(){super(...arguments),this.removePointerDownListener=ea.l}onPointerDown(e){this.session=new ns(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nr(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:n_(e),onStart:n_(t),onMove:n_(r),onEnd:(e,t)=>{delete this.session,n&&J.Gt.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=nt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let nk={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var nx=r(55992);let nE=!1;class nS extends tp.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),r&&r.register&&n&&r.register(i),nE&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),nk.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:r,drag:n,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,e.layoutDependency!==t&&s.setOptions({...s.options,layoutDependency:t}),nE=!0,n||e.layoutDependency!==t||void 0===t||e.isPresent!==i?s.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?s.promote():s.relegate()||J.Gt.postRender(()=>{let e=s.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=t,r.root.didUpdate(),eE.k.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;nE=!0,n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function nP(e){let[t,r]=(0,nx.xQ)(),n=(0,tp.useContext)(tv.L);return(0,tm.jsx)(nS,{...e,layoutGroup:n,switchLayoutGroup:(0,tp.useContext)(tN),isPresent:t,safeToRemove:r})}var nR=r(56477);let nT=e0.length,nA=e=>"string"==typeof e?parseFloat(e):e,nC=e=>"number"==typeof e||g.px.test(e);function nj(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let nO=nI(0,.5,rd),n$=nI(.5,.95,ea.l);function nI(e,t,r){return n=>n<e?0:n>t?1:r((0,nc.q)(e,t,n))}function nL(e,t){e.min=t.min,e.max=t.max}function nM(e,t){nL(e.x,t.x),nL(e.y,t.y)}function nD(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function nN(e,t,r,n,i){return e-=t,e=n+1/r*(e-n),void 0!==i&&(e=n+1/i*(e-n)),e}function nF(e,t,[r,n,i],s,o){!function(e,t=0,r=1,n=.5,i,s=e,o=e){if(g.KN.test(t)&&(t=parseFloat(t),t=(0,e8.k)(o.min,o.max,t/100)-o.min),"number"!=typeof t)return;let a=(0,e8.k)(s.min,s.max,n);e===s&&(a-=t),e.min=nN(e.min,t,r,a,i),e.max=nN(e.max,t,r,a,i)}(e,t[r],t[n],t[i],t.scale,s,o)}let nB=["x","scaleX","originX"],nU=["y","scaleY","originY"];function nV(e,t,r,n){nF(e.x,t,nB,r?r.x:void 0,n?n.x:void 0),nF(e.
31y,t,nU,r?r.y:void 0,n?n.y:void 0)}function nW(e){return 0===e.translate&&1===e.scale}function nH(e){return nW(e.x)&&nW(e.y)}function nq(e,t){return e.min===t.min&&e.max===t.max}function nG(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function nz(e,t){return nG(e.x,t.x)&&nG(e.y,t.y)}function nK(e){return rQ(e.x)/rQ(e.y)}function nJ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var nY=r(30448);class nX{constructor(){this.members=[]}add(e){(0,nY.Kq)(this.members,e);for(let t=this.members.length-1;t>=0;t--){let r=this.members[t];if(r===e||r===this.lead||r===this.prevLead)continue;let n=r.instance;n&&!1!==n.isConnected||r.snapshot||((0,nY.Ai)(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if((0,nY.Ai)(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(!1!==e.isPresent&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();let{layoutDependency:n}=r.options,{layoutDependency:i}=e.options;(void 0===n||n!==i)&&(e.resumeFrom=r,t&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}let nZ=(e,t)=>e.depth-t.depth;class nQ{constructor(){this.children=[],this.isDirty=!1}add(e){(0,nY.Kq)(this.children,e),this.isDirty=!0}remove(e){(0,nY.Ai)(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(nZ),this.isDirty=!1,this.children.forEach(e)}}let n0=["","X","Y","Z"],n1=0;function n2(e,t,r,n){let{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function n8({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(e={},r=t?.()){this.id=n1++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(n5),this.nodes.forEach(io),this.nodes.forEach(ia),this.nodes.forEach(n4)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new nQ)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new eo.v),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=(0,nR.x)(t)&&(!(0,nR.x)(t)||"svg"!==t.tagName),this.instance=t;let{layoutId:r,layout:n,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(n||r)&&(this.isLayoutDirty=!0),e){let r,n=0,i=()=>this.root.updateBlockedByResize=!1;J.Gt.read(()=>{n=window.innerWidth}),e(t,()=>{let e=window.innerWidth;if(e!==n){let t,s;n=e,this.root.updateBlockedByResize=!0,r&&r(),t=ep.k.now(),s=({timestamp:e})=>{let r=e-t;r>=250&&((0,J.WG)(s),i())},J.Gt.setup(s,!0),r=()=>(0,J.WG)(s),nk.hasAnimatedSinceResize&&(nk.hasAnimatedSinceResize=!1,this.nodes.forEac
31h(is))}})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&i&&(r||n)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let s=this.options.transition||i.getDefaultTransition()||ip,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=i.getProps(),l=!this.targetLayout||!nz(this.targetLayout,n),u=!t&&r;if(this.options.layoutRoot||this.resumeFrom||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...tq(s,"layout"),onPlay:o,onComplete:a};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,u,t.path)}else t||is(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),(0,J.WG)(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(il),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:r}=t.options;if(!r)return;let n=r.props[tD];if(window.MotionHasOptimisedAnimation(n,"transform")){let{layout:e,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",J.Gt,!(e||r))}let{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&e(i)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,("string"==typeof t.latestValues.x||"string"==typeof t.latestValues.y)&&(t.isLayoutDirty=!0),t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;let n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(ie),this.nodes.forEach(n7);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(it);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ir),this.nodes.forEach(ii),this.nodes.forEach(n6),this.nodes.forEach(n3)):this.nodes.forEach(it),this.clearAllSnapshots();let e=ep.k.now();J.uv.delta=(0,tY.q)(0,1e3/60,e-J.uv.timestamp),J.uv.timestamp=e,J.uv.isProcessing=!0,J.PP.update.process(J.uv),J.PP.preRender.process(J.uv),J.PP.render.process(J.uv),J.uv.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,eE.k.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(n9),this.sharedNodes.forEach(iu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,J.Gt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){J.Gt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||rQ(this.snapshot.measuredBox.x)||rQ(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=x()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!nH(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;e&&this.instance&&(t||tr(this.latestValues)||s)&&(i(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let r=this.measurePageBox(),n=this.removeElementScroll(r);return e&&(n=this.removeTransform(n)),iv((t=n).x),iv(t.y),{animationId:this.root.animationId,measuredBox:r,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return x();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ib))){let{scroll:e}=this.root;e&&(ta(t.x,e.offset.x),ta(t.y,e.offset.y))}return t}removeElementScroll(e){let t=x();if(nM(t,e),this.scroll?.wasRoot)return t;for(let r=0;r<this.path.length;r++){let n=this.path[r],{scroll:i,options:s}=n;n!==this.root&&i&&s.layoutScroll&&(i.wasRoot&&nM(t,e),ta(t.x,i.offset.x),ta(t.y,i.offset.y))}return t}applyTransform(e,t=!1,r){let n=r||x();nM(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(ta(n.x,-r.scroll.offset.x),ta(n.y,-r.scroll.offset.y)),tr(r.latestValues)&&tc(n,r.latestValues,r.layout?.layoutBox)}return tr(this.latestValues)&&tc(n,this.latestValues,this.layout?.layoutBox),n}removeTransform(e){let t=x();nM(t,e);for(let e=0;e<this.path.length;e++){let r,n=this.path[e];tr(n.latestValues)&&(n.instance&&(tt(n.latestValues)&&n.updateSnapshot(),nM(r=x(),n.measurePageBox())),nV(t,n.latestValues,n.snapshot?.layoutBox,r))}return tr(this.latestValues)&&nV(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==J.uv.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.
31isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let r=!!this.resumingFrom||this!==t;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:n,layoutId:i}=this.options;if(!this.layout||!(n||i))return;this.resolvedRelativeTargetAt=J.uv.timestamp;let s=this.getClosestProjectingParent();if(s&&this.linkedParentVersion!==s.layoutVersion&&!s.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&s&&s.layout?this.createRelativeTarget(s,this.layout.layoutBox,s.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=x(),this.targetWithTransforms=x()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var o,a,l,u;this.forceRelativeParentToResolveTarget(),o=this.target,a=this.relativeTarget,l=this.relativeParent.target,u=this.options.layoutAnchor||void 0,r2(o.x,a.x,l.x,u?.x),r2(o.y,a.y,l.y,u?.y)}else this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):nM(this.target,this.layout.layoutBox),to(this.target,this.targetDelta)):nM(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&s&&!!s.resumingFrom==!!this.resumingFrom&&!s.options.layoutScroll&&s.target&&1!==this.animationProgress?this.createRelativeTarget(s,this.target,s.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||tt(this.parent.latestValues)||tn(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,r){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=x(),this.relativeTargetOrigin=x(),r6(this.relativeTargetOrigin,t,r,this.options.layoutAnchor||void 0),nM(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,r=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(r=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===J.uv.timestamp&&(r=!1),r)return;let{layout:n,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(n||i))return;nM(this.layoutCorrected,this.layout.layoutBox);let s=this.treeScale.x,o=this.treeScale.y;!function(e,t,r,n=!1){let i,s,o=r.length;if(o){t.x=t.y=1;for(let a=0;a<o;a++){s=(i=r[a]).projectionDelta;let{visualElement:o}=i.options;(!o||!o.props.style||"contents"!==o.props.style.display)&&(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(ta(e.x,-i.scroll.offset.x),ta(e.y,-i.scroll.offset.y)),s&&(t.x*=s.x.scale,t.y*=s.y.scale,to(e,s)),n&&tr(i.latestValues)&&tc(e,i.latestValues,i.layout?.layoutBox))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=x());let{target:a}=e;if(!a){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(nD(this.prevProjectionDelta.x,this.projectionDelta.x),nD(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),r1(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===s&&this.treeScale.y===o&&nJ(this.projectionDelta.x,this.prevProjectionDelta.x)&&nJ(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=w(),this.projectionDelta=w(),this.projectionDeltaWithTransform=w()}setAnimationOrigin(e,t=!1,r){let n,i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},a=w();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let l=x(),u=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),h=!c||c.members.length<=1,d=!!(u&&!h&&
31!0===this.options.crossfade&&!this.path.some(id));this.animationProgress=0;let p=r?.interpolateProjection(e);this.mixTargetDelta=t=>{let r=t/1e3,i=p?.(r);if(i?(a.x.translate=i.x,a.x.scale=(0,e8.k)(e.x.scale,1,r),a.x.origin=e.x.origin,a.x.originPoint=e.x.originPoint,a.y.translate=i.y,a.y.scale=(0,e8.k)(e.y.scale,1,r),a.y.origin=e.y.origin,a.y.originPoint=e.y.originPoint):(ic(a.x,e.x,r),ic(a.y,e.y,r)),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var c,f,m,v,y,b;r6(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),m=this.relativeTarget,v=this.relativeTargetOrigin,y=l,b=r,ih(m.x,v.x,y.x,b),ih(m.y,v.y,y.y,b),n&&(c=this.relativeTarget,f=n,nq(c.x,f.x)&&nq(c.y,f.y))&&(this.isProjectionDirty=!1),n||(n=x()),nM(n,this.relativeTarget)}u&&(this.animationValues=o,function(e,t,r,n,i,s){i?(e.opacity=(0,e8.k)(0,r.opacity??1,nO(n)),e.opacityExit=(0,e8.k)(t.opacity??1,0,n$(n))):s&&(e.opacity=(0,e8.k)(t.opacity??1,r.opacity??1,n));for(let i=0;i<nT;i++){let s=e0[i],o=nj(t,s),a=nj(r,s);(void 0!==o||void 0!==a)&&(o||(o=0),a||(a=0),0===o||0===a||nC(o)===nC(a)?(e[s]=Math.max((0,e8.k)(nA(o),nA(a),n),0),(g.KN.test(a)||g.KN.test(o))&&(e[s]+="%")):e[s]=a)}(t.rotate||r.rotate)&&(e.rotate=(0,e8.k)(t.rotate||0,r.rotate||0,n))}(o,s,this.latestValues,r,d,h)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&((0,J.WG)(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=J.Gt.update(()=>{var t,r,n;let i;nk.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=(0,eS.OQ)(0)),this.motionValue.jump(0,!1),this.currentAnimation=(t=this.motionValue,r=[0,1e3],n={...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}},(i=E(t)?t:(0,eS.OQ)(t)).start(rD("",i,r,n)),i.animation),function(e,t){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...ef("layout-animation-start",e),node:t})}catch{}}(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:r,latestValues:n}=e,{target:i}=e;if(t&&i&&r){if(this!==e&&this.layout&&r&&iy(this.options.animationType,this.layout.layoutBox,r.layoutBox)){i=this.target||x();let t=rQ(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let r=rQ(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+r}nM(t,i),tc(t,n),r1(this.projectionDeltaWithTransform,this.layoutCorrected,t,n)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new nX),this.sharedNodes.get(e).add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){let n=this.getStack();n&&n.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}
31resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;let n={};r.z&&n2("z",e,n,this.animationValues);for(let t=0;t<n0.length;t++)n2(`rotate${n0[t]}`,e,n,this.animationValues),n2(`skew${n0[t]}`,e,n,this.animationValues);for(let t in e.render(),n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=tR(t?.pointerEvents)||"",e.transform=r?r(this.latestValues,""):"none";return}let n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=tR(t?.pointerEvents)||""),this.hasProjected&&!tr(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1);return}e.visibility="";let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let s=function(e,t,r){let n="",i=e.x.translate/t.x,s=e.y.translate/t.y,o=r?.z||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:s,rotateY:o,skewX:a,skewY:l}=r;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),i&&(n+=`rotate(${i}deg) `),s&&(n+=`rotateX(${s}deg) `),o&&(n+=`rotateY(${o}deg) `),a&&(n+=`skewX(${a}deg) `),l&&(n+=`skewY(${l}deg) `)}let a=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==a||1!==l)&&(n+=`scale(${a}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,i);r&&(s=r(i,s)),e.transform=s;let{x:o,y:a}=this.projectionDelta;for(let t in e.transformOrigin=`${100*o.origin}% ${100*a.origin}% 0`,n.animationValues?e.opacity=n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=n===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0,e6){if(void 0===i[t])continue;let{correct:r,applyTo:o,isCSSVariable:a}=e6[t],l="none"===s?i[t]:r(i[t],n);if(o){let t=o.length;for(let r=0;r<t;r++)e[o[r]]=l}else a?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=n===this?tR(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(n7),this.root.sharedNodes.clear()}}}function n6(e){e.updateLayout()}function n3(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:n}=e.layout,{animationType:i}=e.options,s=t.source!==e.layout.source;if("size"===i)rZ(e=>{let n=s?t.measuredBox[e]:t.layoutBox[e],i=rQ(n);n.min=r[e].min,n.max=n.min+i});else if("x"===i||"y"===i){let e="x"===i?"y":"x";nL(s?t.measuredBox[e]:t.layoutBox[e],r[e])}else iy(i,t.layoutBox,r)&&rZ(n=>{let i=s?t.measuredBox[n]:t.layoutBox[n],o=rQ(r[n]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+o)});let o=w();r1(o,r,t.layoutBox);let a=w();s?r1(a,e.applyTransform(n,!0),t.measuredBox):r1(a,r,t.layoutBox);let l=!nH(o),u=!1;if(!e.resumeFrom){let n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:i,layout:s}=n;if(i&&s){let o=e.options.layoutAnchor||void 0,a=x();r6(a,t.layoutBox,i.layoutBox,o);let l=x();r6(l,r,s.layoutBox,o),nz(a,l)||(u=!0),n.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=a,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function n5(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function n4(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function n9(e){e.clearSnapshot()}function n7(e){e.clearMeasurements()}function ie(e){e.isLayoutDirty=!0,e.updateLayout()}function it(e){e.isLayoutDirty=!1}function ir(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ii(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function is(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function io(e){e.resolveTargetDelta()}function ia(e){e.calcProjection()}
31function il(e){e.resetSkewAndRotation()}function iu(e){e.removeLeadSnapshot()}function ic(e,t,r){e.translate=(0,e8.k)(t.translate,0,r),e.scale=(0,e8.k)(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function ih(e,t,r,n){e.min=(0,e8.k)(t.min,r.min,n),e.max=(0,e8.k)(t.max,r.max,n)}function id(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let ip={duration:.45,ease:[.4,0,.1,1]},ig=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),im=ig("applewebkit/")&&!ig("chrome/")?Math.round:ea.l;function iv(e){e.min=im(e.min),e.max=im(e.max)}function iy(e,t,r){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(nK(t)-nK(r)))}function ib(e){return e!==e.root&&e.scroll?.wasRoot}let i_=n8({attachResizeListener:(e,t)=>r4(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),iw={current:void 0},ik=n8({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!iw.current){let e=new i_({});e.mount(window),e.setOptions({layoutScroll:!0}),iw.current=e}return iw.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});var ix=r(605);function iE(e,t){let r=(0,ix.K)(e),n=new AbortController;return[r,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function iS(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);let i=n["onHover"+r];i&&J.Gt.postRender(()=>i(t,ne(t)))}class iP extends tV{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){let[n,i,s]=iE(e,r);return n.forEach(e=>{let r,n=!1,s=!1,o=t=>{r&&(r(t),r=void 0),e.removeEventListener("pointerleave",l)},a=e=>{n=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),s&&(s=!1,o(e))},l=e=>{if("touch"!==e.pointerType){if(n){s=!0;return}o(e)}};e.addEventListener("pointerenter",n=>{if("touch"===n.pointerType||rX.x||rX.y)return;s=!1;let o=t(e,n);"function"==typeof o&&(r=o,e.addEventListener("pointerleave",l,i))},i),e.addEventListener("pointerdown",()=>{n=!0,window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",a,i)},i)}),s}(e,(e,t)=>(iS(this.node,t,"Start"),e=>iS(this.node,e,"End"))))}unmount(){}}class iR extends tV{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=(0,tJ.F)(r4(this.node.current,"focus",()=>this.onFocus()),r4(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}var iT=r(23694);let iA=(e,t)=>!!t&&(e===t||iA(e,t.parentElement)),iC=new WeakSet;function ij(e){return t=>{"Enter"===t.key&&e(t)}}function iO(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function i$(e){return r7(e)&&!(rX.x||rX.y)}let iI=new WeakSet;function iL(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);let i=n["onTap"+("End"===r?"":r)];i&&J.Gt.postRender(()=>i(t,ne(t)))}class iM extends tV{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:r}=this.node.props;this.unmount=function(e,t,r={}){let[n,i,s]=iE(e,r),o=e=>{let n=e.currentTarget;if(!i$(e)||iI.has(e))return;iC.add(n),r.stopPropagation&&iI.add(e);let s=t(n,e),o={...i,capture:!0},a=(e,t)=>{window.removeEventListener("pointerup",l,o),window.removeEventListener("pointercancel",u,o),iC.has(n)&&iC.delete(n),i$(e)&&"function"==typeof s&&s(e,{success:t})},l=e=>{a(e,n===window||n===document||r.useGlobalTarget||iA(n,e.target))},u=e=>{a(e,!1)};window.addEventListener("pointerup",l,o),window.addEventListener("pointercancel",u,o)};
31return n.forEach(e=>{((r.useGlobalTarget?window:e).addEventListener("pointerdown",o,i),(0,iT.s)(e))&&(e.addEventListener("focus",e=>((e,t)=>{let r=e.currentTarget;if(!r)return;let n=ij(()=>{if(iC.has(r))return;iO(r,"down");let e=ij(()=>{iO(r,"up")});r.addEventListener("keyup",e,t),r.addEventListener("blur",()=>iO(r,"cancel"),t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)})(e,i)),r3.has(e.tagName)||!0===e.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),s}(e,(e,t)=>(iL(this.node,t,"Start"),(e,{success:t})=>iL(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:r?.tap===!1})}unmount(){}}let iD=new WeakMap,iN=new WeakMap,iF=e=>{let t=iD.get(e.target);t&&t(e)},iB=e=>{e.forEach(iF)},iU={some:0,all:1};class iV extends tV{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.stopObserver?.();let{viewport:r={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:o}=r,a={root:n?n.current:void 0,rootMargin:i,threshold:"number"==typeof s?s:iU[s]},l=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,o&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),i=t?r:n;i&&i(e)};this.stopObserver=(e=this.node.current,t=function({root:e,...t}){let r=e||document;iN.has(r)||iN.set(r,{});let n=iN.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(iB,{root:e,...t})),n[i]}(a),iD.set(e,l),t.observe(e),()=>{iD.delete(e),t.unobserve(e)})}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}let iW=function(e,t){if("u"<typeof Proxy)return tU;let r=new Map,n=(r,n)=>tU(r,n,e,t);return new Proxy((e,t)=>n(e,t),{get:(i,s)=>"create"===s?n:(r.has(s)||r.set(s,tU(s,void 0,e,t)),r.get(s))})}({animation:{Feature:rK},exit:{Feature:rY},inView:{Feature:iV},tap:{Feature:iM},focus:{Feature:iR},hover:{Feature:iP},pan:{Feature:nw},drag:{Feature:nb,ProjectionNode:ik,MeasureLayout:nP},layout:{ProjectionNode:ik,MeasureLayout:nP}},(e,t)=>t.isSVG??tg(e)?new e9(t):new td(t,{allowProjection:e!==tp.Fragment}))},36859:(e,t,r)=>{"use strict";r.d(t,{Dc:()=>c,TL:()=>l});var n,i=r(76430),s=r(5701),o=Object.defineProperty,a=(e,t)=>o(e,"name",{value:t,configurable:!0});function l(e){let t=i.forwardRef((t,r)=>{let{children:n,...o}=t,a=null,l=!1,u=[];m(n)&&"function"==typeof _&&(n=_(n._payload)),i.Children.forEach(n,e=>{if(f(e)){l=!0;let t="child"in e.props?e.props.child:e.props.children;m(t)&&"function"==typeof _&&(t=_(t._payload)),a=h(e,t),u.push(a?.props?.children)}else u.push(e)}),a?a=i.cloneElement(a,void 0,u):!l&&1===i.Children.count(n)&&i.isValidElement(n)&&(a=n);let c=a?p(a):void 0,g=(0,s.s)(r,c);if(!a){if(n||0===n)throw Error(l?b(e):y(e));return n}let v=d(o,a.props??{});return a.type!==i.Fragment&&(v.ref=r?g:c),i.cloneElement(a,v)});return t.displayName=`${e}.Slot`,t}a(l,"createSlot");var u=Symbol.for("radix.slottable");function c(e){let t=a(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=u,t}a(c,"createSlottable");var h=a((e,t)=>{if("child"in e.props){let t=e.props.child;return i.isValidElement(t)?i.cloneElement(t,void 0,e.props.children(t.props.children)):null}return i.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function d(e,t){let r={...t};for(let n in t){let i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...e)=>{let t=s(...e);return i(...e),t}:i&&(r[n]=i):"style"===n?r[n]={...i,...s}:"className"===n&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function p(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function f(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===u}a(d,"mergeProps"),a(p,"getElementRef"),a(f,"isSlottable");var g=Symbol.for("react.lazy");function m(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&v(e._payload)}function v(e){return"object"==typeof e&&null!==e&&"then"in e}a(m,"isLazyComponent"),a(v,"isPromiseLike");var y=a(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),b=a(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),_=(n||(n=r.t(i,2)))[" use ".trim().toString()]},37022:(e,t,r)=>{"use strict";r.d(t,{$:()=>n,V:()=>i}),r(31075);let n=()=>{},i=()=>{}},38554:(e,t,r)=>{"use strict";r.d(t,{Gt:()=>i,PP:()=>a,WG:()=>s,uv:()=>o});var n=r(799);let{schedule:i,cancel:s,state:o,steps:a}=(0,r(85509).I)("u">typeof requestAnimationFrame?requestAnimationFrame:n.l,!0)},38721:(e,t,r)=>{"use strict";r.d(t,{J:()=>s});var n=r(7269);let i={};function s(e,t){let r=(0,n.p)(e);return()=>i[t]??r()}},39445:(e,t,r)=>{"use strict";r.d(t,{k:()=>n});let n=(e,t,r)=>e+(t-e)*r},39643:(e,t,r)=>{"use strict";r.d(t,{S:()=>n});let n=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu},40544:(e,t,r)=>{"use strict";r.d(t,{B:()=>u});var n,i=r(76430),s=r(52652),o=Object.defineProperty,a=(n||(n=r.t(i,2)))[" useId ".trim().toString()]||(()=>void 0),l=0;function u(e){let[t,r]=i.useState(a());return(0,s.N)(()=>{e||r(e=>e??String(l++))},[e]),e||(t?`radix-${t}`:"")}o(u,"name",{value:"useId",configurable:!0})},41502:(e,t,r)=>{"use strict";r.d(t,{q:()=>n});let n=(e,t,r)=>r>t?t:r<e?e:r},41731:(e,t,r)=>{"use strict";r.d(t,{B:()=>l});var n=r(41502),i=r(18138),s=r(62682),o=r(85735);let a={...i.ai,transform:e=>Math.round((0,n.q)(0,255,e))},l={test:(0,o.$)("rgb","red"),parse:(0,o.q)("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+a.transform(e)+", "+a.transform(t)+", "+a.transform(r)+", "+(0,s.a)(i.X4.transform(n))+")"}},42098:(e,t,r)=>{"use strict";r.d(t,{D:()=>c,N:()=>h});var n=r(76430),i=(e,t,r,n,i,s,o,a)=>
31{let l=document.documentElement,u=["light","dark"];function c(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&s?i.map(e=>s[e]||e):i;r?(l.classList.remove(...n),l.classList.add(s&&s[t]?s[t]:t)):l.setAttribute(e,t)}),r=t,a&&u.includes(r)&&(l.style.colorScheme=r)}if(n)c(n);else try{let e=localStorage.getItem(t)||r,n=o&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(n)}catch(e){}},s=["light","dark"],o="(prefers-color-scheme: dark)",a="u"<typeof window,l=n.createContext(void 0),u={setTheme:e=>{},themes:[]},c=()=>{var e;return null!=(e=n.useContext(l))?e:u},h=e=>n.useContext(l)?n.createElement(n.Fragment,null,e.children):n.createElement(p,{...e}),d=["light","dark"],p=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:i=!0,storageKey:a="theme",themes:u=d,defaultTheme:c=r?"system":"light",attribute:h="data-theme",value:p,children:y,nonce:b,scriptProps:_})=>{let[w,k]=n.useState(()=>g(a,c)),[x,E]=n.useState(()=>"system"===w?v():w),S=p?Object.values(p):u,P=n.useCallback(e=>{let n=e;if(!n)return;"system"===e&&r&&(n=v());let o=p?p[n]:n,a=t?m(b):null,l=document.documentElement,u=e=>{"class"===e?(l.classList.remove(...S),o&&l.classList.add(o)):e.startsWith("data-")&&(o?l.setAttribute(e,o):l.removeAttribute(e))};if(Array.isArray(h)?h.forEach(u):u(h),i){let e=s.includes(c)?c:null,t=s.includes(n)?n:e;l.style.colorScheme=t}null==a||a()},[b]),R=n.useCallback(e=>{let t="function"==typeof e?e(w):e;k(t);try{localStorage.setItem(a,t)}catch(e){}},[w]),T=n.useCallback(t=>{E(v(t)),"system"===w&&r&&!e&&P("system")},[w,e]);n.useEffect(()=>{let e=window.matchMedia(o);return e.addListener(T),T(e),()=>e.removeListener(T)},[T]),n.useEffect(()=>{let e=e=>{e.key===a&&(e.newValue?k(e.newValue):R(c))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[R]),n.useEffect(()=>{P(null!=e?e:w)},[e,w]);let A=n.useMemo(()=>({theme:w,setTheme:R,forcedTheme:e,resolvedTheme:"system"===w?x:w,themes:r?[...u,"system"]:u,systemTheme:r?x:void 0}),[w,R,e,x,r,u]);return n.createElement(l.Provider,{value:A},n.createElement(f,{forcedTheme:e,storageKey:a,attribute:h,enableSystem:r,enableColorScheme:i,defaultTheme:c,value:p,themes:u,nonce:b,scriptProps:_}),y)},f=n.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:s,enableColorScheme:o,defaultTheme:a,value:l,themes:u,nonce:c,scriptProps:h})=>{let d=JSON.stringify([r,t,a,e,u,l,s,o]).slice(1,-1);return n.createElement("script",{...h,suppressHydrationWarning:!0,nonce:"u"<typeof window?c:"",dangerouslySetInnerHTML:{__html:`(${i.toString()})(${d})`}})}),g=(e,t)=>{let r;if(!a){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},m=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},v=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light")},42530:(e,t,r)=>{"use strict";r.d(t,{MM:()=>p,Su:()=>u,dT:()=>d,g:()=>c,jJ:()=>f,kD:()=>h});var n=r(72651),i=r(18070),s=r(75242);let o="Could not start checkout, please try again",a=e=>(window.location.assign(e),{redirected:!0}),l=async e=>{let t=await (0,n.SV)({url:"/api/stripe/create-customer",body:{supabaseId:e?.id,email:e?.email,name:e?.user_metadata?.name}});return t?.id||null};async function u({user:e,isYearly:t}){try{let r=await l(e);if(!r)return{message:o};let i=await (0,n.SV)({url:"/api/stripe/create-checkout-session",body:{customer:r,isYearly:t,clientReferenceId:(0,n.Ii)()}});if(i?.alreadySubscribed)return{message:"You already have Pika Pro on this account"};if(!i?.url)return{message:i?.error||o};return(0,n.vq)("upgrading_to_pro",{key:e?.email||""}),a(i.url)}catch(e){return console.log("Pro checkout error",e),{message:o}}}async function c({user:e}){try{let t=await l(e);if(!t)return{message:o};let r=await (0,n.SV)({url:"/api/stripe/create-checkout-session",body:{customer:t,plan:"lifetime",clientReferenceId:(0,n.Ii)()}});if(r?.alreadySubscribed)return{message:r.error||"You already have Pika Pro"};if(!r?.url)return{message:r?.error||o};return a(r.url)}catch(e){return console.log("Lifetime checkout error",e),{message:o}}}async function h({user:e,seats:t,isYearly:r}){try{let i,{url:o}=await s.F.checkout({name:(i=String(e?.user_metadata?.name||"").trim().split(/\s+/)[0])?`${i}'s team`.slice(0,80):"My team",seats:Number(t),interval:r?"annually":"monthly",clientReferenceId:(0,n.Ii)()});return a(o)}catch(e){return{message:e.message||o}}}function d(e,t){return e?.id==="team"?h({user:t,...e}
31):e?.id==="lifetime"?c({user:t}):u({user:t,isYearly:e?.isYearly!==!1})}function p(e){return e?.id==="lifetime"?`${i.Gw.title} \xb7 $${i.Gw.amountUsd} once`:e?.id==="team"?`${i.EE.title} \xb7 ${e.seats} seats \xb7 ${f(e.seats,e.isYearly)}`:e?.isYearly===!1?`Pika Pro \xb7 $${i.yf.amountUsd.monthly}/month`:`Pika Pro \xb7 $${i.yf.amountUsd.annually}/year`}function f(e,t){return t?`$${e*i.EE.amountUsd.annually}/year`:`$${e*i.EE.amountUsd.monthly}/month`}},43138:(e,t,r)=>{"use strict";r.d(t,{c:()=>i,k:()=>n});let{schedule:n,cancel:i}=(0,r(85509).I)(queueMicrotask,!1)},43887:(e,t,r)=>{"use strict";r.d(t,{SV:()=>f,TH:()=>l,cm:()=>u,d4:()=>d,js:()=>h,oM:()=>g,yV:()=>p,zN:()=>s});var n=r(19977),i=r(72651);let s=[{id:"google",label:"Google"},{id:"github",label:"GitHub"}],o="pika:pending-sign-in",a=["code","error","error_code","error_description"];function l({provider:e,checkout:t}){try{localStorage.setItem(o,JSON.stringify({provider:e,checkout:t||null,at:Date.now()}))}catch(e){}}async function u({provider:e,checkout:t}){let r;l({provider:e,checkout:t});let{error:i}=await (0,n.U)().auth.signInWithOAuth({provider:e,options:{redirectTo:(r=new URL(window.location.href),a.forEach(e=>r.searchParams.delete(e)),r.hash="",r.toString())}});return i&&c(),{error:i}}function c(){try{localStorage.removeItem(o)}catch(e){}}function h(e=Date.now()){let t=null;try{t=JSON.parse(localStorage.getItem(o)||"null")}catch(e){}return(c(),t&&e-t.at<36e5)?t:null}function d(){let e=new URL(window.location.href),t=e.searchParams,r=new URLSearchParams(e.hash.replace(/^#/,"")),n=t.get("error_description")||r.get("error_description"),i=t.get("error")||r.get("error");return n||i?(a.forEach(e=>t.delete(e)),(r.has("error")||r.has("error_description"))&&(e.hash=""),window.history.replaceState(window.history.state,"",e.toString()),"access_denied"===i)?"Sign-in was cancelled":n||"Couldn't sign you in, please try again":null}async function p({user:e,name:t}){(0,i.vq)("signed_up",{key:e?.email||"",provider:e?.app_metadata?.provider});try{await fetch("/api/emails/contact",{method:"POST",body:JSON.stringify({name:t||e?.user_metadata?.name,email:e?.email,operation:"add",userId:e?.id,paid:!1})})}catch(e){console.log("add contact error",e)}}function f(){return!!window.PublicKeyCredential}function g(e,t){var r;if(r=e,r?.code==="ERROR_CEREMONY_ABORTED"||r?.cause?.name==="NotAllowedError"||r?.cause?.name==="AbortError")return null;let n=e?.code;return"ERROR_INVALID_RP_ID"===n||"ERROR_INVALID_DOMAIN"===n||e?.cause?.name==="SecurityError"?"Passkeys aren't set up for this site yet":/disabled/i.test(e?.message||"")?"Passkeys aren't available right now":"add"===t?"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED"===n?"This device already has a passkey for your account":"Couldn't add a passkey, please try again":"Couldn't sign in with a passkey. Use another sign-in method, then add a passkey in Settings."}},45127:(e,t,r)=>{"use strict";r(94223)},45204:()=>{},45609:(e,t,r)=>{e.exports=r(89693)},45890:(e,t,r)=>{"use strict";r.d(t,{Q:()=>n});let n=(0,r(76430).createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"})},46001:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=s(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)n.call(e,r)&&e[r]&&(t=s(t,r));return t}(r)))}return e}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(r=(function(){return i}).apply(t,[]))||(e.exports=r)}()},47083:(e,t,r)=>{"use strict";function n(e,t,r,n){return!1}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return n}}),r(907),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},48439:(e,t,r)=>{"use strict";r.d(t,{V:()=>a});var n=r(18138),i=r(15275),s=r(62682),o=r(85735);let a={test:(0,o.$)("hsl","hue"),parse:(0,o.q)("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:o=1})=>"hsla("+Math.round(e)+", "+i.KN.transform((0,s.a)(t))+", "+i.KN.transform((0,s.a)(r))+", "+(0,s.a)(n.X4.transform(o))+")"}},48765:(e,t,r)=>{"use strict";r.d(t,{br:()=>R,xj:()=>A});var n=r(75038),i=r(67938),s=r.n(i),o=r(76430),a=r(25393),l=r(20142),u=new Map;u.set("bold",function(e){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"96",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("circle",{cx:"128",cy:"120",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("path",{d:"M63.8,199.4a72,72,0,0,1,128.4,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}))}),u.set("duotone",function(e){return o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,32A96,96,0,0,0,63.8,199.4h0A72,72,0,0,1,128,160a40,40,0,1,1,40-40,40,40,0,0,1-40,40,72,72,0,0,1,64.2,39.4A96,96,0,0,0,128,32Z",opacity:"0.2"}),o.createElement("circle",{cx:"128",cy:"128",r:"96",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("circle",{cx:"128",cy:"120",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("path",{d:"M63.8,199.4a72,72,0,0,1,128.4,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))}),u.set("fill",function(){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"120",r:"44"}),o.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.2,104.2,0,0,0,128,24Zm65.8,162.4a81.3,81.3,0,0,0-24.5-23,59.7,59.7,0,0,1-82.6,0,81.3,81.3,0,0,0-24.5,23,88,88,0,1,1,131.6,0Z"}))}),u.set("light",function(e){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"96",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("circle",{cx:"128",cy:"120",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("path",{d:"M63.8,199.4a72,72,0,0,1,128.4,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}))}),u.set("thin",function(e){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"96",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("circle",{cx:"128",cy:"120",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("path",{d:"M63.8,199.4a72,72,0,0,1,128.4,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}))}),u.set("regular",function(e){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"96",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("circle",{cx:"128",cy:"120",r:"40",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("path",{d:"M63.8,199.4a72,72,0,0,1,128.4,0",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))});var c=function(e,t){return(0,a.$)(e,t,u)},h=(0,o.forwardRef)(function(e,t){return o.createElement(l.A,Object.assign({ref:t},e,{renderPath:c}))});h.displayName="UserCircle";var d=r(90026),p=r(31246),f=r(98296),g=new Map;g.set("bold",function(e){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"60",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("line",{x1:"128",y1:"28",x2:"128",y2:"12",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("line",{x1:"198.7",y1:"57.3",x2:"210",y2:"46",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("line",{x1:"228",y1:"128",x2:"244",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("line",{x1:"198.7",y1:"198.7",x2:"210",y2:"210",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("line",{x1:"128",y1:"228",x2:"128",y2:"244",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("line",{x1:"57.3",y1:"198.7",x2:"46",y2:"210",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("line",{x1:"28",y1:"128",x2:"12",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("line",{x1:"57.3",y1:"57.3",x2:"46",y2:"46",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}))}),g.set("duotone",function(e){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"60",opacity:"0.2"}),o.createElement("circle",{cx:"128",cy:"128",r:"60",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"128",y1:"36",x2:"128",y2:"16",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"62.9",y1:"62.9",x2:"48.8",y2:"48.8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"36",y1:"128",x2:"16",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"62.9",y1:"193.1",x2:"48.8",y2:"207.2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"128",y1:"220",x2:"128",y2:"240",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"193.1",y1:"193.1",x2:"207.2",y2:"207.2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"220",y1:"128",x2:"240",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"193.1",y1:"62.9",x2:"207.2",y2:"48.8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))}),g.set("fill",function(){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"68"}),o.createElement("path",{d:"M128,44a8,8,0,0,0,8-8V16a8,8,0,0,0-16,0V36A8,8,0,0,0,128,44Z"}),o.createElement("path",{d:"M57.3,68.6a8.1,8.1,0,0,0,11.3,0,8,8,0,0,0,0-11.3L54.5,43.1A8.1,8.1,0,1,0,43.1,54.5Z"}),o.createElement("path",{d:"M44,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H36A8,8,0,0,0,44,128Z"}),o.createElement("path",{d:"M57.3,187.4,43.1,201.5a8.1,8.1,0,0,0,0,11.4,8.5,8.5,0,0,0,5.7,2.3,8.3,8.3,0,0,0,5.7-2.3l14.1-14.2a8,8,0,0,0-11.3-11.3Z"}),o.createElement("path",{d:"M128,212a8,8,0,0,0-8,8v20a8,8,0,0,0,16,0V220A8,8,0,0,0,128,212Z"}),o.createElement("path",{d:"M198.7,187.4a8,8,0,0,0-11.3,11.3l14.1,14.2a8.3,8.3,0,0,0,5.7,2.3,8.5,8.5,0,0,0,5.7-2.3,8.1,8.1,0,0,0,0-11.4Z"}),o.createElement("path",{d:"M240,120H220a8,8,0,0,0,0,16h20a8,8,0,0,0,0-16Z"}),o.createElement("path",{d:"M193.1,70.9a7.8,7.8,0,0,0,5.6-2.3l14.2-14.1a8.1,8.1,0,0,0-11.4-11.4L187.4,57.3a8,8,0,0,0,0,11.3A7.8,7.8,0,0,0,193.1,70.9Z"}))}),g.set("light",function(e){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"60",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("line",{x1:"128",y1:"36",x2:"128",y2:"16",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("line",{x1:"62.9",y1:"62.9",x2:"48.8",y2:"48.8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("line",{x1:"36",y1:"128",x2:"16",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("line",{x1:"62.9",y1:"193.1",x2:"48.8",y2:"207.2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("line",{x1:"128",y1:"220",x2:"128",y2:"240",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("line",{x1:"193.1",y1:"193.1",x2:"207.2",y2:"207.2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("line",{x1:"220",y1:"128",x2:"240",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("line",{x1:"193.1",y1:"62.9",x2:"207.2",y2:"48.8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}))}),g.set("thin",function(e){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"60",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("line",{x1:"128",y1:"36",x2:"128",y2:"16",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("line",{x1:"62.9",y1:"62.9",x2:"48.8",y2:"48.8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("line",{x1:"36",y1:"128",x2:"16",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("line",{x1:"62.9",y1:"193.1",x2:"48.8",y2:"207.2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("line",{x1:"128",y1:"220",x2:"128",y2:"240",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("line",{x1:"193.1",y1:"193.1",x2:"207.2",y2:"207.2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("line",{x1:"220",y1:"128",x2:"240",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("line",{x1:"193.1",y1:"62.9",x2:"207.2",y2:"48.8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}))}),g.set("regular",function(e){return o.createElement(o.Fragment,null,o.createElement("circle",{cx:"128",cy:"128",r:"60",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"128",y1:"36",x2:"128",y2:"16",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"62.9",y1:"62.9",x2:"48.8",y2:"48.8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"36",y1:"128",x2:"16",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"62.9",y1:"193.1",x2:"48.8",y2:"207.2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"128",y1:"220",x2:"128",y2:"240",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"193.1",y1:"193.1",x2:"207.2",y2:"207.2",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"220",y1:"128",x2:"240",y2:"128",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("line",{x1:"193.1",y1:"62.9",x2:"207.2",y2:"48.8",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))});var m=function(e,t){return(0,a.$)(e,t,g)},v=(0,o.forwardRef)(function(e,t){return o.createElement(l.A,Object.assign({ref:t},e,{renderPath:m}))});v.displayName="Sun";var y=new Map;y.set("bold",function(e){return o.createElement(o.Fragment,null,o.createElement("path",{d:"M180,48h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H1
3152a0,0,0,0,1,0,0V76a28,28,0,0,1,28-28Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("path",{d:"M48,48H76a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0A28,28,0,0,1,48,76V48A0,0,0,0,1,48,48Z",transform:"translate(152 152) rotate(180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("path",{d:"M152,152h28a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0a28,28,0,0,1-28-28V152A0,0,0,0,1,152,152Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("path",{d:"M76,152h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H48a0,0,0,0,1,0,0V180A28,28,0,0,1,76,152Z",transform:"translate(152 360) rotate(-180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),o.createElement("rect",{x:"104",y:"104",width:"48",height:"48",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}))}),y.set("duotone",function(e){return o.createElement(o.Fragment,null,o.createElement("path",{d:"M180,48h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H152a0,0,0,0,1,0,0V76A28,28,0,0,1,180,48Z",opacity:"0.2"}),o.createElement("path",{d:"M48,48H76a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0A28,28,0,0,1,48,76V48A0,0,0,0,1,48,48Z",transform:"translate(152 152) rotate(180)",opacity:"0.2"}),o.createElement("path",{d:"M152,152h28a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0a28,28,0,0,1-28-28V152A0,0,0,0,1,152,152Z",opacity:"0.2"}),o.createElement("path",{d:"M76,152h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H48a0,0,0,0,1,0,0V180A28,28,0,0,1,76,152Z",transform:"translate(152 360) rotate(-180)",opacity:"0.2"}),o.createElement("path",{d:"M76,152h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H48a0,0,0,0,1,0,0V180A28,28,0,0,1,76,152Z",transform:"translate(152 360) rotate(-180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("path",{d:"M180,48h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H152a0,0,0,0,1,0,0V76A28,28,0,0,1,180,48Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("path",{d:"M48,48H76a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0A28,28,0,0,1,48,76V48A0,0,0,0,1,48,48Z",transform:"translate(152 152) rotate(180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("path",{d:"M152,152h28a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0a28,28,0,0,1-28-28V152A0,0,0,0,1,152,152Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("rect",{x:"104",y:"104",width:"48",height:"48",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))}),y.set("fill",function(){return o.createElement(o.Fragment,null,o.createElement("path",{d:"M180,144H160V112h20a36,36,0,1,0-36-36V96H112V76a36,36,0,1,0-36,36H96v32H76a36,36,0,1,0,36,36V160h32v20a36,36,0,1,0,36-36ZM160,76a20,20,0,1,1,20,20H160ZM56,76a20,20,0,0,1,40,0V96H76A20.1,20.1,0,0,1,56,76ZM96,180a20,20,0,1,1-20-20H96Zm16-68h32v32H112Zm68,88a20.1,20.1,0,0,1-20-20V160h20a20,20,0,0,1,0,40Z"}))}),y.set("light",function(e){return o.createElement(o.Fragment,null,o.createElement("path",{d:"M180,48h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H152a0,0,0,0,1,0,0V76a28,28,0,0,1,28-28Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("path",{d:"M48,48H76a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0A28,28,0,0,1,48,76V48A0,0,0,0,1,48,48Z",transform:"translate(152 152) rotate(180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("path",{d:"M152,152h28a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0a28,28,0,0,1-28-28V152A0,0,0,0,1,152,152Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("path",{d:"M76,152h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H48a0,0,0,0,1,0,0V180A28,28,0,0,1,76,152Z",transform:"translate(152 360) rotate(-180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),o.createElement("rect",{x:"104",y:"104",width:"48",height:"48",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}))}),y.set("thin",function(e){return o.createElement(o.Fragment,null,o.createElement("path",{d:"M180,48h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H1
3152a0,0,0,0,1,0,0V76a28,28,0,0,1,28-28Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("path",{d:"M48,48H76a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0A28,28,0,0,1,48,76V48A0,0,0,0,1,48,48Z",transform:"translate(152 152) rotate(180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("path",{d:"M152,152h28a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0a28,28,0,0,1-28-28V152A0,0,0,0,1,152,152Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("path",{d:"M76,152h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H48a0,0,0,0,1,0,0V180A28,28,0,0,1,76,152Z",transform:"translate(152 360) rotate(-180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),o.createElement("rect",{x:"104",y:"104",width:"48",height:"48",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}))}),y.set("regular",function(e){return o.createElement(o.Fragment,null,o.createElement("path",{d:"M180,48h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H152a0,0,0,0,1,0,0V76a28,28,0,0,1,28-28Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("path",{d:"M48,48H76a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0A28,28,0,0,1,48,76V48A0,0,0,0,1,48,48Z",transform:"translate(152 152) rotate(180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("path",{d:"M152,152h28a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28h0a28,28,0,0,1-28-28V152A0,0,0,0,1,152,152Z",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("path",{d:"M76,152h0a28,28,0,0,1,28,28v0a28,28,0,0,1-28,28H48a0,0,0,0,1,0,0V180A28,28,0,0,1,76,152Z",transform:"translate(152 360) rotate(-180)",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),o.createElement("rect",{x:"104",y:"104",width:"48",height:"48",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))});var b=function(e,t){return(0,a.$)(e,t,y)},_=(0,o.forwardRef)(function(e,t){return o.createElement(l.A,Object.assign({ref:t},e,{renderPath:b}))});_.displayName="Command";let w=s()(()=>Promise.all([r.e(3699),r.e(5261)]).then(r.bind(r,95261)),{loadableGenerated:{webpack:()=>[95261]}}),k=s()(()=>r.e(4958).then(r.bind(r,24958)),{loadableGenerated:{webpack:()=>[24958]}}),x=s()(()=>r.e(3885).then(r.bind(r,93885)),{loadableGenerated:{webpack:()=>[93885]}}),E=s()(()=>r.e(3481).then(r.bind(r,33481)),{loadableGenerated:{webpack:()=>[33481]}}),S=s()(()=>r.e(6498).then(r.bind(r,76498)),{loadableGenerated:{webpack:()=>[76498]}}),P=s()(()=>Promise.all([r.e(5702),r.e(1198)]).then(r.bind(r,1198)),{loadableGenerated:{webpack:()=>[1198]}}),R=[{key:"account",title:"Account",icon:h,render:e=>(0,n.jsx)(w,{session:e.c_Session,openLoginOrSignup:e.c_OpenLoginOrSignupModal})},{key:"subscription",title:"Subscription",icon:d.A,render:e=>(0,n.jsx)(k,{isPro:e.isPro,isLifetime:e.isLifetime,activeSubscription:e.c_ActiveSubscription,c_StripeSub:e.c_StripeSub,entitlements:e.c_Entitlements})},{key:"team",title:"Team",icon:p.A,render:(e,t)=>(0,n.jsx)(P,{ctx:e,section:t})},{key:"export",title:"Export",icon:f.A,render:()=>(0,n.jsx)(x,{})},{key:"appearance",title:"Appearance",icon:v,render:()=>(0,n.jsx)(E,{})},{key:"shortcuts",title:"Shortcuts",icon:_,render:()=>(0,n.jsx)(S,{})}],T=R[0].key,A=(e,t)=>`/user/settings/${R.some(t=>t.key===e)?e:T}${t?`/${t}`:""}`},50084:(e,t,r)=>{e.exports=r(33152)()},50927:()=>{},51247:e=>{var t={872:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,s=l(e),o=s[0],a=s[1],u=new i((o+a)*3/4-a),c=0,h=a>0?o-4:o;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=0,a=n-i;o<a;o+=16383)s.push(function(e,t,n){for(var i,s=[],o=t;o<n;o+=3)i=(e[o]<<16&0xff0000)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}(e,o,o+16383>a?a:o+16383));return 1===i?s.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&s.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 18,974 bytes, line 31
31+/",o=0,a=s.length;o<a;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(e,t,r){"use strict";var n=r(872),i=r(321),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);var s=0|p(n,i),l=o(s),u=l.write(n,i);return u!==s&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return h(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return a.from(c,t,r);var f=function(e){if(a.isBuffer(e)){var t=0|d(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?o(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(f)return f;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),o(e<0?0:0|d(e))}function h(e){for(var t=e.length<0?0:0|d(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(u(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)};function d(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(e).length;default:if(i)return n?-1:S(e).length;t=(""+t).toLowerCase(),i=!0}}function f(e,t,r){var i,s,o,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=C[e[s]];return i}(this,t,r);case"utf8":case"utf-8":return y(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,s=t,o=r,0===s&&o===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(s,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}(this,t,r);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){var s;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r*=1)!=s&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return v(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var s,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(s=r;s<a;s++)if(u(e,s)===u(t,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===l)return c*o}else -1!==c&&(s-=s-c),c=-1}else for(r+l>a&&(r=a-l),s=r;s>=0;s--){for(var h=!0,d=0;d<l;d++)if(u(e,s+d)!==u(t,d)){h=!1;break}if(h)return s}return -1}a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(A(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),A(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(A(s,Uint8Array)&&(s=a.from(s)),!a.isBuffer(s))throw TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?y(this,0,e):f.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(a.prototype[s]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(A(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,o=r-t,l=Math.min(s,o),u=this.slice(n,i),c=e.slice(t,r),h=0;h<l;++h)if(u[h]!==c[h]){s=u[h],o=c[h];break}return s<o?-1:+(o<s)},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)};function y(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,o,a,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:(192&(s=e[i+1]))==128&&(l=(31&u)<<6|63&s)>127&&(c=l);break;case 3:s=e[i+1],o=e[i+2],(192&s)==128&&(192&o)==128&&(l=(15&u)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],(192&s)==128&&(192&o)==128&&(192&a)==128&&(l=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}var d=n,p=d.length;if(p<=4096)return String.fromCharCode.apply(String,d);for(var f="",g=0;g<p;)f+=String.fromCharCode.apply(String,d.slice(g,g+=4096));return f}function b(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,i,s){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function w(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function k(e,t,r,n,s){return t*=1,r>>>=0,s||w(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function x(e,t,r,n,s){return t*=1,r>>>=0,s||w(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,s,o,a,l,u,c,h,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a,l=parseInt(t.substr(2*o,2),16);if((a=l)!=a)break;e[r+o]=l}return o}(this,e,t,r);case"utf8":case"utf-8":return i=t,s=r,T(S(e,this.length-i),this,i,s);case"ascii":return o=t,a=r,T(P(e),this,o,a);case"latin1":case"binary":return function(e,t,r,n){return T(P(t),e,r,n)}(this,e,t,r);case"base64":return l=t,u=r,T(R(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,h=r,T(function(e,t){for(var r,n,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,h);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;_(this,e,t,r,i,0)}var s=1,o=0;for(this[t]=255&e;++o<r&&(s*=256);)this[t+o]=e/s&255;return t+r},a.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;_(this,e,t,r,i,0)}var s=r-1,o=1;for(this[t+s]=255&e;--s>=0&&(o*=256);)this[t+s]=e/o&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s<r&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o|0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o|0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return k(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var s=i-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,s=e.charCodeAt(0);("utf8"===n&&s<128||"latin1"===n)&&(e=s)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var o=a.isBuffer(e)?e:a.from(e,n),l=o.length;
31if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%l]}return this};var E=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function P(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function R(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var C=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},321:function(e,t){t.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,d=r?-1:1,p=e[t+h];for(h+=d,s=p&(1<<-c)-1,p>>=-c,c+=a;c>0;s=256*s+e[t+h],h+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+e[t+h],h+=d,c-=8);if(0===s)s=1-u;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),s-=u}return(p?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,a,l,u=8*s-i-1,c=(1<<u)-1,h=c>>1,d=5960464477539062e-23*(23===i),p=n?0:s-1,f=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+h>=1?t+=d/l:t+=d*Math.pow(2,1-h),t*l>=2&&(o++,l/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(t*l-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&a,p+=f,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;e[r+p]=255&o,p+=f,o/=256,u-=8);e[r+p-f]|=128*g}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var s=r[e]={exports:{}},o=!0;try{t[e](s,s.exports,n),o=!1}finally{o&&delete r[e]}return s.exports}n.ab="//",e.exports=n(230)},51379:(e,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n,i="dahlia",s="https://js.stripe.com",o="".concat(s,"/").concat(i,"/stripe.js"),a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,l=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,u="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",c=function(){for(var e=document.querySelectorAll('script[src^="'.concat(s,'"]')),t=0;t<e.length;t++){var r,n=e[t];if(r=n.src,a.test(r)||l.test(r))return n}return null},h=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(o).concat(t);var n=document.head||document.body;if(!n)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r},d=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"9.17.0",startTime:t})},p=null,f=null,g=null,m=function(e,t,n){if(null===e)return null;var s,o=t[0];if("string"!=typeof o)throw Error("Expected publishable key to be of type string, got type ".concat(r(o)," instead."));var a=o.match(/^pk_test/),l=3===(s=e.version)?"v3":s;a&&l!==i&&console.warn("Stripe.js@".concat(l," was loaded on the page, but @stripe/stripe-js@").concat("9.17.0"," expected Stripe.js@").concat(i,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var u=e.apply(void 0,t);return d(u,n),u},v=function(e){var t="invalid load parameters; expected object of shape\n\n    {advancedFraudSignals: boolean}\n\nbut received\n\n    ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==r(e))throw Error(t);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw Error(t)},y=!1,b=function(){for(var e,t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];y=!0;var s=Date.now();return(e=n,null!==p?p:(p=new Promise(function(t,r){if("u"<typeof window||"u"<typeof document)return void t(null);if(window.Stripe&&e&&console.warn(u),window.Stripe)return void t(window.Stripe);try{var n,i=c();i&&e?console.warn(u):i?i&&null!==g&&null!==f&&(i.removeEventListener("load",g),i.removeEventListener("error",f),null==(n=i.parentNode)||n.removeChild(i),i=h(e)):i=h(e),g=function(){window.Stripe?t(window.Stripe):r(Error("Stripe.js not available"))},f=function(e){r(Error("Failed to load Stripe.js",{cause:e}))},i.addEventListener("load",g),i.addEventListener("error",f)}catch(e){r(e);return}})).catch(function(e){return p=null,Promise.reject(e)})).then(function(e){return m(e,r,s)})};b.setLoadParameters=function(e){if(!(y&&n&&Object.keys(v(e)).reduce(function(t,r){var i;return t&&e[r]===(null==(i=n)?void 0:i[r])},!0))){if(y)throw Error("You cannot change load parameters after calling loadStripe");
31n=v(e)}},t.loadStripe=b},52652:(e,t,r)=>{"use strict";r.d(t,{N:()=>i});var n=r(76430),i=globalThis?.document?n.useLayoutEffect:()=>{}},54775:(e,t)=>{"use strict";let r;t.qg=function(e,t){let r=new l,n=e.length;if(n<2)return r;let i=t?.decode||h,s=0;do{let t=function(e,t,r){let n=e.indexOf("=",t);return n<r?n:-1}(e,s,n);if(-1===t)break;let o=function(e,t,r){let n=e.indexOf(";",t);return -1===n?r:n}(e,s,n);if(t>o){s=e.lastIndexOf(";",t-1)+1;continue}let a=c(e,s,t);void 0===r[a]&&(r[a]=i(c(e,t+1,o))),s=o+1}while(s<n);return r},t.lK=u,t.lK=u;let n=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,s=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,l=((r=function(){}).prototype=Object.create(null),r);function u(e,t,r){let l="object"==typeof e?e:{...r,name:e,value:String(t)},u=("object"==typeof t?t:r)?.encode||encodeURIComponent;if(!n.test(l.name))throw TypeError(`argument name is invalid: ${l.name}`);let c=l.value?u(l.value):"";if(!i.test(c))throw TypeError(`argument val is invalid: ${l.value}`);let h=l.name+"="+c;if(void 0!==l.maxAge){if(!Number.isInteger(l.maxAge))throw TypeError(`option maxAge is invalid: ${l.maxAge}`);h+="; Max-Age="+l.maxAge}if(l.domain){if(!s.test(l.domain))throw TypeError(`option domain is invalid: ${l.domain}`);h+="; Domain="+l.domain}if(l.path){if(!o.test(l.path))throw TypeError(`option path is invalid: ${l.path}`);h+="; Path="+l.path}if(l.expires){var d;if(d=l.expires,"[object Date]"!==a.call(d)||!Number.isFinite(l.expires.valueOf()))throw TypeError(`option expires is invali
31d: ${l.expires}`);h+="; Expires="+l.expires.toUTCString()}if(l.httpOnly&&(h+="; HttpOnly"),l.secure&&(h+="; Secure"),l.partitioned&&(h+="; Partitioned"),l.priority)switch("string"==typeof l.priority?l.priority.toLowerCase():void 0){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw TypeError(`option priority is invalid: ${l.priority}`)}if(l.sameSite)switch("string"==typeof l.sameSite?l.sameSite.toLowerCase():l.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw TypeError(`option sameSite is invalid: ${l.sameSite}`)}return h}function c(e,t,r){let n=t,i=r;do{let t=e.charCodeAt(n);if(32!==t&&9!==t)break}while(++n<i);for(;i>n;){let t=e.charCodeAt(i-1);if(32!==t&&9!==t)break;i--}return e.slice(n,i)}function h(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},55992:(e,t,r)=>{"use strict";r.d(t,{xQ:()=>s});var n=r(76430),i=r(24943);function s(e=!0){let t=(0,n.useContext)(i.t);if(null===t)return[!0,null];let{isPresent:r,onExitComplete:o,register:a}=t,l=(0,n.useId)();(0,n.useEffect)(()=>{if(e)return a(l)},[e]);let u=(0,n.useCallback)(()=>e&&o&&o(l),[l,o,e]);return!r&&o?[!1,u]:[!0]}},56477:(e,t,r)=>{"use strict";r.d(t,{x:()=>i});var n=r(64971);function i(e){return(0,n.G)(e)&&"ownerSVGElement"in e}},56725:(e,t,r)=>{"use strict";r.d(t,{FR:()=>f,Zn:()=>g,bV:()=>p,bj:()=>v,W6:()=>c,rf:()=>h,UE:()=>w,ML:()=>E,P$:()=>_,_8:()=>y,MB:()=>x,rQ:()=>k});var n=r(75038),i=r(76430),s=r(17531),o=r.n(s),a={templateTitle:"",noindex:!1,nofollow:!1,norobots:!1,defaultOpenGraphImageWidth:0,defaultOpenGraphImageHeight:0,defaultOpenGraphVideoWidth:0,defaultOpenGraphVideoHeight:0},l=(e,t=[],{defaultWidth:r,defaultHeight:i}={})=>t.reduce((t,s,o)=>(t.push((0,n.jsx)("meta",{property:`og:${e}`,content:s.url},`og:${e}:0${o}`)),s.alt&&t.push((0,n.jsx)("meta",{property:`og:${e}:alt`,content:s.alt},`og:${e}:alt0${o}`)),s.secureUrl&&t.push((0,n.jsx)("meta",{property:`og:${e}:secure_url`,content:s.secureUrl.toString()},`og:${e}:secure_url0${o}`)),s.type&&t.push((0,n.jsx)("meta",{property:`og:${e}:type`,content:s.type.toString()},`og:${e}:type0${o}`)),s.width?t.push((0,n.jsx)("meta",{property:`og:${e}:width`,content:s.width.toString()},`og:${e}:width0${o}`)):r&&t.push((0,n.jsx)("meta",{property:`og:${e}:width`,content:r.toString()},`og:${e}:width0${o}`)),s.height?t.push((0,n.jsx)("meta",{property:`og:${e}:height`,content:s.height.toString()},`og:${e}:height${o}`)):i&&t.push((0,n.jsx)("meta",{property:`og:${e}:height`,content:i.toString()},`og:${e}:height${o}`)),t),[]),u=e=>{let t=[];e.titleTemplate&&(a.templateTitle=e.titleTemplate);let r="";e.title?(r=e.title,a.templateTitle&&(r=a.templateTitle.replace(/%s/g,()=>r))):e.defaultTitle&&(r=e.defaultTitle),r&&t.push((0,n.jsx)("title",{children:r},"title"));let i=void 0===e.noindex?a.noindex||e.dangerouslySetAllPagesToNoIndex:e.noindex,s=void 0===e.nofollow?a.nofollow||e.dangerouslySetAllPagesToNoFollow:e.nofollow,o=e.norobots||a.norobots,u="";if(e.robotsProps){let{nosnippet:t,maxSnippet:r,maxImagePreview:n,maxVideoPreview:i,noarchive:s,noimageindex:o,notranslate:a,unavailableAfter:l}=e.robotsProps;u=`${t?",nosnippet":""}${r?`,max-snippet:${r}`:""}${n?`,max-image-preview:${n}`:""}${s?",noarchive":""}${l?`,unavailable_after:${l}`:""}${o?",noimageindex":""}${i?`,max-video-preview:${i}`:""}${a?",notranslate":""}`}if(e.norobots&&(a.norobots=!0),i||s?(e.dangerouslySetAllPagesToNoIndex&&(a.noindex=!0),e.dangerouslySetAllPagesToNoFollow&&(a.nofollow=!0),t.push((0,n.jsx)("meta",{name:"robots",content:`${i?"noindex":"index"},${s?"nofollow":"follow"}${u}`},"robots"))):(!o||u)&&t.push((0,n.jsx)("meta",{name:"robots",content:`index,follow${u}`},"robots")),e.description&&t.push((0,n.jsx)("meta",{name:"description",content:e.description},"description")),e.themeColor&&t.push((0,n.jsx)("meta",{name:"theme-color",content:e.themeColor},"theme-color")),e.mobileAlternate&&t.push((0,n.jsx)("link",{rel:"alternate",media:e.mobileAlternate.media,href:e.mobileAlternate.href},"mobileAlternate")),e.languageAlternates&&e.languageAlternates.length>
310&&e.languageAlternates.forEach(e=>{t.push((0,n.jsx)("link",{rel:"alternate",hrefLang:e.hrefLang,href:e.href},`languageAlternate-${e.hrefLang}`))}),e.twitter&&(e.twitter.cardType&&t.push((0,n.jsx)("meta",{name:"twitter:card",content:e.twitter.cardType},"twitter:card")),e.twitter.site&&t.push((0,n.jsx)("meta",{name:"twitter:site",content:e.twitter.site},"twitter:site")),e.twitter.handle&&t.push((0,n.jsx)("meta",{name:"twitter:creator",content:e.twitter.handle},"twitter:creator"))),e.facebook&&e.facebook.appId&&t.push((0,n.jsx)("meta",{property:"fb:app_id",content:e.facebook.appId},"fb:app_id")),(e.openGraph?.title||r)&&t.push((0,n.jsx)("meta",{property:"og:title",content:e.openGraph?.title||r},"og:title")),(e.openGraph?.description||e.description)&&t.push((0,n.jsx)("meta",{property:"og:description",content:e.openGraph?.description||e.description},"og:description")),e.openGraph){if((e.openGraph.url||e.canonical)&&t.push((0,n.jsx)("meta",{property:"og:url",content:e.openGraph.url||e.canonical},"og:url")),e.openGraph.type){let r=e.openGraph.type.toLowerCase();t.push((0,n.jsx)("meta",{property:"og:type",content:r},"og:type")),"profile"===r&&e.openGraph.profile?(e.openGraph.profile.firstName&&t.push((0,n.jsx)("meta",{property:"profile:first_name",content:e.openGraph.profile.firstName},"profile:first_name")),e.openGraph.profile.lastName&&t.push((0,n.jsx)("meta",{property:"profile:last_name",content:e.openGraph.profile.lastName},"profile:last_name")),e.openGraph.profile.username&&t.push((0,n.jsx)("meta",{property:"profile:username",content:e.openGraph.profile.username},"profile:username")),e.openGraph.profile.gender&&t.push((0,n.jsx)("meta",{property:"profile:gender",content:e.openGraph.profile.gender},"profile:gender"))):"book"===r&&e.openGraph.book?(e.openGraph.book.authors&&e.openGraph.book.authors.length&&e.openGraph.book.authors.forEach((e,r)=>{t.push((0,n.jsx)("meta",{property:"book:author",content:e},`book:author:0${r}`))}),e.openGraph.book.isbn&&t.push((0,n.jsx)("meta",{property:"book:isbn",content:e.openGraph.book.isbn},"book:isbn")),e.openGraph.book.releaseDate&&t.push((0,n.jsx)("meta",{property:"book:release_date",content:e.openGraph.book.releaseDate},"book:release_date")),e.openGraph.book.tags&&e.openGraph.book.tags.length&&e.openGraph.book.tags.forEac
31h((e,r)=>{t.push((0,n.jsx)("meta",{property:"book:tag",content:e},`book:tag:0${r}`))})):"article"===r&&e.openGraph.article?(e.openGraph.article.publishedTime&&t.push((0,n.jsx)("meta",{property:"article:published_time",content:e.openGraph.article.publishedTime},"article:published_time")),e.openGraph.article.modifiedTime&&t.push((0,n.jsx)("meta",{property:"article:modified_time",content:e.openGraph.article.modifiedTime},"article:modified_time")),e.openGraph.article.expirationTime&&t.push((0,n.jsx)("meta",{property:"article:expiration_time",content:e.openGraph.article.expirationTime},"article:expiration_time")),e.openGraph.article.authors&&e.openGraph.article.authors.length&&e.openGraph.article.authors.forEach((e,r)=>{t.push((0,n.jsx)("meta",{property:"article:author",content:e},`article:author:0${r}`))}),e.openGraph.article.section&&t.push((0,n.jsx)("meta",{property:"article:section",content:e.openGraph.article.section},"article:section")),e.openGraph.article.tags&&e.openGraph.article.tags.length&&e.openGraph.article.tags.forEach((e,r)=>{t.push((0,n.jsx)("meta",{property:"article:tag",content:e},`article:tag:0${r}`))})):("video.movie"===r||"video.episode"===r||"video.tv_show"===r||"video.other"===r)&&e.openGraph.video&&(e.openGraph.video.actors&&e.openGraph.video.actors.length&&e.openGraph.video.actors.forEach((e,r)=>{e.profile&&t.push((0,n.jsx)("meta",{property:"video:actor",content:e.profile},`video:actor:0${r}`)),e.role&&t.push((0,n.jsx)("meta",{property:"video:actor:role",content:e.role},`video:actor:role:0${r}`))}),e.openGraph.video.directors&&e.openGraph.video.directors.length&&e.openGraph.video.directors.forEach((e,r)=>{t.push((0,n.jsx)("meta",{property:"video:director",content:e},`video:director:0${r}`))}),e.openGraph.video.writers&&e.openGraph.video.writers.length&&e.openGraph.video.writers.forEach((e,r)=>{t.push((0,n.jsx)("meta",{property:"video:writer",content:e},`video:writer:0${r}`))}),e.openGraph.video.duration&&t.push((0,n.jsx)("meta",{property:"video:duration",content:e.openGraph.video.duration.toString()},"video:duration")),e.openGraph.video.releaseDate&&t.push((0,n.jsx)("meta",{property:"video:release_date",content:e.openGraph.video.releaseDate},"video:release_date")),e.openGraph.video.tags&&e.openGraph.video.tags.length&&e.openGraph.video.tags.forEac
31h((e,r)=>{t.push((0,n.jsx)("meta",{property:"video:tag",content:e},`video:tag:0${r}`))}),e.openGraph.video.series&&t.push((0,n.jsx)("meta",{property:"video:series",content:e.openGraph.video.series},"video:series")))}e.defaultOpenGraphImageWidth&&(a.defaultOpenGraphImageWidth=e.defaultOpenGraphImageWidth),e.defaultOpenGraphImageHeight&&(a.defaultOpenGraphImageHeight=e.defaultOpenGraphImageHeight),e.openGraph.images&&e.openGraph.images.length&&t.push(...l("image",e.openGraph.images,{defaultWidth:a.defaultOpenGraphImageWidth,defaultHeight:a.defaultOpenGraphImageHeight})),e.defaultOpenGraphVideoWidth&&(a.defaultOpenGraphVideoWidth=e.defaultOpenGraphVideoWidth),e.defaultOpenGraphVideoHeight&&(a.defaultOpenGraphVideoHeight=e.defaultOpenGraphVideoHeight),e.openGraph.videos&&e.openGraph.videos.length&&t.push(...l("video",e.openGraph.videos,{defaultWidth:a.defaultOpenGraphVideoWidth,defaultHeight:a.defaultOpenGraphVideoHeight})),e.openGraph.audio&&t.push(...l("audio",e.openGraph.audio)),e.openGraph.locale&&t.push((0,n.jsx)("meta",{property:"og:locale",content:e.openGraph.locale},"og:locale")),(e.openGraph.siteName||e.openGraph.site_name)&&t.push((0,n.jsx)("meta",{property:"og:site_name",content:e.openGraph.siteName||e.openGraph.site_name},"og:site_name"))}return e.canonical&&t.push((0,n.jsx)("link",{rel:"canonical",href:e.canonical},"canonical")),e.additionalMetaTags&&e.additionalMetaTags.length>0&&e.additionalMetaTags.forEach(({keyOverride:e,...r})=>{t.push((0,n.jsx)("meta",{...r},`meta:${e??r.name??r.property??r.httpEquiv}`))}),e.additionalLinkTags?.length&&e.additionalLinkTags.forEach(e=>{let{crossOrigin:r,...i}=e;t.push((0,n.jsx)("link",{...i,crossOrigin:"anonymous"===r||"use-credentials"===r||""===r?r:void 0},`link${i.keyOverride??i.href}${i.rel}`))}),t};let c="https://pika.style",h=e=>!e||/^https?:\/\//.test(e)?e:`${c}${e}`,d=e=>e?.openGraph?.images?{...e,openGraph:{...e.openGraph,images:e.openGraph.images.map(e=>({...e,url:h(e.url)}))}}:e,p=e=>(0,n.jsx)(o(),{children:u(d(e))}),f=e=>(0,n.jsx)(o(),{children:function(e){let{title:t,titleTemplate:r,defaultTitle:n,themeColor:i,dangerouslySetAllPagesToNoIndex:s=!1,dangerouslySetAllPagesToNoFollow:o=!1,description:a,canonical:l,facebook:c,openGraph:h,additionalMetaTags:d,twitter:p,defaultOpenGraphImageWidth:f,defaultOpenGraphImageHeight:g,defaultOpenGraphVideoWidth:m,defaultOpenGraphVideoHeight:v,mobileAlternate:y,languageAlternates:b,additionalLinkTags:_,robotsProps:w,norobots:k}=e;return u({title:t,titleTemplate:r,defaultTitle:n,themeColor:i,dangerouslySetAllPagesToNoIndex:s,dangerouslySetAllPagesToNoFollow:o,description:a,canonical:l,facebook:c,openGraph:h,additionalMetaTags:d,twitter:p,defaultOpenGraphImageWidth:f,defaultOpenGraphImageHeight:g,defaultOpenGraphVideoWidth:m,defaultOpenGraphVideoHeight:v,mobileAlternate:y,languageAlternates:b,additionalLinkTags:_,robotsProps:w,norobots:k})}(d(e))}),g=({id:e,data:t})=>(0,n.jsx)(o(),{children:(0,n.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org",...t}).replace(/</g,"\\u003c")}},`jsonld-${e}`)}),m=e=>null==e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?String(e):Array.isArray(e)?e.map(m).join(""):(0,i.isValidElement)(e)?i.Children.toArray(e.props?.children).map(m).join(""):"",v={x:"https://x.com/AppPika",chromeExtension:"https://chromewebstore.google.com/detail/pika-capture-website-scre/eabcpmplbinmgkaaccanhofnmljaaiia",vscodeExtension:"https://marketplace.visualstudio.com/items?itemName=RishiMohan.pika-vscode",raycastExtension:"https://www.raycast.com/rishi/pika",github:"https://github.com/rishimohan/pika"},y={"@type":"Organization","@id":`${c}/#organization`,name:"Pika",alternateName:"Pika.style",url:c,logo:{"@type":"ImageObject",url:`${c}/icons/pika-filled-squared-120.png`,width:120,height:120},description:"Pika is a screenshot and mockup editor for the web: add backgrounds, device frames and shadows to screenshots, then export them for social posts, docs and app stores.",email:"[email protected]",founder:{"@type":"Person",name:"Rishi Mohan",url:"https://rishimohan.me",sameAs:["https://x.com/thelifeofrishi"]},parentOrganization:{"@type":"Organization",name:"DaSkrad Ltd",url:"https://daskrad.com"},contactPoint:{"@type":"ContactPoint",contactType:"customer support",email:"[email protected]",url:`${c}/contact`},sameAs:Object.values(v)},b=e=>m(e).replace(/\s+/g," ").trim(),_=e=>({"@type":"FAQPage",mainEntity:e.map(({q:e,a:t})=>({q:b(e),a:b(t)})).filter(({q:e,a:t})=>e&&t).map(({q:e,a:t})=>
31({"@type":"Question",name:e,acceptedAnswer:{"@type":"Answer",text:t}}))}),w=e=>({"@type":"BreadcrumbList",itemListElement:e.map(({name:e,path:t},r)=>({"@type":"ListItem",position:r+1,name:e,item:`${c}${t}`}))}),k=({name:e,description:t,path:r,image:n})=>({"@type":"WebApplication",name:e,description:t,url:`${c}${r}`,...n?{image:h(n)}:{},applicationCategory:"DesignApplication",operatingSystem:"Web browser",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},publisher:{"@id":`${c}/#organization`}}),x=({name:e,description:t,path:r,installUrl:n,operatingSystem:i,image:s})=>({"@type":"SoftwareApplication",name:e,description:t,url:`${c}${r}`,...n?{downloadUrl:n,installUrl:n}:{},...s?{image:h(s)}:{},applicationCategory:"DesignApplication",operatingSystem:i,offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},isPartOf:{"@type":"WebApplication",name:"Pika",url:c},publisher:{"@id":`${c}/#organization`}}),E=({name:e,description:t,path:r,items:n})=>({"@type":"CollectionPage",name:e,description:t,url:`${c}${r}`,isPartOf:{"@id":`${c}/#website`},mainEntity:{"@type":"ItemList",numberOfItems:n.length,itemListElement:n.map(({name:e,path:t},r)=>({"@type":"ListItem",position:r+1,name:e,url:`${c}${t}`}))}})},56802:(e,t,r)=>{"use strict";r.d(t,{q:()=>n});let n=(e,t,r)=>{let n=t-e;return n?(r-e)/n:1}},58619:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},58891:(e,t,r)=>{"use strict";r.d(t,{MN:()=>l,SM:()=>a,nF:()=>o});let n=["name","full_name","user_name","preferred_username"],i=["avatar_url","picture"],s=/^[a-z0-9_]{1,32}$/;function o(e){let t=e?.user_metadata||{};for(let e of i){let r=t[e];if("string"==typeof r&&r.startsWith("https://")&&r.length<=2048)return r}return null}function a(e,t=Date.now()){let r=Date.parse(e?.created_at||"");return Number.isFinite(r)&&t-r<6e5}async function l(e,t){if(!t?.id)return null;let r=null,i=function(e){let t=e?.user_metadata||{};for(let e of n){let r="string"==typeof t[e]?t[e].trim():"";if(r)return r.slice(0,200)}return null}(t);if(i&&!t.user_metadata?.name){let{data:t,error:n}=await e.auth.updateUser({data:{name:i}});n?console.log("Error setting name",n):r=t?.user??null}try{let n,{data:a,error:l}=await e.from("profiles").select("name, avatar_url, provider").eq("user_id",t.id).maybeSingle();if(l||!a)return r;let u={},c=o(t),h=(n=t?.app_metadata?.provider,"string"==typeof n&&s.test(n)?n:null);if(i&&a.name!==i&&(u.name=i),c&&a.avatar_url!==c&&(u.avatar_url=c),h&&!a.provider&&(u.provider=h),Object.keys(u).length){let{error:r}=await e.from("profiles").update(u).eq("user_id",t.id);r&&console.log("Error updating profile",r)}}catch(e){console.log("Error syncing profile",e)}return r}},60644:(e,t,r)=>{"use strict";r.d(t,{Eq:()=>u});var n=new WeakMap,i=new WeakMap,s={},o=0,a=function(e){return e&&(e.host||a(e.parentNode))},l=function(e,t,r,l){var u=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=a(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});s[r]||(s[r]=new WeakMap);var c=s[r],h=[],d=new Set,p=new Set(u),f=function(e){!e||d.has(e)||(d.add(e),f(e.parentNode))};u.forEach(f);var g=function(e){!e||p.has(e)||Array.prototype.forEach.call(e.children,function(e){if(d.has(e))g(e);else try{var t=e.getAttribute(l),s=null!==t&&"false"!==t,o=(n.get(e)||0)+1,a=(c.get(e)||0)+1;n.set(e,o),c.set(e,a),h.push(e),1===o&&s&&i.set(e,!0),1===a&&e.setAttribute(r,"true"),s||e.setAttribute(l,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return g(t),d.clear(),o++,function(){h.forEach(function(e){var t=n.get(e)-1,s=c.get(e)-1;n.set(e,t),c.set(e,s),t||(i.has(e)||e.removeAttribute(l),i.delete(e)),s||e.removeAttribute(r)}),--o||(n=new WeakMap,n=new WeakMap,i=new WeakMap,s={})}},u=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),l(n,i,r,"aria-hidden")):function(){return null}}},61362:(e,t,r)=>{"use strict";r.d(t,{v:()=>i});var n=r(30448);class i{constructor(){this.subscriptions=[]}add(e){return(0,n.Kq)(this.subscriptions,e),()=>this.remove(e)}remove(e){(0,n.Ai)(this.subscriptions,e)}notify(e,t,r){let n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let i=0;i<n;i++){let n=this.subscriptions[i];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}},61869:(e,t,r)=>{"use strict";r.d(t,{N:()=>b});var n=r(75038),i=r(76430),s=r(1867),o=r(17655),a=r(6363),l=r(24943),u=r(23694),c=r(45890);function h(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class d extends i.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if((0,u.s)(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let e=t.offsetParent,r=(0,u.s)(e)&&e.offsetWidth||0,n=(0,u.s)(e)&&e.offsetHeight||0,i=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(i.height),s.width=parseFloat(i.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=r-s.width-s.left,s.bottom=n-s.height-s.top,s.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function p({children:e,isPresent:t,anchorX:r,anchorY:s,root:o,pop:a}){let l=(0,i.useId)(),u=(0,i.useRef)(null),f=(0,i.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:g}=(0,i.useContext)(c.Q),m=function(...e){return i.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=h(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():h(e[t],null)}}}}(...e),e)}(u,!1!==a?e.props?.ref??e?.ref:void 0);return(0,i.useInsertionEffect)(()=>{let{width:e,height:n,top:i,left:c,right:h,bottom:d,direction:p}=f.current;if(t||!1===a||!u.current||!e||!n)return;
31let m="rtl"===p,v="left"===r?m?`right: ${h}`:`left: ${c}`:m?`left: ${c}`:`right: ${h}`,y="bottom"===s?`bottom: ${d}`:`top: ${i}`;u.current.dataset.motionPopId=l;let b=document.createElement("style");g&&(b.nonce=g);let _=o??document.head;return _.appendChild(b),b.sheet&&b.sheet.insertRule(`
32          [data-motion-pop-id="${l}"] {
33            position: absolute !important;
34            width: ${e}px !important;
35            height: ${n}px !important;
36            ${v}px !important;
37            ${y}px !important;
38          }
39        `),()=>{u.current?.removeAttribute("data-motion-pop-id"),_.contains(b)&&_.removeChild(b)}},[t]),(0,n.jsx)(d,{isPresent:t,childRef:u,sizeRef:f,pop:a,children:!1===a?e:i.cloneElement(e,{ref:m})})}let f=({children:e,initial:t,isPresent:r,onExitComplete:s,custom:u,presenceAffectsLayout:c,mode:h,anchorX:d,anchorY:f,root:m})=>{let v=(0,o.M)(g),y=(0,i.useId)(),b=(0,i.useRef)(r),_=(0,i.useRef)(s);(0,a.E)(()=>{b.current=r,_.current=s});let w=!0,k=(0,i.useMemo)(()=>(w=!1,{id:y,initial:t,isPresent:r,custom:u,onExitComplete:e=>
39{for(let t of(v.set(e,!0),v.values()))if(!t)return;s&&s()},register:e=>(v.set(e,!1),()=>{v.delete(e),b.current||v.size||_.current?.()})}),[r,v,s]);return c&&w&&(k={...k}),(0,i.useMemo)(()=>{v.forEach((e,t)=>v.set(t,!1))},[r]),i.useEffect(()=>{r||v.size||!s||s()},[r]),e=(0,n.jsx)(p,{pop:"popLayout"===h,isPresent:r,anchorX:d,anchorY:f,root:m,children:e}),(0,n.jsx)(l.t.Provider,{value:k,children:e})};function g(){return new Map}var m=r(55992);let v=e=>e.key||"";function y(e){let t=[];return i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&t.push(e)}),t}let b=({children:e,custom:t,initial:r=!0,onExitComplete:l,presenceAffectsLayout:u=!0,mode:c="sync",propagate:h=!1,anchorX:d="left",anchorY:p="top",root:g})=>{let[b,_]=(0,m.xQ)(h),w=(0,i.useMemo)(()=>y(e),[e]),k=h&&!b?[]:w.map(v),x=(0,i.useRef)(!0),E=(0,i.useRef)(w),S=(0,o.M)(()=>new Map),P=(0,i.useRef)(new Set),[R,T]=(0,i.useState)(w),[A,C]=(0,i.useState)(w);(0,a.E)(()=>{!h||b||A.length||_?.()},[b,h,A.length,_]),(0,a.E)(()=>{x.current=!1,E.current=w;for(let e=0;e<A.length;e++){let t=v(A[e]);k.includes(t)?(S.delete(t),P.current.delete(t)):!0!==S.get(t)&&S.set(t,!1)}},[A,k.length,k.join("-")]);let j=[];if(w!==R){let e=[...w],t=0;for(let r of A){let n=k.indexOf(v(r));-1===n?(e.splice(t++,0,r),j.push(r)):t=n+j.length+1}return"wait"===c&&j.length&&(e=j),C(y(e)),T(w),null}let{forceRender:O}=(0,i.useContext)(s.L);return(0,n.jsx)(n.Fragment,{children:A.map(e=>{let i=v(e),s=(!h||!!b)&&(w===A||k.includes(i));return(0,n.jsx)(f,{isPresent:s,initial:(!x.current||!!r)&&void 0,custom:t,presenceAffectsLayout:u,mode:c,root:g,onExitComplete:s?void 0:()=>{if(P.current.has(i)||!S.has(i))return;P.current.add(i),S.set(i,!0);let e=!0;S.forEach(t=>{t||(e=!1)}),e&&(O?.(),C(E.current),h&&_?.(),l&&l())},anchorX:d,anchorY:p,children:e},i)})})}},62091:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var n=r(75038),i=r(71934);let s=({children:e})=>(0,n.jsx)(i.b,{children:e})},62260:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(76430),i=r(25393),s=r(20142),o=new Map;o.set("bold",function(e){return n.createElement(n.Fragment,null,n.createElement("line",{x1:"200",y1:"56",x2:"56",y2:"200",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),n.createElement("line",{x1:"200",y1:"200",x2:"56",y2:"56",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}))}),o.set("duotone",function(e){return n.createElement(n.Fragment,null,n.createElement("line",{x1:"200",y1:"56",x2:"56",y2:"200",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("line",{x1:"200",y1:"200",x2:"56",y2:"56",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))}),o.set("fill",function(){return n.createElement(n.Fragment,null,n.createElement("path",{d:"M139.3,128l66.4-66.3a8.1,8.1,0,0,0-11.4-11.4L128,116.7,61.7,50.3A8.1,8.1,0,0,0,50.3,61.7L116.7,128,50.3,194.3a8.1,8.1,0,0,0,0,11.4,8.2,8.2,0,0,0,11.4,0L128,139.3l66.3,66.4a8.2,8.2,0,0,0,11.4,0,8.1,8.1,0,0,0,0-11.4Z"}))}),o.set("light",function(e){return n.createElement(n.Fragment,null,n.createElement("line",{x1:"200",y1:"56",x2:"56",y2:"200",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),n.createElement("line",{x1:"200",y1:"200",x2:"56",y2:"56",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}))}),o.set("thin",function(e){return n.createElement(n.Fragment,null,n.createElement("line",{x1:"200",y1:"56",x2:"56",y2:"200",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),n.createElement("line",{x1:"200",y1:"200",x2:"56",y2:"56",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}))}),o.set("regular",function(e){return n.createElement(n.Fragment,null,n.createElement("line",{x1:"200",y1:"56",x2:"56",y2:"200",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("line",{x1:"200",y1:"200",x2:"56",y2:"56",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))});var a=function(e,t){return(0,i.$)(e,t,o)},l=(0,n.forwardRef)(function(e,t){return n.createElement(s.A,Object.assign({ref:t},e,{renderPath:a}))});l.displayName="X";let u=l},62682:(e,t,r)=>{"use strict";r.d(t,{a:()=>n});let n=e=>Math.round(1e5*e)/1e5},63282:(e,t,r)=>{"use strict";r.d(t,{n:()=>p});
39var n=r(76430),i=r(5701),s=r(73846),o=r(11212),a=r(75038),l=Object.defineProperty,u=(e,t)=>l(e,"name",{value:t,configurable:!0}),c="focusScope.autoFocusOnMount",h="focusScope.autoFocusOnUnmount",d={bubbles:!1,cancelable:!0},p=n.forwardRef(u(function(e,t){let{loop:r=!1,trapped:l=!1,onMountAutoFocus:p,onUnmountAutoFocus:v,...y}=e,[b,k]=n.useState(null),x=(0,o.c)(p),S=(0,o.c)(v),P=n.useRef(null),R=(0,i.s)(t,k),T=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(l){let e=function(e){if(T.paused||!b)return;let t=e.target;b.contains(t)?P.current=t:_(P.current,{select:!0})},t=function(e){if(T.paused||!b)return;let t=e.relatedTarget;null!==t&&(b.contains(t)||_(P.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&_(b)};u(e,"handleFocusIn"),u(t,"handleFocusOut"),u(r,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(r);return b&&n.observe(b,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[l,b,T.paused]),n.useEffect(()=>{if(b){w.add(T);let e=document.activeElement;if(!b.contains(e)){let t=new CustomEvent(c,d);b.addEventListener(c,x),b.dispatchEvent(t),t.defaultPrevented||(f(E(m(b)),{select:!0}),document.activeElement===e&&_(b))}return()=>{b.removeEventListener(c,x),setTimeout(()=>{let t=new CustomEvent(h,d);b.addEventListener(h,S),b.dispatchEvent(t),t.defaultPrevented||_(e??document.body,{select:!0}),b.removeEventListener(h,S),w.remove(T)},0)}}},[b,x,S,T]);let A=n.useCallback(e=>{if(!r&&!l||T.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[i,s]=g(t);i&&s?e.shiftKey||n!==s?e.shiftKey&&n===i&&(e.preventDefault(),r&&_(s,{select:!0})):(e.preventDefault(),r&&_(i,{select:!0})):n===t&&e.preventDefault()}},[r,l,T.paused]);return(0,a.jsx)(s.sG.div,{tabIndex:-1,...y,ref:R,onKeyDown:A})},"FocusScope"));function f(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(_(n,{select:t}),document.activeElement!==r)return}function g(e){let t=m(e);return[v(t,e),v(t.reverse(),e)]}function m(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:u(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}function v(e,t){let r="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let n of e)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):y(n,{upTo:t})))return n}function y(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function b(e){return e instanceof HTMLInputElement&&"select"in e}function _(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&b(e)&&t&&e.select()}}u(f,"focusFirst"),u(g,"getTabbableEdges"),u(m,"getTabbableCandidates"),u(v,"findVisible"),u(y,"isHidden"),u(b,"isSelectableInput"),u(_,"focus");var w=k();function k(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),(e=x(e,t)).unshift(t)},remove(t){e=x(e,t),e[0]?.resume()}}}function x(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}function E(e){return e.filter(e=>"A"!==e.tagName)}u(k,"createFocusScopesStack"),u(x,"arrayRemove"),u(E,"removeLinks")},63506:(e,t,r)=>{"use strict";r.d(t,{u:()=>i});var n=r(41731);let i={test:(0,r(85735).$)("#"),parse:function(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:n.B.transform}},63675:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(76430),i=r(75038),s=Object.defineProperty,o=(e,t)=>s(e,"name",{value:t,configurable:!0});function a(e,t=[]){let r=[];
39function s(t,s){let a=n.createContext(s);a.displayName=t+"Context";let l=r.length;r=[...r,s];let u=o(t=>{let{scope:r,children:s,...o}=t,u=r?.[e]?.[l]||a,c=n.useMemo(()=>o,Object.values(o));return(0,i.jsx)(u.Provider,{value:c,children:s})},"Provider");function c(r,i,o={}){let{optional:u=!1}=o,h=i?.[e]?.[l]||a,d=n.useContext(h);if(d)return d;if(void 0!==s)return s;if(!u)throw Error(`\`${r}\` must be used within \`${t}\``)}return u.displayName=t+"Provider",o(c,"useContext"),[u,c]}o(s,"createContext");let u=o(()=>{let t=r.map(e=>n.createContext(e));return o(function(r){let i=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:i}}),[r,i])},"useScope")},"createScope");return u.scopeName=e,[s,l(u,...t)]}function l(...e){let t=e[0];if(1===e.length)return t;let r=o(()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return o(function(e){let i=r.reduce((t,{useScope:r,scopeName:n})=>{let i=r(e)[`__scope${n}`];return{...t,...i}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return r.scopeName=t.scopeName,r}o(function(e,t){let r=n.createContext(t);r.displayName=e+"Context";let s=o(e=>{let{children:t,...s}=e,o=n.useMemo(()=>s,Object.values(s));return(0,i.jsx)(r.Provider,{value:o,children:t})},"Provider");function a(i,s={}){let{optional:o=!1}=s,l=n.useContext(r);if(l)return l;if(void 0!==t)return t;if(!o)throw Error(`\`${i}\` must be used within \`${e}\``)}return s.displayName=e+"Provider",o(a,"useContext"),[s,a]},"createContext"),o(a,"createContextScope"),o(l,"composeContextScopes")},64971:(e,t,r)=>{"use strict";r.d(t,{G:()=>n});let n=e=>"object"==typeof e&&null!==e},65511:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>$});var n,i,s,o,a,l=r(75038),u=r(76430),c=r(17531),h=r.n(c),d=r(87206),p=r.n(d),f=r(67938),g=r.n(f),m=r(2272),v=r(42098),y=r(56725),b=r(92376);r(21606),r(1688),r(50927),r(97048),r(8282),r(45204);var _=r(1433),w=r(70799),k=(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),x=(0,u.createContext)({get client(){return a},bootstrap:void 0});function E(e){var t,r,n=e.children,i=e.client,s=e.apiKey,o=e.options,l=(0,u.useRef)(null),c=(0,u.useMemo)(function(){if(i)return s&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),i;var e=a;return s||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),e},[i,s,JSON.stringify(o)]);return(0,u.useEffect)(function(){if(!i&&s){var e=a,t=l.current;t?(s!==t.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!function e(t,r,n){if(void 0===n&&(n=new WeakMap),t===r)return!0;if("object"!=typeof t||null===t||"object"!=typeof r||null===r)return!1;if(n.has(t)&&n.get(t)===r)return!0;n.set(t,r);var i=Object.keys(t),s=Object.keys(r);if(i.length!==s.length)return!1;for(var o=0;o<i.length;o++){var a=i[o];if(!s.includes(a)||!e(t[a],r[a],n))return!1}return!0}(o,t.options)&&e.set_config(o)):(e.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),e.init(s,o)),l.current={apiKey:s,options:null!=o?o:{}}}},[i,s,JSON.stringify(o)]),u.createElement(x.Provider,{value:{client:c,bootstrap:null!=(t=null==o?void 0:o.bootstrap)?t:null==(r=null==i?void 0:i.config)?void 0:r.bootstrap}},n)}var S=function(e){return"function"==typeof e},P=function(e){var t=Object.prototype.toString.call(e);
39return e instanceof Error||"[object Error]"===t||"[object Exception]"===t||"[object DOMException]"===t||"[object DOMError]"===t},R=function(e,t){try{Object.defineProperty(e,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(e){}},T=function(e,t){for(var r=new WeakSet,n=e;!r.has(n);){if(r.add(n),!P(n.cause)){void 0!==n.cause&&(t.cause=n.cause),n.cause=t;return}n=n.cause}},A=function(e,t){if(!t)return e;var r=Error(P(e)?e.message:"Primitive value captured as exception: ".concat(String(e)));return(R(r,"React ErrorBoundary ".concat(P(e)?e.name:"Error")),r.stack=t,P(e))?(T(e,r),e):r},C={componentStack:null,exceptionEvent:null,error:null};i=o=function(e){function t(t){var r=e.call(this,t)||this;return r._resetError=function(){r.setState(C)},r.state=C,r}return k(t,e),t.prototype.componentDidCatch=function(e,t){var r,n=this.props.additionalProperties;S(n)?r=n(e,t):"object"==typeof n&&(r=n);var i=this.context.client,s=t.componentStack,o=i.captureException(A(e,s),r);this.setState({error:e,componentStack:null!=s?s:null,exceptionEvent:o})},t.prototype.render=function(){var e=this.props,t=e.children,r=e.fallback,n=this.state;if(null==n.componentStack)return S(t)?t():t;var i=S(r)?u.createElement(r,{error:n.error,componentStack:n.componentStack,exceptionEvent:n.exceptionEvent,resetError:this._resetError}):r;return u.isValidElement(i)?i:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),u.createElement(u.Fragment,null))},t}(u.Component),"symbol"==typeof(s="PostHogErrorBoundary")&&(s=s.description?"[".concat(s.description,"]"):""),Object.defineProperty(i,"name",{configurable:!0,value:s}),o.contextType=x,a=w.Ay;let j=g()(()=>r.e(4520).then(r.bind(r,34520)),{loadableGenerated:{webpack:()=>[34520]}}),O=g()(()=>Promise.resolve().then(r.bind(r,76902)),{loadableGenerated:{webpack:()=>[76902]}});w.Ay.init("phc_pBEwUMRAc84ZDWdwvxisE4oQt4s61QeOoze16us5wb1",{api_host:"/ingest",ui_host:"https://us.posthog.com",defaults:"2026-08-30",capture_exceptions:!0});let $=function({Component:e,pageProps:t}){let[r,n]=(0,u.useState)(!1),i=(0,b.useRouter)(),s=("https://pika.style"+("/"===i.asPath?"":i.asPath)).split(/[?#]/)[0];return(0,u.useEffect)(()=>{n(!0)},[]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y.FR,{title:"Pika – Create Screenshots and Mockups",description:"Create beautiful screenshots and mockups effortlessly. Capture screenshots from URL or from webpages using our Chrome extension and beautify them in seconds",canonical:s,openGraph:{type:"website",siteName:"Pika",locale:"en_US",images:[{url:"/og-images/main.png",width:800,height:600,alt:"Pika – Create Screenshots and Mockups"}]},twitter:{handle:"@thelifeofrishi",site:"@AppPika",cardType:"summary_large_image"},additionalLinkTags:[{rel:"apple-touch-icon",sizes:"180x180",href:"/icons/pwa/256.png"}]}),(0,l.jsx)(p(),{id:"crisp-widget",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:`window.$crisp=[];window.CRISP_WEBSITE_ID="2fc94cb3-0b8b-4d15-8f06-798ae0ceff00";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();$crisp.push(["on", "message:received", function(message) {
40            // message.from can be "operator" or "user"
41            if (message.from === "operator") {
42              $crisp.push(['do', 'chat:show']);
43            }
44          }]);`}}),(0,l.jsxs)(h(),{children:[(0,l.jsx)("link",{rel:"manifest",href:"/manifest.json"}),(0,l.jsx)("link",{rel:"shortcut icon",href:"/icons/favicon-1.ico",type:"image/x-icon"}),(0,l.jsx)("meta",{name:"mobile-web-app-capable",content:"yes"}),(0,l.jsx)("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"})]}),(0,l.jsx)(p(),{id:"initRewardful",dangerouslySetInnerHTML:{__html:"(function(w,r){w._rwq=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)}})(window,'rewardful');"}}),(0,l.jsx)(p(),{id:"setRewardful",src:"https://r.wdfl.co/rw.js","data-rewardful":"581494"}),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p(),{defer:!0,src:"https://analytics.pika.style/pa.js",id:"pianjs","data-code":"xiKJWaoolX0VGLTN54jqAoWQZrl2WQjq","data-hit-endpoint":"https://analytics.pika.style/hit","data-event-endpoint":"https://analytics.pika.style/event","data-session-endpoint":"https://analytics.pika.style/session"}
44),(0,l.jsx)(p(),{defer:!0,src:"/js/fast-script.js",id:"datafastjs","data-website-id":"dfid_DEePO57SdBH4yASoihpEY","data-domain":"pika.style"})]}),(0,l.jsx)(v.N,{attribute:"class",children:(0,l.jsxs)(m.Q,{children:[(0,l.jsx)(E,{client:w.Ay,children:(0,l.jsx)(e,{...t})}),(0,l.jsx)(O,{}),r?(0,l.jsx)("div",{onClick:()=>_.oR.dismiss(),children:(0,l.jsx)(_.l$,{position:"bottom-center",containerStyle:{bottom:"24px"},toastOptions:{style:{padding:"5px 10px",bottom:"100px",borderRadius:"12px",fontSize:"0.91rem",boxShadow:"0 6px 128px rgba(0, 0, 0, 0.4)",background:"linear-gradient(335deg, #fff, #fffffff0)",backdropFilter:"blur(3px)",border:"1px solid #d9d8d8",color:"#333",whiteSpace:"nowrap",maxWidth:"380px",lineHeight:"1.2",textShadow:"0 1px 12px #11111136",fontFamily:"Inter, --apple-system, sans-serif"},success:{iconTheme:{primary:"#3c9f62",secondary:"#fff"}},error:{iconTheme:{primary:"#ff5151",secondary:"#fff"}}}})}):"",(0,l.jsx)(j,{})]})})]})}},65779:(e,t,r)=>{"use strict";r.d(t,{J:()=>i,d:()=>s});var n=r(38721);let i=(0,n.J)(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),s=(0,n.J)(()=>void 0!==window.ViewTimeline,"viewTimeline")},65911:(e,t,r)=>{"use strict";r.d(t,{j:()=>P});var n=r(62682),i=r(86955),s=r(37022),o=r(75623),a=r(29993),l=r(32863),u=r(63506),c=r(48439);function h(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var d=r(41731);function p(e,t){return r=>r>0?t:e}var f=r(39445);let g=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},m=[u.u,d.B,c.V];function v(e){let t=m.find(t=>t.test(e));if(!t)return(0,s.$)(!1,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!1;let r=t.parse(e);return t===c.V&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let i=0,s=0,o=0;if(t/=100){let n=r<.5?r*(1+t):r+t-r*t,a=2*r-n;i=h(a,n,e+1/3),s=h(a,n,e),o=h(a,n,e-1/3)}else i=s=o=r;return{red:Math.round(255*i),green:Math.round(255*s),blue:Math.round(255*o),alpha:n}}(r)),r}let y=(e,t)=>{let r=v(e),n=v(t);if(!r||!n)return p(e,t);let i={...r};return e=>(i.red=g(r.red,n.red,e),i.green=g(r.green,n.green,e),i.blue=g(r.blue,n.blue,e),i.alpha=(0,f.k)(r.alpha,n.alpha,e),d.B.transform(i))},b=new Set(["none","hidden"]);function _(e,t){return r=>(0,f.k)(e,t,r)}function w(e){return"number"==typeof e?_:"string"==typeof e?(0,o.pG)(e)?p:a.y.test(e)?y:E:Array.isArray(e)?k:"object"==typeof e?a.y.test(e)?y:x:p}function k(e,t){let r=[...e],n=r.length,i=e.map((e,r)=>w(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=i[t](e);return r}}function x(e,t){let r={...e,...t},n={};for(let i in r)void 0!==e[i]&&void 0!==t[i]&&(n[i]=w(e[i])(e[i],t[i]));return e=>{for(let t in n)r[t]=n[t](e);return r}}let E=(e,t)=>{let r=l.f.createTransformer(t),n=(0,l.Vf)(e),o=(0,l.Vf)(t);if(!(n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length))return(0,s.$)(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),p(e,t);if(b.has(e)&&!o.values.length||b.has(t)&&!n.values.length)return b.has(e)?r=>r<=0?e:t:r=>r>=1?t:e;return(0,i.F)(k(function(e,t){let r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let s=t.types[i],o=e.indexes[s][n[s]],a=e.values[o]??0;r[i]=a,n[s]++}return r}(n,o),o.values),r)},S=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function P(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,f.k)(e,t,r);if("string"==typeof e&&"string"==typeof t){let r=function(e,t){let r=S.exec(e);if(!r)return;let i=S.exec(t);if(!i||r[2]!==i[2])return;let s=r[2],o=parseFloat(r[1]),a=parseFloat(i[1]);return e=>(0,n.a)((0,f.k)(o,a,e))+s}(e,t);if(r)return r}return w(e)(e,t)}},67938:(e,t,r)=>{e.exports=r(11828)},70081:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=[{title:"Web",slug:"web",description:"Generate beautiful screenshots for your website, code snippets and more instantly",icon:"",theme:"",templates:[{title:"Screenshot Editor",metaTitle:"Pika – Free online screenshot editor with frames and mockups",metaDescription:"Edit screenshots online for free. Add backgrounds, browser frames, shadows and text, or capture a website from its URL. No sign-up needed.",slug:"screenshot-editor",theme:"from-red-200 via-pink-300 to-blue-100",description:"Quickly create beautiful website and app mockups from screenshot for free. Pika lets you capture website screenshot from URL, add device and browser frames, customize background and more",src:"/templates/previews/screenshot-editor.png",tags:["Free size","Screenshots from URL","Browser Frames"],price:["free"],hasPaidOptions:!0},{title:"Icon Image Generator",metaTitle:"Pika – Free icon image generator, save icons as PNG",metaDescription:"Turn an icon into an image for the App Store, Play Store or social posts. Search the icon library, pick a style, size and shadow, and save it as a PNG.",slug:"icon-image-maker",theme:"from-red-200 via-pink-300 to-blue-100",description:"Free tool to generate beautiful images from icons for App Store, Google Play Store and more. Select icon, customize appearance and export as PNG image",src:"/templates/previews/icon-image-maker.png",tags:["Free size","Icons"],price:["free"],hasPaidOptions:!0},{title:"Tweet Screenshot Generator",metaTitle:"Pika – Turn any tweet into a beautiful screenshot image",metaDescription:"Paste a tweet (X post) link and turn it into a clean image. Adjust size, font, shadow and background, then export as PNG. Free tweet to image tool.",slug:"tweet-image",theme:"from-red-200 via-pink-300 to-blue-100",description:"Free tool to design and create professional tweet screenshots online. Paste your tweet URL to get started",src:"/templates/previews/tweet-image.png",tags:["Free size","Tweets"],price:["free"],hasPaidOptions:!0},{title:"Code Screenshot Generator",metaTitle:"Pika – Turn your code into beautiful code screenshots",metaDescription:"Turn code into a beautiful image with syntax highlighting for 20+ languages, themes and backgrounds. Free code screenshot tool, export as PNG.",slug:"code-image",theme:"from-red-200 via-pink-300 to-blue-100",description:"Free tool to create code screenshots for 20+ languages including HTML, CSS, JavaScript",src:"/templates/previews/code-image.png",tags:["Free size","Syntax Highlighting","Languages Support"],price:["free"],hasPaidOptions:!0},{title:"Testimonial Image Template",metaTitle:"Pika – Free testimonial image generator for social posts",metaDescription:"Turn customer quotes into testimonial images for your website, Instagram and LinkedIn. Add the author's photo, pick a style and export as PNG. Free.",slug:"testimonial-quote-design-template",theme:"from-red-200 via-pink-300 to-blue-100",description:"Free tool to generate beautiful testimonial images. Design stunning testimonial image for websites, Instagram and more",src:"/templates/previews/testimonial-image.png",tags:["Free size","Quotes","Testimonial"],price:["free"],hasPaidOptions:!0},{title:"Open Graph Image and Tag Generator",metaTitle:"Pika – Free Open Graph image and meta tag generator",metaDescription:"Design an Open Graph (og:image) image for your links from 5 layouts, then copy the og: and twitter: meta tags. Free OG image generator, export as PNG.",slug:"open-graph-generator",theme:"from-red-200 via-pink-300 to-blue-100",description:"Quickly generate perfectly sized Open Graph image(og:image) and meta tags from URL for Facebook, Twitter, LinkedIn and more",src:"/templates/previews/og-image-generator.png",tags:["Open Graph","Links"],price:["free"],hasPaidOptions:!1},{title:"Notion Style Image",metaTitle:"Pika – Create Notion style images, covers and screenshots",metaDescription:"Create Notion-style screenshots and cover images for your Notion templates and UI designs, in the right size for websites and s
44ocial posts.",slug:"notion-style-image",theme:"from-red-200 via-pink-300 to-blue-100",description:"Create Notion style screenshots and cover image quickly. Perfect to present your Notion template and aesthetic UI designs in perfect size",src:"/templates/previews/notion-screenshot.png",tags:["Free size","Upto 2 screenshots"],price:["free"],hasPaidOptions:!0}]},{title:"Device",description:"Design mobile app screenshots for marketing and for App Store, Google Play Store",templates:[{title:"iPad Mini Mockup",metaTitle:"Pika – Create iPad Mini mockups from your screenshots",metaDescription:"Put your screenshot on an iPad Mini with layouts, shadows and backgrounds, and add an Apple Pencil with Pro. Free to start, export as PNG or JPG.",slug:"ipad-mini-mockup",description:"Customizable mockup template to generate iPad Mini images for landing page, social media, App Store. This free template has a floating view of iPad with Apple Pencil",src:"/templates/previews/ipad-mini-mockup.png",theme:"from-yellow-100 via-red-300 to-orange-100",tags:["Free Size","Single Screenshot"],isPaid:!1,hasPaidOptions:!0},{title:"App Store Screenshot Generator",metaTitle:"Pika – Create App Store and Play Store screenshots",metaDescription:"Design App Store and Google Play screenshots from your app screens with device frames, captions and backgrounds at the right sizes. Free to start.",slug:"app-store-play-store-screenshot",description:"Generate customizable App Store mockups for iPhone app for free. Supports iPhone 14 frame, custom background, text and more",src:"/templates/previews/app-store-screenshot.png",theme:"from-yellow-100 via-red-300 to-orange-100",tags:["Free Size","Single Screenshot","Phone frames"],isPaid:!1,hasPaidOptions:!0},{title:"Google Pixel Mockup",metaTitle:"Pika – Google Pixel mockup generator for app screenshots",metaDescription:"Show your Android app in a Google Pixel 5 frame with layouts, shadows and backgrounds, for Play Store listings and landing pages. Free to start.",slug:"google-pixel-mockup",description:"Free and customizable Google Pixel mockup generator to generate images for Google Play Store, landing pages and more, which you can save as PNG or JPG",src:"/templates/previews/google-pixel-5-dark.png",theme:"from-yellow-100 via-red-300 to-orange-100",tags:["Free Size","Single Screenshot","Phone frames"],isPaid:!1,hasPaidOptions:!0},{title:"MacBook Mockup Template",metaTitle:"Pika – Free MacBook mockup template for your screenshots",metaDescription:"Put your screenshot on a MacBook in seconds. Free MacBook mockup template with gradient backgrounds, patterns and shadows. Export as PNG or JPG.",slug:"macbook-mockup-template",description:"A customizable and free template to generate MacBook Pro mockup from screenshots. You can save image with transparent background, add text, watermark and more",src:"/templates/previews/macbook-mockup-template.png",theme:"from-yellow-100 via-red-300 to-orange-100",tags:["Free Size","Single Screenshot","MacBook frame"],isPaid:!1,hasPaidOptions:!0},{title:"Mobile App Presentation Template",metaTitle:"Pika – Mobile app presentation mockup for up to 6 screens",metaDescription:"Show up to 6 screens of your mobile app side by side in iPhone frames, with custom spacing and backgrounds. A Pika Pro template for landing pages and decks.",slug:"mobile-app-presentation-template",description:"A customizable template to create classic presentation image from mobile app screenshots. You can add iPhone frame and upto 6 screens of your app",src:"/templates/previews/app-presentation-mockup.png",theme:"from-yellow-100 via-red-300 to-orange-100",tags:["Upto 6 screenshots","Phone frames"],isPaid:!0,hasPaidOptions:!0},{title:"iPhone 14 Screenshots Mockup",metaTitle:"Pika – iPhone screenshot mockup template for 3 screens",metaDescription:"Show up to 3 app screenshots in stacked iPhone 14 frames on a gradient, color or image background. A Pika Pro template for App Store promos and websites.",slug:"stacked-mobile-app-screenshot",description:"A customizable iPhone 14 mockup generator, supports upto 3 screen shots. You can add background image or gradient, add 3d-effect, custom text and more",src:"/templates/previews/stacked-iphone.png",theme:"from-yellow-100 via-red-300 to-orange-100",tags:["iPhone","Upto 3 screenshots","Phone frames"],isPaid:!0,hasPaidOptions:!0}]}]},70799:(e,t,r)=>{"use strict";let n,i,s,o,a,l,u,c;r.d(t,{Ay:()=>lP});let h="u">typeof window?window:void 0,d="u">typeof globalThis?globalThis:h,p=null==d?void 0:d.navigator,f=null==d?void 0:d.document,g=null==d?void 0:d.location,m=null==d?void 0:d.fetch,v=(null==d?void 0:d.XMLHttpRequest)&&"withCredentials"in new d.XMLHttpRequest?d.XMLHttpRequest:void 0,y=null==d?void 0:d.AbortController,b=null==d?void 0:d.CompressionStream,_=null==p?void 0:p.userAgent;function w(){return!(!h||!1===h.navigator.onLine)}let k="u">typeof globalThis?globalThis:h;k&&"u"<typeof self&&(k.self=k),k&&"u"<typeof File&&(k.File=function(){});let x=null!=h?h:{},E="0.9.0",S={DEBUG:!1,LIB_VERSION:E,LIB_NAME:"browser-common",JS_SDK_VERSION:E};var P,R,T,A,C=((R={}).AnonymousId="anonymous_id",R.DistinctId="distinct_id",R.Props="props",R.EnablePersonProcessing="enable_person_processing",R.PersonMode="person_mode",R.FeatureFlagDetails="feature_flag_details",R.FeatureFlags="feature_flags",R.FeatureFlagPayloads="feature_flag_payloads",R.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",R.BootstrapFeatureFlags="bootstrap_feature_flags",R.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",R.OverrideFeatureFlags="override_feature_flags",R.Queue="queue",R.AiQueue="ai_queue",R.AiCaptureQueue="ai_capture_queue",R.LogsQueue="logs_queue",R.OptedOut="opted_out",R.SessionId="session_id",R.SessionStartTimestamp="session_start_timestamp",R.SessionLastTimestamp="session_timestamp",R.PersonProperties="person_properties",R.GroupProperties="group_properties",R.InstalledAppBuild="installed_app_build",R.InstalledAppVersion="installed_app_version",R.SessionReplay="session_replay",R.PushRegistered="push_registered",R.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",R.SurveyLastSeenDate="survey_last_seen_date",R.SurveysInProgress="surveys_in_progress",R.SurveysSeen="surveys_seen",R.Surveys="surveys",R.RemoteConfig="remote_config",R.FlagsEndpointWasHit="flags_endpoint_was_hit",R.DeviceId="device_id",R),j=((T={}).GZipJS="gzip-js",T.Base64="base64",T);let O=["$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"],$=["token"];function I(e,t){return -1!==e.indexOf(t)}let L=function(e){return e.trim()},M=function(e){return e.replace(/^\$/,"")};function D(e){var t;let r=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(t))return"[Circular]";r.push(t)}return t}}))?t:"null"}let N=Object.prototype,F=N.hasOwnProperty,B=N.toString,U=Array.isArray||function(e){return"[object Array]"===B.call(e)},V=e=>"function"==typeof e,W=e=>e===Object(e)&&!U(e),H=e=>{if(W(e)){for(let t in e)if(F.call(e,t))return!1;return!0}return!1},q=e=>void 0===e,G=e=>"[object String]"==B.call(e),z=e=>G(e)&&0===e.trim().length,K=e=>null===e,J=e=>q(e)||K(e),Y=e=>"[object Number]"==B.call(e)&&e==e,X=e=>Y(e)&&e>0,Z=e=>"[object Boolean]"===B.call(e),Q=e=>I(O,e),ee=e=>I($,e);function et(e){return null===e||"object"!=typeof e}function er(e,t){return({}).toString.call(e)===`[object ${t}]`}function en(e){switch(({}
44).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return es(e,Error)}}function ei(e){return"u">typeof Event&&es(e,Event)}function es(e,t){try{return e instanceof t}catch(e){return!1}}let eo=[!0,"true",1,"1","yes"],ea=[!1,"false",0,"0","no"];function el(e,t,r,n,i,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,i)}function eu(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var s=e.apply(t,r);function o(e){el(s,n,i,o,a,"next",e)}function a(e){el(s,n,i,o,a,"throw",e)}o(void 0)})}}let ec=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],eh=function(e,t=[]){if(!e)return!1;let r=e.toLowerCase();return ec.concat(t).some(e=>{let t=e.toLowerCase();return -1!==r.indexOf(t)})};function ed(e,t,r,n,i){return t>r&&(n.warn("min cannot be greater than max."),t=r),Y(e)?e>r?(n.warn(" cannot be  greater than max: "+r+". Using max value instead."),r):t>e?(n.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),ed(null!=i?i:r,t,r,n))}var ep=class{constructor(e){this.C={},this.I=e.I,this.R=ed(e.bucketSize,0,100,e.$),this.A=ed(e.refillRate,0,this.R,e.$),this.O=ed(e.refillInterval,0,864e5,e.$)}F(e,t){let r=Math.floor((t-e.lastAccess)/this.O);r>0&&(e.tokens=Math.min(e.tokens+r*this.A,this.R),e.lastAccess=e.lastAccess+r*this.O)}consumeRateLimit(e){var t;let r=Date.now(),n=String(e),i=this.C[n];return i?this.F(i,r):(i={tokens:this.R,lastAccess:r},this.C[n]=i),0===i.tokens||(i.tokens--,0===i.tokens&&(null==(t=this.I)||t.call(this,e)),0===i.tokens)}stop(){this.C={}}};let ef="Mobile",eg="Android",em="Tablet",ev="Android Tablet",ey="iPad",eb="Apple Watch",e_="Safari",ew="BlackBerry",ek="Samsung Internet",ex="Chrome",eE="Chrome iOS",eS="Internet Explorer",eP="Internet Explorer Mobile",eR="Opera",eT="Microsoft Edge",eA="Firefox",eC="Firefox iOS",ej="Nintendo",eO="PlayStation",e$="Xbox",eI="Android Mobile",eL="Mobile Safari",eM="Windows",eD="Windows Phone",eN="Nokia",eF="Ouya",eB="Generic "+ef.toLowerCase(),eU="Generic "+em.toLowerCase(),eV="Konqueror",eW="Oculus Browser",eH="Vivaldi",eq="Yandex",eG="Whale",ez="DuckDuckGo",eK="Pale Moon",eJ="Waterfox",eY="Brave",eX="Claude",eZ="Codex",eQ="ChatGPT",e0="Google Search App",e1=RegExp("Version/(\\d+(\\.\\d+)?)"),e2=RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),e8=RegExp(e$,"i"),e6=RegExp("PlayStation \\w+","i"),e3=RegExp("Nintendo \\w+","i"),e5=RegExp("BlackBerry|PlayBook|BB10","i"),e4={"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"},e9=function(e,t,r,n){var i;return t=t||"",((null==r?void 0:r.brave)?eY:null)||((null==n?void 0:n.detectGoogleSearchApp)&&I(e,"GSA/")?e0:I(e," OPR/")&&I(e,"Mini")?"Opera Mini":I(e," OPR/")?eR:e5.test(e)?ew:I(e,"IEMobile")||I(e,"WPDesktop")?eP:I(e,"OculusBrowser")?eW:I(e,"SamsungBrowser")?ek:I(e,"Edge")||I(e,"Edg/")?eT:I(e,"Vivaldi/")?eH:I(e,"YaBrowser/")?eq:I(e,"Whale/")?eG:I(e,"DuckDuckGo/")||I(e,"Ddg/")?ez:I(e,"Claude/")?eX:I(e,"Codex/")?eZ:I(e,"ChatGPT/")?eQ:I(e,"FBIOS")?"Facebook Mobile":I(e,"UCWEB")||I(e,"UCBrowser")?"UC Browser":I(e,"CriOS")?eE:I(e,"CrMo")||I(e,ex)?ex:I(e,eg)&&I(e,e_)?eI:I(e,"FxiOS")?eC:I(e.toLowerCase(),eV.toLowerCase())?eV:I(e,"Brave/")?eY:(i=t)&&I(i,"Apple")||I(e,e_)&&!I(e,ex)&&!I(e,eg)?I(e,ef)?eL:e_:I(e,"PaleMoon/")?eK:I(e,"Waterfox/")?eJ:I(e,eA)?eA:I(e,"MSIE")||I(e,"Trident/")?eS:I(e,"Gecko")?eA:"")},e7={[eP]:[RegExp("rv:(\\d+(\\.\\d+)?)")],[eT]:[RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ex]:[RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[eE]:[RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[e_]:[e1],[eL]:[e1],[eR]:[RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[eA]:[RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[eC]:[RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[eV]:[RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ew]:[RegExp("BlackBerry (\\d+(\\.\\d+)?)"),e1],[eI]:[RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ek]:[RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[eW]:[RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[eH]:[RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[eq]:[RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[eG]:[RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[eY]:[RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[eX]:[e2],[eZ]:[e2],[eQ]:[e2],[ez]:[RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[eK]:[RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[eJ]:[RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[e0]:[RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[eS]:[RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[RegExp("rv:(\\d+(\\.\\d+)?)")]},te=function(e,t,r,n){let i=e7[e9(e,t,r,n)];if(q(i))return null;for(let t=0;i.length>t;t++){let r=e.match(i[t]);if(r)return parseFloat(r[r.length-2])}return null},tt=[[RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[e$,e&&e[1]||""]],[RegExp(ej,"i"),[ej,""]],[RegExp(eO,"i"),[eO,""]],[e5,[ew,""]],[RegExp(eM,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eD,""];if(new RegExp(ef).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];let r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){let e=e4[r[1]]||"";return/arm/i.test(t)&&(e="RT"),[eM,e]}return[eM,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=q(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[eg,[e[2],e[3],e[4]||"0"].join(".")]:[eg,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],tr=function(e){for(let t=0;tt.length>t;t++){let[r,n]=tt[t],i=r.exec(e),s=i&&(V(n)?n(i,e):n);if(s)return s}return["",""]},tn=function(e){return e3.test(e)?ej:e6.test(e)?eO:e8.test(e)?e$:RegExp(eF,"i").test(e)?eF:RegExp("(Windows Phone|WPDesktop)","i").test(e)?eD:/iPad/.test(e)?ey:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?eb:e5.test(e)?ew:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eN,"i").test(e)?eN:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ef).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?eg:ev:RegExp("(pda|Mobile)","i").test(e)?eB:RegExp(em,"i").test(e)&&!RegExp("Tablet pc","i").test(e)?eU:""},ti=function(e,t){var r,n,i,s;let o=tn(e);return o===ey||o===ev||"Kobo"===o||"Kindle Fire"===o||o===eU?em:o===ej||o===e$||o===eO||o===eF?"Console":o===eb?"Wearable":o?ef:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!=(s=null==t?void 0:t.maxTouchPoints)?s:0)>0?600>Math.min(null!=(r=null==t?void 0:t.screenWidth)?r:0,null!=(n=null==t?void 0:t.screenHeight)?n:0)/(null!=(i=null==t?void 0:t.devicePixelRatio)?i:1)?ef:em:"Desktop"},ts=/\bFBAV\/(\d+(?:\.\d+)*)/i,to=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",ts],[/\bFBAN\/EMA\b/i,"Facebook Lite",ts],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",ts],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?
44:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],ta="[Truncated]",tl="[Unserializable]";function tu(e){let t="";for(let r=0;e.length>r;r++){let n=e.charCodeAt(r);if(55296>n||n>56319)t+=56320>n||n>57343?e[r]:"�";else{let n=e.charCodeAt(r+1);56320>n||n>57343?t+="�":(t+=e[r]+e[r+1],r++)}}return t}function tc(e,t){if(!t)return e;let r=[];try{r=Object.keys(t)}catch(e){r=[]}for(let n of r){let r;try{r=t[n]}catch(e){r=tl}Object.defineProperty(e,n,{value:r,enumerable:!0,writable:!0,configurable:!0})}return e}var th=class{record(e){if("too-large"===e.kind)return;if("retry-later"!==e.kind)return void this.reset();if(!e.retryAfterMs)return;let t=this.isOpen(),r=Date.now(),n=Math.min(e.retryAfterMs,3e5);t?this.es=Math.max(this.es,Math.min(r+n,this.ts+3e5)):(this.ts=r,this.es=r+n)}remainingMs(){let e=Date.now();if(this.ts-5e3>e)return this.reset(),0;let t=Math.min(3e5,Math.max(0,this.es-e));return 0===t&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};let td=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tp(e,t){return"string"==typeof e&&td.test(e)?e:t()}function tf(e,t){let r=Error(t);try{Object.defineProperty(r,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return r}function tg(e){return e?e.split("#")[0]:e}function tm(e){try{return e()}catch(e){return}}function tv(e,t){let r=setTimeout(e,t);return null!=r&&r.unref&&(null==r||r.unref()),r}function ty(e,t,r){return tb.apply(this,arguments)}function tb(){return(tb=eu(function*(e,t,r){let n;try{return yield Promise.race([e,new Promise((e,i)=>{n=tv(()=>{try{null==r||r(),e()}catch(e){i(e)}},t)})])}finally{clearTimeout(n)}})).apply(this,arguments)}function t_(e){return(t_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function tk(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tw(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e){if("object"!=t_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=t_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==t_(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tw(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var tx=class{constructor(e,t,r=[]){this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t={}){let r=t&&t.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,t,0).apply(e),i=this.buildParsingContext(t),s=this.parseStacktrace(n,i);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var t=this;return eu(function*(){for(let r of e)r.stacktrace&&r.stacktrace.frames&&U(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r;let n,i;if(null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack)try{i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
44pFirstLines:0),t.chunkIdMap)}catch(e){}return tk(tk({},e),{},{cause:n,stack:i,errors:null==(r=e.errors)?void 0:r.map(e=>this.parseStacktrace(e,t))})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(let r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return eu(function*(){let r=e;for(let e of t.modifiers)r=yield e(r);return r})()}convertToExceptionList(e,t){let r=[],n=(e,i,s)=>{var o;let a=r.length,l=void 0===i?tk(tk({type:"string"==typeof t.type&&t.type.length>0?t.type:"generic"},"boolean"==typeof t.handled?{handled:t.handled}:void 0===t.handled?{handled:!0}:{}),{},{synthetic:"boolean"==typeof t.synthetic?t.synthetic:e.synthetic,exception_id:a}):{type:"chained",source:s,synthetic:e.synthetic,exception_id:a,parent_id:i},u={type:e.type,value:e.value,mechanism:l};for(let t of(e.stack&&(u.stacktrace={type:"raw",frames:e.stack}),r.push(u),e.cause&&n(e.cause,a,"cause"),null!=(o=e.errors)?o:[]))n(t,a,"member")};return n(e),r}buildParsingContext(e){var t;return{chunkIdMap:function(e){let t=globalThis._posthogChunkIds;if(!t)return;let r=Object.keys(t);return s&&r.length===i||(i=r.length,s=r.reduce((r,i)=>{n||(n={});let s=n[i];if(s)r[s[0]]=s[1];else{let s=e(i);for(let e=s.length-1;e>=0;e--){let o=s[e],a=null==o?void 0:o.filename,l=t[i];if(a&&l){r[a]=l,n[i]=[a,l];break}}}return r},{})),s}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}getAggregateErrors(e){try{if(en(e)){let r=Object.getPrototypeOf(e);for(let n=0;r&&100>n;n++){var t;let n=null==(t=Object.getOwnPropertyDescriptor(r,"constructor"))?void 0:t.value;if("function"==typeof n&&"AggregateError"===n.name){let t=e.errors;return U(t)?t:void 0}r=Object.getPrototypeOf(r)}}}catch(e){}}buildCoercingContext(e,t,r=0){let n=0,i=0,s=!1,o=new Set,a=[],l={},u=(e,t,r=0)=>{let u,h,d=c(t,r),p=d.apply;if(d.apply=t=>{a.push(e);try{return p(t)}finally{a.pop()}},r>4||r>0&&-1!==a.indexOf(e))return this.coerceFallback(d);let f="object"==typeof e&&null!==e||"function"==typeof e;if(0===r&&n>=50||f&&o.has(e))return;f&&o.add(e),0===r&&n++;let g=this.getAggregateErrors(e);s||(s=!!g);try{if(!(u=this.applyCoercers(e,d)))throw l}catch(e){if(e===l)return void(0===r&&n--);if(!s)throw e;u=this.coerceFallback(d)}if(!g||n>=50)return u;try{h=g.length}catch(e){return u}if(!Number.isInteger(h)||0>h||h>0xffffffff)return u;let m=[];for(let e=0;50>n&&1e3>i&&h>e;e++){let r;i++;try{r=d.next(g[e])}catch(e){n++,r=this.coerceFallback(c(t+1))}r&&m.push(r)}return tk(tk({},u),{},{errors:m})},c=(r,n=0)=>tk(tk({},t),{},{syntheticException:0==r?t.syntheticException:void 0,mechanism:0==r?e:{},apply(e){let t=u(e,r,n+1);if(!t)throw l;return t},next:e=>u(e,r+1)}),h=c(r);return tk(tk({},h),{},{apply:e=>{var t;return null!=(t=u(e,r))?t:this.coerceFallback(h)}})}};let tE=/^([a-z][a-z0-9.+-]+):/i,tS=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function tP(e,t,r,n,i){let s={platform:e,filename:t,function:"<anonymous>"===r?"?":r,in_app:function(e){if(!e||"<anonymous>"===e)return!1;let t=tE.exec(e);return!t||tS.includes(t[1].toLowerCase())}(t)};return q(n)||(s.lineno=n),q(i)||(s.colno=i),s}let tR=(e,t)=>{let r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:"?",r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},tT=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tC=/\((\S*)(?::(\d+))(?::(\d+))\)/,tj=(e,t)=>{let r=tT.exec(e);if(r){let[,e,n,i]=r;return tP(t,e,"?",+n,+i)}let n=tA.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){let e=tC.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}let[e,r]=tR(n[1]||"?",n[2]);return tP(t,r,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},tO=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,t$=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tI=(e,t)=>{let r=tO.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){let e=t$.exec(r[3]);e&&(r[1]=r[1]||"eval",r[3]=e[1],r[4]=e[2],r[5]="")}let e=r[3],n=r[1]||"?";return[n,e]=tR(n,e),tP(t,e,n,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},tL=/\(error: (.*)\)/;function tM(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function tD(e,t){let r=t.start;for(;r>0&&tM(e[r-1],e[r-1+t.length]);)r--;return t.start-r}function tN(e,t){let r=t.start+t.length,n=r;for(;e.length>n&&tM(e[n],e[n-t.length]);)n++;return n-r}var tF=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){let r=G(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){let t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return er(e,"DOMException")}isDOMError(e){return er(e,"DOMError")}},tB=class{match(e){return en(e)}coerce(e,t){var r;let n=this.getStack(e),i=void 0===n?null==(r=t.syntheticException)?void 0:r.stack:void 0;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=n?n:i,cause:e.cause?t.next(e.cause):void 0,synthetic:!!i}}getType(e){return e.name||e.constructor.name}getMessage(e,t){let r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){try{let t=e.stacktrace;if("string"==typeof t&&t.length>0)return t;let r=e.stack;return"string"==typeof r&&r.length>0?r:void 0}catch(e){return}}},tU=class{match(e){return!!er(e,"ErrorEvent")&&(null!=e.error||this.ur(e))}coerce(e,t){var r;if(null!=e.error)return t.apply(e.error);let n=t.apply(e.message);return tk(tk({},n),{},{stack:null!=(r=this.cr(e))?r:n.stack,synthetic:!0})}ur(e){return G(e.message)&&e.message.length>0}cr(e){var t,r;let n=null!=(t=e.lineno)?t:0,i=null!=(r=e.colno)?r:0;if(G(e.filename)&&0!==e.filename.length&&0!==n)return`Error
45    at ${e.filename}:${n}:${i}`}};let tV=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var tW=class{match(e){return"string"==typeof e}coerce(e,t){var r;let[n,i]=this.getInfos(e);return{type:null!=n?n:"Error",value:null!=i?i:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){let t="Error",r=e,n=e.match(tV);return n&&(t=n[1],r=n[2]),[t,r]}};let tH=["fatal","error","warning","log","info","debug"];function tq(e,t=40){let r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let e=r.length;e>0;e--){let n=r.slice(0,e).join(", ");
45if(t>=n.length)return e===r.length?n:n.length>t?`${n.slice(0,t)}...`:n}return""}var tG=class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,n;let i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null!=(r=this.getStack(e))?r:null==(n=t.syntheticException)?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(ei(e))return e.constructor.name;let t="name"in e?e.name:void 0;return G(t)&&!z(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){let t=`'${e.name}' captured as exception`;return"message"in e&&"string"==typeof e.message&&(t+=` with message: '${e.message}'`),t}if("message"in e&&"string"==typeof e.message)return e.message;let t=this.getObjectClassName(e);return`${t&&"Object"!==t?`'${t}'`:"Object"} captured as exception with keys: ${tq(e)}`}isSeverityLevel(e){return G(e)&&!z(e)&&tH.indexOf(e)>=0}getStack(e){try{return G(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:G(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(let t in e)if(({}).hasOwnProperty.call(e,t)){let r=e[t];if(en(r))return r}}getObjectClassName(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},tz=class{match(e){return ei(e)}coerce(e,t){var r;let n=e.constructor.name;return{type:n,value:`${n} captured as exception with keys: ${tq(e)}`,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},tK=class{match(e){return et(e)}coerce(e,t){var r;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},tJ=class{match(e){return er(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ei(e))return!1;try{let t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r;let n=this.getUnhandledRejectionReason(e);return et(n)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}};let tY="$message",tX="$timestamp",tZ=new Set([tY,tX]),tQ={enabled:!0,max_bytes:32768};function t0(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tQ.enabled,max_bytes:function(e,t){if(!Y(e)||1/0===e||-1/0===e)return t;let r=Math.floor(e);return 0>r?t:r}(e.max_bytes,tQ.max_bytes)}:tk({},tQ)}var t1=class{constructor(e){this.ns=[],this.ss=0,this.Rr=t0(e)}setConfig(e){this.Rr=t0(e),this.rs()}add(e){let t=function(e){let t;try{t=D(e)}catch(e){return}try{let e=JSON.parse(t);if(!W(e))return;let r=e[tY],n=e[tX];if(!G(r)||0===r.trim().length||!G(n)&&!Y(n))return;return{step:e,json:t}}catch(e){return}}(e);if(!t)return;let r=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;let t=encodeURIComponent(e),r=0;for(let e=0;t.length>e;e++)"%"===t[e]?(r+=1,e+=2):r+=1;return r}(t.json);r>this.Rr.max_bytes||(this.ns.push({step:t.step,bytes:r}),this.ss+=r,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Rr.max_bytes&&this.ns.length>0;){let e=this.ns.shift();e&&(this.ss-=e.bytes)}}};let t2=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function t8(e){return"string"==typeof e||e}function t6(e){return"string"==typeof e?e:void 0}let t3=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],t5="NativeGzipValidationError",t4=e=>e.length>=2&&31===e[0]&&139===e[1],t9=(e,t)=>
45e===j.GZipJS||t===j.GZipJS||"gzip"===t,t7=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),re=e=>{throw tf(t5,`Native gzip produced invalid output: ${e}`)},rt=(A=eu(function*(e,t){18>e.size&&re("too-short");let r=new Uint8Array((yield e.slice(0,10).arrayBuffer()));t4(r)&&8===r[2]||re("invalid-header");let n=new DataView((yield e.slice(e.size-8).arrayBuffer()));n.getUint32(0,!0)!==(e=>{let t=(()=>{if(o)return o;o=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)t=1&t?0xedb88320^t>>>1:t>>>1;o[e]=t>>>0}return o})(),r=0xffffffff;for(let n=0;e.length>n;n++)r=t[255&(r^e[n])]^r>>>8;return(0xffffffff^r)>>>0})(t)&&re("invalid-crc");let i=t.length>>>0;n.getUint32(4,!0)!==i&&re("invalid-size")}),function(e,t){return A.apply(this,arguments)});function rr(){return(rr=eu(function*(e,t=!0,r){var n;try{let t=(new TextEncoder).encode(e),r=new globalThis.CompressionStream("gzip"),i=r.writable.getWriter(),s=i.write(t).then(()=>i.close()).catch((n=eu(function*(e){try{yield i.abort(e)}catch(e){}throw e}),function(e){return n.apply(this,arguments)})),o=new Response(r.readable).blob(),[a]=yield Promise.all([o,s]);return yield rt(a,t),a}catch(e){if(null==r?void 0:r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}function rn(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;s.length>n;n++)t.includes(r=s[n])||({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}let ri={}.propertyIsEnumerable;function rs(e,t){try{return ro(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function ro(e,t,r,n){let i=[];for(let s in e)if(ri.call(e,s)){if(!s){null==t||t.debug("Dropping an attribute with an empty key");continue}if(i.length>=1e3||0>=r.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let o=e[s];if(K(o)||q(o))continue;i.push({key:tu(s),value:function e(t,r,n,i){if(0>=n.remainingNodes)return{stringValue:ta};if(n.remainingNodes--,Z(t))return{boolValue:t};if("bigint"==typeof t){let e,n;return e=t.toString(),t>=(n=BigInt("9223372036854775808"))||-n>t?(null==r||r.debug(`Attribute ${e} is outside the int64 range; encoding it as a string`),{stringValue:e}):{intValue:e}}if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};let e=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>t?(null==r||r.debug(`Attribute ${e} is outside the int64 range; encoding it as a string`),{stringValue:e}):{intValue:e}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:tu(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(i>=20)return{stringValue:ta};if(t instanceof Date){let e=Number.isFinite(t.getTime())?t.toISOString():String(t);return{stringValue:"string"==typeof e?tu(e):String(e)}}n.ancestors.add(t);try{try{let s=t.toJSON;if("function"==typeof s)return e(s.call(t),r,n,i+1)}catch(e){}return U(t)?{arrayValue:{values:function(t,r,n,i){let s=[],o=Math.min(t.length,1e3),a=0;for(;o>a&&n.remainingNodes>0;a++)try{let o=a in t?t[a]:void 0;if(J(o))continue;s.push(e(o,r,n,i))}catch(e){s.push({stringValue:tl})}return t.length>a&&s.push({stringValue:ta}),s}(t,r,n,i+1)}}:{kvlistValue:{values:ro(t,r,n,i+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:tu(String(t))}}(o,t,r,n)})}catch(e){i.push({key:tu(s),value:{stringValue:tl}})}}return i}function ra(e,t,r){return tk(tk(tk(tk({},tc({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":r})}let rl=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function ru(e,t){let r=tc({},e),n={};for(let e of rl)({}).hasOwnProperty.call(r,e)&&(n[e]=r[e],delete r[e]);return[...rs(r,t),...rs(n,t)]}let rc={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},rh={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},rd=rh.info;function rp(e,t,r,n){return{resourceLogs:[{resource:{attributes:ru(t)},scopeLogs:[{scope:{name:r,version:n},logRecords:e}]}]}}var rf=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.hs}arm(e){this.clear(),this.us=Date.now()+e,this.hs=tv(()=>{this.hs=void 0,this.ls()},e)}armNoEarlierThan(e){this.hs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function rg(){return .75+.5*Math.random()}function rm(e,t,r,n){let i=e*Math.pow(2,Math.min(Math.max(0,t-1),6));return Math.round((void 0===n?i:Math.min(i,Math.max(n,e)))*r)}var rv=class{constructor(e,t,r,n,i,s=()=>Promise.resolve(),o){var a;this._instance=e,this.Rr=t,this.$=r,this.cs=n,this.ds=i,this.vs=s,this.fs=o,this.ps=new rf(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new th,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Ts=t.maxBufferSize,this.Is=Math.max(null!=(a=t.maxQueueSize)?a:t.maxBufferSize,t.maxBufferSize),this.Ms=t.flushIntervalMs,this.Es=t.maxBatchRecordsPerPost,this.Ps=t.rateCapWindowMs,this.Rs=t.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(C.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Rr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,t){var r;if(this._instance.isDisabled||this._instance.optedOut||!(null==e?void 0:e.body))return;let n=this.Os(e);if(null===n)return;if(!n.body)return void this.$.info("Log was rejected in beforeSend function");if(!this.Ds())return;let i={record:function(e,t,r,n){let{text:i,number:s}=rh[e.level||"info"]||rd,o=function(e=Date.now()){return String(e)+"000000"}(Y(n)?n:void 0),a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),J(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),J(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);let l=tk({},a),u=e.attributes;if(u){let e=[];try{e=Object.keys(u)}catch(t){e=[]}for(let t of e){let e;try{e=u[t]}catch(t){e=tl}Object.defineProperty(l,t,{value:e,enumerable:!0,writable:!0,configurable:!0})}}let c={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:i,body:{stringValue:function(e){try{return tu(String(e))}catch(e){return tl}}(e.body)},attributes:rs(l,r)};return e.trace_id&&(c.traceId=e.trace_id),e.span_id&&(c.spanId=e.span_id),q(e.trace_flags)||(c.flags=e.trace_flags),c}(n,null!=(r=null==t?void 0:t.context)?r:this.cs(),this.$,null==t?void 0:t.occurredAtMs)};this.ds(()=>this.Ls(i))}Os(e){let t=this.Rr.beforeSend;if(!t)return e;let r=U(t)?t:[t],n=e;for(let e of r)try{let t=e(n);if(!t)return this.$.info("Log was rejected in beforeSend function"),null;n=t}catch(e){return this.$.error("Error in beforeSend function for log:",e),null}return n}Ds(){if(void 0===this.Rs)return!0;let e=Date.now(),t=e-this.xs;return this.Ps>t&&t>=0||(this.xs=e,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.$.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var e=this;return eu(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return eu(function*(){var t,r,n;e.ps.clear();let i=null!=(t=e._instance.getPersistedProperty(C.LogsQueue))?t:[];if(0===i.length)return;let s=i.length,o=0;for(;i.length>0&&s>o;){let t=e._s;e.bs=0;let s=Math.min(i.length,e.Es),a=i.slice(0,s),l=rp(a.map(e=>e.record),e.qs(),null!=(r=e.fs)?r:e._instance.getLibraryId(),e._instance.getLibraryVersion()),u=yield e._instance.js(l);if(e._s!==t)return;if("too-large"===u.kind&&a.length>1)e.Es=Math.max(1,Math.floor(a.length/2)),e.$.warn(`Logs batch of size ${a.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(u),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),"retry-later"===u.kind||("too-large"===u.kind?e.$.warn("Dropping a single log record with batch size 1 — the record 
45is larger than the server cap and cannot be split further."):"ok"===u.kind&&e.Rr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Rr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(a.length),i=null!=(n=e._instance.getPersistedProperty(C.LogsQueue))?n:[],o+=a.length,"fatal"===u.kind))throw u.error}})()}Bs(e){var t=this;return eu(function*(){var r;let n=Math.max(0,e-t.bs),i=null!=(r=t._instance.getPersistedProperty(C.LogsQueue))?r:[];t._instance.setPersistedProperty(C.LogsQueue,i.slice(n)),yield t.vs()})()}qs(){var e;return e=this.Rr,ra(e,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var t;if(this._instance.optedOut)return;let r=null!=(t=this._instance.getPersistedProperty(C.LogsQueue))?t:[];this.Is>r.length||(r.shift(),this.bs++,this.$.info("Logs queue is full, dropping oldest record.")),r.push(e),this._instance.setPersistedProperty(C.LogsQueue,r),this.Ts>r.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(rm(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){let e=this._instance.getPersistedProperty(C.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return eu(function*(){t.ps.clear();let r=t.flush().catch(()=>{});void 0!==e?yield ty(r,e):yield r})()}flushWithTimeout(e){var t=this;return eu(function*(){let r=t.flush();yield ty(r,e,()=>{r.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=rg(),this.$.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};let ry=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function rb(e){return String(e)+"000000"}function r_(e,t,r,n){let i="";return n&&(i=Object.keys(n).sort().map(e=>`${JSON.stringify(e)}:${JSON.stringify(n[e])}`).join(",")),`${e}\0${t}\0${null!=r?r:""}\0${i}`}var rw=class{constructor(e,t,r){this._instance=e,this.Rr=t,this.$=r,this.zs=new Map,this.ps=new rf(()=>this.flush().catch(e=>{this.$.error("Metrics flush failed:",e)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new th,this.ks=0,this.Ss=1,this.Gs=0}count(e,t=1,r){this.Zs({name:e,type:"count",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(e,t,r){this.Zs({name:e,type:"gauge",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(e,t,r){this.Zs({name:e,type:"histogram",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var e,t=this;let r=this.ys,n=(e=eu(function*(){r&&(yield r.catch(()=>{})),yield t.Qs()}),function(){return e.apply(this,arguments)})().finally(()=>{this.ys===n&&(this.ys=null)});return this.ys=n,n}drainWindow(){if(0===this.zs.size)return null;let e=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(e){let t,r;if(this._instance.isDisabled||this._instance.optedOut)return;let n=this.Os(e);if(null===n)return;if(!n.name||"string"!=typeof n.name)return void this.$.warn("Dropping metric with empty name");if("number"!=typeof n.value||!Number.isFinite(n.value))return void this.$.warn(`Dropping metric '${n.name}': value must be a finite number`);if("count"===n.type&&0>n.value)return void this.$.warn(`Dropping count '${n.name}': counters are monotonic, value must be >= 0`);try{t=n.attributes?tk({},n.attributes):void 0,r=r_(n.type,n.name,n.unit,t)}catch(e){return void this.$.warn(`Dropping metric '${n.name}': attributes could not be serialized`,e)}let i=this.zs.get(r);if(!i){if(!this.Ks())return;i={name:n.name,type:n.type,unit:n.unit,attributes:t,windowStartMs:Date.now()},this.zs.set(r,i)}let s=this.Ws.get(n.name);void 0===s?this.Ws.set(n.name,n.type):s===n.type||this.Vs.has(n.name)||(this.Vs.add(n.name),this.$.warn(`Metric name '${n.name}' is already used as a ${s}; recording it as a ${n.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(i,n.value),this.Fs()}Ks(){return this.Rr.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.$.warn(`Metric series cap reached (${this.Rr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,t){switch(e.type){case"count":var r;e.total=(null!=(r=e.total)?r:0)+t;break;case"gauge":e.last=t;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:Array(ry.length+1).fill(0)});let r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(e,t){for(let r=0;t.length>r;r++)if(t[r]>=e)return r;return t.length}(t,ry)]+=1}}}Os(e){let t=this.Rr.beforeSend;if(!t)return e;let r=U(t)?t:[t],n=e;for(let e of r)try{let t=e(n);if(!t)return this.$.info("Metric was rejected in beforeSend function"),null;n=t}catch(e){return this.$.error("Error in beforeSend function for metric:",e),null}return n}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(rm(this.Rr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var e=this;return eu(function*(){if(e.ps.clear(),0===e.zs.size)return;let t=e.zs;e.zs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;let r=e.Gs,n=yield e._instance.Ys(e.Js(t));if(r===e.Gs)switch(e.ws.record(n),"retry-later"===n.kind?(e.ks++,e.Ss=rg()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.Hs()),n.kind){case"ok":return;case"retry-later":return e.ho(t),void e.ps.armNoEarlierThan(e.Hs());case"too-large":return void e.$.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.$.error("Failed to send metrics batch:",n.error)}})()}Js(e){var t,r,n,i;return t=this.vo(e),r=ra(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:ru(r)},scopeMetrics:[{scope:{name:n,version:i},metrics:t}]}]}}vo(e){let t=rb(Date.now()),r=new Map;for(let o of e.values()){var n,i,s;
45let e=r_(o.type,o.name,o.unit,void 0),a=r.get(e);a||(a=tk({name:o.name},o.unit&&{unit:o.unit}),"count"===o.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===o.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},r.set(e,a));let l=rs(null!=(n=o.attributes)?n:{},this.$),u=rb(o.windowStartMs);if("count"===o.type){let e={attributes:l,startTimeUnixNano:u,timeUnixNano:t,asDouble:null!=(i=o.total)?i:0};a.sum.dataPoints.push(e)}else if("gauge"===o.type){let e={attributes:l,timeUnixNano:t,asDouble:null!=(s=o.last)?s:0};a.gauge.dataPoints.push(e)}else o.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:t,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:ry})}return Array.from(r.values())}ho(e){for(let[n,i]of e){let e=this.zs.get(n);if(e)switch(e.windowStartMs=Math.min(e.windowStartMs,i.windowStartMs),e.type){case"count":var t,r;e.total=(null!=(t=e.total)?t:0)+(null!=(r=i.total)?r:0);break;case"gauge":break;case"histogram":if(i.hist)if(e.hist){e.hist.count+=i.hist.count,e.hist.sum+=i.hist.sum,e.hist.min=Math.min(e.hist.min,i.hist.min),e.hist.max=Math.max(e.hist.max,i.hist.max);for(let t=0;e.hist.bucketCounts.length>t;t++)e.hist.bucketCounts[t]+=i.hist.bucketCounts[t]}else e.hist=i.hist}else this.Ks()&&this.zs.set(n,i)}}};let rk=(e,{debugEnabled:t}={})=>{let r={N(r,...n){h&&(S.DEBUG||h.POSTHOG_DEBUG||t)&&!q(h.console)&&h.console&&("__rrweb_original__"in h.console[r]?h.console[r].__rrweb_original__:h.console[r])(e,...n)},debug(...e){r.N("debug",...e)},info(...e){r.N("log",...e)},warn(...e){r.N("warn",...e)},error(...e){r.N("error",...e)},critical(...t){console.error(e,...t)},uninitializedWarning(e){r.error(`You must initialize PostHog before calling ${e}`)},createLogger:(t,r)=>rk(`${e} ${t}`,r)};return r},rx=rk("[PostHog.js]"),rE=rx.createLogger,rS=rE("[ExternalScriptsLoader]"),rP=e=>{let t=null==f?void 0:f.querySelectorAll("script");if(t){for(let r=0;t.length>r;r++)if(t[r].src===e||t[r].getAttribute("src")===e)return t[r]}},rR=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return rS.warn(`${t} was requested but loading of external scripts is disabled.`),r("Loading of external scripts is disabled");let n=rP(t);if(n){if(n.__posthog_loading_callback_fired)return r();let e=n.__posthog_loading_error;return e?r(e):(n.addEventListener("load",e=>{n.__posthog_loading_callback_fired=!0,r(void 0,e)}),void n.addEventListener("error",e=>{n.__posthog_loading_error=e,r(e)}))}let i=()=>{if(!f)return r("document not found");if(rP(t))return rR(e,t,r);let n=f.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=t,n.onload=e=>{n.__posthog_loading_callback_fired=!0,r(void 0,e)},n.onerror=e=>{n.__posthog_loading_error=e,r(e)},e.config.prepare_external_dependency_script&&(n=e.config.prepare_external_dependency_script(n)),!n)return r("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)f.head.appendChild(n);else{var i;let e=f.querySelectorAll("body > script");e.length>0?null==(i=e[0].parentNode)||i.insertBefore(n,e[0]):f.body.appendChild(n)}};(null==f?void 0:f.body)?i():null==f||f.addEventListener("DOMContentLoaded",i)},rT={},rA=(e,t)=>{let r=`/static/${t}.js?v=${e.version}`;return"toolbar"===t&&(r=`${r}&t=${3e5*Math.floor(Date.now()/3e5)}`),e.requestRouter.endpointFor("assets",r)};x.__PosthogExtensions__=x.__PosthogExtensions__||{},x.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if("remote-config"===t){let t=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);return void rR(e,t,r)}let n=e.config.strict_script_versioning;if(n){let i=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),s=rT[i];if("fallback"===n&&s){if(rP(s))return void rR(e,s,r);delete rT[i]}return void rR(e,i,"fallback"===n?(n,s)=>{if(n)if("string"==typeof n)r(n);else{var o;let n=rA(e,t);rT[i]=n;let s=rP(i);null==s||null==(o=s.parentNode)||o.removeChild(s),rR(e,n,r)}else r(void 0,s)}:r)}rR(e,rA(e,t),r)},x.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{let n=e.requestRouter.endpointFor("api",t);rR(e,n,r)},S.DEBUG=!1,S.LIB_VERSION="1.434.5",S.LIB_NAME="web";let rC="distinct_id",rj="$device_id",rO="$device_model",r$="__alias",rI="$fbc",rL="$fbc_persistence",rM="$fbp",rD="$fbp_persistence",rN="__timers",rF="$autocapture_disabled_server_side",rB="$heatmaps_enabled_server_side",rU="$exception_capture_enabled_server_side",rV="$error_tracking_suppression_rules",rW="$error_tracking_capture_extension_exceptions",rH="$web_vitals_enabled_server_side",rq="$dead_clicks_enabled_server_side",rG="$product_tours_enabled_server_side",rz="$logs_capture_enabled_server_side",rK="$web_vitals_allowed_metrics",rJ="$session_recording_remote_config",rY="$sesid",rX="$session_is_sampled",rZ="$enabled_feature_flags",rQ="$active_feature_flags",r0="$early_access_features",r1="$feature_flag_details",r2="$feature_flag_payloads",r8="$feature_flag_request_id",r6="$minimal_flag_called_events",r3="$override_feature_flags",r5="$override_feature_flag_payloads",r4="$stored_person_properties",r9="$stored_group_properties",r7="$groups",ne="$surveys",nt="$surveys_loaded_at",nr="$surveys_activated",nn="$surveys_activated_session",ni="$surveys_activated_timestamps",ns="ph_product_tours",no="$flag_call_reported",na="$flag_call_reported_session_id",nl="$feature_flag_errors",nu="$feature_flag_evaluated_at",nc="$user_state",nh="$client_session_props",nd="$initial_campaign_params",np="$initial_referrer_info",nf="$initial_person_info",
45ng="$epp",nm="$posthog_cookieless",nv="$cookieless_mode",ny="$sdk_debug_extensions_init_method",nb="$sdk_debug_extensions_init_time_ms",n_="$sdk_debug_recording_script_not_loaded",nw="$sdk_debug_replay_stale_config",nk="PostHog loadExternalDependency extension not found.",nx="anonymous",nE="identified",nS="identified_only",nP="visibilitychange",nR="beforeunload",nT="$pageview",nA="$pageleave",nC="$identify",nj="$groupidentify";function nO(e,t){U(e)&&e.forEach(t)}function n$(e,t){if(!J(e))if(U(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,r)=>t(e,r));else for(let r in e)F.call(e,r)&&t(e[r],r)}let nI=function(e,...t){for(let r of t)for(let t in r)void 0!==r[t]&&(e[t]=r[t]);return e};function nL(e){let t=Object.keys(e),r=t.length,n=Array(r);for(;r--;)n[r]=[t[r],e[t[r]]];return n}let nM=function(e){return function(...t){try{return e.apply(this,t)}catch(e){rx.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),rx.critical(e)}}},nD=function(e){let t={};return n$(e,function(e,r){(G(e)&&e.length>0||Y(e))&&(t[r]=e)}),t};function nN(e){let t=tk({},e);for(let r of["name","message","stack","cause","errors"])try{r in e&&(t[r]=e[r])}catch(e){}return t}let nF=["herokuapp.com","vercel.app","netlify.app"];function nB(e,t,r,n){let{capture:i=!1,passive:s=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:s})}function nU(e){return"ph_toolbar_internal"===e.name}let nV=e=>{if(f){try{let t=e+"=",r=f.cookie.split(";").filter(e=>e.length);for(let e=0;r.length>e;e++){let n=r[e];for(;" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Y(e)&&isFinite(e)&&Math.floor(e)===e});var nW=class e{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(t,r,n,i){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||0>t||0>r||0>n||0>i||t>0xffffffffffff||r>4095||n>0x3fffffff||i>0xffffffff)throw RangeError("invalid field value");let s=new Uint8Array(16);return s[0]=t/0x10000000000,s[1]=t/0x100000000,s[2]=t/0x1000000,s[3]=t/65536,s[4]=t/256,s[5]=t,s[6]=112|r>>>8,s[7]=r,s[8]=128|n>>>24,s[9]=n>>>16,s[10]=n>>>8,s[11]=n,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new e(s)}toString(){let e="";for(let t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;16>t;t++){let r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}},nH=class{generate(){let e=this.generateOrAbort();if(!q(e))return e;{this.Ct=0;let e=this.generateOrAbort();if(q(e))throw Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){let e,t=Y(e=Date.now())&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0;if(t>this.Ct)this.Ct=t,this.Mt();else{if(this.Ct>=t+1e4)return;this.It++,this.It>0x3ffffffffff&&(this.Ct++,this.Mt())}return nW.fromFieldsV7(this.Ct,Math.trunc(this.It/0x40000000),0x3fffffff&this.It,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new nG}};let nq=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};h&&!q(h.crypto)&&crypto.getRandomValues&&(nq=e=>crypto.getRandomValues(e));var nG=class{nextUint32(){return this.Rt.length>this.$t||(nq(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let nz=()=>nK().toString(),nK=()=>(a||(a=new nH)).generate(),nJ="",nY=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,nX=null,nZ={Et(){if(!K(nX))return nX;if(nX=!1,f)try{let e=`__ph_cookie_support_${nz()}`;nZ.At(e,"xyz"),nX='"xyz"'===nV(e),nZ.Lt(e)}catch(e){nX=!1}return nX},Pt(e){rx.error("cookieStore error: "+e)},Ot:nV,Dt(e){let t;try{t=JSON.parse(nZ.Ot(e))||{}}catch(e){}return t},At(e,t,r,n,i){if(!f)return!1;try{let s="",o="",a=function(e,t){if(t){let t=function(e,t=f){if(nJ)return nJ;if(!t||["localhost","127.0.0.1"].includes(e))return"";let r=e.split("."),n=Math.min(r.length,8),i="dmn_chk_"+nz();for(;!nJ&&n--;){let e=r.slice(n).join("."),s=i+"=1;domain=."+e+";path=/";t.cookie=s+";max-age=3",t.cookie.includes(i)&&(t.cookie=s+";max-age=0",nJ=e)}return nJ}(e);if(!t){let r,n=(r=e.match(nY))?r[0]:"";n!==t&&rx.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}(f.location.hostname,n);if(r){let e=new Date;e.setTime(e.getTime()+864e5*r),s="; expires="+e.toUTCString()}i&&(o="; secure");let l=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&rx.warn("cookieStore warning: large cookie, len="+l.length),f.cookie=l,!0}catch(e){return!1}},Lt(e,t){if(null==f?void 0:f.cookie)try{nZ.At(e,"",-1,t)}catch(e){return}}},nQ=null,n0={Et(){if(!K(nQ))return nQ;let e=!0;if(q(h))e=!1;
45else try{let t="__mplssupport__";n0.At(t,"xyz"),'"xyz"'!==n0.Ot(t)&&(e=!1),n0.Lt(t)}catch(t){e=!1}return e||rx.error("localStorage unsupported; falling back to cookie store"),nQ=e,e},Pt(e){rx.error("localStorage error: "+e)},Ot(e){try{return null==h?void 0:h.localStorage.getItem(e)}catch(e){n0.Pt(e)}return null},Dt(e){try{return JSON.parse(n0.Ot(e))||{}}catch(e){}return null},At(e,t){try{return null==h||h.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){n0.Pt(e)}return!1},Lt(e){try{null==h||h.localStorage.removeItem(e)}catch(e){n0.Pt(e)}}},n1=[r4,rQ,rZ,r1,r2,r8,nu,nl,no],n2=[rj,rC,rY,rX,ng,nf,rL,nc],n8=["__proto__","constructor","prototype"],n6=e=>{if(!W(e))return{};let t={};return Object.keys(e).forEach(r=>{-1===n8.indexOf(r)&&(t[r]=e[r])}),t},n3=(e,t=[])=>{let r={};return[...n2,...t].forEach(t=>{let n=e[t];q(n)||K(n)||""===n||(r[t]=n)}),r},n5=e=>{let t=5381,r=0x811c9dc5;for(let n=0;e.length>n;n++){let i=e.charCodeAt(n);t=33*t^i,r=Math.imul(r^i,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(r>>>0).toString(36)},n4=(e,t)=>({p:t,f:n5(JSON.stringify(e))}),n9=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{let r=nZ.Dt(e+"_cpm"),n=(null==r?void 0:r.f)===n5(t)&&U(r.p);return{properties:n?r.p:[],isValid:n}}catch(e){return{properties:[],isValid:!1}}},n7=(e,t)=>t+"|"+(nZ.Ot(e+"_cpm")||""),ie={},it={Et:()=>!0,Pt(e){rx.error("memoryStorage error: "+e)},Ot:e=>e in ie?ie[e]:null,Dt:e=>e in ie?ie[e]:null,At:(e,t)=>(ie[e]=t,!0),Lt(e){delete ie[e]}},ir=null,ii={Et(){if(!K(ir))return ir;if(ir=!0,q(h))ir=!1;else try{let e="__support__";ii.At(e,"xyz"),'"xyz"'!==ii.Ot(e)&&(ir=!1),ii.Lt(e)}catch(e){ir=!1}return ir},Pt(e){rx.error("sessionStorage error: ",e)},Ot(e){try{return null==h?void 0:h.sessionStorage.getItem(e)}catch(e){ii.Pt(e)}return null},Dt(e){try{return JSON.parse(ii.Ot(e))||null}catch(e){}return null},At(e,t){try{return null==h||h.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){ii.Pt(e)}return!1},Lt(e){try{null==h||h.sessionStorage.removeItem(e)}catch(e){ii.Pt(e)}}};var is=class{constructor(e){this._instance=e}get Rr(){return this._instance.config}get consent(){return this.Lo()?0:this.No}isOptedOut(){return"always"===this.Rr.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Rr.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Rr.opt_out_capturing_by_default}optInOut(e){this.qo.At(this.jo,+!!e,this.Rr.cookie_expiration,this.Rr.cross_subdomain_cookie,this.Rr.secure_cookie)}reset(){this.qo.Lt(this.jo,this.Rr.cross_subdomain_cookie)}get jo(){let{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get No(){let e=this.qo.Ot(this.jo);return I(eo,e)?1:I(ea,e)?0:-1}get qo(){let e=this.Rr.opt_out_capturing_persistence_type,t="localStorage"===e?n0:nZ,r=t.Et()?t:it;if(!this.Bo||this.Bo!==r){this.Bo=r;let t="localStorage"===e?nZ:n0;t.Ot(this.jo)&&(this.Bo.Ot(this.jo)||this.optInOut(I(eo,t.Ot(this.jo))),t.Lt(this.jo,this.Rr.cross_subdomain_cookie))}return this.Bo}Lo(){return!!this.Rr.respect_dnt&&[null==p?void 0:p.doNotTrack,null==p?void 0:p.msDoNotTrack,x.doNotTrack,null==p?void 0:p.globalPrivacyControl].some(e=>I(eo,e))}};function io(e,t){var r;let n=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!V(n))return t;try{let e=n(t);return G(e)&&e?e:t}catch(e){return rx.error("Error in get_current_url, falling back to window.location.href",e),t}}function ia(e){var t;return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!!(null==(t=e.closest)?void 0:t.call(e,".toolbar-global-fade-container")))}function il(e){return!!e&&1===e.nodeType}function iu(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ic(e){return!!e&&3===e.nodeType}function ih(e){return!!e&&11===e.nodeType&&il(e.host)}function id(e){return e?L(e).split(/\s+/):[]}function ip(e,t){var r;let n,i=q(n=null==h||null==(r=h.location)?void 0:r.href)?void 0:io(t,n);return!!(i&&e&&e.some(e=>i.match(e)))}function ig(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return id(t)}function im(e){return J(e)?null:L(e).split(/(\s+)/).filter(e=>iB(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function iv(e){let t="";return iO(e)&&!i$(e)&&e.childNodes&&e.childNodes.length&&n$(e.childNodes,function(e){var r;ic(e)&&e.textContent&&(t+=null!=(r=im(e.textContent))?r:"")}),L(t)}function iy(e){var t;return q(e.target)?e.srcElement||null:(null==(t=e.target)?void 0:t.shadowRoot)?e.composedPath()[0]||null:e.target||null}let ib=["a","button","form","input","select","textarea","label"];function i_(e,t){let r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}function iw(e,t){if(q(t))return!0;for(let r of e)if(t.some(e=>i_(r,e)))return!0;return!1}function ik(e){let t=e.parentNode;return!(!t||!il(t))&&t}let ix=[".ph-no-autocapture","[data-ph-no-autocapture]"],iE=["next","previous","prev",">","<"],iS=[...iE,"+","-","−","–"],iP=(e,t)=>
45/[a-z0-9]/i.test(t)?e.includes(t):e===t,iR=[".ph-no-rageclick",".ph-no-capture"],iT=["","text","search","email","password","url","tel","number"];function iA(e,t){var r,n,i;let s,o,a;if(!h||iC(e)||(Z(t)?(s=!!t&&iR,o=void 0,a=!1):(s=null!=(r=null==t?void 0:t.css_selector_ignorelist)?r:iR,o=null==t?void 0:t.content_ignorelist,a=null!=(n=null==t?void 0:t.ignore_text_selection)&&n),!1===s)||a&&!(!(i=e)||!il(i))&&(iu(i,"textarea")||(iu(i,"input")?I(iT,(i.getAttribute("type")||"").toLowerCase()):function(e){var t;if(e.isContentEditable)return!0;let r=null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return"true"===r||""===r}(i))))return!1;let{targetElementList:l}=ij(e,!1);return!function(e,t){let r;if(!1===e||q(e))return!1;if(!0===e)r=iE;else{if(!U(e))return!1;if(e.length>10)return rx.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map(e=>e.toLowerCase())}return t.some(({safeText:e,ariaLabel:t})=>r.some(r=>iP(e,r)||iP(t,r)))}(o,l.map(e=>{var t;return{safeText:iv(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!iw(l,s)}let iC=e=>!e||iu(e,"html")||!il(e),ij=(e,t)=>{if(!h||iC(e))return{parentIsUsefulElement:!1,targetElementList:[]};let r=!1,n=[e],i=e;for(;i.parentNode&&!iu(i,"body");){if(ih(i.parentNode)){n.push(i.parentNode.host),i=i.parentNode.host;continue}let e=ik(i);if(!e)break;if(t||ib.indexOf(e.tagName.toLowerCase())>-1)r=!0;else try{let t=h.getComputedStyle(e);t&&"pointer"===t.getPropertyValue("cursor")&&(r=!0)}catch(e){}n.push(e),i=e}return{parentIsUsefulElement:r,targetElementList:n}};function iO(e){let t=new Set,r=0;for(let n=e;n.parentNode&&!iu(n,"body");n=n.parentNode){if(r++>=1e3||t.has(n))return!1;t.add(n);let e=ig(n);if(I(e,"ph-sensitive")||I(e,"ph-no-capture"))return!1}if(I(ig(e),"ph-include"))return!0;let n=e.type||"";if(G(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}let i=e.name||e.id||"";return!G(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function i$(e){return!!(iu(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||iu(e,"select")||iu(e,"textarea")||"true"===e.getAttribute("contenteditable"))}let iI=RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),iL=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,iM=[16,15,14,13],iD=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),iN=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),iF=/[0-9A-Za-z_]/;function iB(e,t=!0){return!(J(e)||G(e)&&(e=L(e),(t?iI.test((e||"").replace(/[- ]/g,"")):function(e){let t;for(iL.lastIndex=0;t=iL.exec(e);){let e=t[2];if(!e)continue;let r=e.replace(/[- ]/g,"");for(let e=0;r.length>e;e++)for(let t of iM){let n=e+t;if(r.length>=n){let t=r.slice(e,n);if(iI.test(t)&&function(e){let t=0,r=!1;for(let n=e.length-1;n>=0;n--){let i=e.charCodeAt(n)-48;r&&(i*=2)>9&&(i-=9),t+=i,r=!r}return t%10==0}(t))return!0}}}return!1}(e))||(t?iD.test(e):function(e){let t;for(iN.lastIndex=0;t=iN.exec(e);){let e=t[1],r=t[3];if(!(e&&r&&iF.test(e)&&iF.test(r)))return!0}return!1}(e))))&&!0}function iU(e){let t=iv(e);return iB(t=`${t} ${(function e(t){let r="";return t&&t.childNodes&&t.childNodes.length&&n$(t.childNodes,function(t){var n;if(t&&"span"===(null==(n=t.tagName)?void 0:n.toLowerCase()))try{let n=iv(t);r=`${r} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(r=`${r} ${e(t)}`.trim())}catch(e){rx.error("[AutoCapture]",e)}}),r})(e)}`.trim())?t:""}function iV(e){return e.replace(/"|\\"/g,'\\"')}let iW=rE("[Dead Clicks]"),iH=()=>!0,iq=e=>{var t;let r=!!(null==(t=e.instance.persistence)?void 0:t.get_property(rq)),n=e.instance.config.capture_dead_clicks;return Z(n)?n:!!W(n)||r};var iG=class{get lazyLoadedDeadClicksAutocapture(){return this.Ho}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[rq]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.zo(()=>{this.Uo()}):this.stop()}zo(e){var t,r,n;(null==(t=x.__PosthogExtensions__)?void 0:t.initDeadClicksAutocapture)?e():null==(r=x.__PosthogExtensions__)||null==(n=r.loadExternalDependency)||n.call(r,this.instance,"dead-clicks-autocapture",t=>{t?iW.error("failed to load script",t):e()})}Uo(){var e;if(f){if(!this.Ho&&(null==(e=x.__PosthogExtensions__)?void 0:e.initDeadClicksAutocapture)){let e=W(this.instance.config.capture_dead_clicks)?tk({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Ho=x.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Ho.start(f),iW.info("starting...")}}else iW.error("`document` not found. Cannot start.")}stop(){this.Ho&&(this.Ho.stop(),this.Ho=void 0,iW.info("stopping..."))}};let iz=rE("[SegmentIntegration]");function iK(e,t,r=!0){let n,i,s=e.config.segment;if(!s)return t();let{analytics:o,filterProperties:a}=V(s.register)?{analytics:s}:s;n=n=>{let i=()=>n.anonymousId()||nz();e.config.get_device_id=i,r&&n.id()&&(e.register({distinct_id:n.id(),$device_id:i()}),e.persistence.set_property(nc,nE)),(r=>{o.register(((e,t,{filterProperties:r}={})=>{"u">typeof Promise&&Promise.resolve||iz.warn("This browser does not have Promise support, and can not use the segment integration");let n=(n,i)=>{if(!i)return n;let s=!!t&&n.event.anonymousId===t&&!n.event.userId;s||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(iz.info("No userId set, resetting PostHog"),e.reset()),s||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(iz.info("UserId set, identifying with PostHog"),e.identify(n.event.userId)
45);let o=e.calculateEventProperties(i,n.event.properties);if(!J(r)){let e=n.event.properties||{},t={};for(let r of Object.keys(o))F.call(e,r)||(t[r]=o[r]);let i=((e,t)=>{let r=U(e)?e:[e],n=tk({},t);for(let e of r)try{if(n=e(n),J(n))return null}catch(e){return iz.error("Error in Segment filterProperties:",e),null}return n})(r,t);if(J(i))return n;o=i}return n.event.properties=Object.assign({},o,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>n(e,e.event.event),page:e=>n(e,nT),identify:e=>n(e,nC),screen:e=>n(e,"$screen")}})(e,r,{filterProperties:a})).then(()=>{t()},e=>{iz.error("Failed to register the Segment integration",e),t()})})(r?void 0:n.anonymousId()||void 0)},"then"in(i=o.user())&&V(i.then)?i.then(n):n(i)}let iJ="posthog-js";function iY(e,{organization:t,projectId:r,prefix:n,severityAllowList:i=["error"],sendExceptionsToPostHog:s=!0}={}){return o=>{var a,l,u,c,h,d;if("*"!==i&&!i.includes(o.level)||!e.__loaded)return o;o.tags||(o.tags={});let p=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));let f=(null==(a=o.exception)?void 0:a.values)||[],g=f.map(e=>tk(tk({},e),{},{stacktrace:e.stacktrace?tk(tk({},e.stacktrace),{},{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>tk(tk({},e),{},{platform:"web:javascript"}))}):void 0})),m={$exception_message:(null==(l=f[0])?void 0:l.value)||o.message,$exception_type:null==(u=f[0])?void 0:u.type,$exception_level:o.level,$exception_list:g,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||o.message,$sentry_exception_type:null==(h=f[0])?void 0:h.type,$sentry_tags:o.tags};return t&&r&&(m.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+o.event_id),s&&(null==(d=e.exceptions)||d.sendExceptionEvent(m)),o}}var iX=class{constructor(e,t,r,n,i,s){this.name=iJ,this.setupOnce=function(o){o(iY(e,{organization:t,projectId:r,prefix:n,severityAllowList:i,sendExceptionsToPostHog:null==s||s}))}}},iZ=class{constructor(e){this.Wo=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(rx.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Vo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Go()}Go(){var e;this.Zo=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Wo)}destroy(){var e;null==(e=this.Zo)||e.call(this),this.Zo=void 0}doPageView(e,t){var r;let n=this.Qo(e,t);return this.Vo={pathname:null!=(r=null==h?void 0:h.location.pathname)?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var t;return this.Qo(e,null==(t=this.Vo)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Vo)?void 0:e.pageViewId}}Qo(e,t){let r=this.Vo;if(!r)return{$pageview_id:t};let n={$pageview_id:t,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:e,lastScrollY:t,maxScrollY:r,maxContentHeight:s,lastContentY:o,maxContentY:a}=i;if(!(q(e)||q(t)||q(r)||q(s)||q(o)||q(a))){e=Math.ceil(e),t=Math.ceil(t),r=Math.ceil(r),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a);let i=e>1?ed(t/e,0,1,rx):1,l=e>1?ed(r/e,0,1,rx):1,u=s>1?ed(o/s,0,1,rx):1,c=s>1?ed(a/s,0,1,rx):1;n=nI(n,{$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:i,$prev_pageview_max_scroll:r,$prev_pageview_max_scroll_percentage:l,$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:u,$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:c})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}};let iQ=["flags","surveys"],i0={$people_distinct_id:{exposure:"hidden"},[r$]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[rN]:{exposure:"hidden"},[rL]:{exposure:"hidden"},[rD]:{exposure:"hidden"},[rF]:{exposure:"event"},[rB]:{exposure:"hidden"},[rz]:{exposure:"hidden"},[rU]:{exposure:"event"}
45,[rV]:{exposure:"hidden"},[rW]:{exposure:"event"},[rH]:{exposure:"event"},[rq]:{exposure:"event"},[rG]:{exposure:"hidden"},[rK]:{exposure:"event"},[rJ]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[rY]:{exposure:"hidden"},[rX]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:e=>K(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[rZ]:{exposure:"hidden",storageGroup:"flags"},[rQ]:{exposure:"hidden",storageGroup:"flags"},[r0]:{exposure:"hidden"},[r1]:{exposure:"hidden",storageGroup:"flags"},[r2]:{exposure:"hidden",storageGroup:"flags"},[r8]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[r6]:{exposure:"hidden",storageGroup:"flags"},[r3]:{exposure:"hidden"},[r5]:{exposure:"hidden"},[r4]:{exposure:"hidden"},[r9]:{exposure:"hidden"},[ne]:{exposure:"hidden",storageGroup:"surveys"},[nt]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[nr]:{exposure:"event"},[nn]:{exposure:"hidden"},[ni]:{exposure:"hidden"},[ns]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[no]:{exposure:"hidden"},[na]:{exposure:"hidden"},[r7]:{exposure:"event"},[nl]:{exposure:"hidden"},[nu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[nc]:{exposure:"hidden"},[nh]:{exposure:"hidden"},$capture_rate_limit:{exposure:"hidden"},[nd]:{exposure:"hidden"},[np]:{exposure:"hidden"},[nf]:{exposure:"hidden"},[ng]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[ny]:{exposure:"event"},[nb]:{exposure:"event"},[n_]:{exposure:"event"},[nw]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
45,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},i1=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],i2=e=>{let t=i0[e];if(t)return t;for(let[t,r]of i1)if(0===e.indexOf(t))return r},i8=(e,t)=>{try{let r;return JSON.stringify(e,(e,t)=>en(t)?(null!=r||(r=new WeakMap),r.has(t)||r.set(t,nN(t)),r.get(t)):"bigint"==typeof t?t.toString():t,t)}catch(t){return D(e)}},i6=e=>{let t=null==f?void 0:f.createElement("a");return q(t)?null:(t.href=e,t)},i3=function(e,t){let r,n=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");for(let e=0;n.length>e;e++){let i=n[e].split("=");if(i[0]===t){r=i;break}}if(!U(r)||2>r.length)return"";{let e=r[1];try{e=decodeURIComponent(e)}catch(t){rx.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},i5=function(e,t,r){if(!e||!t||!t.length)return e;let n=e.split("#"),i=n[1],s=(n[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[];for(let e=0;l.length>e;e++){let n=l[e].split("=");U(n)&&(t.includes(n[0])?u.push(n[0]+"="+r):u.push(l[e]))}let c=a;return null!=o&&(c+="?"+u.join("&")),null!=i&&(c+="#"+i),c},i4=function(e,t){let r=e.match(RegExp(t+"=([^&]*)"));return r?r[1]:null},i9=(e,t)=>e>=t&&w(),i7=(e,t,r,n)=>{if(0===e){if(w()){let e=t+1;return e===r&&n(),e}return t}return 0},se=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],st=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...se],sr="<masked>",sn=["li_fat_id"];function si(e,t,r){let n;if(!f)return{};let i=t?[...se,...r||[]]:[],s=ss(i5(f.URL,i,sr),e);return nI((n={},n$(sn,function(e){let t=nV(e);n[e]=t||null}),n),s)}function ss(e,t){let r=st.concat(t||[]),n={};return n$(r,function(t){let r=i3(e,t);n[t]=r||null}),n}function so(e){let t=e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null,r={};if(!K(t)){r.$search_engine=t;let e=f?i3(f.referrer,"yahoo"!=t?"q":"p"):"";e.length&&(r.ph_keyword=e)}return r}function sa(){return navigator.language||navigator.userLanguage}let sl="$direct";function su(){return(null==f?void 0:f.referrer)||sl}function sc(e,t,r=!1){let n=e?[...se,...t||[]]:[],i=r?tg(null==g?void 0:g.href):null==g?void 0:g.href,s=null==i?void 0:i.substring(0,1e3);return{r:su().substring(0,1e3),u:s?i5(s,n,sr):void 0}}function sh(e,t=!1){var r;let{r:n,u:i}=e,s=t?tg(i):i,o={$referrer:n,$referring_domain:null==n?void 0:n==sl?sl:null==(r=i6(n))?void 0:r.host};if(s){o.$current_url=s;let e=i6(s);o.$host=null==e?void 0:e.host,o.$pathname=null==e?void 0:e.pathname,nI(o,ss(s))}return n&&nI(o,so(n)),o}function sd(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}let sp={flags:nu,surveys:nt},sf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sg=e=>`${e}_cookie_identity_change_pending`,sm=e=>{let t="",r=0;for(let n of e){let e=encodeURIComponent(JSON.stringify(n).slice(1,-1)).length;if(r+e>1e3)break;t+=n,r+=e}return t},sv="main",sy=[rZ,rQ,r1,r2,r8,nu,r6,r4],sb=e=>-1!==sy.indexOf(e),s_=[rL,rD],sw=e=>-1!==s_.indexOf(e),sk=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(r){return e===t}},sx=e=>{if(!e)return{};let t=JSON.parse(e);return W(t)?t:{}},sE=(e,t)=>{n$(e,(r,n)=>{let i=i2(n);i&&"event"!==i.exposure||({}).hasOwnProperty.call(t,n)||delete e[n]})};var sS=class{constructor(e,t,r=!0){if(this.Jo={},this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=!1,this.ia=new Map,this.na=!1,this.sa=!1,this.ra=!1,this.oa=new Set,this.aa=new Set,this.Rr=e,this.la=r,this.props={},this.ua=void 0,this.ha=(e=>{let t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.qo=this.ca(e),this.Yo=this.da(e),this.load(),this.va(),e.debug&&rx.info("Persistence loaded",e.persistence,tk({},this.props)),this.update_config(e,e,t),this.save(),h){const e=()=>this.flush();nB(h,"beforeunload",e,{capture:!1}),nB(h,"pagehide",e,{capture:!1}),this.fa=e=>{if(this.Ko&&(!e.storageArea||e.storageArea===(null==h?void 0:h.localStorage))&&e.key)if(e.key!==this.ha){if(this.Yo){let t=iQ.find(t=>e.key===this.pa(t));t&&this.ga(e.key,t)}}else this.ga(e.key,sv)},nB(h,"storage",this.fa)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([e,t])=>{let r=this.ia.get(e);if(!sb(e)||!0===r)return;if(!0===t)return void this.ma(e,!0);let n=new Set(r||[]);
45t.forEach(e=>n.add(e)),n.size&&this.ma(e,n)})}onCrossTabFeatureFlagChange(e){return this.aa.add(e),()=>this.aa.delete(e)}destroy(){this.fa&&h&&(h.removeEventListener("storage",this.fa),this.fa=void 0),this.aa.clear()}ga(e,t,r=!0){let n,i;if(this.mi)return!1;try{if(i=n0.Ot(e),K(i)){let e=this.ya(t);return e.storageValue=null,t!==sv&&(e.persisted=!1),!1}n=sx(i)}catch(e){return!1}let s=t===sv?n:n0.Dt(this.ha);if(s&&this.ba(s))return!1;let o=this._a(n,t,r);return t===sv&&this.Yo&&!sk(this.wa().main,n)||this.ka(n,t,!0,i),o}ba(e){let t=this.props[rC],r=e[rC];return!q(t)&&!q(r)&&t!==r}ka(e,t,r,n){let i=this.ya(t);i.storageValue=n,t!==sv&&(i.persisted=r);try{i.fingerprint=this.Sa(e,t)}catch(e){i.fingerprint=void 0}}_a(e,t,r){let n=!1;return sy.forEach(r=>{var i;let s=null==(i=i2(r))?void 0:i.storageGroup;if(t===sv&&this.Yo&&s||t!==sv&&s!==t)return;let o=r in e,a=this.xa(r,o?e[r]:void 0),l=this.ia.has(r)?r in this.props:o;l===r in this.props&&sk(a,this.props[r])||(l?this.Ca(r,a,!1):this.$a(r,!1),n=!0)}),n&&r&&this.aa.forEach(e=>e()),n}Ta(){if(!this.Ko)return!1;try{this.ra=!1;let e=n0.Ot(this.ha),t=this.ya(sv),r,n=!1,i=!1;if(e!==t.storageValue)if(K(e))t.storageValue=null;else{if(r=sx(e),this.ra=!this.sa&&this.ba(r),this.ra)return!1;i=this._a(r,sv,!1),!this.Yo||sk(this.wa().main,r)?this.ka(r,sv,!0,e):t.storageValue=e,n=!0}return this.Yo&&iQ.forEach(e=>{let t=n0.Ot(this.pa(e)),s=this.ya(e),o=r||{},a=n&&sy.some(t=>{var r;return(null==(r=i2(t))?void 0:r.storageGroup)===e&&t in o});if(t===s.storageValue&&!a)return;if(K(t))return s.storageValue=null,s.persisted=!1,void(a&&(i=this._a(o,e,!1)||i));let l=sx(t);i=this._a(l,e,!1)||i,this.ka(l,e,!0,t)}),i}catch(e){return!1}}ma(e,t){this.ia.set(e,t);let r=i2(e);(null==r?void 0:r.volatile)||(this.ya((this.Yo?null==r?void 0:r.storageGroup:void 0)||sv).fingerprint=void 0,this.Ia(e))}Ma(){sy.forEach(e=>this.ia.set(e,!0))}va(){if(this.Ko)try{let e=n0.Ot(this.ha),t=sx(e);this.ya(sv).storageValue=e,sy.forEach(e=>{var r;let n=this.Yo?null==(r=i2(e))?void 0:r.storageGroup:void 0,i=n?n0.Ot(this.pa(n)):null;if(n){let e=this.ya(n);e.storageValue=i,e.persisted=!K(i)}let s=n&&!K(i)?sx(i):t;e in this.props?this.Ea(e,s[e],this.props[e]):e in s&&this.ma(e,!0)})}catch(e){}}xa(e,t){let r=this.ia.get(e);if(!r)return t;if(!0===r)return this.props[e];if("$active_feature_flags"===e){let n=new Set(U(t)?t:[]),i=new Set(U(this.props[e])?this.props[e]:[]);return r.forEach(e=>i.has(e)?n.add(e):n.delete(e)),Array.from(n)}let n=W(t)?tk({},t):{},i=W(this.props[e])?this.props[e]:{};return r.forEach(e=>{e in i?n[e]=i[e]:delete n[e]}),n}Ea(e,t,r){if(!sb(e))return;let n=this.ia.get(e);if(!0===n)return;let i=t;if(this.Ko)try{var s;let t=this.Yo?null==(s=i2(e))?void 0:s.storageGroup:void 0,r=t?this.pa(t):this.ha;i=sx(n0.Ot(r))[e]}catch(e){}let o=new Set(n||[]);if("$active_feature_flags"===e){if(!q(t)&&!U(t)||!q(i)&&!U(i)||!U(r))return void this.ma(e,!0);let n=new Set(t||[]),s=new Set(i||[]),a=new Set(r);new Set([...n,...a]).forEach(e=>{n.has(e)!==a.has(e)&&o.add(e)}),o.forEach(e=>{s.has(e)===a.has(e)&&o.delete(e)})}else{if(!W(r))return void(sk(i,r)?this.ia.delete(e):this.ma(e,!0));{if(!q(t)&&!W(t)||q(t)&&H(r)&&q(i))return void this.ma(e,!0);let n=W(t)?t:{},s=W(i)?i:{};new Set([...Object.keys(n),...Object.keys(r)]).forEach(e=>{e in n==e in r&&sk(n[e],r[e])||o.add(e)}),o.forEach(e=>{e in s==e in r&&sk(s[e],r[e])&&o.delete(e)})}}o.size?this.ma(e,o):this.ia.delete(e)}Pa(){var e;let t=null==(e=this.Rr)?void 0:e.persistence_save_debounce_ms;return Y(t)&&t>0?t:0}Ra(e){if(this.Rr.cookieWinsOnConflict&&"localstorage+cookie"===this.Rr.persistence.toLowerCase())if(e)try{let t=n3(e,this.Rr.cookie_persisted_properties||[]),r=n4(t,this.Rr.cookie_persisted_properties||[]),n=JSON.stringify(t)+"|"+JSON.stringify(r),i=nZ.Ot(this.ha)||void 0;i&&n7(this.ha,i)===n&&(this.Aa=n,this.Fa=i)}catch(e){}else try{let e=nZ.Ot(this.ha)||void 0;this.Aa=e?n7(this.ha,e):void 0,this.Fa=e}catch(e){}}syncCookieProperties(){return this.Oa(this.Rr)}Oa(e,t=!1){let r,n;if(this.mi&&!t||this.ea||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{r=nZ.Ot(this.ha)||void 0}catch(e){}
45if(!r||r===this.Fa)return!1;let i=n7(this.ha,r);try{n=n6(JSON.parse(r))}catch(e){return!1}if((nZ.Ot(this.ha)||void 0)!==r)return!1;this.Aa=i,this.Fa=r;let s=n9(this.ha,r),o=[...n2,...s.properties],a={};if(Object.keys(n).forEach(e=>{let t=n[e];(q(t)||K(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(a[e]=!0,delete n[e])}),H(n))return!1;let l="distinct_id"in n||"anonymous"===n.$user_state||"identified"===n.$user_state,u=this.props,c=u[rC],h=u[nc],d=nI({},u);[...n2,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==o.indexOf(e)&&!(e in n)&&!a[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){let t=d[e];(s.isValid||-1===n2.indexOf(e)||!1!==t&&0!==t)&&delete d[e]}}),this.props=nI(d,n),sy.forEach(e=>{let t=e in this.props;e in u===t&&sk(u[e],this.props[e])||(t?this.Ea(e,u[e],this.props[e]):this.ma(e,!0))}),!l||"$user_state"in n||"$user_state"in this.props||this.Ca(nc,nx);let p=this.props[rC],f=this.props[nc];return l&&(p!==c||f!==h)&&(this.sa=!0,this.ta=!0,ii.At(sg(this.ha),!0),this.$a(r4),this.$a(rQ),this.$a(rZ),this.$a(r1),this.$a(r2),this.$a(r8),this.$a(nu),this.$a(nl),this.$a(no),"anonymous"!==f||"identified"!==h&&"anonymous"!==n.$user_state&&(q(c)||p===c)||(sE(this.props,n),this.$a(r9)),"identified"===f?this.props.$user_id=p:delete this.props.$user_id,this.$a(r$)),!0}
45consumeCookieIdentityChange(){let e=sg(this.ha),t=this.ta||!!ii.Ot(e);return this.ta=!1,t&&ii.Lt(e),t}Da(e=!1){return!(this.ea||this.mi&&!e||!this.Rr.cookieWinsOnConflict||"localstorage+cookie"!==this.Rr.persistence.toLowerCase()||(this.ea=!0,0))}La(){this.ea&&(q(this.Na)||(clearTimeout(this.Na),this.Na=void 0),delete this.Jo[sv],this.qa(!0))}ja(e=!0){if(this.ea)try{e?this.La():q(this.Na)||(clearTimeout(this.Na),this.Na=void 0)}finally{this.ea=!1}}isDisabled(){return!!this.mi}ca(e){-1===sf.indexOf(e.persistence.toLowerCase())&&(rx.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");let t=((e=[],t=!1)=>{let r=[...n2,...e];return tk(tk({},n0),{},{Dt(e){try{let i,s,o={};try{o=(s=nZ.Ot(e)||void 0)?n6(JSON.parse(s)):{}}catch(e){}let a=JSON.parse(n0.Ot(e)||"{}");if(t){let t=n9(e,s),l=[...n2,...t.properties],u={};Object.keys(o).forEach(e=>{let t=o[e];K(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(u[e]=t)});let c="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var n;let e=a[rC],i=null!=(n=a.$user_state)?n:nx;r.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in o)&&(c||"distinct_id"!==e&&"$user_state"!==e)){let r=a[e];(t.isValid||-1===n2.indexOf(e)||!1!==r&&0!==r)&&delete a[e]}}),!c||"$user_state"in o||"$user_state"in a||(a[nc]=nx),c&&(("distinct_id"in u?u[rC]:a[rC])!==e||("$user_state"in u?u[nc]:a[nc])!==i)&&(n1.forEach(e=>delete a[e]),"identified"===u.$user_state&&"distinct_id"in u?a.$user_id=u[rC]:delete a.$user_id,"identified"!==u.$user_state&&(delete a[r7],delete a[r9]),delete a.__alias)}i=nI(a,u)}else i=nI(o,a);return n0.At(e,i),i}catch(e){}return null},At(r,n,i,s,o,a){let l=n0.At(r,n,void 0,void 0,a);try{let u=n3(n,e);if(Object.keys(u).length){if(t){let t=r+"_cpm",c=n4(u,e);if(nZ.At(t,c,i,s,o,a),nZ.Ot(t)!==JSON.stringify(c)){nZ.Lt(t,s);let e=n3(n);return nZ.At(r,e,i,s,o,a),l}}nZ.At(r,u,i,s,o,a)}}catch(e){n0.Pt(e)}return l},Lt(e,t){try{null==h||h.localStorage.removeItem(e),nZ.Lt(e,t),nZ.Lt(e+"_cpm",t)}catch(e){n0.Pt(e)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),r,n=!1,i=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&n0.Et()?(r=n0,i=!0):"localstorage+cookie"===s&&t.Et()?(r=t,i=!0,n=!0):"sessionstorage"===s&&ii.Et()?r=ii:"memory"===s?r=it:"cookie"===s&&nZ.Et()?(r=nZ,n=!0):t.Et()?(r=t,i=!0,n=!0):nZ.Et()?(r=nZ,n=!0):r=it,this.Ko=i,this.Xo=n,r}pa(e){return`${this.ha}__${e}`}da(e){return this.Ko&&!!e.split_storage}properties(){let e={};return n$(this.props,(t,r)=>{let n=i2(r);if(!n||"event"===n.exposure){var i;if(null==n||null==(i=n.shouldSkipFromEventProperties)?void 0:i.call(n,t))return;e[r]=t}}),e}load(e=!1){if(this.mi&&!e)return;let t=this.Rr.cookieWinsOnConflict&&"localstorage+cookie"===this.Rr.persistence.toLowerCase(),r=t?n0.Dt(this.ha):null,n={};if(t)try{n=n6(nZ.Dt(this.ha)),n$(n,(e,t)=>{(q(e)||K(e)||""===e)&&delete n[t]})}catch(e){}let i=this.qo.Dt(this.ha);if(i&&(this.props=nI({},i)),this.Yo&&this.Ba(),t&&i){var s,o;let e=null==r?void 0:r[rC],t=null!=(s=null==r?void 0:r.$user_state)?s:nx,a=i[rC],l=null!=(o=i.$user_state)?o:nx;if(a!==e||l!==t){this.ta=!0,ii.At(sg(this.ha),!0);let r=nI({},this.props);n1.forEach(e=>delete r[e]),"anonymous"!==l||"identified"!==t&&"anonymous"!==n.$user_state&&(q(e)||a===e)||(sE(r,n),delete r[r9]),this.props=r;let i=new Set;n1.forEach(e=>{var t;let r=null==(t=i2(e))?void 0:t.storageGroup;r&&i.add(r)}),i.forEach(e=>{let t={};n$(this.props,(r,n)=>{var i;(null==(i=i2(n))?void 0:i.storageGroup)===e&&(t[n]=r)}),H(t)?(n0.Lt(this.pa(e)),this.Jo[e]={}):n0.At(this.pa(e),t)&&(this.Jo[e]={persisted:!0,fingerprint:this.Sa(t,e)})})}}ii.Ot(sg(this.ha))&&(this.ta=!0)}Ba(){for(let e of iQ){let t=n0.Dt(this.pa(e));if(t&&!H(t)){let r=this.ya(e);r.persisted=!0,this.Ha(e)||(r.fingerprint=this.Sa(t,e)),this.za(e,t)||nI(this.props,t)}}}Ha(e){return Object.keys(this.props).some(t=>{var r;return(null==(r=i2(t))?void 0:r.storageGroup)===e})}za(e,t){let r=sp[e];if(!r)return!1;let n=t[r],i=this.props[r];return Y(n)&&Y(i)&&i>n}refreshKey(e){var t;if(this.mi||this.oa.has(e))return;let r=this.Yo?null==(t=i2(e))?void 0:t.storageGroup:void 0,n=r?n0.Dt(this.pa(r)):this.qo.Dt(this.ha);if(n&&e in n)this.Ca(e,n[e],!1);else{if(r){let t=this.qo.Dt(this.ha);if(t&&e in t)return void this.Ca(e,t[e],!1)}this.$a(e,!1)}}save(){if(this.mi)return;let e=this.Pa();e>0?q(this.Na)&&(this.Na=setTimeout(()=>{this.Na=void 0,this.qa()},e)):this.qa()}flush(){q(this.Na)||(clearTimeout(this.Na),this.Na=void 0,this.qa())}qa(e=!1){if(this.mi||this.ea&&!e)return;e||(this.syncCookieProperties(),this.Rr.cookieWinsOnConflict&&"localstorage+cookie"===this.Rr.persistence.toLowerCase()||s_.forEach(e
45=>this.refreshKey(e)));let t=!e&&!this.na;t||(this.ra=!1);let r=!!t&&this.Ta();if(this.ra)return void(this.Rr.debug&&rx.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Yo)return this.Ua(),void(r&&this.aa.forEach(e=>e()));let n=this.Wa(this.qo,this.ha,this.props,sv);"written"===n&&this.Ra(this.props),"failed"!==n&&(this.ia.clear(),this.sa=!1,this.oa.clear()),r&&this.aa.forEach(e=>e())}Ua(){let{main:e,groups:t}=this.wa(),r=this.Wa(this.qo,this.ha,e,sv);for(let i of("written"===r&&this.Ra(e),"failed"!==r&&(this.sa=!1,this.oa.clear(),sy.forEach(e=>{var t;(null==(t=i2(e))?void 0:t.storageGroup)||this.ia.delete(e)})),iQ)){var n;let e=t[i];if(H(e)&&!(null==(n=this.Jo[i])?void 0:n.persisted)){sy.forEach(e=>{var t;(null==(t=i2(e))?void 0:t.storageGroup)===i&&this.ia.delete(e)});continue}let r=this.Wa(n0,this.pa(i),e,i);"failed"!==r&&sy.forEach(e=>{let t=i2(e);(null==t?void 0:t.storageGroup)!==i||"written"!==r&&t.volatile||this.ia.delete(e)})}}wa(){let e={},t={flags:{},surveys:{}};return n$(this.props,(r,n)=>{var i;let s=null==(i=i2(n))?void 0:i.storageGroup;s?t[s][n]=r:e[n]=r}),{main:e,groups:t}}Sa(e,t){if(t===sv)return JSON.stringify(e)+"|"+this.Va+"|"+this.Ga+"|"+this.Za;let r={};return n$(e,(e,t)=>{var n;r[t]=(null==(n=i2(t))?void 0:n.volatile)?"__volatile__":e}),JSON.stringify(r)}Wa(e,t,r,n){let i,s=this.ya(n);if(n!==sv&&!s.dirty&&!q(s.fingerprint))return"skipped";try{if((i=this.Sa(r,n))===s.fingerprint)return s.dirty=!1,"skipped"}catch(e){i=void 0}return e.At(t,r,this.Va,this.Ga,this.Za,this.Rr.debug)?(s.dirty=!1,n!==sv&&(s.persisted=!0),q(i)||(s.fingerprint=i),this.Ko&&(s.storageValue=n0.Ot(t)),"written"):(this.Rr.debug&&rx.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Ma(),q(this.Na)||(clearTimeout(this.Na),this.Na=void 0),this.qo.Lt(this.ha,!1),this.qo.Lt(this.ha,!0),!e&&this.la)for(let e of iQ)n0.Lt(this.pa(e));e?delete this.Jo[sv]:this.Jo={},this.Aa=void 0,this.Fa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,r){if(W(e)){this.syncCookieProperties(),q(t)&&(t="None"),this.Va=q(r)?this.Qa:r;let n=!1;if(n$(e,(e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.Ca(r,e),n=!0)}),n)return this.save(),!0}return!1}register(e,t){if(W(e)){this.syncCookieProperties(),this.Va=q(t)?this.Qa:t;let r=!1;if(n$(e,(t,n)=>{e.hasOwnProperty(n)&&(this.props[n]!==t||W(t)||U(t))&&(this.Ca(n,t),r=!0)}),r)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();let t=!1;for(let r of"string"==typeof e?[e]:e)r in this.props&&(this.$a(r),t=!0);t&&this.save()}update_campaign_params(){let e=null==f?void 0:f.URL;if(e===this.ua)return;let t=si(this.Rr.custom_campaign_params,this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties),r=!H(nD(t));return r&&this.register(t),this.ua=e,r?t:void 0}update_search_keyword(){let e;this.register((e=null==f?void 0:f.referrer)?so(e):{})}update_referrer_info(){var e;this.register_once({$referrer:su(),$referring_domain:(null==f?void 0:f.referrer)&&(null==(e=i6(f.referrer))?void 0:e.host)||sl},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;let e=sc(this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties,this.Rr.disable_capture_url_hashes);this.register_once({[nf]:this.Xo?{r:sm(e.r),u:e.u?sm(e.u):void 0}:e},void 0)}get_initial_props(){let e={};n$([np,nd],t=>{let r=this.props[t];r&&n$(r,function(t,r){e["$initial_"+M(r)]=t})});let t=this.props[nf];return t&&nI(e,function(e,t=!1){let r=sh(e,t),n={};return n$(r,function(e,t){n[`$initial_${M(t)}`]=e}),n}(t,this.Rr.disable_capture_url_hashes)),e}safe_merge(e){return n$(this.props,function(t,r){r in e||(e[r]=t)}),e}update_config(e,t,r){let n=e.persistence!==t.persistence,i=!((e,t)=>{if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((e,t)=>e===n[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=n||i,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!r,l=!!this.mi&&!a;a||this.Oa(t,l),this.Rr=e,!a&&(n||i||o)&&(this.Aa=void 0,this.Fa=void 0,this.Oa(tk(tk({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),l));let u=s||o?this.ca(e):this.qo;this.Ja();let c=this.da(e),h=s||c!==this.Yo,d=!a&&(h||e.cross_subdomain_cookie!==this.Ga||e.secure_cookie!==this.Za)&&this.Da(l);this.na=h;try{if(this.Qa=this.Va=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),h){let e=this.props;this.clear(),this.qo=u,this.Yo=c,this.props=e,this.save()}else o&&(this.qo=u,a||(delete this.Jo[sv],this.qa()))}finally{this.na=!1,d&&this.ja()}}Ja(){let e=this.props[nf];if(!this.Xo||!W(e)||"string"!=typeof e.r)return;let t=sm(e.r),r="string"==typeof e.u?sm(e.u):e.u;t===e.r&&r===e.u||this.Ca(nf,tk(tk({},e),{},{r:t,u:r}))}set_disabled(e){this.mi=e,this.mi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ga&&(this.Ga=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Za&&(this.Za=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){let r=this.props.__timers||{};r[e]=t,this.Ca(rN,r),this.save()}remove_event_timer(e){let t=this.props.__timers||{},r=t[e];return q(r)||(delete t[e],this.Ca(rN,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Ca(e,t),this.save()}Ca(e,t,r=!0){var n;let i=this.props[e];this.props[e]=t,r&&("distinct_id"!==e&&"$user_state"!==e||i===t||(this.sa=!0),sw(e)&&!sk(i,t)&&this.oa.add(e),this.Ea(e,i,t),(null==(n=i2(e))?void 0:n.volatile)||this.Ia(e))}$a(e,t=!0){delete this.props[e],t&&(sb(e)&&this.ma(e,!0),sw(e)&&this.oa.add(e),this.Ia(e))}Ia(e){var t;let r=null==(t=i2(e))?void 0:t.storageGroup;r&&(this.ya(r).dirty=!0)}ya(e){return this.Jo[e]||(this.Jo[e]={})}};let sP="gzip-js",sR="base64",sT="events",sA="cancelEvents",sC="survey shown",sj="survey dismissed",sO="survey sent",s$="popover";function sI(e){let t=!0;return{dispose(){if(t){t=!1;let r=e();r&&V(r.then)&&r.then(void 0,()=>{})}}}}let sL=rE("[RateLimiter]");var sM=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{let t=e.text;
vendor: 5,296 bytes, line 45
45if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{sL.info(`${e||"events"} is quota limited.`),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void sL.warn(`could not rate limit - continuing. Error: "${null==e?void 0:e.message}"`,{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var t,r,n;let{captureEventsBurstLimit:i,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!=(t=null==(r=this.instance.persistence)?void 0:r.get_property("$capture_rate_limit"))?t:{tokens:i,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>i&&(a.tokens=i);let l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){let e=(Y(a.dropped)?a.dropped:0)+1;a.dropped=e,!this.lastEventRateLimited&&this.Ka(e)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(n=this.instance.persistence)||n.set_property("$capture_rate_limit",a),{isRateLimited:l,remainingTokens:a.tokens}}Xa(e){let t=this.instance.config.property_denylist;return!U(t)||!t.includes(e)}Ya(){var e;if(this.Xa("$current_url")&&this.Xa("$pathname")&&(null==g?void 0:g.pathname))return`${null!=(e=g.origin)?e:""}${g.pathname}`}Ka(e){var t,r;let{captureEventsBurstLimit:n,captureEventsPerSecond:i}=this,s=this.Ya(),o=this.Xa("$session_id")?null==(t=(r=this.instance).get_session_id)?void 0:t.call(r):void 0,a=[`${e} event(s) dropped since the last warning`,s?`triggered on ${s}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${a}. Config is set to ${i} events per second and ${n} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){let t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}};let sD=rE("[RemoteConfig]");var sN=class{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=x._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}tl(e){var t,r,n;(null==(t=x.__PosthogExtensions__)?void 0:t.loadExternalDependency)?null==(r=x.__PosthogExtensions__)||null==(n=r.loadExternalDependency)||n.call(r,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}el(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return sD.info("Using preloaded remote config",this.remoteConfig),void this.il(this.remoteConfig);if(this._instance.nl())return void sD.warn("Remote config is disabled. Falling back to local config.");this.tl(e=>{e?this.il(e):(sD.info("No config found after loading remote JS config. Falling back to JSON."),this.el(e=>{this.il(e.json,e)}))})}catch(e){sD.error("Error loading remote config",e),this.il()}}il(e,t){!e&&t&&(0===t.statusCode?t.error||sD.warn("Failed to fetch remote config from PostHog."):sD.error("Failed to fetch remote config from PostHog."));try{this._instance.il(e?{ok:!0,config:e}:{ok:!1})}catch(e){sD.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;null==(r=this._instance.featureFlags)||r.ensureFlagsLoaded()}catch(e){sD.error("Error loading feature flags",e)}}},sF=Uint8Array,sB=Uint16Array,sU=Uint32Array,sV=new sF([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]),sW=new sF([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]),sH=new sF([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sq=function(e,t){for(var r=new sB(31),n=0;31>n;++n)r[n]=t+=1<<e[n-1];var i=new sU(r[30]);for(n=1;30>n;++n)for(var s=r[n];r[n+1]>s;++s)i[s]=s-r[n]<<5|n;return[r,i]},sG=sq(sV,2),sz=sG[1];sG[0][28]=258,sz[258]=28;for(var sK=sq(sW,0)[1],sJ=new sB(32768),sY=0;32768>sY;++sY){var sX=(43690&sY)>>>1|(21845&sY)<<1;sJ[sY]=((65280&(sX=(61680&(sX=(52428&sX)>>>2|(13107&sX)<<2))>>>4|(3855&sX)<<4))>>>8|(255&sX)<<8)>>>1}var sZ=function(e,t,r){for(var n=e.length,i=0,s=new sB(t);n>i;++i)++s[e[i]-1];var o,a=new sB(t);for(i=0;t>i;++i)a[i]=a[i-1]+s[i-1]<<1;if(r){o=new sB(1<<t);var l=15-t;for(i=0;n>i;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],h=a[e[i]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)o[sJ[h]>>>l]=u}else for(o=new sB(n),i=0;n>i;++i)o[i]=sJ[a[e[i]-1]++]>>>15-e[i];return o},sQ=new sF(288);for(sY=0;144>sY;++sY)sQ[sY]=8;for(sY=144;256>sY;++sY)sQ[sY]=9;for(sY=256;280>sY;++sY)sQ[sY]=7;for(sY=280;288>sY;++sY)sQ[sY]=8;var s0=new sF(32);for(sY=0;32>sY;++sY)s0[sY]=5;var s1=sZ(sQ,9,0),s2=sZ(s0,5,0),s8=function(e){return(e/8|0)+(7&e&&1)},s6=function(e,t,r){(null==t||0>t)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof sB?sB:e instanceof sU?sU:sF)(r-t);return n.set(e.subarray(t,r)),n},s3=function(e,t,r){var n=t/8|0;e[n]|=r<<=7&t,e[n+1]|=r>>>8},s5=function(e,t,r){var n=t/8|0;e[n]|=r<<=7&t,e[n+1]|=r>>>8,e[n+2]|=r>>>16},s4=function(e,t){for(var r=[],n=0;e.length>n;
vendor: 4,264 bytes, line 45
45++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,s=r.slice();if(!i)return[new sF(0),0];if(1==i){var o=new sF(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[h].f>r[u].f?u++:h++],l=r[u!=c&&r[h].f>r[u].f?u++:h++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(n=1;i>n;++n)s[n].s>d&&(d=s[n].s);var p=new sB(d+1),f=s9(r[c-1],p,0);if(f>t){n=0;var g=0,m=f-t,v=1<<m;for(s.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});i>n;++n){var y=s[n].s;if(t>=p[y])break;g+=v-(1<<f-p[y]),p[y]=t}for(g>>>=m;g>0;){var b=s[n].s;t>p[b]?g-=1<<t-p[b]++-1:++n}for(;n>=0&&g;--n){var _=s[n].s;p[_]==t&&(--p[_],++g)}f=t}return[new sF(p),f]},s9=function(e,t,r){return -1==e.s?Math.max(s9(e.l,t,r+1),s9(e.r,t,r+1)):t[e.s]=r},s7=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new sB(++t),n=0,i=e[0],s=1,o=function(e){r[n++]=e},a=1;t>=a;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[r.subarray(0,n),t]},oe=function(e,t){for(var r=0,n=0;t.length>n;++n)r+=e[n]*t[n];return r},ot=function(e,t,r){var n=r.length,i=s8(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;n>s;++s)e[i+s+4]=r[s];return 8*(i+4+n)},or=function(e,t,r,n,i,s,o,a,l,u,c){s3(t,c++,r),++i[256];for(var h=s4(i,15),d=h[0],p=h[1],f=s4(s,15),g=f[0],m=f[1],v=s7(d),y=v[0],b=v[1],_=s7(g),w=_[0],k=_[1],x=new sB(19),E=0;y.length>E;++E)x[31&y[E]]++;for(E=0;w.length>E;++E)x[31&w[E]]++;for(var S=s4(x,7),P=S[0],R=S[1],T=19;T>4&&!P[sH[T-1]];--T);var A,C,j,O,$=u+5<<3,I=oe(i,sQ)+oe(s,s0)+o,L=oe(i,d)+oe(s,g)+o+14+3*T+oe(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(I>=$&&L>=$)return ot(t,c,e.subarray(l,l+u));if(s3(t,c,1+(I>L)),c+=2,I>L){A=sZ(d,p,0),C=d,j=sZ(g,m,0),O=g;var M=sZ(P,R,0);for(s3(t,c,b-257),s3(t,c+5,k-1),s3(t,c+10,T-4),c+=14,E=0;T>E;++E)s3(t,c+3*E,P[sH[E]]);c+=3*T;for(var D=[y,w],N=0;2>N;++N){var F=D[N];for(E=0;F.length>E;++E)s3(t,c,M[B=31&F[E]]),c+=P[B],B>15&&(s3(t,c,F[E]>>>5&127),c+=F[E]>>>12)}}else A=s1,C=sQ,j=s2,O=s0;for(E=0;a>E;++E)if(n[E]>255){s5(t,c,A[257+(B=n[E]>>>18&31)]),c+=C[B+257],B>7&&(s3(t,c,n[E]>>>23&31),c+=sV[B]);var B,U=31&n[E];s5(t,c,j[U]),c+=O[U],U>3&&(s5(t,c,n[E]>>>5&8191),c+=sW[U])}else s5(t,c,A[n[E]]),c+=C[n[E]];return s5(t,c,A[256]),c+C[256]},on=new sU([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oi=new sF(0),os=function(){for(var e=new sU(256),t=0;256>t;++t){for(var r=t,n=9;--n;)r=(1&r&&0xedb88320)^r>>>1;e[t]=r}return e}(),oo=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};let oa=!!v||!!m,ol=new WeakMap,ou="text/plain",oc=0,oh=!1,od=(e,t)=>{let[r,n]=e.split("#"),[i,s]=r.split("?");if(!s)return e;let o=s.split("&").filter(e=>e.split("=")[0]!==t).join("&");return`${i}${o?`?${o}`:""}${n?`#${n}`:""}`},op=(e,t,r=!0)=>{var n;let[i,s]=e.split("?"),o=tk({},t),a=null!=(n=null==s?void 0:s.split("&").map(e=>{var t;let[n,i]=e.split("="),s=r&&null!=(t=o[n])?t:i;return delete o[n],`${n}=${s}`}))?n:[],l=function(e,t="&"){let r,n,i=[];return n$(e,function(e,t){q(e)||q(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)}),i.join(t)}(o);return l&&a.push(l),a.length>0?`${i}?${a.join("&")}`:i},of=e=>{var t,r,n,i,s,o,a,l,u,c;if(e.sl)return e.sl;let{data:h,compression:d}=e;if(!h)return;if(d===sP){let e=(t=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new sF(e.length+(e.length>>>1)),n=0,i=function(e){r[n++]=e},s=0;t>s;++s){if(n+5>r.length){var o=new sF(n+8+(t-s<<1));o.set(r),r=o}var a=e.charCodeAt(s);128>a?i(a):(2048>a?i(192|a>>>6):(a>55295&&57344>a?(i(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++s))>>>18),i(128|a>>>12&63)):i(224|a>>>12),i(128|a>>>6&63)),i(128|63&a))}return s6(r,0,n)}(i8(h)),r={mtime:0},n=0xffffffff,i={p(e){for(var t=n,r=0;e.length>r;++r)t=os[255&t^e[r]]^t>>>8;n=t},d:()=>0xffffffff^n},s=t.length,i.p(t),u=(o=10+(r.filename&&r.filename.length+1||0),l=function(e,t,r,n,i){var s=e.length,o=new sF(n+s+5*(1+Math.floor(s/7e3))+8),a=o.subarray(n,o.length-8),l=0;if(!t||8>s)for(var u=0;s>=u;u+=65535){var c=u+65535;s>
45c?l=ot(a,l,e.subarray(u,c)):(a[u]=i,l=ot(a,l,e.subarray(u,s)))}else{for(var h=on[t-1],d=h>>>13,p=8191&h,f=(1<<r)-1,g=new sB(32768),m=new sB(f+1),v=Math.ceil(r/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&f},_=new sU(25e3),w=new sB(288),k=new sB(32),x=0,E=0,S=(u=0,0),P=0,R=0;s>u;++u){var T=b(u),A=32767&u,C=m[T];if(g[A]=C,m[T]=A,u>=P){var j=s-u;if((x>7e3||S>24576)&&j>423){l=or(e,a,0,_,w,k,E,S,R,u-R,l),S=x=E=0,R=u;for(var O=0;286>O;++O)w[O]=0;for(O=0;30>O;++O)k[O]=0}var $=2,I=0,L=p,M=A-C&32767;if(j>2&&T==b(u-M))for(var D=Math.min(d,j)-1,N=Math.min(32767,u),F=Math.min(258,j);N>=M&&--L&&A!=C;){if(e[u+$]==e[u+$-M]){for(var B=0;F>B&&e[u+B]==e[u+B-M];++B);if(B>$){if($=B,I=M,B>D)break;var U=Math.min(M,B-2),V=0;for(O=0;U>O;++O){var W=u-M+O+32768&32767,H=W-g[W]+32768&32767;H>V&&(V=H,C=W)}}}M+=(A=C)-(C=g[A])+32768&32767}if(I){_[S++]=0x10000000|sz[$]<<18|sK[I];var q=31&sz[$],G=31&sK[I];E+=sV[q]+sW[G],++w[257+q],++k[G],P=u+$,++x}else _[S++]=e[u],++w[e[u]]}}l=or(e,a,i,_,w,k,E,S,R,u-R,l),i||(l=ot(a,l,oi))}return s6(o,0,n+s8(l)+8)}(t,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+r.mem,o,!a)).length,function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&oo(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;r.length>=n;++n)e[n+10]=r.charCodeAt(n)}}(l,r),oo(l,u-8,i.d()),oo(l,u-4,s),l);return{contentType:ou,body:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),estimatedSize:e.byteLength}}if(d===sR){let e,t="data="+encodeURIComponent("string"==typeof(e=(c=i8(h))?btoa(encodeURIComponent(c).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):c)?e:i8(e));return{contentType:"application/x-www-form-urlencoded",body:t,estimatedSize:new Blob([t]).size}}let p=i8(h);return{contentType:"application/json",body:p,estimatedSize:new Blob([p]).size}},og=e=>{var t;let r,n=()=>"sendBeacon"===e.transport?{url:op(e.url,{compression:sR}),encodedBody:of(tk(tk({},e),{},{compression:sR,sl:void 0}))}:{url:od(e.url,"compression"),encodedBody:of(tk(tk({},e),{},{compression:void 0,sl:void 0}))};try{r=of(e)}catch(t){if(t9(e.compression,i3(e.url,"compression")))return rx.error("Failed to gzip request body, sending uncompressed payload",t),n();throw t}return!(r&&t9(e.compression,i3(e.url,"compression")))||((t=r.body)instanceof ArrayBuffer?t4(new Uint8Array(t)):ArrayBuffer.isView(t)&&t4(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:r}:(oh=!0,n())},om=e=>{try{return og(e)}catch(r){var t;return rx.error(r),void(null==(t=e.callback)||t.call(e,{statusCode:0,error:r}))}},ov=(P=eu(function*(e){let t=yield function(e){return rr.apply(this,arguments)}(i8(e.data),S.DEBUG,{rethrow:!0});if(!t)return e;let r=yield t.arrayBuffer();return tk(tk({},e),{},{sl:{contentType:ou,body:r,estimatedSize:r.byteLength}})}),function(e){return P.apply(this,arguments)}),oy=/Failed to fetch|NetworkError|Load failed/i,ob=e=>"TypeError"===(null==e?void 0:e.name)&&oy.test((null==e?void 0:e.message)||""),o_=e=>{try{let t=function(e,t=Date.now()){if("string"!=typeof e||!e)return;let r=e.trim(),n=/^\d+\s*,/.test(r)?r.slice(0,r.indexOf(",")).trim():r;if(/^\d+$/.test(n)){let e=1e3*Math.min(Number(n),300);return e>0?e:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(n))return;let i=/^\w{3} \w{3} /.test(n)?n+" GMT":n,s=Date.parse(i)-t;return Number.isFinite(s)&&s>0?Math.min(s,3e5):void 0}(e());return q(t)?void 0:Math.min(t,3e4)}catch(e){return}},ow=e=>{let t=om(e);if(!t)return;let r=new v;ol.set(r,!0);let{url:n,encodedBody:i}=t;r.open(e.method||"GET",n,!0);let{contentType:s,body:o}=null!=i?i:{};n$(e.headers,function(e,t){r.setRequestHeader(t,e)}),s&&r.setRequestHeader("Content-Type",s),e.timeout&&(r.timeout=e.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var t;let n={statusCode:r.status,text:r.responseText};if(200===r.status)try{n.json=JSON.parse(r.responseText)}catch(e){}null==(t=e.callback)||t.call(e,n,o_(()=>r.getResponseHeader("Retry-After")))}},r.send(o)},ok=e=>{let t=om(e);if(!t)return;let{url:r,encodedBody:n}=t,{contentType:i,body:s,estimatedSize:o}=null!=n?n:{},a=new Headers;n$(e.headers,function(e,t){a.append(t,e)}),i&&a.append("Content-Type",i);let l=null,u=!1;if(y){let t=new y;l={signal:t.signal,timeout:setTimeout(()=>{var r;u=!0;try{t.abort(tf("AbortError","PostHog request timed out"+((r=e.timeout)?` after ${r}ms`:"")))}catch(e){h(e)}}
45,e.timeout)}}let c=!1,h=t=>{var r;c||(c=!0,u&&"AbortError"===(null==t?void 0:t.name)||ob(t)?rx.warn(t):rx.error(t),null==(r=e.callback)||r.call(e,{statusCode:0,error:t}))},d=0,p=()=>{oc-=d,d=0,l&&clearTimeout(l.timeout)};try{let t=tk({method:(null==e?void 0:e.method)||"GET",headers:a,referrerPolicy:"strict-origin",body:s,signal:null==l?void 0:l.signal},e.fetchOptions),n=null!=o?o:q(s)?0:void 0;t.keepalive="POST"===t.method&&!e.rl&&!1!==t.keepalive&&t.body===s&&!q(n)&&n>=0&&52428.8>oc+n,t.keepalive&&(d=n,oc+=d),m(r,t).then(t=>t.text().then(r=>{var n;if(c)return;let i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){rx.error(e)}c=!0,p(),null==(n=e.callback)||n.call(e,i,o_(()=>t.headers.get("Retry-After")))})).catch(e=>{p(),h(e)}).finally(p)}catch(e){p(),h(e)}},ox=e=>{try{var t;let{url:r,encodedBody:n}=og(e),{contentType:i,body:s,estimatedSize:o}=null!=n?n:{};if(!s)return;let a=s instanceof Blob?s:new Blob([s],{type:i});if(p.sendBeacon(r,a))return;let l=U(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(U(l)&&l.length>1&&(null!=o?o:0)>16384){let t=Math.ceil(l.length/2),r=t=>U(e.data)?t:tk(tk({},e.data),{},{batch:t});return ox(tk(tk({},e),{},{data:r(l.slice(0,t))})),void ox(tk(tk({},e),{},{data:r(l.slice(t))}))}rx.warn(`Beacon of ~${null!=o?o:0} bytes was rejected by the browser, falling back to ${m?"fetch":"XHR"}`),m?ok(tk(tk({},e),{},{rl:!0})):ow(e)}catch(e){rx.warn("Beacon send failed",e)}},oE=(e,t,r,n)=>{let i="query"===n?"POST"===t?"sent_at":"_":void 0;return op(r===sP?od(e,"compression"):e,tk(tk({},i?{[i]:Date.now().toString()}:{}),r===sP?{}:{compression:r}))},oS=(l=[],m&&l.push({transport:"fetch",method:ok}),v&&l.push({transport:"XHR",method:ow}),(null==p?void 0:p.sendBeacon)&&l.push({transport:"sendBeacon",method:ox}),l),oP=!oa&&-1===(null==_?void 0:_.indexOf("MSIE"))&&-1===(null==_?void 0:_.indexOf("Mozilla"));function oR(e,t,r){var n,i,s;r&&(t=tk(tk({},t),{},{callback:e=>r(e)})),e.__loaded?oP?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==(i=t.callback)||i.call(t,{statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=tk(tk({},e.config.request_headers),t.headers),t.compression="best-available"===t.compression?null!=(n=e.compression)?n:t.compressionFallback:t.compression,(q(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,((e,t)=>{var r,n,i,s,o,a;let l,u,c=tk(tk({},e),{},{callback:null!=t?t:t=>{var r;return null==(r=e.callback)?void 0:r.call(e,t)}});c.timeout=c.timeout||6e4;let h=null!=(r=c.transport)?r:"fetch";"sendBeacon"===h&&q(c.compression)&&c.data&&(c.compression=sR),"POST"===c.method&&c.data&&("capture-body"===c.timestampMode?(u=(l=(U(s=c.data)?s:[s]).map(e=>tk(tk({},e),e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0],c.data={api_key:null!=(o=null==u||null==(a=u.properties)?void 0:a.token)?o:null==u?void 0:u.token,batch:l,sent_at:(new Date).toISOString()}):"body"===c.timestampMode&&(c.data=((e,t=(new Date).toISOString())=>U(e)?e.map(e=>tk(tk({},e),{},{sent_at:t})):tk(tk({},e),{},{sent_at:t}))(c.data))),c.url=oE(c.url,c.method,c.compression,c.timestampMode);let d=oS.filter(e=>!c.disableTransport||!e.transport||!c.disableTransport.includes(e.transport)),p=null!=(n=null==(i=function(e,t){for(let r=0;e.length>r;r++)if(t(e[r]))return e[r]}(d,e=>e.transport===h))?void 0:i.method)?n:d[0].method;if(!p)throw Error("No available transport method");let f=e=>{try{p(e)}catch(e){var t;ob(e)?rx.warn(e):rx.error(e),null==(t=c.callback)||t.call(c,{statusCode:0,error:e})}};"sendBeacon"!==h&&!c.preferSyncCompression&&c.data&&c.compression===sP&&b&&"u">typeof Promise&&!oh?ov(c).then(e=>{f(e)}).catch(t=>{t7(t)?(oh=!0,f(tk(tk({},c),{},{compression:void 0,url:oE(e.url,e.method,void 0,e.timestampMode)}))):((e=>{if(!e||"object"!=typeof e)return!1;let t="name"in e?String(e.name):"";return t7(e)||t===t5})(t)&&(oh=!0),f(c))}):f(c)})(t,(n,i)=>{var s,o,a;e.rateLimiter.checkForLimiting(n),400>n.statusCode||null==(s=(o=e.config).on_request_error)||s.call(o,n),r?r(n,i):null==(a=t.callback)||a.call(t,n)})):t.fireCallbackOnDrop&&(null==(s=t.callback)||s.call(t,{statusCode:0}))}var oT=class{constructor(e,t){this.ol=!0,this.al=[],this.ll=ed((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,rx.createLogger("flush interval"),3e3),this.ul=e}enqueue(e){this.al.push(e),this.hl||this.cl()}unload(){this.dl();let e=Object.values(this.al.length>0?this.vl():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.fl(e,"sendBeacon")})}enable(){this.ol=!1,this.cl()}cl(){this.ol||(this.hl=setTimeout(()=>{if(this.dl(),this.al.length>0){let e=this.vl();for(let t in e)this.fl(e[t])}},this.ll))}fl(e,t){try{this.ul(e,t)}catch(e){rx.error(e)}}dl(){clearTimeout(this.hl),this.hl=void 0}vl(){let e={};return n$(this.al,t=>{var r;let n=((t?t.batchKey:null)||t.url)+(t.batchGroup?`:${t.batchGroup}`:"");q(e[n])&&(e[n]=tk(tk({},t),{},{data:[]})),null==(r=e[n].data)||r.push(t.data)}),this.al=[],e}};let oA=["retriesPerformedSoFar"];var oC=class{constructor(e){this._instance=e,this.pl=!1,this.gl=3e3,this.al=[],this.al=[],this.ml=!0,this.resume()}resume(){!q(h)&&"onLine"in h.navigator&&(this.ml=h.navigator.onLine,this.yl||(this.yl=()=>{this.ml=!0,this.bl()},this._l=()=>{this.ml=!1},nB(h,"online",this.yl),nB(h,"offline",this._l)))}get length(){return this.al.length}retriableRequest(e,t){let{retriesPerformedSoFar:r}=e,n=rn(e,oA);X(r)&&(n.url=op(n.url,{retry_count:r})),oR(this._instance,t?tk(tk({},n),{},{transport:t}):n,(e,t)=>{var i;if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=r?r:0))return void this.Ls(tk({retriesPerformedSoFar:r},n),t);0===e.statusCode&&rx.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${null!=r?r:0} retries.`)}null==(i=n.callback)||i.call(n,e)})}Ls(e,t){let r,n,i,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;let o=Math.max((i=(Math.random()-.5)*((n=Math.min(18e5,r=3e3*Math.pow(2,s)))-r/2),Math.ceil(n+i)),null!=t?t:0),a=Date.now()+o;this.al.push({retryAt:a,requestOptions:e});let l=`Enqueued failed request for retry in ${o}`;navigator.onLine||(l+=" (Browser is offline)"),rx.warn(l),this.pl||(this.pl=!0,this.wl())}wl(){(this.kl&&clearTimeout(this.kl),0===this.al.length)?(this.pl=!1,this.kl=void 0):this.kl=setTimeout(()=>{this.ml&&this.al.length>0&&this.bl(),this.wl()},this.gl)}bl(){let e=Date.now(),t=[],r=this.al.filter(r=>e>r.retryAt||(t.push(r),!1));if(this.al=t,r.length>0)for(let{requestOptions:e}of r)this.retriableRequest(e)}unload(){for(let{requestOptions:e}of(this.kl&&(clearTimeout(this.kl),this.kl=void 0),this.pl=!1,q(h)||(this.yl&&(h.removeEventListener("online",this.yl),this.yl=void 0),this._l&&(h.removeEventListener("offline",this._l),this._l=void 0)),this.al))try{this._instance._send_request(tk(tk({},e),{},{transport:"sendBeacon"}))}catch(e){rx.error(e)}this.al=[]}},oj=class{constructor(e){this._instance=e,this.Sl=()=>{var e,t,r,n;this.xl||(this.xl={});let i=this.scrollElement(),s=this.scrollY(),o=i?Math.max(0,i.scrollHeight-i.clientHeight):0,a=s+((null==i?void 0:i.clientHeight)||0),l=(null==i?void 0:i.scrollHeight)||0;this.xl.lastScrollY=Math.ceil(s),this.xl.maxScrollY=Math.max(s,null!=(e=this.xl.maxScrollY)?e:0),this.xl.maxScrollHeight=Math.max(o,null!=(t=this.xl.maxScrollHeight)?t:0),this.xl.lastContentY=a,this.xl.maxContentY=Math.max(a,null!=(r=this.xl.maxContentY)?r:0),this.xl.maxContentHeight=Math.max(l,null!=(n=this.xl.maxContentHeight)?n:0)}}get Cl(){return this._instance.config.scroll_root_selector}getContext(){return this.xl}resetContext(){let e=this.xl;return this.xl=void 0,setTimeout(this.Sl,0),e}startMeasuringScrollPosition(){nB(h,"scroll",this.Sl,{capture:!0}),nB(h,"scrollend",this.Sl,{capture:!0}),nB(h,"resize",this.Sl)}scrollElement(){var e,t;if(this.Cl){for(let t of U(this.Cl)?this.Cl:[this.Cl]){let r=null==h||null==(e=h.document)?void 0:e.querySelector(t);if(r)return r}return}return null==h||null==(t=h.document)?void 0:t.documentElement}$l(e){var t,r;if(this.Cl){let t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return h?"y"===e?h.scrollY||h.pageYOffset||(null==(t=h.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:h.scrollX||h.pageXOffset||(null==(r=h.document)||null==(r=r.documentElement)?void 0:r.scrollLeft)||0:0}scrollY(){return this.$l("y")}scrollX(){return this.$l("x")}};let oO=e=>sc(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes
45);var o$=class{constructor(e,t,r,n){this.Be=e=>{let t=this.Tl();if(t&&t.sessionId===e)return;let r={sessionId:e,props:this.Il(this._instance)};this.Ml.register({[nh]:r})},this._instance=e,this.El=t,this.Ml=r,this.Il=n||oO,this.El.onSessionId(this.Be)}Tl(){return this.Ml.props[nh]}getSetOnceProps(){var e;let t=null==(e=this.Tl())?void 0:e.props;return t?"r"in t?sh(t,this._instance.config.disable_capture_url_hashes):{$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(){let e={};return n$(nD(this.getSetOnceProps()),(t,r)=>{"$current_url"===r&&(r="url"),e[`$session_entry_${M(r)}`]=t}),e}},oI=class{on(e,t){return this.Pl[e]||(this.Pl[e]=[]),this.Pl[e].push(t),()=>{this.Pl[e]=this.Pl[e].filter(e=>e!==t)}}emit(e,t){for(let r of this.Pl[e]||[])r(t);for(let r of this.Pl["*"]||[])r(e,t)}constructor(){this.Pl={}}};let oL=rE("[SessionId]");var oM=class{on(e,t){return this.Rl.on(e,t)}constructor(e,t,r){var n;if(this.Al=null,this.Fl=null,this.Ol=[],this.Dl=void 0,this.Ll=!1,this.Rl=new oI,this.Nl=(e,t)=>!(!X(e)||!X(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rr=e.config,this.Ml=e.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.ql=void 0,this._sessionActivityTimestamp=null,this.jl=t||nz,this.Bl=r||nz;const i=this.Rr.persistence_name||this.Rr.token;if(this._sessionTimeoutMs=1e3*ed(this.Rr.session_idle_timeout_seconds||1800,60,36e3,oL.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hl(),this.zl="ph_"+i+"_window_id",this.Ul="ph_"+i+"_primary_window_exists",this.Wl()){const e=ii.Dt(this.zl),t=ii.Dt(this.Ul);e&&!t?this.He=e:ii.Lt(this.zl),ii.At(this.Ul,!0)}(null==(n=this.Rr.bootstrap)?void 0:n.sessionID)&&this.setBootstrapSessionId(this.Rr.bootstrap.sessionID),this.Vl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return q(this.Ol)&&(this.Ol=[]),this.Ol.push(e),this.Xt&&e(this.Xt,this.He),()=>{this.Ol=this.Ol.filter(t=>t!==e)}}Wl(){return"memory"!==this.Rr.persistence&&!this.Ml.mi&&ii.Et()}Gl(e){e!==this.He&&(this.He=e,this.Wl()&&ii.At(this.zl,e))}Zl(){return this.He?this.He:this.Wl()?ii.Dt(this.zl):null}Ql(e){let t=this.Al;return!K(t)&&!K(e)&&5e3>Math.abs(e-t)}Jl(e,t,r){let n=t!==this._sessionActivityTimestamp,i=e===this.Xt&&r===this._sessionStartTimestamp;this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.Xt=e,i&&!n||i&&this.Ql(t)||(this.Al=t,this.Ml.register({[rY]:[t,e,r]}))}Kl(){var e;let t=null==(e=this.Rr)?void 0:e.persistence_save_debounce_ms;return X(t)&&t>0}Xl(){this.Kl()?this.Ml.refreshKey(rY):(this.Ml.flush(),this.Ml.load())}Yl(){var e;if(K(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Al)return;this.Xl();let[,t,r]=this.tu();t===this.Xt&&r===this._sessionStartTimestamp&&(this.Al=this._sessionActivityTimestamp,this.Ml.register({[rY]:[this._sessionActivityTimestamp,null!=(e=this.Xt)?e:null,this._sessionStartTimestamp]}),this.Ml.flush())}eu(){let[e]=this.tu();return Math.max(X(e)?e:0,X(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}iu(e){return this.Xl(),this.Nl(e,this.eu())}tu(){let e=this.Ml.props[rY];return U(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Al=null,this.ql=void 0,clearTimeout(this.nu),this.nu=void 0,this.Jl(null,null,null)}setBootstrapSessionId(e,t=!1){let r=((e,t=(new Date).getTime())=>{try{let r=(e=>{let t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return r>t+6e4?void oL.error("Bootstrap sessionID cannot be in the future"):r}catch(e){return void oL.error("Invalid sessionID in bootstrap",e)}})(e);return!q(r)&&(t?this.ql={sessionId:e,sessionStartTimestamp:r}:this.Jl(e,(new Date).getTime(),r),!0)}destroy(){this.Ll=!0,this.Yl(),clearTimeout(this.nu),this.nu=void 0,this.Dl&&h&&(h.removeEventListener(nR,this.Dl,{capture:!1}),this.Dl=void 0),this.Ol=[]}Vl(){this.Dl=()=>{this.Yl(),this.Wl()&&ii.Lt(this.Ul)},nB(h,nR,this.Dl,{capture:!1})}
45checkAndGetSessionAndWindowId(e=!1,t=null,r=!1){if("always"===this.Rr.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');let n=t||(new Date).getTime(),i=this.Xt;if(r)this.Fl=n;else if(K(this.Fl)||this.Fl>n||n-this.Fl>=1e3){var s,o;null==(s=(o=this.Ml).syncCookieProperties)||s.call(o),this.Fl=n}let[,a,l]=this.tu(),u=!q(i)&&a!==i,c=this.eu(),h=this.Zl(),d=this.ql,p=!!d&&(d.sessionStartTimestamp>n+6e4||n-d.sessionStartTimestamp>864e5),f=d?p:X(l)&&Math.abs(n-l)>864e5,g=!1,m=u,v=!a||!!d,y=a,b=!v&&!e&&this.Nl(n,c);if(b&&((b=this.iu(n))||oL.info("cross-tab refresh kept the session alive",{sessionId:a}),[,a,l]=this.tu(),b||(v=!a||!!d)),v||b||f){m=!1;let e=d&&!p;a=e?d.sessionId:this.jl(),h=this.Bl(),oL.info("new session ID assigned",{sessionId:a,windowId:h,bootstrapped:!!e,changeReason:{noSessionId:v,activityTimeout:b,sessionPastMaximumLength:f}}),l=e?d.sessionStartTimestamp:n,this.ql=void 0,g=!0}else h||(h=this.Bl(),g=!0),(m=m||a!==y)&&(oL.info("adopted cross-tab session id",{sessionId:a,windowId:h}),g=!0);let _=X(c)&&e&&!f?c:n,w=X(l)?l:(new Date).getTime();this.Gl(h),this.Jl(a,_,w),e||this.Hl();let k={noSessionId:v,activityTimeout:b,sessionPastMaximumLength:f,crossTabAdoption:m};return g&&this.Ol.forEach(e=>e(a,h,k)),{sessionId:a,windowId:h,sessionStartTimestamp:w,changeReason:g?k:void 0,lastActivityTimestamp:c}}Hl(){this.Ll||(clearTimeout(this.nu),this.nu=setTimeout(()=>{if(!this.Ll)if(this.iu((new Date).getTime())){let e=this.Xt;this.resetSessionId(),this.Rl.emit("forcedIdleReset",{idleSessionId:e})}else this.Hl()},1.1*this.sessionTimeoutMs))}};let oD=function(e,t){if(!e)return!1;let r=e.userAgent;if(r&&eh(r,t))return!0;try{let r=null==e?void 0:e.userAgentData;if((null==r?void 0:r.brands)&&r.brands.some(e=>eh(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function oN(){return(oN=eu(function*(){let e=null==p?void 0:p.userAgentData;if(null==e?void 0:e.getHighEntropyValues)try{let t=yield e.getHighEntropyValues(["model"]),r=null==t?void 0:t.model;return G(r)&&r.length>0?r:void 0}catch(e){return void rx.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function oF(e){var t;return!!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)}let oB=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},oU=e=>e.toLowerCase(),oV={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>oB(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!oB(t,e))),icontains:(e,t)=>t.map(oU).some(t=>e.map(oU).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(oU).every(t=>e.map(oU).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{let r=parseFloat(t);return!isNaN(r)&&e.some(e=>r>parseFloat(e))}),lt:(e,t)=>t.some(t=>{let r=parseFloat(t);return!isNaN(r)&&e.some(e=>r<parseFloat(e))})};function oW(e,t){return!e||Object.entries(e).every(([e,r])=>{let n=null==t?void 0:t[e];if(null==n)return!1;let i=oV[r.operator];return!!i&&i(r.values.map(String),[String(n)])})}function oH(e,t,r){return i8({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}let oq="custom",oG="i.posthog.com",oz=/^\/static\//,oK=["/s/","/e/","/i/"];var oJ=class{constructor(e){this.su={},this.instance=e}get apiHost(){let e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){let e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${oG}`,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.su[this.apiHost]||(this.su[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":oq),this.su[this.apiHost]}ru(e){if(!oz.test(e))return;let t=this.instance.config.asset_host;return"string"==typeof t&&t.trim().replace(/\/$/,"")||void 0}ou(e){let t=i6(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}au(e,t,r){if("ui"===e)return r;let n=r,i=this.instance.config.rewriteRequestPath;if(i){var s;n=i(new URL((null==(s=i6(r))?void 0:s.href)||r)).toString()}if(i&&"api"===e&&oK.some(e=>0===t.indexOf(e))){let e=this.ou(n);if(e){let t=this.apiHost,r=this.lu;(null==r?void 0:r.apiHost)===t&&r.rewriteRequestPath===i||(r={apiHost:t,rewriteRequestPath:i,urls:new Set},this.lu=r),r.urls.add(e)}}return n}isIngestionEndpoint(e){let t=this.lu,r=this.ou(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&t.urls.has(r)}endpointFor(e,t=""){if(t&&(t="/"===t[0]?t:`/${t}`),"ui"===e)return this.au(e,t,this.uiHost+t);if("flags"===e)return this.au(e,t,this.flagsApiHost+t);if("assets"===e){let r=this.ru(t);if(r)return this.au(e,t,`${r}${t}`)}if(this.region===oq)return this.au(e,t,this.apiHost+t);let r=oG+t;switch(e){case"assets":return this.au(e,t,`https://${this.region}-assets.${r}`);case"api":return this.au(e,t,`https://${this.region}.${r}`)}}};let oY=rE("[Surveys]"),oX=e=>{try{let t=`seenSurvey_${e.current_iteration&&e.current_iteration>0?`${e.id}_${e.current_iteration}`:e.id}`;if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){oY.error("Failed to persist survey seen state",e)}}
45,oZ=["popover","widget","api"],oQ={ignoreConditions:!1,ignoreDelay:!1,displayType:s$},o0=rE("[PostHog ExternalIntegrations]"),o1={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var o2=class{constructor(e){this._instance=e}zo(e,t){var r,n;null==(r=x.__PosthogExtensions__)||null==(n=r.loadExternalDependency)||n.call(r,this._instance,e,e=>{if(e)return o0.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t,r,n;for(let[i,s]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!s||(null==(t=x.__PosthogExtensions__)||null==(t=t.integrations)?void 0:t[i])||this.zo(o1[i],()=>{var e;null==(e=x.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[i])||e.start(this._instance)}),!s&&(null==(r=x.__PosthogExtensions__)||null==(r=r.integrations)?void 0:r[i])&&(null==(n=x.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[i])||n.stop())}},o8=class{constructor(e,t){this.$=e,this.wo=t,this.uu=new Map,this.Io=!1}add(e){var t=this;return eu(function*(){if(t.Io)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.uu.has(e.name))throw Error(`Browser extension "${e.name}" is already registered`);t.uu.set(e.name,e);try{let r=e.setup(t.wo);r&&(yield r)}catch(n){let r=t.uu.get(e.name)===e;r&&t.uu.delete(e.name),t.$.error(`Failed to set up browser extension "${e.name}"`,n),r&&t.hu(e)}})()}getExtension(e){return this.uu.get(e)}dispose(){if(this.Io)return;this.Io=!0;let e=Array.from(this.uu.values()).reverse();for(let t of(this.uu.clear(),e))this.hu(t)}hu(e){try{var t;let r=null==(t=e.dispose)?void 0:t.call(e);r&&V(r.then)&&r.then(void 0,t=>{this.$.error(`Failed to dispose browser extension "${e.name}"`,t)})}catch(t){this.$.error(`Failed to dispose browser extension "${e.name}"`,t)}}},o6=class{constructor(e){this._instance=e}initialize(){}get(e){let t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);let r={};for(let n of e){let e=null==t?void 0:t.get_property(n);q(e)||(r[n]=e)}return r}set(e,t){var r;null==(r=this._instance.persistence)||r.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}};let o3="extensionsRemoteConfig";var o5=class{constructor(e){this.instance=e,this.Io=!1,this.$=rx,this.cu=e.du,this.kv=new o6(e),this.onEvent=e=>sI(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.$.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.Io)return sI(()=>{});let t=t=>{try{e(t)}catch(e){this.$.error("Browser extension remote config listener failed",e)}},r=this.instance.vu.on(o3,t);return this.cu&&t(this.cu),sI(r)},this.fu=new o8(rx.createLogger("[BrowserExtensions]"),this)}get logger(){return this.$}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property("$device_id"))?e:this.distinctId}get deviceId(){let e=this.instance.get_property(rj);return"string"==typeof e?e:void 0}get library(){return{name:S.LIB_NAME,version:S.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,r,n;let i=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==i?void 0:i.sessionId)?t:"",windowId:null!=(r=null==i?void 0:i.windowId)?r:"",sessionStartTimestamp:null!=(n=null==i?void 0:i.sessionStartTimestamp)?n:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.fu.add(e)}getExtension(e){return this.fu.getExtension(e)}capture(e,t,r){r?this.instance.capture(e,t,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):this.instance.capture(e,t)}registerDynamicEventProperties(e){return sI(this.instance.pu(e))}handleRemoteConfig(e){this.Io||(this.cu=e,this.instance.vu.emit(o3,e))}sendRequest(e){var t=this;return eu(function*(e,r={}){var n;let i=t.instance.requestRouter.endpointFor(null!=(n=r.target)?n:"api",e),s={method:r.method,url:r.query?op(i,r.query):i,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:"flags"===r.target&&"best-available"===r.compression?j.Base64:void 0,timestampMode:r.sentAt};return"sendBeacon"===r.transport?(t.instance._send_request(s),{statusCode:202}):new Promise(e=>
45{s.callback=e,t.instance._send_request(s)})}).apply(this,arguments)}dispose(){this.Io||(this.Io=!0,this.fu.dispose())}};let o4={},o9=0,o7=()=>{},ae='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',at="Surveys module not available",ar="sanitize_properties is deprecated. Use before_send instead",an="Invalid value for property_denylist config: ",ai=/^[A-Za-z0-9_-]{1,400}$/,as=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,ao=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,aa=["token","distinct_id",nv],al="posthog",au=e=>{var t;let r;return tk({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){let t=null==e?void 0:e.hostname;if(!G(t))return!1;let r=t.split(".").slice(-2).join(".");for(let e of nF)if(r===e)return!1;return!0}(null==f?void 0:f.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:o7,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:g&&G(null==g?void 0:g.search)&&-1!==g.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==h||null==(t=h.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(e){rx.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:nS,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:o7},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:iS,ignore_text_selection:!0}
45:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:(r={},e&&"unset"!==e&&("2025-11-30">e||(r.strictMinimumDuration=!0),"2026-05-30">e||(r.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(r.streamNetworkBody=!0),"2026-08-30">e||(r.captureJsonLd=!0)),r),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)})},ac=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],ah=e=>{let t={};for(let[r,n]of ac)q(e[r])||(t[n]=e[r]);let r=nI({},t,e),n=e.__preview_external_dependency_versioned_paths;return q(n)||(q(e.strict_script_versioning)&&(r.strict_script_versioning=!!n),G(n)&&q(e.asset_host)&&(r.asset_host=n)),U(e.property_blacklist)&&(q(e.property_denylist)?r.property_denylist=e.property_blacklist:U(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:rx.error(an+e.property_denylist)),r};var ad=class{constructor(){this.__forceAllowLocalhost=!1}get gu(){return this.__forceAllowLocalhost}set gu(e){rx.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},ap=class e{mu(e){if(!e)return;let t=this.uu.indexOf(e);-1!==t&&this.uu.splice(t,1)}yu(e,t){var r;return this.mu(e),this.uu.push(t),null==(r=t.initialize)||r.call(t),t}bu(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}_u(){let e,t,r;if(this.wu||this.config.reuseAnonymousId||this.config.segment||this.bu())return;let n="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(n||this.config.disable_persistence)&&(this.ku||(n?(e=`persistence is set to '${this.config.persistence}'`,t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",r="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",r="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.wu=!0,console.warn("[PostHog.js]",`${e} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${t}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${r}`)))}Su(){if(this.bu()||"$posthog_cookieless"!==this.get_distinct_id())return;let e=this.persistence;if(!e)return;this.xu()||e.load(!0);let t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){let t=this.config.get_device_id(nz());this.register({distinct_id:t,$device_id:t}),e.set_property(nc,nx)}this.Cu()}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){var t;this.$u=!1,this.Tu=!1,this.webPerformance=new ad,this.Iu=!1,this.version=S.LIB_VERSION,this.Mu=new Set,this.Eu="",this.vu=new oI,this.uu=[],this.Pu=[],this.ku=!1,this.wu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=au(),this.SentryIntegration=iX,this.sentryIntegration=e=>{let t;return t=iY(this,e),{name:iJ,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ru=!1,this.Au=null,this.Fu=null,this.Ou=null,this.scrollManager=new oj(this),this.pageViewM
45anager=new iZ(this),this.rateLimiter=new sM(this),this.requestRouter=new oJ(this),this.consent=new is(this),this.externalIntegrations=new o2(this);const r=null!=(t=e.__defaultExtensionClasses)?t:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.metrics=r.metrics&&new r.metrics(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:(e,t,r)=>{let n=G(e)?{[e]:t}:e;this.setPersonProperties(n),null==r||r({})},set_once:(e,t,r)=>{let n=G(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),null==r||r({})}},this.on("eventCaptured",e=>rx.info(`send "${null==e?void 0:e.event}"`,e))}init(t,r,n){if(n&&n!==al){var i;let s=null!=(i=o4[n])?i:new e;return s._init(t,r,n),o4[n]=s,o4[al][n]=s,s}return this._init(t,r,n)}_init(e,t={},r){var n,i,s,o;let a=G(e)?e.trim():"";if(!a)return rx.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 a!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=au(t.defaults),t.debug=this.Du(t.debug),this.Lu=t,this.Nu=[],t.person_profiles?this.Fu=t.person_profiles:t.process_person&&(this.Fu=t.process_person);let l=au(t.defaults),u=ah(t),c=nI({},l,u,{name:r,token:a});W(l.rageclick)&&W(u.rageclick)&&(c.rageclick=nI({},l.rageclick,u.rageclick)),W(l.session_recording)&&W(u.session_recording)&&(c.session_recording=nI({},l.session_recording,u.session_recording)),this.set_config(c),this.config.on_xhr_error&&rx.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:sP;let d=this.xu();if(this.persistence=new sS(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sS(tk(tk({},this.config),{},{persistence:"sessionStorage"}),d,!1),this.Eu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&ii.Et()){let e=ii.Dt(this.Eu);U(e)&&e.forEach(e=>{G(e)&&this.Mu.add(e)})}else ii.Lt(this.Eu);let p=tk({},this.persistence.props),f=tk({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.qu=new oT((e,t)=>this.ju(e,t),this.config.request_queue_config),this.Bu=new oC(this),this.__request_queue=[];let g=this.bu();g||(this.sessionManager=new oM(this),this.sessionPropsManager=new o$(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,r)=>{((null==r?void 0:r.activityTimeout)||(null==r?void 0:r.sessionPastMaximumLength)||(null==r?void 0:r.crossTabAdoption))&&this.Hu()})),this.zu(),this.config.__preview_deferred_init_extensions?(rx.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Uu(g)},0)):(rx.info("Initializing extensions synchronously"),this.Uu(g)),S.DEBUG=S.DEBUG||this.config.debug,S.DEBUG&&rx.info("Starting in debug mode",{this:this,config:t,thisC:tk({},this.config),p:p,s:f}),!this.config.identity_distinct_id||(null==(n=t.bootstrap)?void 0:n.distinctID)||(t.bootstrap=tk(tk({},t.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));let m=null==(i=t.bootstrap)?void 0:i.distinctID;if(this.ku=!!m&&!z(m),null==(s=t.bootstrap)?void 0:s.distinctID){let e=t.bootstrap.distinctID,r=this.get_distinct_id(),n=this.persistence.get_property(nc);if(t.bootstrap.isIdentifiedID&&null!=r&&r!==e&&"anonymous"===n)this.identify(e);else if(t.bootstrap.isIdentifiedID&&null!=r&&r!==e&&"identified"===n)rx.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{let r=this.config.get_device_id(nz()),n=t.bootstrap.isIdentifiedID?r:e;this.persistence.set_property(nc,t.bootstrap.isIdentifiedID?nE:nx),this.register({distinct_id:e,$device_id:n})}}if(g)this.register_once({distinct_id:nm,$device_id:null},"");else if(!this.get_distinct_id()){let e=this.config.get_device_id(nz());this.register_once({distinct_id:e,$device_id:e},""),this.persistence.set_property(nc,nx)}return nB(h,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),nB(h,"pageshow",()=>{var e;this.$u=!1,this.Tu||null==(e=this.Bu)||e.resume()}),t.segment?iK(this,()=>this.Wu()):this.Wu(),V(this.config._onCapture)&&this.config._onCapture!==o7&&(rx.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&rx.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return oN.apply(this,arguments)})().then(e=>{e&&this.register({[rO]:e})}).catch(o7),this}Vu(e){return G(e.name)&&V(e.setup)}Gu(e,t){this.Vu(e)?t.push(()=>{this.Zu().add(e).catch(()=>{var t;return null==(t=e.dispose)?void 0:t.call(e)}).catch(t=>{rx.error(`Failed to dispose browser extension "${e.name}"`,t)})}):this.uu.push(e)}zu(){var t,r,n,i,s,o;let a=null!=(t=null==(r=this.config.__extensionClasses)?void 0:r.featureFlags)?t:null==(n=e.__defaultExtensionClasses)?void 0:n.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(i=this.Qu)||i.call(this),this.Qu=void 0,this.featureFlags=new a(this)),V(this.featureFlags.onReloading)&&V(this.featureFlags.setup)?this.Qu||(this.Qu=this.featureFlags.onReloading(()=>{this.vu.emit("featureFlagsReloading",!0)}),this.Zu().add(this.featureFlags)):null==(s=(o=this.featureFlags).initialize)||s.call(o))}Uu(t){var r,n,i,s,o,a,l;let u=performance.now(),c=tk(tk({},e.__defaultExtensionClasses),this.config.__extensionClasses),h=[];c.exceptions&&this.uu.push(this.exceptions=null!=(r=this.exceptions)?r:new c.exceptions(this)),c.historyAutocapture&&this.uu.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.uu.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.uu.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!t&&this.uu.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.Gu(this.autocapture=new c.autocapture(this),h),c.surveys&&this.Gu(this.surveys=null!=(n=this.surveys)?n:new c.surveys(this),h),c.logs&&this.Gu(this.logs=null!=(i=this.logs)?i:new c.logs(this),h),c.metrics&&this.uu.push(this.metrics=null!=(s=this.metrics)?s:new c.metrics(this)),c.conversations&&this.uu.push(this.conversations=null!=(o=this.conversations)?o:new c.conversations(this)),c.productTours&&this.uu.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.uu.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.uu.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.uu.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.uu.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,iq)),c.toolbar&&this.uu.push(this.toolbar=null!=(a=this.toolbar)?a:new c.toolbar(this)),c.experiments&&this.uu.push(this.experiments=null!=(l=this.experiments)?l:new c.experiments(this)),this.uu.forEach(e
45=>{e.initialize&&h.push(()=>{var t;null==(t=e.initialize)||t.call(e)})}),h.push(()=>{if(this.Ju){let e=this.Ju;this.Ju=void 0,this.uu.forEach(t=>{var r;return null==(r=t.onRemoteConfig)?void 0:r.call(t,e)})}}),this.Ku(h,u)}Ku(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Ku(e,t)},0);let r=e.shift();if(r)try{r()}catch(e){rx.error("Error initializing extension:",e)}}let r=Math.round(performance.now()-t);this.register_for_session({[ny]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[nb]:r}),this.config.__preview_deferred_init_extensions&&rx.info(`PostHog extensions initialized (${r}ms)`)}il(e){var t,r;if(!f||!f.body)return rx.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.il(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ju=e),this.du=e,this.compression=void 0,e.ok){let t=e.config;t.supportedCompression&&!this.config.disable_compression&&(this.compression=I(t.supportedCompression,sP)?sP:I(t.supportedCompression,sR)?sR:void 0),(null==(r=t.analytics)?void 0:r.endpoint)&&(this.analyticsDefaultEndpoint=t.analytics.endpoint)}this.set_config({person_profiles:this.Fu?this.Fu:nS}),null==(t=this.Xu)||t.handleRemoteConfig(e),this.uu.forEach(t=>{var r;return null==(r=t.onRemoteConfig)?void 0:r.call(t,e)})}Wu(){try{this.config.loaded(this)}catch(e){rx.critical("`loaded` function failed",e)}if(this.Yu(),this.config.internal_or_test_user_hostname&&(null==g?void 0:g.hostname)){let e=g.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.bu())&&this.th()},1),this.eh=new sN(this),this.eh.load()}Yu(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.qu)||e.enable())}_dom_loaded(){this.is_capturing()&&nO(this.__request_queue,e=>this.ju(e)),this.__request_queue=[],this.Yu()}_handle_unload(){var e,t,r,n,i,s;this.$u=!0,null==(e=this.surveys)||null==(t=e.handlePageUnload)||t.call(e),null==(r=this.metrics)||r.flush("sendBeacon"),this.config.request_batching?(this.ih()&&this.capture(nA),null==(n=this.logs)||n.flushLogs("sendBeacon"),null==(i=this.qu)||i.unload(),null==(s=this.Bu)||s.unload()):this.ih()&&this.capture(nA,null,{transport:"sendBeacon"})}_send_request(e){oR(this,e)}ju(e,t){this.Bu?this.Bu.retriableRequest(e,t):this._send_request(t?tk(tk({},e),{},{transport:t}):e)}_execute_array(e){o9++;try{let t,r=[],n=[],i=[];nO(e,e=>{if(e)if(t=e[0],U(t))i.push(e);else if(V(e))try{e.call(this)}catch(t){rx.error("Error executing queued PostHog call",e,t)}else U(e)&&"alias"===t?r.push(e):U(e)&&-1!==t.indexOf("capture")&&V(this[t])?i.push(e):n.push(e)});let s=function(e,t){nO(e,function(e){try{if(U(e[0])){let r=t;n$(e,function(e){r=r[e[0]].apply(r,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){rx.error("Error executing queued PostHog call",e,t)}})};s(r,this),s(n,this),s(i,this)}finally{o9--}}push(t){if(o9>0&&U(t)&&G(t[0])){let r=e.prototype[t[0]];return void(V(r)&&r.apply(this,t.slice(1)))}this._execute_array([t])}get nh(){return{property:rI,persistenceKey:rL,cookieName:"_fbc",pattern:as,register:(e,t)=>{var r;return null==(r=this.persistence)?void 0:r.register({[rL]:{value:e,delivered:t}})},unregister:()=>{var e;return null==(e=this.persistence)?void 0:e.unregister(rL)}}}get sh(){return{property:rM,persistenceKey:rD,cookieName:"_fbp",pattern:ao,register:(e,t)=>{var r;return null==(r=this.persistence)?void 0:r.register({[rD]:{value:e,delivered:t}})},unregister:()=>{var e;return null==(e=this.persistence)?void 0:e.unregister(rD)}}}rh(e){var t;let r=null==(t=this.persistence)?void 0:t.get_property(e.persistenceKey);return G(r)&&e.pattern.test(r)?{value:r,delivered:!1}:W(r)&&G(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:!0===r.delivered}:void 0}oh(e,t,r){return t===(null==r?void 0:r.value)?{value:t,pending:!r.delivered}:(e.register(t,!1),{value:t,pending:!0})}ah(e){if(!this.config.save_campaign_params||this.bu())return;let t=nV(e.cookieName);return G(t)&&e.pattern.test(t)?t:void 0}uh(e,t,r,n){if(!this.persistence)return;let i=this.nh;this.persistence.refreshKey(i.persistenceKey);let s=this.rh(i);if(n)return void i.unregister();if(r)return G(t)&&as.test(t)?this.oh(i,t,s):void i.unregister();let o=G(e)&&ai.test(e)?e:void 0,a=this.ah(i);return a&&((e,t,r)=>{let n=e.split(".");if(t)return n[3]===t;if(!r)return!0;let i=r.value.split(".");return n[3]===i[3]||Number(n[2])>Number(i[2])})(a,o,s)?this.oh(i,a,s):o?(null==s?void 0:s.value.split(".")[3])===o?{value:s.value,pending:!s.delivered}:this.oh(i,`fb.1.${Date.now()}.${o}`,s):s?{value:s.value,pending:!s.delivered}:void 0}hh(e,t,r){if(!this.persistence)return;let n=this.sh;this.persistence.refreshKey(n.persistenceKey);let i=this.rh(n);if(r)return void n.unregister();if(t)return G(e)&&ao.test(e)?this.oh(n,e,i):void n.unregister();let s=this.ah(n);return s?this.oh(n,s,i):i?{value:i.value,pending:!i.delivered}:void 0}dh(e,t){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);let r=this.rh(e);(null==r?void 0:r.value)!==t||r.delivered||e.register(t,!0)}capture(e,t,r){var n,i,s,o,a,l,u,c;let h,d;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.qu))return void rx.uninitializedWarning("posthog.capture");
45if(!this.is_capturing())return;if(q(e)||!G(e))return void rx.error("No event name provided to posthog.capture");this.Su();let p=!this.config.opt_out_useragent_filter&&this._is_bot();if(p&&!this.config.__preview_capture_bot_pageviews)return;let f=(null==r?void 0:r.skip_client_rate_limiting)?void 0:this.rateLimiter.clientRateLimitContext();if(null==f?void 0:f.isRateLimited)return void rx.critical("This capture call is ignored due to client rate limiting.");(null==t?void 0:t.$current_url)&&!G(null==t?void 0:t.$current_url)&&(rx.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||(null==r?void 0:r.fh)||rx.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(h=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();let g=new Date,m=(null==r?void 0:r.timestamp)||g,v=tp(null==r?void 0:r.uuid,nz),y={uuid:v,event:e,properties:this.calculateEventProperties(e,t||{},m,v)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&p&&(y.event="$bot_pageview",y.properties.$browser_type="bot"),f&&(y.properties.$lib_rate_limit_remaining_tokens=f.remainingTokens);let b="$feature_flag_called"===e&&!1===y.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");(null==r?void 0:r.$set)&&!b&&(y.$set=null==r?void 0:r.$set);let _=W(null==t?void 0:t.$set)?t.$set:void 0,w=U(null==t?void 0:t.$unset)?t.$unset:[],k=(null==r?void 0:r.$unset)||[],x=e=>{var t;let n=!!(null==r?void 0:r.$set)&&e in r.$set;return{hasProvided:n||!!_&&e in _,provided:n?null==r||null==(t=r.$set)?void 0:t[e]:null==_?void 0:_[e],unset:-1!==w.indexOf(e)||-1!==k.indexOf(e)}},E=x(rI),S=x(rM),P=[{channel:this.nh,hasProvided:E.hasProvided,update:this.uh(null==h?void 0:h.fbclid,E.provided,E.hasProvided,E.unset)},{channel:this.sh,hasProvided:S.hasProvided,update:this.hh(S.provided,S.hasProvided,S.unset)}];for(let{channel:e,hasProvided:t,update:r}of P)r&&!0===y.properties.$process_person_profile&&r.pending&&!t&&!b&&(y.$set=tk({[e.property]:r.value},y.$set));let R=null==r?void 0:r.$unset;R&&(y.$unset=R);let T=b?void 0:this.ph(null==r?void 0:r.$set_once,e!==nj,e===nC);if(T&&(y.$set_once=T),(null==r?void 0:r._noTruncate)||(s=this.config.properties_string_max_length,a=y,l=e=>G(e)?e.slice(0,s):e,d=new Set,y=function e(t,r){let n;if(t!==Object(t))return l?l(t):t;if(!d.has(t)){if(d.add(t),U(t))n=[],nO(t,t=>{n.push(e(t))});else{let r={};n$(en(t)?nN(t):t,(t,n)=>{d.has(t)||(r[n]=e(t,n))}),n=r}return n}}(a)),y.timestamp=m,q(null==r?void 0:r.timestamp)||(y.properties.$event_time_override_provided=!0,y.properties.$event_time_override_system_time=g),b&&(y.properties=((e,t=[])=>{let r={},n=t=>{void 0!==e[t]&&(r[t]=e[t])};return t3.forEach(n),t.forEach(n),r})(y.properties,aa)),e===sj||e===sO){let r,n=null==t?void 0:t.$survey_id,i=null==t?void 0:t.$survey_iteration;oX({id:n,current_iteration:i}),y.$set=tk(tk({},y.$set),{},{[(u={id:n,current_iteration:i},c=e===sO?"responded":"dismissed",r=`$survey_${c}/${u.id}`,u.current_iteration&&u.current_iteration>0&&(r=`$survey_${c}/${u.id}/${u.current_iteration}`),r)]:!0})}else e===sC&&(y.$set=tk(tk({},y.$set),{},{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){let e=null==t?void 0:t.$product_tour_type;e&&(y.$set=tk(tk({},y.$set),{},{[`$product_tour_last_seen_date/${e}`]:(new Date).toISOString()}))}let A=tk(tk({},y.properties.$set),y.$set);if(H(A)||this.setPersonPropertiesForFlags(A),!J(this.config.before_send)){let e=this.Os(y);if(!e)return;(y=e).uuid=tp(y.uuid,nz)}let C=P.filter(({channel:e,update:t})=>{var r,n,i;let s=null!=(r=null==(n=y.$set)?void 0:n[e.property])?r:W(null==(i=y.properties)?void 0:i.$set)?y.properties.$set[e.property]:void 0;return(null==t?void 0:t.pending)&&s===t.value});this.vu.emit("eventCaptured",y);let j=null!=(n=null==r?void 0:r._url)?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),O="recordings"===(null==r?void 0:r._batchKey)||/\/s\/(?:\?|$)/.test(j),$=tk(tk(tk({method:"POST",url:j,data:y,compression:"best-available",preferSyncCompression:null==r?void 0:r.send_instantly,timestampMode:O?"body":"capture-body",batchKey:null==r?void 0:r._batchKey},O&&(null==(i=y.properties)?void 0:i.$session_id)?{batchGroup:y.properties.$session_id+(y.properties.$window_id?`-${y.properties.$window_id}`:"")}:{}),(null==r?void 0:r.transport)?{transport:r.transport}:{}),C.length?{fireCallbackOnDrop:!0,callback:e=>{if(e.statusCode>=200&&300>e.statusCode)for(let{channel:e,update:t}of C)this.dh(e,t.value)}}:{});if(!this.config.request_batching||r&&!(null==r?void 0:r._batchKey)||(null==r?void 0:r.send_instantly)||C.length){let e;!$.transport&&!$.callback&&H(null!=(o=this.config.request_headers)?o:{})&&this.$u&&(e="sendBeacon"),this.ju($,e)}else this.qu.enqueue($);return y}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.Xu)?void 0:t.getExtension(e)}Zu(){var e;
45return null!=(e=this.Xu)?e:this.Xu=new o5(this)}pu(e){this.Pu.push(e);let t=!0;return()=>{if(!t)return;t=!1;let r=this.Pu.indexOf(e);-1!==r&&this.Pu.splice(r,1)}}gh(e=!0){var t,r,n;return!!(null==(t=this.persistence)?void 0:t.consumeCookieIdentityChange())&&(this.Ou=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(n=this.sessionPersistence)||n.clear(),this.Mu.clear(),this.mh()),null==(r=this.featureFlags)||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,r,n,i){let s;if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.gh();let o=i?void 0:this.persistence.remove_event_timer(e),a=tk({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.bu()&&(a[nv]=!0),"$snapshot"===e){let e=tk(tk({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=e.distinct_id,(!G(a.distinct_id)&&!Y(a.distinct_id)||z(a.distinct_id))&&rx.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}let l=function(e,t,r,n=!1){var i,s,o,a;let l,u;if(!_)return{};let c=e?[...se,...t||[]]:[],[d,p]=tr(_),[f,m]=function(e){for(let t=0;to.length>t;t++){let[r,n,i]=to[t],s=e.match(r);if(s){let t=i&&e.match(i)||s;return[n,(null==t?void 0:t[1])||""]}}return["",""]}(_),v=(null==(l="u">typeof navigator?navigator:void 0)?void 0:l.brave)?{brave:!0}:{},y={};q(r)||(y.detectGoogleSearchApp=r);let b={},w=null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,k=null==(s=navigator)?void 0:s.maxTouchPoints,x=null==h||null==(o=h.screen)?void 0:o.width,E=null==h||null==(a=h.screen)?void 0:a.height,P=null==h?void 0:h.devicePixelRatio;q(w)||(b.userAgentDataPlatform=w),q(k)||(b.maxTouchPoints=k),q(x)||(b.screenWidth=x),q(E)||(b.screenHeight=E),q(P)||(b.devicePixelRatio=P);let R=nI(nD({$os:d,$os_version:p,$browser:e9(_,navigator.vendor,v,y),$webview_app:f,$webview_app_version:m,$device:tn(_),$device_type:ti(_,b),$timezone:sd(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:i5(n?tg(null==g?void 0:g.href):null==g?void 0:g.href,c,sr),$host:null==g?void 0:g.host,$pathname:null==g?void 0:g.pathname,$raw_user_agent:_.length>1e3?_.substring(0,997)+"...":_,$browser_version:te(_,navigator.vendor,v,y),$browser_language:sa(),$browser_language_prefix:"string"==typeof(u=sa())?u.split("-")[0]:void 0,$screen_height:null==h?void 0:h.screen.height,$screen_width:null==h?void 0:h.screen.width,$viewport_height:null==h?void 0:h.innerHeight,$viewport_width:null==h?void 0:h.innerWidth,$lib:S.LIB_NAME,$lib_version:S.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return S.SDK_DIST_CHANNEL&&(R.$sdk_dist_channel=S.SDK_DIST_CHANNEL),R}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){let{sessionId:e,windowId:t}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);a.$session_id=e,a.$window_id=t}this.sessionPropsManager&&nI(a,this.sessionPropsManager.getSessionProps());try{var u;this.sessionRecording&&nI(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(u=this.Bu)?void 0:u.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===oq&&(a.$lib_custom_api_host=this.config.api_host),s="$pageview"!==e||i?"$pageleave"!==e||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),a=nI(a,s),"$pageview"===e&&f&&(a.title=f.title),!q(o)){let e=r.getTime()-o;a.$duration=parseFloat((e/1e3).toFixed(3))}_&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");let c=this.persistence.properties(),d=this.sessionPersistence.properties(),p=a.$groups,m=c.$groups;W(p)&&!H(p)&&(a.$groups=tk(tk({},W(m)?m:{}),p)),n$(["$referrer","$referring_domain"],e=>{e in c&&delete d[e]});let v={};if(this.Pu.length>0)for(let e of this.Pu.slice())try{nI(v,e())}catch(e){rx.error("Failed to produce browser extension event properties",e)}(a=nI({},l,c,d,tk(tk({},v),a))).$is_identified=this._isIdentified(),U(this.config.property_denylist)?n$(this.config.property_denylist,function(e){delete a[e]}):rx.error(an+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let y=this.config.sanitize_properties;y&&(rx.error(ar),a=y(a,e));let b=this.yh();return a.$process_person_profile=b,b&&!i&&this.bh("_calculate_event_properties"),a}ph(e,t=!0,r=!1){var n;if(!this.persistence||!this.yh()||this.Iu&&!r)return e;let i=nI({},this.persistence.get_initial_props(),(null==(n=this.sessionPropsManager)?void 0:n.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(rx.error(ar),i=s(i,"$set_once")),t&&(this.Iu=!0),H(i)?void 0:i}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var n;null==(n=this.persistence)||n.register_once(e,t,r)}register_for_session(e){var t,r;null==(t=this.persistence)||t.syncCookieProperties(),this.gh(),null==(r=this.sessionPersistence)||r.register(e),Object.keys(e).forEach(e
45=>this.Mu.add(e)),this.mh()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.Mu.delete(e),this.mh()}_h(e,t){this.register({[e]:t})}Hu(){this.Mu.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.Mu.clear(),this.mh()}mh(){var e;if(!this.Eu)return;if("memory"===this.config.persistence||(null==(e=this.sessionPersistence)?void 0:e.mi)||!ii.Et())return void ii.Lt(this.Eu);let t=[];this.Mu.forEach(e=>t.push(e)),t.length>0?ii.At(this.Eu,t):ii.Lt(this.Eu)}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var r,n;return null!=(r=null==(n=this.featureFlags)?void 0:n.isFeatureEnabled(e,t))?r:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var n;null==(n=this.featureFlags)||n.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var n;null==(n=this.featureFlags)||n.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t=!1,r){var n;return null==(n=this.featureFlags)?void 0:n.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.vu.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:at}),()=>{})}onSessionId(e){var t,r;return null!=(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))?t:()=>{}}getSurveys(e,t=!1){this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:at})}getActiveMatchingSurveys(e,t=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:at})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t=oQ){var r;null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!=(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))?t:{visible:!1,disabledReason:at}}canRenderSurveyAsync(e,t=!1){var r,n;return null!=(r=null==(n=this.surveys)?void 0:n.canRenderSurveyAsync(e,t))?r:Promise.resolve({visible:!1,disabledReason:at})}wh(e){return!e||z(e)?(rx.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(rx.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(rx.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return rx.uninitializedWarning("posthog.identify");if(Y(e)&&(e=e.toString(),rx.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.wh(e)||!this.bh("posthog.identify"))return;this.Su();let n=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==n,s=this.gh(!1),o=this.persistence.Da(),a=!1;try{let n=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:n},""),e!==n&&e!==this.get_property("__alias")&&(this.unregister(r$),this.register({distinct_id:e}));let o=(this.persistence.get_property("$user_state")||"anonymous")===nx,u=e!==n,c=!u&&o;if(u&&o){var l;let i=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:n};this.persistence.set_property(nc,nE),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$identify",i,{$set:t||{},$set_once:r||{}})&&(this.Ou=oH(e,t,r)),null==(l=this.featureFlags)||l.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:n)}else if(c){this.persistence.set_property(nc,nE);let n=t||{},i=r||{};this.setPersonPropertiesForFlags({$set:n,$set_once:i},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$set",{$set:n,$set_once:i})&&(this.Ou=oH(e,t,r))}else(t||r)&&this.setPersonProperties(t,r);u||i||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(no)):c&&(t||r)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.ja(a)}}setPersonProperties(e,t){if(!e&&!t||!this.bh("posthog.setPersonProperties"))return;let r=oH(this.get_distinct_id(),e,t);this.Ou!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}})&&(this.Ou=r)):rx.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var t;let r=(U(e)?e:[e]).filter(e=>G(e)&&e.length>0);0!==r.length&&this.bh("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Ou=null)}group(e,t,r){var n;if(!e||!t)return void rx.error("posthog.group requires a group type and group key");null==(n=this.persistence)||n.syncCookieProperties(),this.gh();let i=this.getGroups(),s=i[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:tk(tk({},i),{},{[e]:t})}),(s||r)&&this.yh()){let n={$group_type:e,$group_key:t};r&&(n.$group_set=r),this.capture(nj,n)}r&&this.setGroupPropertiesForFlags({[e]:r}),s&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t=!0){var r;null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e=!0){var t;null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t=!0){var r;this.bh("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){let t=Z(e)?e:null==e?void 0:e.resetDeviceID,r=Z(e)||null==e?void 0:e.bootstrap;this.kh(t,!1,r)}kh(e,t=!1,r){var n,i,s,o,a,l,u,c,h,d,p,f,g,m,v,y,b,_,w,k,x;if(rx.info("reset"),!this.__loaded)return rx.uninitializedWarning("posthog.reset");let E=null==r?void 0:r.sessionID;this.config.bootstrap=r||(null==(n=this.Lu)?void 0:n.bootstrap)||{},null==(i=this.featureFlags)||null==(s=i.updateConfig)||s.call(i,this.config,this.nl());let S=this.get_property(rj),P=this.get_property(rO),R=this.get_property(rJ);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();let T=this.is_capturing();this.consent.reset(),t||!T||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");let A=null==(a=this.persistence)||null==(l=a.Da)?void 0:l.call(a),C=!1;try{if(null==(u=this.persistence)||u.clear(),null==(c=this.sessionPersistence)||c.clear(),this.Mu.clear(),this.mh(),q(R)||null==(y=this.persistence)||y.register({$session_recording_remote_config:R}),null==(h=this.surveys)||h.reset(),null==(d=this.featureFlags)||d.reset(),null==(p=this.conversations)||p.reset(),null==(f=this.logs)||f.reset(),null==(g=this.metrics)||g.reset(),null==(m
45=this.persistence)||m.set_property("$user_state","anonymous"),null==(v=this.sessionManager)||v.resetSessionId(),this.Ou=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:nm,$device_id:null},"");else{let t=this.config.get_device_id(nz());this.register_once({distinct_id:t,$device_id:e?t:S},""),e||q(P)||this.register({[rO]:P})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),r&&(r.distinctID&&!this.bu()&&(null==(w=this.persistence)||w.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),null==(b=this.featureFlags)||b.initialize(),!J(E)&&!(null==(_=this.sessionManager)?void 0:_.setBootstrapSessionId(E,!0)))){let e=tk({},r);delete e.sessionID,this.config.bootstrap=e}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,C=!0}finally{A&&(null==(k=this.persistence)||null==(x=k.ja)||x.call(k,C))}this.reloadFeatureFlags()}shutdown(e){var t=this;return eu(function*(){var e,r,n,i,s,o,a,l,u;if(t.__loaded){t.Tu=!0,t.Zu().dispose(),null==(e=t.sessionRecording)||e.dispose(),null==(r=t.logs)||r.flushLogs("sendBeacon"),null==(n=t.metrics)||n.flush("sendBeacon"),null==(i=t.metrics)||i.dispose(),null==(s=t.qu)||s.unload(),null==(o=t.Bu)||o.unload();try{null==(u=t.featureFlags)||u.destroy()}catch(e){rx.error("Error while destroying feature flags",e)}null==(a=t.persistence)||a.destroy(),null==(l=t.sessionPersistence)||l.destroy()}else rx.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r.Sh()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e.xh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";let{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${t}`);if((null==e?void 0:e.withTimestamp)&&r){var i;let t=null!=(i=e.timestampLookBack)?i:10;if(!r)return n;n+=`?t=${Math.max(Math.floor(((new Date).getTime()-r)/1e3)-t,0)}`}return n}alias(e,t){return e===this.get_property("$people_distinct_id")?(rx.critical("Attempting to create alias for existing People user - aborting."),-2):this.bh("posthog.alias")?(q(t)&&(t=this.get_distinct_id()),e!==t?(this._h(r$,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(rx.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){let t=tk({},this.config);if(W(e)){var r,n,i,s,o,a,l,u,c,h,d,p,f,g,m;nI(this.config,ah(e));let v=this.xu();null==(r=this.persistence)||r.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sS(tk(tk({},this.config),{},{persistence:"sessionStorage"}),v,!1);let y=this.Du(this.config.debug);Z(y)&&(this.config.debug=y),Z(this.config.debug)&&(this.config.debug?(S.DEBUG=!0,n0.Et()&&n0.At("ph_debug",!0),rx.info("set_config",{config:e,oldConfig:t,newConfig:tk({},this.config)})):(S.DEBUG=!1,n0.Et()&&n0.Lt("ph_debug"))),null==(n=this.featureFlags)||null==(i=n.updateConfig)||i.call(n,this.config,this.nl()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.metrics)||a.onConfigChange(),null==(l=this.sessionRecording)||l.startIfEnabledOrStop(),null==(u=this.tracingHeaders)||u.startIfEnabledOrStop(),null==(c=this.autocapture)||c.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(m=this.historyAutocapture)||m.startIfEnabledOrStop()),null==(d=this.exceptionObserver)||d.startIfEnabledOrStop(),null==(p=this.deadClicksAutocapture)||p.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.Cu(),null==(g=this.externalIntegrations)||g.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&iK(this,o7,!1)}}_overrideSDKInfo(e,t){S.LIB_NAME=e,S.LIB_VERSION=t}startSessionRecording(e){var t,r,n,i,s;let o=!0===e,a={sampling:o||!!(null==e?void 0:e.sampling),linked_flag:o||!!(null==e?void 0:e.linked_flag),url_trigger:o||!!(null==e?void 0:e.url_trigger),event_trigger:o||!!(null==e?void 0:e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(n=this.sessionRecording)||n.overrideLinkedFlag()),a.url_trigger&&(null==(i=this.sessionRecording)||i.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(null==(e=this.sessionRecording)?void 0:e.started)}captureException(e,t){try{if(!this.exceptions)return;let r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(tk(tk({},r),t))}catch(e){return}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var t,r;return null!=(t=null==(r=this.logs)?void 0:r.logger)?t:e.Ch}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!=(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e;let t=null!=(e=this.config.name)?e:al;return t!==al&&(t="posthog."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))}yh(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&
45!this._isIdentified()&&H(this.getGroups())&&!(null==(e=this.persistence)||null==(e=e.props)?void 0:e.__alias)&&!(null==(t=this.persistence)||null==(t=t.props)?void 0:t.$epp))}ih(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.yh()||this.bh("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bh("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bh(e){return"never"===this.config.person_profiles?(rx.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._u(),this._h(ng,!0),!0)}xu(){if("always"===this.config.cookieless_mode)return!0;let e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}Cu(){var e,t,r,n,i;let s=this.xu();return this.is_capturing()||null==(r=this.logs)||r.$h(),(null==(e=this.persistence)?void 0:e.mi)!==s&&(null==(n=this.persistence)||n.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.mi)!==s&&(null==(i=this.sessionPersistence)||i.set_disabled(s)),s&&(this.Mu.clear(),this.mh()),s}opt_in_capturing(t){var r,n,i,s,o,a,l,u,c,h,d;if("always"!==this.config.cookieless_mode){if(this.bu()){null==(n=this.sessionRecording)||n.dispose({discardBufferedEvents:!0}),this.kh(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(s=this.pageViewManager)||s.destroy(),this.sessionManager=new oM(this),this.pageViewManager=new iZ(this),this.persistence&&(this.sessionPropsManager=new o$(this,this.sessionManager,this.persistence));let t=null!=(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)?o:null==(l=e.__defaultExtensionClasses)?void 0:l.sessionRecording;t&&(this.sessionRecording=this.yu(this.sessionRecording,new t(this)),this.du&&(null==(u=this.sessionRecording)||null==(c=u.onRemoteConfig)||c.call(u,this.du)))}this.consent.optInOut(!0),this.Cu(),this.Yu(),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(h=this.surveys)||h.loadIfEnabled()),(q(null==t?void 0:t.captureEventName)||(null==t?void 0:t.captureEventName))&&this.capture(null!=(d=null==t?void 0:t.captureEventName)?d:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.th()}else rx.warn(ae)}opt_out_capturing(){var e,t;if("always"===this.config.cookieless_mode)return void rx.warn(ae);let r="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==r||r.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.kh(!0,!0),this.consent.optInOut(!1),this.Cu(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:nm,$device_id:null}),this.mu(r),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.th(),this.Yu())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){let e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Cu()}_is_bot(){return p?oD(p,this.config.custom_blocked_useragents):void 0}th(){f&&("visible"===f.visibilityState?this.Ru||(this.Ru=!0,this.capture(nT,{title:f.title},{send_instantly:!0}),this.Au&&(f.removeEventListener(nP,this.Au),this.Au=null)):this.Au||(this.Au=this.th.bind(this),nB(f,nP,this.Au)))}debug(e){!1===e?(null==h||h.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==h||h.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}nl(){var e,t;let r,n,i=this.Lu||{};return"advanced_disable_flags"in i?!!i.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(rx.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):(t="advanced_disable_decide",r=(e="advanced_disable_flags")in i&&!J(i[e]),n=t in i&&!J(i[t]),r?i[e]:!!n&&(rx&&rx.warn(`Config field '${t}' is deprecated. Please use '${e}' instead. The old field will be removed in a future major version.`),i[t]))}Os(e){var t;if(J(this.config.before_send))return e;let r=Object.keys(null!=(t=e.properties)?t:{}).filter(ee),n=U(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;
45for(let t of n)try{if(i=t(i),J(i)){let t=`Event '${e.event}' was rejected in beforeSend function`;return Q(e.event)?rx.warn(`${t}. This can cause unexpected behavior.`):rx.info(t),null}i.properties&&!H(i.properties)||rx.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(t){return rx.error(`Error in beforeSend function for event '${e.event}':`,t),null}for(let t of r)if(i.properties&&J(i.properties[t]))return rx.warn(`Event '${e.event}' had its '${t}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var e;return null==(e=this.pageViewManager.Vo)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}Du(e){let t=Z(e)&&!e,r=n0.Et()&&"true"===n0.Ot("ph_debug");return!t&&(!!r||e)}};ap.__defaultExtensionClasses={},ap.Ch={trace:u=()=>{},debug:u,info:u,warn:u,error:u,fatal:u},function(e,t){for(let r=0;t.length>r;r++)e.prototype[t[r]]=nM(e.prototype[t[r]])}(ap,["identify"]);var af=class{constructor(e){this.disabled=!1===e;const t=W(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;let n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<this.thresholdPx&&this.timeoutMs>r-n.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}};let ag="$copy_autocapture",am=rE("[AutoCapture]");function av(e,t){return t.length>e?t.slice(0,e)+"...":t}var ay=class{fo(){this.po=void 0,clearTimeout(this.mo),this.mo=void 0}yo(e){var t;if(!iO(e))return!0;let r=null!=(t=this.bo().css_selector_ignorelist)?t:ix,n=new Set,i=e;for(;i;){if(n.size>=1e3||n.has(i))return!0;n.add(i);let e=i,t=ig(e);if(I(t,"ph-no-capture")||I(t,"ph-sensitive")||i$(e)||r.some(t=>i_(e,t)))return!0;let s=i.parentNode;i=ih(s)?s.host:s&&il(s)?s:null}return!1}_o(e){if(!this.isEnabled||"pointercancel"===e.type)return void this.fo();if("pointerdown"===e.type){var t;this.fo();let r=iy(e);return void(e.isPrimary&&0===e.button&&!e.ctrlKey&&r&&il(r)&&(this.po={target:r,excluded:this.yo(r),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(t=this.wo)?void 0:t.distinctId}))}let r=this.po;r&&(e.pointerId!==r.id||Math.abs(e.clientX-r.x)>5||Math.abs(e.clientY-r.y)>5?this.fo():"pointerup"===e.type&&(r.released=!0,this.mo=setTimeout(()=>this.fo(),0)))}ko(e){var t,r;let n=this.po;this.fo();let i=iy(e);if((null==n?void 0:n.released)&&n.target.isConnected&&n.distinctId===(null==(t=this.wo)?void 0:t.distinctId)&&e.pointerId===n.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-n.x)&&5>=Math.abs(e.clientY-n.y)&&i&&(iu(i,"html")||iu(i,"body"))){if(n.excluded)return null;let e=null!=(r=this.bo().css_selector_ignorelist)?r:ix;return[i,null==f?void 0:f.documentElement,null==f?void 0:f.body].some(t=>{if(!t)return!1;let r=ig(t);return I(r,"ph-no-capture")||I(r,"ph-sensitive")||!iO(t)||i$(t)||e.some(e=>i_(t,e))})?null:n.target}}constructor(e){this.So=e,this.name="autocapture",this.xo=!1,this.Co=null,this.$o=!1,this.To=!1,this.Rr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Io=!1,this.So.refresh(this.Rr),this.rageclicks=new af(this.Rr.rageclick),this.Mo=null}setup(e){this.Eo(),this.wo=e;let t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Io?t.dispose():(this.Po=t,this.startIfEnabled())}dispose(){var e;this.Io||(this.Io=!0,this.wo=void 0,null==(e=this.Po)||e.dispose(),this.Po=void 0,this.Ro())}bo(){return this.So.refresh(this.Rr),this.Rr}Eo(){var e,t;return this.bo(),this.Rr.url_allowlist=null==(e=this.Rr.url_allowlist)?void 0:e.map(e=>new RegExp(e)),this.Rr.url_ignorelist=null==(t=this.Rr.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),this.Rr}Ao(){if(!this.isBrowserSupported())return void am.info("Disabling Automatic Event Collection because this browser is not supported");
45if(!h||!f)return;let e=this.Fo=e=>{e=e||(null==h?void 0:h.event);try{if("blur"===e.type)return void this.fo();if(0===e.type.indexOf("pointer"))return void this._o(e);let t="click"===e.type?this.ko(e):void 0;if(K(t))return;this.Oo(e,"$autocapture",t)}catch(e){am.error("Failed to capture event",e)}};if(nB(h,"blur",e),nB(f,"submit",e,{capture:!0}),nB(f,"change",e,{capture:!0}),nB(f,"click",e,{capture:!0}),n$(["pointerdown","pointermove","pointerup","pointercancel"],t=>{nB(f,t,e,{capture:!0})}),this.bo().capture_copied_text){let e=this.Do=e=>{e=e||(null==h?void 0:h.event);try{this.Oo(e,ag)}catch(e){am.error("Failed to capture clipboard event",e)}};nB(f,"copy",e,{capture:!0}),nB(f,"cut",e,{capture:!0}),nB(f,"paste",e,{capture:!0})}}Ro(){this.fo(),this.Fo&&(null==h||h.removeEventListener("blur",this.Fo),n$(["pointerdown","pointermove","pointerup","pointercancel"],e=>{null==f||f.removeEventListener(e,this.Fo,!0)}),null==f||f.removeEventListener("submit",this.Fo,!0),null==f||f.removeEventListener("change",this.Fo,!0),null==f||f.removeEventListener("click",this.Fo,!0),this.Fo=void 0),this.Do&&(null==f||f.removeEventListener("copy",this.Do,!0),null==f||f.removeEventListener("cut",this.Do,!0),null==f||f.removeEventListener("paste",this.Do,!0),this.Do=void 0),this.xo=!1}startIfEnabled(){this.isEnabled||this.fo(),!this.Io&&this.wo&&this.isEnabled&&!this.xo&&(this.Ao(),this.xo=!0)}onRemoteConfig(e){var t;if(this.Io)return;if(this.$o=!0,!e.ok)return void this.startIfEnabled();let r=e.config;r.elementsChainAsString&&(this.To=r.elementsChainAsString);let n=r.autocapture_opt_out;Z(n)&&(null==(t=this.wo)||t.kv.set("$autocapture_disabled_server_side",n),this.Co=n),this.startIfEnabled()}setElementSelectors(e){this.Mo=e}getElementSelectors(e,t){var r;let n=[];return null==(r=this.Mo)||r.forEach(r=>{let i=null==f?void 0:f.querySelectorAll(r);null==i||i.forEach(i=>{e!==i&&t!==i||I(n,r)||n.push(r)})}),n}get isEnabled(){var e,t;if(this.Io)return!1;let r=null==(e=this.wo)?void 0:e.kv.get(rF),n=this.Co,i=this.bo();if(!i.remoteRequestsDisabled&&!this.$o)return!1;let s=i.remoteRequestsDisabled&&!this.$o;if(K(n)&&!Z(r)&&!s)return!1;let o=null!=(t=this.Co)?t:!!r;return!!i.enabled&&!o}Oo(e,t="$autocapture",r){var n,i,s,o;if(!this.isEnabled)return void this.fo();let a=r||iy(e);ic(a)&&(a=a.parentNode||null);let l=this.Eo();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&l.rageclick&&(null==(n=this.rageclicks)?void 0:n.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime()))&&iA(a,l.rageclick)&&this.Oo(e,"$rageclick",r);let u=t===ag,c=u?tk(tk({},l),{},{dom_event_allowlist:void 0}):l;if(a&&function(e,t,r,n,i,s){var o;if(!h||iC(e)||(null==r?void 0:r.url_allowlist)&&!ip(r.url_allowlist,s)||(null==r?void 0:r.url_ignorelist)&&ip(r.url_ignorelist,s))return!1;if(null==r?void 0:r.dom_event_allowlist){let e=r.dom_event_allowlist;if(e&&!e.some(e=>t.type===e))return!1}let{parentIsUsefulElement:a,targetElementList:l}=ij(e,n);if(!function(e,t){let r=null==t?void 0:t.element_allowlist;if(q(r))return!0;for(let t of e)if(r.some(e=>t.tagName.toLowerCase()===e))return!0;return!1}(l,r)||!iw(l,null==r?void 0:r.css_selector_allowlist)||iw(l,null!=(o=null==r?void 0:r.css_selector_ignorelist)?o:ix))return!1;try{let r=h.getComputedStyle(e);if(r&&"pointer"===r.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}let u=e.tagName.toLowerCase();switch(u){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return a?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(ib.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}(a,e,c,u,u?["copy","cut","paste"]:void 0,{config:{get_current_url:l.getCurrentUrl}})){let{props:r,explicitNoCapture:n,target:u}=function(e,{e:t,maskAllElementAttributes:r,maskAllText:n,elementAttributeIgnoreList:i,elementsChainAsString:s,disableCaptureUrlHashes:o}){var a,l,u,c;if(!il(e))return{props:{}};let d=[e],p=new Set([e]),f=e;for(;f.parentNode&&!iu(f,"body")&&1e3>d.length;){if(ih(f.parentNode)){let e=f.parentNode.host;if(p.has(e))break;p.add(e),d.push(e),f=e;continue}if(!il(f.parentNode)||p.has(f.parentNode))break;p.add(f.parentNode),d.push(f.parentNode),f=f.parentNode}let g="click"===t.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?d.findIndex(e=>iu(e,"button")||iu(e,"a")):-1;g>0&&(n=n||d.slice(0,g+1).some(e=>!iO(e)||i$(e)));let m=[],v={},y,b=!1,_=!1;if(n$(d,e=>{let t=iO(e);
45if(iu(e,"a")&&!r&&!(null==i?void 0:i.includes("href"))){let r=e.getAttribute("href");b=!!(t&&r&&iB(r))&&(o?tg(r):r)}I(ig(e),"ph-no-capture")&&(_=!0),m.push(function(e,t,r,n,i=!1){let s=e.tagName.toLowerCase(),o={tag_name:s};ib.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?av(1024,iU(e)):av(1024,iv(e)));let a=ig(e);t||(null==n?void 0:n.includes("class"))||0>=a.length||(o.classes=a.filter(function(e){return""!==e})),n$(e.attributes,function(r){var s;if((!i$(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&!(null==n?void 0:n.includes(r.name))&&!t&&iB(r.value)&&(!G(s=r.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){let e=r.value;"class"===r.name&&(e=id(e).join(" ")),o["attr__"+r.name]=av(1024,"href"===r.name&&i?tg(e):e)}});let l=1,u=1,c=e;for(;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!il(t));return t}(c);)l++,c.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,r,n,i,o)),n$(function(e){if(!iO(e))return{};let t={};return n$(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){let r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&iB(n)&&(t[r]=n)}}),t}(e),(e,t)=>{({}).hasOwnProperty.call(v,t)||(v[t]=e)})}),_)return{props:{},explicitNoCapture:_};if(g>0&&(e=d[g],m.splice(0,g)),n||(m[0].$el_text=iu(e,"a")||iu(e,"button")?iU(e):iv(e)),b){m[0].attr__href=b;let e=null==(u=i6(b))?void 0:u.host,t=null==h||null==(c=h.location)?void 0:c.host;e&&t&&e!==t&&(y=b)}return{props:nI({$event_type:t.type,$ce_version:1},s?{}:{$elements:m},{$elements_chain:U(m)?m.map(e=>{var t,r;let n={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:function(e){let t=e.attr__class;if(t)return U(t)?t:id(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return nL(e).filter(([e])=>0===e.indexOf("attr__")).forEach(([e,t])=>n.attributes[e]=t),n}).map(e=>{var t,r;let n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(let t of(e.attr_class.sort(),e.attr_class))n+=`.${t.replace(/"/g,"")}`;let i=tk(tk(tk(tk({},e.text?{text:e.text}:{}),{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(r=e.nth_of_type)?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),s={};return nL(i).sort(([e],[t])=>t>e?-1:+(e>t)).forEach(([e,t])=>s[iV(e.toString())]=iV(t.toString())),n+=":",n+=nL(s).map(([e,t])=>`${e}="${t}"`).join("")}).join(";"):""},(null==(a=m[0])?void 0:a.$el_text)?{$el_text:null==(l=m[0])?void 0:l.$el_text}:{},y&&"click"===t.type?{$external_click_url:y}:{},v),target:e}}(a,{e:e,maskAllElementAttributes:l.maskAllElementAttributes,maskAllText:l.maskAllText,elementAttributeIgnoreList:l.element_attribute_ignorelist,elementsChainAsString:this.To,disableCaptureUrlHashes:l.disableCaptureUrlHashes});if(n)return!1;let c=this.getElementSelectors(a,u);if(c&&c.length>0&&(r.$element_selectors=c),t===ag){let t=e.type||"clipboard";if("paste"!==t){let e=null==h||null==(s=h.getSelection())?void 0:s.toString(),t=im(e);if(!t)return!1;r.$selected_content=t,r.$clipboard_text_length=null!=(o=null==e?void 0:e.length)?o:0}r.$copy_type=t}return null==(i=this.wo)||i.capture(t,r),!0}}isBrowserSupported(){return V(null==f?void 0:f.querySelectorAll)}},ab=class{constructor(e){this._instance=e}refresh(e){let t=this._instance.config,r=W(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.nl(),e.url_allowlist=null==r?void 0:r.url_allowlist,e.url_ignorelist=null==r?void 0:r.url_ignorelist,e.dom_event_allowlist=null==r?void 0:r.dom_event_allowlist,e.element_allowlist=null==r?void 0:r.element_allowlist,e.css_selector_allowlist=null==r?void 0:r.css_selector_allowlist,e.css_selector_ignorelist=null==r?void 0:r.css_selector_ignorelist,e.element_attribute_ignorelist=null==r?void 0:r.element_attribute_ignorelist,e.capture_copied_text=null==r?void 0:r.capture_copied_text}};let a_=rE("[ExceptionAutocapture]"),aw=()=>{},ak=e=>{var t;if(V(e))return null!=(t=e.__posthog_layer__)?t:e.__rrweb_layer__};function ax(e,t,r){try{if(!(t in e))return aw;let n={next:e[t]},i=r(function(...e){return n.next.apply(this,e)});return V(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:n}})),e[t]=i,()=>{if(e[t]===i)return void(e[t]=n.next);let r=e[t],s=ak(r);for(;s;){if(s.next===i)return void(s.next=n.next);
45r=s.next,s=ak(r)}}}catch(e){return aw}}let aE=rE("[TracingHeaders]"),aS=rE("[Web Vitals]"),aP=["CLS","FCP","INP","LCP"],aR=["INP","LCP"],aT=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],aA="disabled",aC="lazy_loading",aj=rE("[SessionRecording]"),aO=rE("[Heatmaps]");function a$(e){return W(e)&&"clientX"in e&&"clientY"in e&&Y(e.clientX)&&Y(e.clientY)}let aI=rE("[Product Tours]"),aL=e=>{var t;return!e.config.disable_product_tours&&!!(null==(t=e.persistence)?void 0:t.get_property(rG))},aM=["$set_once","$set"],aD=rE("[SiteApps]"),aN="Error while initializing PostHog app with config id ",aF=(e,t)=>(null==e?void 0:e.then)?e.then(t):t(e),aB="SDK is not enabled or survey functionality is not yet loaded",aU="Disabled. Not loading surveys.";var aV=class{constructor(e,t){this.So=e,this.Th=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Ih=!1,this.Mh=[],this.Eh=null,this.Ph=null,this.Io=!1,this.Rh=new Set,this.onRemoteConfig=e=>{if(this.Io||this.Rr.disableSurveys)return;if(!e.ok)return oY.warn("Remote config unavailable. Not loading surveys.");let t=e.config.surveys;if(J(t))return oY.warn("Flags not loaded yet. Not loading surveys.");this.Ah=Z(t)?t:t.length>0,oY.info(`flags response received, isSurveysEnabled: ${this.Ah}`),this.loadIfEnabled()}}setup(e){if(!this.Io)return this.Fh=e,aF(e.kv.initialize(),()=>{if(this.Fh!==e||this.Io)return;this.Fh=void 0,this.wo=e;let t=e.onRemoteConfig(this.onRemoteConfig);this.Io?t.dispose():(this.Po=t,this.loadIfEnabled())})}dispose(){var e,t,r,n;this.Io||(this.Io=!0,this.Fh=void 0,this.wo=void 0,null==(e=this.Po)||e.dispose(),this.Po=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(r=this._surveyManager)||null==(n=r.dispose)||n.call(r),this._surveyManager=null,this.Mh=[],this.Eh=null,this.Rh.forEach(e=>clearTimeout(e)),this.Rh.clear())}get Rr(){return this.So.get()}initialize(){this.loadIfEnabled()}reset(){var e,t,r;null==(e=this._surveyManager)||null==(t=e.clearInMemoryInProgressSurveyState)||t.call(e);try{null==(r=this._surveyEventReceiver)||r.reset(),localStorage.removeItem("lastSeenSurveyDate");let e=[];for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);((null==r?void 0:r.startsWith("seenSurvey_"))||(null==r?void 0:r.startsWith("inProgressSurvey_")))&&e.push(r)}e.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(this.Io||!this.wo)return;let e=this.Rr;if(this._surveyManager)return;if(this.Ih)return void oY.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void oY.info(aU);if(e.cookielessMode&&this.So.isOptedOut())return void oY.info("Not loading surveys in cookieless mode without consent.");let t=this.So.getExtensions();if(!t)return void oY.error("PostHog Extensions not found.");if(q(this.Ah)&&!e.advancedEnableSurveys)return;let r=this.Ah||e.advancedEnableSurveys;this.Ih=!0;try{let e=t.generateSurveys;if(e)return this.Oh(e,r),void(this.Ih=!1);let n=t.loadExternalDependency;if(!n)return this.Dh(nk),void(this.Ih=!1);n(e=>{try{if(this.Io)return;let t=this.So.getExtensions();!e&&(null==t?void 0:t.generateSurveys)?this.Oh(t.generateSurveys,r):this.Dh("Could not load surveys script",e)}finally{this.Ih=!1}})}catch(e){throw this.Ih=!1,this.Dh("Error initializing surveys",e),e}}Oh(e,t){this.Io||(this._surveyManager=e(t),this._surveyEventReceiver=this.So.createEventReceiver(),oY.info("Surveys loaded successfully"),this.Lh({isLoaded:!0}))}Dh(e,t){oY.error(e,t),this.Lh({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Mh.push(e),this._surveyManager&&this.Lh({isLoaded:!0}),()=>{this.Mh=this.Mh.filter(t=>t!==e)}}getSurveys(e,t=!1){var r;let n=null!=(r=this.wo)?r:this.Th;if(!n||this.Io)return;if(this.Rr.disableSurveys)return oY.info(aU),e([]);let i=n.kv.get(ne);if(i&&!t)return e(i,{isLoaded:!0}),void(this.Nh()&&this.getSurveys(()=>{},!0));if(this.Eh)return void this.Eh.then(({surveys:t,context:r})=>{this.Io||e(t,r)}).catch(e=>oY.error("Error in survey callback",e));let s=this.qh("/api/surveys/",{method:"GET",query:{token:n.projectToken},sentAt:"query",timeoutMs:this.Rr.requestTimeoutMs}).then(e=>{try{return this.jh(n,e)}catch(e){return oY.error("Error processing surveys response",e),this.jh(n,{statusCode:0,error:e})}},e=>this.jh(n,{statusCode:0,error:e}));this.Eh=s;let o=()=>{this.Eh===s&&(this.Eh=null)};s.then(t=>{o(),this.Io||e(t.surveys,t.context)},o).catch(e=>oY.error("Error in survey callback",e))}qh(e,t){let r=this.wo;return r?r.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:Error(aB)}))}jh(e,t){var r;if(this.Io)return{surveys:[],context:{isLoaded:!1,error:aB}};let n=t.statusCode;if(200!==n||!t.json){let e=`Surveys API could not be loaded, status: ${n}`;return 0!==n?oY.error(e):t.error||oY.warn(e),this.Ph=Date.now(),{surveys:[],context:{isLoaded:!1,error:e}}}this.Ph=null;let i=t.json.surveys||[],s=i.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(oF(e)||!!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length))});return s.length>0&&(null==(r=this._surveyEventReceiver)||r.register(s)),e.kv.set({[ne]:i,[nt]:Date.now()}),{surveys:i,context:{isLoaded:!0}}}Nh(){return this.Bh()&&!this.Eh&&!this.Hh()}Bh(){var e,t;let r=null==(e=null!=(t=this.wo)?t:this.Th)?void 0:e.kv.get(nt);return Y(r)&&Date.now()-r>3e5}Hh(){return Y(this.Ph)&&3e5>Date.now()-this.Ph}markSurveyAsSeen(e,t){var r;oX({id:e,current_iteration:null!=(r=null==t?void 0:t.iteration)?r:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}
45Lh(e){for(let t of this.Mh)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){oY.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t=!1){if(!J(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);oY.warn("init was not called")}zh(e){let t=null;return this.getSurveys(r=>{var n;t=null!=(n=r.find(t=>t.id===e))?n:null}),t}Uh(e){if(J(this._surveyManager))return{eligible:!1,reason:aB};let t="string"==typeof e?this.zh(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Wh(e){if(!this.So.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(J(this._surveyManager))return{eligible:!1,reason:aB};let t="string"==typeof e?this.zh(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(J(this._surveyManager))return oY.warn("init was not called"),{visible:!1,disabledReason:aB};let t=this.Wh(e);return{visible:t.eligible,disabledReason:t.reason}}
45canRenderSurveyAsync(e,t){return J(this._surveyManager)?(oY.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:aB})):new Promise(r=>{this.getSurveys(t=>{var n;let i=null!=(n=t.find(t=>t.id===e))?n:null;if(i){let e=this.Wh(i);r({visible:e.eligible,disabledReason:e.reason})}else r({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,r){var n;if(!this.So.isCapturing())return;if(J(this._surveyManager))return void oY.warn("init was not called");let i="string"==typeof e?this.zh(e):e;if(!(null==i?void 0:i.id))return void oY.warn("Survey not found");if(!oZ.includes(i.type))return void oY.warn(`Surveys of type ${i.type} cannot be rendered in the app`);let s=null==f?void 0:f.querySelector(t);if(s){if(null==(n=i.appearance)?void 0:n.surveyPopupDelaySeconds){oY.info(`Rendering survey ${i.id} with delay of ${i.appearance.surveyPopupDelaySeconds} seconds`);let e=setTimeout(()=>{var t,n;this.Rh.delete(e),!this.Io&&this.So.isCapturing()&&(oY.info(`Rendering survey ${i.id} with delay of ${null==(t=i.appearance)?void 0:t.surveyPopupDelaySeconds} seconds`),null==(n=this._surveyManager)||n.renderSurvey(i,s,r),oY.info(`Survey ${i.id} rendered`))},1e3*i.appearance.surveyPopupDelaySeconds);return void this.Rh.add(e)}this._surveyManager.renderSurvey(i,s,r)}else oY.warn("Survey element not found")}displaySurvey(e,t){var r;if(!this.So.isCapturing())return;if(J(this._surveyManager))return void oY.warn("init was not called");let n=this.zh(e);if(!n)return void oY.warn("Survey not found");let i=n;if((null==(r=n.appearance)?void 0:r.surveyPopupDelaySeconds)&&t.ignoreDelay&&(i=tk(tk({},n),{},{appearance:tk(tk({},n.appearance),{},{surveyPopupDelaySeconds:0})})),t.displayType!==s$&&t.initialResponses&&oY.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){let e=this.Uh(n);if(!e.eligible)return void oY.warn("Survey is not eligible to be displayed: ",e.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}cancelPendingSurvey(e){J(this._surveyManager)?oY.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;null==(e=this._surveyManager)||null==(t=e.handlePageUnload)||t.call(e)}};function aW(e,t,r){if(J(e))return!1;switch(r){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var aH=class{constructor(e){this._instance=e,this.Vh=new Set,this.Gh=new Set,this.Zh=new oI,this.Qh=(e,t)=>this.Jh(e,t)&&this.Kh(e,t)&&this.Xh(e,t)&&this.Yh(e,t),this.Jh=(e,t)=>!(null==t?void 0:t.event)||(null==e?void 0:e.event)===(null==t?void 0:t.event)}init(){var e,t;q(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.tc=null==(t=this._instance)?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e;null==(e=this.tc)||e.call(this),this.tc=void 0,this.Zh=new oI}register(e){var t,r;if(!q(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.Vh.add(e),null==(t=e.steps)||t.forEach(e=>{this.Gh.add((null==e?void 0:e.event)||"")})}),null==(r=this._instance)?void 0:r.autocapture)){let e=new Set;this.Vh.forEach(t=>{var r;null==(r=t.steps)||r.forEach(t=>{(null==t?void 0:t.selector)&&e.add(t.selector)})}),this._instance.autocapture.setElementSelectors(e)}}replace(e){this.Vh.clear(),this.Gh.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.Gh.has(e)||this.Gh.has(t.event))&&this.Vh.forEach(e=>{this.ec(t,e)&&this.Zh.emit("actionCaptured",e.name)})}nc(e){this.onAction("actionCaptured",t=>e(t))}ec(e,t){if(null==(null==t?void 0:t.steps))return!1;for(let r of t.steps)if(this.Qh(e,r))return!0;return!1}onAction(e,t){return this.Zh.on(e,t)}Kh(e,t){if(null==t?void 0:t.url){var r;let n=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!n||"string"!=typeof n||!aW(n,t.url,t.url_matching||"contains"))return!1}return!0}Xh(e,t){return!!this.sc(e,t)&&!!this.rc(e,t)&&!!this.oc(e,t)}sc(e,t){var r;let n;if(!(null==t?void 0:t.href))return!0;let i=this.ac(e);if(i.length>0)return i.some(e=>aW(e.href,t.href,t.href_matching||"exact"));let s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&aW((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}rc(e,t){var r,n,i,s;if(!(null==t?void 0:t.text))return!0;let o=this.ac(e);if(o.length>0)return o.some(e=>aW(e.text,t.text,t.text_matching||"exact")||aW(e.$el_text,t.text,t.text_matching||"exact"));let a=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!a&&(r=function(e){let t,r=[],n=/(?::|")text="(.*?)"/g;for(;!J(t=n.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),n=t.text,i=t.text_matching||"exact",r.some(e=>aW(e,n,i)))}oc(e,t){var r,n;if(!(null==t?void 0:t.selector))return!0;let i=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null==i?void 0:i.includes(t.selector))return!0;let s=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){}return!1}ac(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Yh(e,t){return!(null==t?void 0:t.properties)||0===t.properties.length||oW(t.properties.reduce((e,t)=>
45{let r=U(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}},aq=class{constructor(e){var t,r;this.lc=[],this._instance=e,this.uc=new Map,this.hc=new Map,this.cc=new Map,this.dc=null==(t=this._instance)||null==(r=t.onSessionId)?void 0:r.call(t,e=>this.vc(e))}fc(e){return!1}gc(){return null}mc(e){}yc(){}bc(e,t){return!!e&&oW(e.propertyFilters,null==t?void 0:t.properties)}_c(e,t){let r=new Map;return e.forEach(e=>{var n;null==(n=e.conditions)||null==(n=n[t])||null==(n=n.values)||n.forEach(t=>{if(null==t?void 0:t.name){let n=r.get(t.name)||[];n.push(e.id),r.set(t.name,n)}})}),r}wc(e,t,r){let n=(r===sT?this.uc:this.hc).get(e),i=[];return this.kc(e=>{i=e.filter(e=>null==n?void 0:n.includes(e.id))}),i.filter(n=>{var i;let s=null==(i=n.conditions)||null==(i=i[r])||null==(i=i.values)?void 0:i.find(t=>t.name===e);return this.bc(s,t)})}register(e){this.Sc(e,!1)}replace(e){this.Sc(e,!0)}Sc(e,t){var r;q(null==(r=this._instance)?void 0:r._addCaptureHook)||(this.xc(e,t),this.Cc(e,t))}Cc(e,t){var r;let n=e.filter(e=>{var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this.cc.clear(),0===n.length)return void(t&&(null==(r=this.$c)||r.replace([])));this.$c||(this.$c=new aH(this._instance),this.$c.init(),this.$c.nc(e=>this.onAction(e)));let i=[];n.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(t=>{if(i.push(t),t.name){var r;let n=null!=(r=this.cc.get(t.name))?r:[];n.includes(e.id)||n.push(e.id),this.cc.set(t.name,n)}})}),t?this.$c.replace(i):this.$c.register(i)}Tc(e,t){t.forEach((t,r)=>{var n;let i=null!=(n=e.get(r))?n:[];t.forEach(e=>{i.includes(e)||i.push(e)}),e.set(r,i)})}xc(e,t){var r;let n=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0}),i=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}),s=this._c(e,sT),o=this._c(e,sA);t?(this.uc=s,this.hc=o):(this.Tc(this.uc,s),this.Tc(this.hc,o)),(0!==n.length||0!==i.length)&&(null!=this.tc||(this.tc=null==(r=this._instance)?void 0:r._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var r,n;let i=this.Ic(),s=(null==t||null==(r=t.properties)?void 0:r.$survey_id)||(null==t||null==(n=t.properties)?void 0:n.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){let t=this.Mc(e,s);if("consume"===t)return i.info("event consumed activated item, removing it",{event:e,itemId:s}),void this.Ec([s]);if("persist"===t)return i.info("shown item promoted to persisted activation",{event:e,itemId:s}),this.Pc(s),void this.Rc([s])}if(this.hc.has(e)){let r=this.wc(e,t,sA);r.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:r.map(e=>e.id)}),this.Ec(r.map(e=>e.id)),r.forEach(e=>this.Ac(e.id)))}if(!this.uc.has(e))return;i.info("event name matched",{event:e,eventPayload:t,items:this.uc.get(e)});let o=this.wc(e,t,sT);this.Fc(o.map(e=>e.id))}onAction(e){this.cc.has(e)&&this.Fc(this.cc.get(e)||[])}Fc(e){var t,r;if(0===e.length)return;let n=!!(null==(t=this._instance)||null==(r=t.get_session_id)?void 0:r.call(t)),i=[];for(let t of e)n&&this.fc(t)?this.Pc(t)&&this.Oc(t):i.push(t);i.length>0&&(this.lc=[...new Set([...this.lc,...i])]),this.Ic().info("updating activated items",{activatedItems:this.getActivatedIds()})}Pc(e){this.lc=this.lc.filter(t=>t!==e);let t=this.Dc();return!t.includes(e)&&(this.Lc([...t,e]),this.Nc(),!0)}Ec(e){let t=new Set(e);this.lc=this.lc.filter(e=>!t.has(e));let r=this.qc(),n=r.filter(e=>!t.has(e));n.length!==r.length&&(this.Lc(n),0===n.length&&this.jc()),this.Rc(e)}Bc(){var e;let t=this.gc();if(!t)return{};let r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return r&&"object"==typeof r?r:{}}Oc(e){if(!this.gc())return;let t=this.Bc();this.mc(tk(tk({},t),{},{[e]:Date.now()}))}Rc(e){if(!this.gc())return;let t=this.Bc(),r={},n=!1;for(let[i,s]of Object.entries(t))e.includes(i)?n=!0:r[i]=s;n&&(H(r)?this.yc():this.mc(r))}Hc(){this.gc()&&this.yc()}getActivationTimestamp(e){if(!this.Dc().includes(e))return;let t=this.Bc()[e];return Y(t)?t:void 0}qc(){var e;let t=this.zc();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}Dc(){var e,t,r;let n=this.qc();if(0===n.length)return[];let i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Uc()],s=null==(t=this._instance)||null==(r=t.get_session_id)?void 0:r.call(t);return s&&i===s?n:[]}Nc(){var e,t;let r=null==(e=this._instance)||null==(t=e.get_session_id)?void 0:t.call(e);r&&this.Wc(r)}jc(){this.Vc()}vc(e){var t;let r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Uc()];if(r&&r!==e){let e=this.qc(),t=this.Bc();e.length>0&&(this.Lc([]),e.filter(e=>
45Y(t[e])).forEach(e=>this.Ac(e))),this.jc(),this.Hc()}}getActivatedIds(){return[...new Set([...this.Dc(),...this.lc])].filter(e=>!this.Gc(e))}dispose(){var e,t,r;null==(e=this.dc)||e.call(this),this.dc=void 0,null==(t=this.tc)||t.call(this),this.tc=void 0,null==(r=this.$c)||r.dispose(),this.$c=void 0}reset(){this.lc=[],this.qc().length>0&&this.Lc([]),this.jc(),this.Hc()}getEventToItemsMap(){return this.uc}Zc(){return this.$c}},aG=class extends aq{constructor(e){super(e)}zc(){return nr}Uc(){return nn}gc(){return ni}mc(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({$surveys_activated_timestamps:e})}yc(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister("$surveys_activated_timestamps")}fc(e){var t;let r;this.kc(t=>{r=t.find(t=>t.id===e)});let n=null==r||null==(t=r.appearance)?void 0:t.surveyPopupDelaySeconds;return Y(n)&&n>0}Qc(){return sC}kc(e){var t;null==(t=this._instance)||t.getSurveys(e)}Ac(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Ic(){return oY}Lc(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({$surveys_activated:e})}Wc(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({$surveys_activated_session:e})}Vc(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister("$surveys_activated_session")}Gc(){return!1}Mc(e,t){var r,n;let i;return this.kc(e=>{i=e.find(e=>e.id===t)}),!i||oF(r=i)&&(null==(n=r.conditions)||null==(n=n.events)?void 0:n.repeatedActivation)||"always"===r.schedule?e===sC?"consume":"ignore":e===sC?"persist":e===sj||e===sO?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},az=class{constructor(e){this._instance=e}initialize(){}get(e){if("string"==typeof e)return this._instance.get_property(e);let t={};for(let r of e){let e=this._instance.get_property(r);q(e)||(t[r]=e)}return t}set(e,t){this._instance.register("string"==typeof e?{[e]:t}:e)}remove(e){"string"!=typeof e?e.forEach(e=>this._instance.unregister(e)):this._instance.unregister(e)}},aK=class{constructor(e){this._instance=e}get(){let e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){let e=null==x?void 0:x.__PosthogExtensions__;if(!e)return;let{generateSurveys:t,loadExternalDependency:r}=e;return{generateSurveys:t?e=>t(this._instance,e):void 0,loadExternalDependency:r?e=>r(this._instance,"surveys",e):void 0}}createEventReceiver(){return new aG(this._instance)}};let aJ=(null==h?void 0:h.location)?i4(h.location.hash,"__posthog")||i4(location.hash,"state"):null,aY="_postHogToolbarParams",aX=rE("[Toolbar]"),aZ=rE("[FeatureFlags]");var aQ=class{constructor(e,t=!1){this.Jc=!1,this.update(e,t)}update(e,t){var r,n,i,s,o,a,l,u;this.Kc={bootstrap:{featureFlags:null!=(r=null==(n=e.bootstrap)?void 0:n.featureFlags)?r:void 0,featureFlagPayloads:null!=(i=null==(s=e.bootstrap)?void 0:s.featureFlagPayloads)?i:void 0},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!=(o=e.remote_config_refresh_interval_ms)?o:3e5,idleRefreshBackoff:q(e.remote_config_refresh_interval_ms),requestTimeoutMs:e.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,null!=(a=e.feature_flag_request_max_retries)?a:1),compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!=(l=null!=(u=e.evaluation_contexts)?u:e.evaluation_environments)?l:[],flagKeys:U(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.Jc||(aZ.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Jc=!0),q(e.flag_keys)||U(e.flag_keys)||aZ.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Kc}};let a0=rE("[FeatureFlags]"),a1=rE("[FeatureFlags]",{debugEnabled:!0}),a2="\" failed. Feature flags didn't load in time.",a8=[502,504],a6=["click","keydown","wheel","touchstart","pointerdown"],a3="connection_error",a5=e=>{let t={};for(let r=0;e.length>r;r++)t[e[r]]=!0;return t},a4=e=>{let t={};for(let[r,n]of nL(e||{}))n&&(t[r]=n);return t},a9=e=>en(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message),a7=rE("[Error tracking]"),le="webkit-masked-url:",lt=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],lr=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",le],ln=["__firefox__","__gCrWeb"],li="Refusing to render web experiment since the viewer is a likely bot",ls={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>oB(t,e),not_regex:(e,t)=>!oB(t,e),exact:(e,t)=>
45t===e,is_not:(e,t)=>t!==e},lo=rE("[Conversations]"),la="Conversations not available yet.";function ll(e,t){var r,n,i,s,o,a,l;let u=null!=(r=null==e?void 0:e.flushIntervalMs)?r:3e3,c=null!=(n=null==e?void 0:e.maxBufferSize)?n:100,h=(null==t?void 0:t.consoleCapture)?void 0:null!=(i=null==e?void 0:e.maxLogsPerInterval)?i:1e3,d=q(h)?Math.max(c,2048):Math.max(c,h),f=tk(tk({},function(){var e,t;let r,n="",i="";try{let e=null==p?void 0:p.userAgent;e&&([n,i]=tr(e))}catch(e){}return e=n,t=i,tk(tk({},(r=function(e){if(e)return({}).hasOwnProperty.call(rc,e)?rc[e]:e}(e))?{"os.name":r}:{}),t?{"os.version":t}:{})}()),null==e?void 0:e.resourceAttributes);return{serviceName:null!=(s=null!=(o=null==f?void 0:f["service.name"])?o:null==e?void 0:e.serviceName)?s:null==t?void 0:t.serviceNameDefault,serviceVersion:null!=(a=null==f?void 0:f["service.version"])?a:null==e?void 0:e.serviceVersion,environment:null!=(l=null==f?void 0:f["deployment.environment"])?l:null==e?void 0:e.environment,resourceAttributes:f,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:c,maxQueueSize:d,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}let lu=["debug","log","warn","error","info"],lc=e=>{for(;null==e?void 0:e.__rrweb_original__;)e=e.__rrweb_original__;return e},lh="console",ld="__posthogHandledLogsRequestError",lp=(e,t)=>{let r=e instanceof Error?e:Error(t);return r[ld]=!0,r},lf=e=>!!e&&"object"==typeof e&&!0===e[ld],lg=rE("[NetworkMetrics]"),lm=()=>{var e;return(null==h||null==(e=h.performance)?void 0:e.now)?h.performance.now():Date.now()},lv={"http:":80,"https:":443},ly=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),lb=(e,t)=>{var r;let n=String(t);return{method:String(e).toUpperCase(),url:(null==(r=i6(n))?void 0:r.href)||n}},l_=(e,t,r,n,i,s,o=!1)=>{try{var a,l,u;let c,h=i();if(!h)return;let d=r||void 0,p=lm()-n,f=i6(t.url);if(f&&"http:"!==f.protocol&&"https:"!==f.protocol)return;let g={url:(null==f?void 0:f.href)||t.url,method:t.method},m=V(h.name)?h.name(g):G(h.name)?h.name:"http.client.request.duration";if(!m)return;let v=o&&!d?void 0:d?400>d?void 0:String(d):(null==s?void 0:s.name)||"_OTHER",y=tk(tk(tk(tk(tk({},(u=g.method,c=ly.has(u)?u:"_OTHER",tk({"http.request.method":c},"_OTHER"===c&&u!==c?{"http.request.method_original":u}:{}))),f?{"server.address":f.hostname.startsWith("[")&&f.hostname.endsWith("]")?f.hostname.slice(1,-1):f.hostname,"server.port":Number(f.port)||lv[f.protocol],"url.scheme":f.protocol.slice(0,-1),"url.template":f.pathname.split("/").map(e=>/^\d+$/.test(e)||e.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(e)?":id":e).join("/")}:{}),d?{"http.response.status_code":d}:{}),v?{"error.type":v}:{}),null==(a=h.attributes)?void 0:a.call(h,g,{status:d,durationMs:p}));null==(l=e.metrics)||l.histogram(m,p,{unit:"ms",attributes:y})}catch(e){lg.error("Failed to record network metric",e)}},lw=()=>{},lk={featureFlags:class{constructor(e){this.name="featureFlags",this.Xc=!1,this.featureFlagEventHandlers=[],this.$=a0,this.Yc={},this.td={},this.ed=[],this.nd=!1,this.sd=!1,this.rd=0,this.od=!1,this.ad=!1,this.ld=!1,this.ud=!1,this.hd=0,this.dd=!1,this.an=()=>{let e=this.vd();this.hd=0,e&&this.reloadFeatureFlags()},this.fd=()=>{var e,t;let r=this.pd,n=null!=(e=this.gd)?e:r;q(r)||q(n)||this.Rr.remoteRequestsDisabled||!f||"hidden"===f.visibilityState||Date.now()-(null!=(t=this.md)?t:0)<n||(this.gd=this.dd||!this.Rr.idleRefreshBackoff?r:Math.min(2*n,36e5),this.dd=!1,this.reloadFeatureFlags(),this.yd())},this.bd=()=>{this.dd&&this.gd===this.pd||this._d()},this.ln=()=>{"visible"===(null==f?void 0:f.visibilityState)&&this._d()},"get"in e?this.So=e:(this._instance=e,this.wd=new aQ(e.config,e.nl()),this.So=this.wd)}updateConfig(e,t){var r;null==(r=this.wd)||r.update(e,t),this.wo&&this.kd()}setup(e){return this.Fh=e,this.$=e.logger.createLogger("[FeatureFlags]"),aF(e.kv.initialize(),()=>{this.Fh===e&&(this.Fh=void 0,this.wo=e,this.Sd(e))})}Sd(e){var t;if(this.wo===e)return h&&nB(h,"online",this.an),this.kd(),this.xd=e.registerDynamicEventProperties(()=>
45this.Cd()?this.Yc:this.td),this.$d=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Td(),this.Id(),this.Md()}),this.Id(),this.initialize()}_d(){this.dd=!0,this.gd=this.pd,this.fd()}kd(){let e=this.Rr.refreshIntervalMs,t=!this.Rr.remoteRequestsDisabled&&f&&!q(e)&&e>0?e:void 0;this.Rr.idleRefreshBackoff||(this.gd=t),t!==this.pd&&(this.Ed(),q(t)||(this.pd=t,this.gd=t,this.yd(),(null==f?void 0:f.addEventListener)&&(nB(f,nP,this.ln),nO(a6,e=>{nB(f,e,this.bd,{capture:!0})}))))}yd(){q(this.pd)||(q(this.Pd)||clearInterval(this.Pd),this.md=Date.now(),this.Pd=setInterval(this.fd,this.pd))}Ed(){var e;q(this.Pd)||(clearInterval(this.Pd),this.Pd=void 0,null==f||null==(e=f.removeEventListener)||e.call(f,"visibilitychange",this.ln),nO(a6,e=>{var t;null==f||null==(t=f.removeEventListener)||t.call(f,e,this.bd,{capture:!0})})),this.pd=void 0,this.gd=void 0,this.dd=!1,this.md=void 0}destroy(){this.Rd()}dispose(){this.Rd()}Rd(){var e,t;this.Ed(),this.rd++,this.ad=!1,this.Fh=void 0,this.wo&&(this.Ad(),null==(e=this.xd)||e.dispose(),this.xd=void 0,null==(t=this.$d)||t.call(this),this.$d=void 0,this.ed=[],null==h||h.removeEventListener("online",this.an),this.wo=void 0)}get Rr(){return this.So.get()}Fd(e){var t;return this.Od&&e in this.Od?this.Od[e]:null==(t=this.wo)?void 0:t.kv.get(e)}Td(){return!!this.Od&&(this.Od=void 0,!0)}Dd(){var e;return!q(null==(e=this.wo)?void 0:e.kv.get("$enabled_feature_flags"))&&this.Td()}At(e){this.Ld(()=>{var t;return null==(t=this.wo)?void 0:t.kv.set(e)})}Nd(e,t,r){var n;if(!(null==(n=this._instance)?void 0:n.persistence)||!e.$enabled_feature_flags)return;let i=this.Fd("$enabled_feature_flags")||{},s=e.$enabled_feature_flags||{},o=t.flags||t.featureFlags,a=t.flags?Object.entries(t.flags).filter(([,e])=>!(null==e?void 0:e.failed)).map(([e])=>e):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,u=l?a:r&&!U(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(i),...Object.keys(s)])),c=this.Fd("$feature_flag_payloads")||{},h=e.$feature_flag_payloads||{},d=l||r?u:Array.from(new Set([...Object.keys(c),...Object.keys(h)])),p=!l&&!r,f=!!p||u,g={[rQ]:f,[rZ]:f,[r2]:!!p||d};for(let t of(e.$feature_flag_details&&(g[r1]=f),[r8,nu,r6]))q(e[t])||(g[t]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}Lt(e){this.Ld(()=>{var t;return null==(t=this.wo)?void 0:t.kv.remove(e)})}Ld(e){try{e()}catch(e){this.$.error("Failed to update feature flag persistence",e)}}Id(){let e={};for(let t of[rQ,r2,r8,r3]){let r=this.Fd(t);q(r)||(e[t]=r)}this.Yc=e;let t=tk({},e),r=this.Fd(rZ);if(r)for(let[e,n]of Object.entries(r))t[`$feature/${e}`]=n;this.td=t}Cd(){let e=this.Rr.cacheTtlMs;if(!e||0>=e)return!1;let t=this.Fd(nu);return"number"!=typeof t||Date.now()-t>e}qd(){return!!this.Cd()&&(this.ud||this.sd||(this.ud=!0,this.$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}jd(){let e=this.Rr.evaluationContexts;return(null==e?void 0:e.length)?e.filter(e=>{let t=e&&"string"==typeof e&&e.trim().length>0;return t||this.$.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Bd(){let e=this.Rr.flagKeys;if(!q(e))return e.filter(e=>{let t=e&&"string"==typeof e&&e.trim().length>0;return t||this.$.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,r,n;let i=this.Rr,s=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(s).length){let e=null!=(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?r:{},t=Object.keys(s).filter(e=>!q(s[e])).reduce((e,t)=>(e[t]=s[t],e),{}),o=Object.keys(e).filter(e=>t[e]).reduce((t,r)=>(t[r]=e[r],t),{});return this.Hd({featureFlags:t,featureFlagPayloads:o},void 0,{persist:!1})}}updateFlags(e,t,r){var n,i;let s=(null==r?void 0:r.merge)&&null!=(n=this.Fd("$enabled_feature_flags"))?n:{},o=(null==r?void 0:r.merge)&&null!=(i=this.Fd("$feature_flag_payloads"))?i:{},a=tk(tk({},s),e),l=tk(tk({},o),t),u={};for(let[e,t]of Object.entries(a))u[e]={key:e,enabled:t8(t),variant:t6(t),reason:void 0,metadata:q(null==l?void 0:l[e])?void 0:{id:0,version:void 0,description:void 0,payload:l[e]}};this.Hd({flags:u})}get hasLoadedFlags(){return this.nd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){let e=this.Fd(r1),t=this.Fd(r3),r=this.Fd(r5);if(!r&&!t)return e||{};let n=nI({},e||{});for(let e of[...new Set([...Object.keys(r||{}),...Object.keys(t||{})])]){var i,s;let o=n[e],a=null==t?void 0:t[e],l=q(a)?null!=(i=null==o?void 0:o.enabled)&&i:!!a,u=q(a)?null==o?void 0:o.variant:"string"==typeof a?a:void 0,c=null==r?void 0:r[e],h=tk(tk({},o),{},{enabled:l,variant:l?null!=u?u:null==o?void 0:o.variant:void 0});l!==(null==o?void 0:o.enabled)&&(h.original_enabled=null==o?void 0:o.enabled),u!==(null==o?void 0:o.variant)&&(h.original_variant=null==o?void 0:o.variant),c&&(h.metadata=tk(tk({},null==o?void 0:o.metadata),{},{payload:c,original_payload:null==o||null==(s=o.metadata)?void 0:s.payload})),n[e]=h}return this.Xc||(this.$.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.Xc=!0),n}getAllFeatureFlags(){let e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(r=>{let n=e[r];return{key:r,enabled:t8(n),variant:t6(n),payload:t2(t[r])}})}getFlagVariants(){let e=this.Fd(rZ),t=this.Fd(r3);if(!t)return e||{};let r=nI({},e||{}),n=Object.keys(t);for(let e=0;n.length>e;e++)r[n[e]]=t[n[e]];return this.Xc||(this.$.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Xc=!0),r}getFlagPayloads(){let e=this.Fd(r2),t=this.Fd(r5);if(!t)return e||{};let r=nI({},e||{}),n=Object.keys(t);for(let e=0;n.length>e;e++)r[n[e]]=t[n[e]];return this.Xc||(this.$.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Xc=!0),r}reloadFeatureFlags(){this.od||this.Rr.featureFlagsDisabled||this.vd()||(this.sd&&(this.ad=!0),this.zd||(this.ed.slice().forEac
45h(e=>{try{e()}catch(e){this.$.error("Error while running feature flags reloading callback",e)}}),this.zd=setTimeout(()=>{this.Ud()},5)))}Ad(){clearTimeout(this.zd),this.zd=void 0}onReloading(e){return this.ed.push(e),()=>{this.ed=this.ed.filter(t=>t!==e)}}ensureFlagsLoaded(){this.nd||this.sd||this.zd||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.od=e}resetFlagCallReported(){this.Lt(no)}Ud(e){this.Ad();let t=this.wo;if(!t||this.Rr.remoteRequestsDisabled||this.vd())return;if(this.sd)return void(this.ad=!0);let r={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:tk(tk(tk({},t.initialPersonProperties),this.Fd("$stored_person_properties")||{}),{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.Fd(r9),timezone:sd()};q(t.deviceId)||(r.$device_id=t.deviceId),((null==e?void 0:e.disableFlags)||this.Rr.featureFlagsDisabled)&&(r.disable_flags=!0);let n=this.jd();n.length&&(r.evaluation_contexts=n);let i=this.Bd();q(i)||(r.flag_keys=i);let s=this.Rr.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),a=this.rd;this.sd=!0;let l=()=>{this.ad&&(this.ad=!1,this.Ud())},u=e=>{var t,n;let i=null!=(t=e.json)?t:{},o=200!==e.statusCode;if(this.sd=!1,a!==this.rd)return void l();if(this.Wd(e.statusCode),o||this.ad||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.ad)return;this.ld=!o;let u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?a3:"unknown_error"):200!==e.statusCode&&u.push(`api_error_${e.statusCode}`),i.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");let c=!!(null==(n=i.quotaLimited)?void 0:n.includes("feature_flags"));c&&u.push("quota_limited"),this.At({[nl]:u}),c?this.$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):r.disable_flags||this.Hd(i,o,{partialResponse:s}),l()},c=e=>{this.sd=!1,a===this.rd&&(this.At({[nl]:[a3]}),this.$.error("Feature flag request failed",e),this.Dd()&&this.Md(!0)),l()},h=this.Rr.requestMaxRetries,d=()=>h>0&&a===this.rd,p=()=>{if(a!==this.rd||!this.wo||this.Rr.remoteRequestsDisabled)return this.sd=!1,void l();try{t.sendRequest(o,{target:"flags",method:"POST",body:r,compression:this.Rr.compression,sentAt:"body",timeoutMs:this.Rr.requestTimeoutMs}).then(e=>{(a8.includes(e.statusCode)||0===e.statusCode&&e.error instanceof Error&&"AbortError"===e.error.name)&&d()?(h--,setTimeout(p,500)):u(e)}).catch(c)}catch(e){c(e)}};p()}vd(){return i9(this.hd,3)}Wd(e){this.hd=i7(e,this.hd,3,()=>this.$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t={}){var r;if(t.fresh&&!this.ld)return;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlag for key "'+e+a2);if(this.qd())return;let n=this.getFeatureFlagResult(e,t);return null!=(r=null==n?void 0:n.variant)?r:null==n?void 0:n.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){let t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t={}){var r,n,i,s,o,a,l,u,c,h,d,p,f,g;if(t.fresh&&!this.ld)return;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlagResult for key "'+e+a2);if(this.qd())return;let m=this.getFlagVariants(),v=e in m,y=m[e],b=this.getFlagPayloads()[e],_=String(y),w=this.Fd("$feature_flag_request_id")||void 0,k=this.Fd("$feature_flag_evaluated_at")||void 0,x,E=this.Fd("$flag_call_reported")||{};if(this.Rr.deduplicateCallsPerSession){let e=null==(r=this.wo)?void 0:r.session.sessionId,t=this.Fd(na);e&&e!==t&&(E={},x=e)}if(!t.send_event&&"send_event"in t)x&&this.At({[no]:E,[na]:x});else if(e in E&&E[e].includes(_))x&&this.At({[no]:E,[na]:x});else{U(E[e])?E[e].push(_):E[e]=[_],this.At(tk({[no]:E},x?{[na]:x}:{}));let t=this.getFeatureFlagDetails(e),r=[...null!=(n=this.Fd("$feature_flag_errors"))?n:[]];q(y)&&r.push("flag_missing");let m={$feature_flag:e,$feature_flag_response:y,$feature_flag_payload:null!=b?b:null,$feature_flag_request_id:w,$feature_flag_evaluated_at:k,$feature_flag_bootstrapped_response:null!=(i=null==(s=this.Rr.bootstrap)||null==(s=s.featureFlags)?void 0:s[e])?i:null,$feature_flag_bootstrapped_payload:null!=(o=null==(a=this.Rr.bootstrap)||null==(a=a.featureFlagPayloads)?void 0:a[e])?o:null,$used_bootstrap_value:!this.ld};q(null==t||null==(l=t.metadata)?void 0:l.has_experiment)||(m.$feature_flag_has_experiment=t.metadata.has_experiment),q(null==t||null==(u=t.metadata)?void 0:u.version)||(m.$feature_flag_version=t.metadata.version);let v=null!=(c=null==t||null==(h=t.reason)?void 0:h.description)?c:null==t||null==(d=t.reason)?void 0:d.code;v&&(m.$feature_flag_reason=v),(null==t||null==(p=t.metadata)?void 0:p.id)&&(m.$feature_flag_id=t.metadata.id),q(null==t?void 0:t.original_variant)&&q(null==t?void 0:t.original_enabled)||(m.$feature_flag_original_response=q(t.original_variant)?t.original_enabled:t.original_variant),(null==t||null==(f=t.metadata)?void 0:f.original_payload)&&(m.$feature_flag_original_payload=null==t||null==(g=t.metadata)?void 0:g.original_payload),r.length&&(m.$feature_flag_error=r.join(",")),this.Vd(m)}return v?{key:e,enabled:!!y,variant:"string"==typeof y?y:void 0,payload:t2(b)}:void 0}Vd(e){try{var t;null==(t=this.wo)||t.capture("$feature_flag_called",e)}catch(e){this.$.error("Failed to capture feature flag call",e)}
45}getRemoteConfigPayload(e,t){this.Gd(e,t)}Gd(e,t){var r=this;return eu(function*(){let n,i=r.wo;if(!i)return;let s={distinct_id:i.distinctId,token:i.projectToken,person_properties:{$lib:i.library.name,$lib_version:i.library.version}},o=r.jd();o.length&&(s.evaluation_contexts=o);let a=r.Bd();q(a)||(s.flag_keys=a);try{var l;let t=null==(l=(yield i.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:r.Rr.compression,sentAt:"body",timeoutMs:r.Rr.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;n=(null==t?void 0:t[e])||void 0}catch(e){return void r.$.error("Remote config feature flag request failed",e)}try{t(n)}catch(e){r.$.error("Remote config feature flag callback failed",e)}})()}isFeatureEnabled(e,t={}){if(t.fresh&&!this.ld)return t.defaultValue;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return this.$.warn('isFeatureEnabled for key "'+e+a2),t.defaultValue;let r=this.getFeatureFlag(e,t);return q(r)?t.defaultValue:!!r}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,r){this.Hd(e,t,r)}Hd(e,t,r){if(!this.wo)return;this.nd=!0;let n=((e,t={},r={},n={},i,s=a0)=>{let o=((e,t)=>{let r=e.flags;if(r){let t=Object.fromEntries(Object.keys(r).map(e=>{var t;return[e,null!=(t=r[e].variant)?t:r[e].enabled]})),n=Object.fromEntries(Object.keys(r).filter(e=>r[e].enabled).filter(e=>{var t;return!q(null==(t=r[e].metadata)?void 0:t.payload)}).map(e=>{var t;return[e,null==(t=r[e].metadata)?void 0:t.payload]}));return tk(tk({},e),{},{featureFlags:t,featureFlagPayloads:n})}return e.featureFlags&&t.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e,s),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(!l)return;let c=e.requestId,h=e.evaluatedAt;if(U(l)){s.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");let e={};if(l)for(let t=0;l.length>t;t++)e[l[t]]=!0;return{[rQ]:l,[rZ]:e,[r6]:!1}}let d=l,p=u,f=a;if(null==i?void 0:i.partialResponse){let e=Object.keys(d),i=p||{};d=tk(tk({},t),d),p=tk(tk({},r),i),e.forEach(e=>{e in i||null==p||delete p[e]}),f=tk(tk({},n),f)}else if(e.errorsWhileComputingFlags)if(a){let e=new Set(Object.keys(a).filter(e=>{var t;return!(null==(t=a[e])?void 0:t.failed)}));d=tk(tk({},t),Object.fromEntries(Object.entries(d).filter(([t])=>e.has(t))));let i=Object.fromEntries(Object.entries(p||{}).filter(([t])=>e.has(t)));p=tk(tk({},r),i),e.forEach(e=>{e in i||null==p||delete p[e]}),f=tk(tk({},n),Object.fromEntries(Object.entries(f||{}).filter(([t])=>e.has(t))))}else d=tk(tk({},t),d),p=tk(tk({},r),p),f=tk(tk({},n),f);return tk(tk({[rQ]:Object.keys(a4(d)),[rZ]:d||{},[r2]:p||{},[r1]:f||{},[r6]:!0===e.minimalFlagCalledEvents},c?{[r8]:c}:{}),h?{[nu]:h}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),r,this.$);if(n)if(!1===(null==r?void 0:r.persist)){let e=!q(this.wo.kv.get(rZ));this.Od=n,e||this.At(n)}else this.Td(),this.Nd(n,e,!!(null==r?void 0:r.partialResponse)),this.At(n);else t&&this.Dd();t||(this.ud=!1),this.Md(t)}override(e,t=!1){this.$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.Zd(e)}Zd(e){if(this.wo){if(!1===e)return this.Lt([r3,r5]),this.Md(),void a1.info("All overrides cleared");if(U(e))return this.At({[r3]:a5(e)}),this.Md(),void a1.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;this.Xc=!!(null!=(t=e.suppressWarning)&&t);let r={},n=e.flags,i=e.payloads;return n&&(r[r3]=U(n)?a5(n):n),i&&(r[r5]=i),Object.keys(r).length&&this.At(r),!1===n&&!1===i?this.Lt([r3,r5]):!1===n?this.Lt(r3):!1===i&&this.Lt(r5),this.Md(),!1===n?a1.info("Flag overrides cleared"):n&&a1.info("Flag overrides set",{flags:n}),void(!1===i?a1.info("Payload overrides cleared"):i&&a1.info("Payload overrides set",{payloads:i}))}if(e&&"object"==typeof e)return this.At({[r3]:e}),this.Md(),void a1.info("Flag overrides set",{flags:e});this.$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.$.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.nd){let{flags:t,flagVariants:r}=this.Qd();try{e(t,r)}catch(e){this.$.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,r){var n,i;let s=(this.Fd("$early_access_features")||[]).find(t=>t.flagKey===e),o={[`$feature_enrollment/${e}`]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};s&&(a.$early_access_feature_name=s.name),r&&(a.$feature_enrollment_stage=r);let l=tk(tk({},this.getFlagVariants()),{},{[e]:t});null==(n=this._instance)||null==(n=n.persistence)||n.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(o)}),this.At({[rQ]:Object.keys(a4(l)),[rZ]:l,[r4]:tk(tk({},this.Fd("$stored_person_properties")||{}),o)}),this.Md();try{null==(i=this.wo)||i.capture("$feature_enrollment_update",a)}catch(e){this.$.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t=!1,r){let n=this.Fd(r0);!n||t?this.Jd(e,r):e(n)}Jd(e,t){var r=this;return eu(function*(){let n,i=r.wo;if(!i)return;let s=t?`&${t.map(e=>`stage=${e}`).join("&")}`:"";try{let e=yield i.sendRequest(`/api/early_access_features/?token=${i.projectToken}${s}`,{target:"api",method:"GET",sentAt:"query"});if(!e.json)return;n=e.json.earlyAccessFeatures,r.At({[r0]:n})}catch(e){return void r.$.error("Early access feature request failed",e)}try{e(n)}catch(e){r.$.error("Early access feature callback failed",e)}})()}Qd(){let e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,r)=>(e[r]=t[r],e),{})}}Md(e){this.Id();let{flags:t,flagVariants:r}=this.Qd();
45this.featureFlagEventHandlers.forEach(n=>{try{n(t,r,{errorsLoading:e})}catch(e){this.$.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t=!0){this.Kd(e,t)}Kd(e,t=!0){let r=this.Fd("$stored_person_properties")||{},n=(null==e?void 0:e.$set)||((null==e?void 0:e.$set_once)?{}:e),i=null==e?void 0:e.$set_once,s={};if(i)for(let e in i)({}).hasOwnProperty.call(i,e)&&(e in r||(s[e]=i[e]));this.At({[r4]:tk(tk(tk({},r),s),n)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){let r=tk({},this.Fd("$stored_person_properties")||{});e.forEach(e=>{delete r[e]}),this.At({[r4]:r}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Lt(r4),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){let r=this.Fd("$stored_group_properties")||{},n=tk({},r);for(let t of Object.keys(e))n[t]=tk(tk({},r[t]),e[t]);this.At({[r9]:n}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){let t=this.Fd("$stored_group_properties")||{};this.At({[r9]:tk(tk({},t),{},{[e]:{}})})}else this.Lt(r9)}reset(){this.rd++,this.ad=!1,this.Yc={},this.td={},this.Od=void 0,this.nd=!1,this.od=!1,this.ld=!1,this.$anon_distinct_id=void 0,this.Ad(),this.Xc=!1,this.hd=0}}},lx=tk({productTours:class{get Ml(){return this._instance.persistence}constructor(e){this.df=null,this.vf=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if("productTours"in t){var r,n;if(this.Ml&&this.Ml.register({[rG]:!!t.productTours}),!aL(this._instance))return!this.df&&J(null==(r=this.Ml)?void 0:r.props.ph_product_tours)||aI.info("product tours disabled; stopping and clearing cached tours"),null==(n=this.df)||n.stop(),this.df=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.df&&aL(this._instance)&&this.zo(()=>this.ff())}zo(e){var t,r,n;(null==(t=x.__PosthogExtensions__)?void 0:t.generateProductTours)?e():null==(r=x.__PosthogExtensions__)||null==(n=r.loadExternalDependency)||n.call(r,this._instance,"product-tours",t=>{t?aI.error("Could not load product tours script",t):e()})}ff(){var e;!this.df&&(null==(e=x.__PosthogExtensions__)?void 0:e.generateProductTours)&&(this.df=x.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(U(this.vf)&&!t)return void e(this.vf,{isLoaded:!0});let r=this.Ml;if(r){let n=r.props[ns];if(U(n)&&!t)return this.vf=n,void e(n,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:t=>{if(!aL(this._instance))return void e([],{isLoaded:!0});let n=t.statusCode;if(200!==n||!t.json){let r=`Product Tours API could not be loaded, status: ${n}`;return 0===n?t.error||aI.warn(r):aI.error(r),void e([],{isLoaded:!1,error:r})}let i=U(t.json.product_tours)?t.json.product_tours:[];this.vf=i,r&&r.register({[ns]:i}),e(i,{isLoaded:!0})}})}getActiveProductTours(e){J(this.df)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.df.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.df)||t.showTourById(e)}previewTour(e){this.df?this.df.previewTour(e):this.zo(()=>{var t;this.ff(),null==(t=this.df)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.df)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.df)||e.nextStep()}previousStep(){var e;null==(e=this.df)||e.previousStep()}clearCache(){var e;this.vf=null,null==(e=this.Ml)||e.unregister("ph_product_tours")}resetTour(e){var t;null==(t=this.df)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.df)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.df)||t.cancelPendingTour(e)}}},lk),lE=tk({surveys:class extends aV{constructor(e){super(new aK(e),{get projectToken(){return e.config.token},kv:new az(e)}),this._instance=e}qh(e,t){let r=t.query?op(e,t.query):e;return new Promise(e=>{var n;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor(null!=(n=t.target)?n:"api",r),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})}}},lk),lS=tk({experiments:class e{get Rr(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(t=!1)=>{this.getWebExperiments(t=>{e.Of("retrieved web experiments from the server"),this.Df=new Map,t.forEach(t=>
45{if(t.feature_flag_key){var r;this.Df&&(e.Of("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=this.Df)||r.set(t.feature_flag_key,t));let n=this._instance.getFeatureFlag(t.feature_flag_key);G(n)&&t.variants[n]&&this.Lf(t.name,n,t.variants[n].transforms)}else if(t.variants)for(let r in t.variants){let n=t.variants[r];e.Nf(n,this._instance)&&this.Lf(t.name,r,n.transforms)}})},t)},this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Of(li);else if(!this.Rr.disable_web_experiments){if(J(this.Df))return this.Df=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Of("applying feature flags",t),t.forEach(e=>{var t,r;if(this.Df&&(null==(t=this.Df)?void 0:t.has(e))){let t=this._instance.getFeatureFlag(e),n=null==(r=this.Df)?void 0:r.get(e);t&&(null==n?void 0:n.variants[t])&&this.Lf(n.name,t,n.variants[t].transforms)}})}}previewWebExperiment(){let t=e.getWindowLocation();if(null==t?void 0:t.search){let r=i3(null==t?void 0:t.search,"__experiment_id"),n=i3(null==t?void 0:t.search,"__experiment_variant");r&&n&&(e.Of(`previewing web experiments ${r} && ${n}`),this.getWebExperiments(e=>{this.qf(parseInt(r),n,e)},!1,!0))}}loadIfEnabled(){this.Rr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Rr.disable_web_experiments&&!r)return e([]);let n=this._instance.get_property("$web_experiments");if(n&&!t)return e(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Rr.token}`),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}qf(t,r,n){let i=n.filter(e=>e.id===t);i&&i.length>0&&(e.Of(`Previewing web experiment [${i[0].name}] with variant [${r}]`),this.Lf(i[0].name,r,i[0].variants[r].transforms))}static Nf(t,r){return!J(t.conditions)&&e.jf(t,r)&&e.Bf(t)}static jf(t,r){var n,i,s,o;if(J(t.conditions)||J(null==(n=t.conditions)?void 0:n.url))return!0;let a=e.getWindowLocation();if(a){let e=io(r,a.href);return!(null==(i=t.conditions)?void 0:i.url)||ls[null!=(s=null==(o=t.conditions)?void 0:o.urlMatchType)?s:"icontains"](t.conditions.url,e)}return!1}
45static getWindowLocation(){return null==h?void 0:h.location}static Bf(e){var t,r,n,i,s,o,a,l,u;if(J(e.conditions)||J(null==(t=e.conditions)?void 0:t.utm))return!0;let c=si();if(c.utm_source){let t=!(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==c.utm_campaign,h=!(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.utm_source)||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_source)==c.utm_source,d=!(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_medium)||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_medium)==c.utm_medium,p=!(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_term)||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==c.utm_term;return t&&d&&p&&h}return!1}static Of(e,...t){rx.info(`[WebExperiments] ${e}`,t)}Lf(t,r,n){this._is_bot()?e.Of(li):"control"!==r?n.forEach(n=>{if(n.selector){var i;e.Of(`applying transform of variant ${r} for experiment ${t} `,n);let s=null==(i=document)?void 0:i.querySelectorAll(n.selector);null==s||s.forEach(e=>{n.html&&(e.innerHTML=n.html),n.css&&e.setAttribute("style",n.css)})}}):e.Of("Control variants leave the page unmodified.")}_is_bot(){return p&&this._instance?oD(p,this.Rr.custom_blocked_useragents):void 0}}},lk);ap.__defaultExtensionClasses=tk({},tk(tk(tk(tk(tk(tk(tk(tk(tk(tk(tk(tk(tk({},lk),{sessionRecording:class{get Rr(){return this._instance.config}get Ml(){return this._instance.persistence}get started(){var e;return!!(null==(e=this.Xd)?void 0:e.isStarted)}get status(){var e,t;return"awaiting_config"===this.Yd||"missing_config"===this.Yd?this.Yd:null!=(e=null==(t=this.Xd)?void 0:t.status)?e:this.Yd}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.Yd=aA,this.tv=void 0,this.ev=!1,this.Xe=(()=>{var e,t;if(!(null==f?void 0:f.visibilityState)||"visible"===f.visibilityState)return!0;let r=null==h||null==(e=h.performance)||null==(t=e.getEntriesByType)?void 0:t.call(e,"visibility-state");return!(null==r?void 0:r.length)||r.some(e=>"visible"===e.name)})(),this.ln=()=>{var e,t;"visible"===(null==f?void 0:f.visibilityState)&&(this.Xe=!0,null==(e=this.Xd)||null==(t=e.setDocumentWasEverVisible)||t.call(e,!0))},!this._instance.sessionManager)throw aj.error("started without valid sessionManager"),Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Rr.cookieless_mode)throw Error('[SessionRecording] cannot be used with cookieless_mode="always"');(null==f?void 0:f.addEventListener)&&nB(f,"visibilitychange",this.ln)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this.ev=!0,null==f||null==(t=f.removeEventListener)||t.call(f,"visibilitychange",this.ln),e?this.iv(!0):this.stopRecording()}get nv(){var e;let t=!!(null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.enabled),r=!this.Rr.disable_session_recording,n=this.Rr.disable_session_recording||this._instance.consent.isOptedOut();return h&&t&&r&&!n}startIfEnabledOrStop(e){var t;if(this.ev||this.nv&&(null==(t=this.Xd)?void 0:t.isStarted))return;let r=!q(Object.assign)&&!q(Array.from);this.nv&&r?(this.sv(e),aj.info("starting")):(this.Yd=aA,this.stopRecording())}sv(e){var t,r,n,i;if(this.nv)if("awaiting_config"!==this.Yd&&"missing_config"!==this.Yd&&(this.Yd=aC),(null==x||null==(t=x.__PosthogExtensions__)||null==(t=t.rrweb)?void 0:t.record)&&(null==(r=x.__PosthogExtensions__)?void 0:r.initSessionRecording))this.rv(e);else{let t=this._instance.sessionManager;null==(n=x.__PosthogExtensions__)||null==(i=n.loadExternalDependency)||i.call(n,this._instance,this.ov,r=>{if(!this.ev&&this.nv&&this._instance.sessionManager===t)return r?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),aj.error("could not load recorder",r)):void this.rv(e);this.Yd="disabled"})}}stopRecording(){var e,t;null==(e=this.tv)||e.call(this),this.tv=void 0,null==(t=this.Xd)||t.stop()}iv(e=!1){var t,r;null==(t=this.tv)||t.call(this),this.tv=void 0,null==(r=this.Xd)||r.discard({discardProducerEvents:e})}av(){var e,t;null==(e=this.Ml)||e.unregister("$session_is_sampled"),null==(t=this.Ml)||t.unregister("$replay_sample_rate")}lv(e,t){if(J(e))return null;let r=Y(e)?e:parseFloat(e);return"number"!=typeof r||!Number.isFinite(r)||0>r||r>1?(aj.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):r}uv(e){if(this.Ml){var t,r;let n=this.Ml,i=()=>{var t;let r=!1===e.sessionRecording?void 0:e.sessionRecording,i=this.lv(null==(t=this.Rr.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),s=this.lv(null==r?void 0:r.sampleRate,"remote config sampleRate"),o=null!=i?i:s;J(o)&&this.av();let a=null==r?void 0:r.minimumDurationMilliseconds;n.register({[rJ]:tk(tk({cache_timestamp:Date.now(),enabled:!!r},r),{},{networkPayloadCapture:tk({capturePerformance:e.capturePerformance},null==r?void 0:r.networkPayloadCapture),canvasRecording:{enabled:null==r?void 0:r.recordCanvas,fps:null==r?void 0:r.canvasFps,quality:null==r?void 0:r.canvasQuality},sampleRate:o,minimumDurationMilliseconds:q(a)?null:a,endpoint:null==r?void 0:r.endpoint,triggerMatchType:null==r?void 0:r.triggerMatchType,masking:null==r?void 0:r.masking,urlTriggers:null==r?void 0:r.urlTriggers,version:null==r?void 0:r.version,triggerGroups:null==r?void 0:r.triggerGroups})})};i(),null==(t=this.tv)||t.call(this),this.tv=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(i)}}onRemoteConfig(e){let t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.uv(t),void this.iv()):(this.uv(t),void this.startIfEnabledOrStop()):("awaiting_config"===this.Yd&&(this.Yd="missing_config",this._instance.register_for_session({[nw]:!0}),aj.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t="log"){var r;
45(null==(r=this.Xd)?void 0:r.log)?this.Xd.log(e,t):aj.warn("log called before recorder was ready")}get ov(){var e,t;let r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(rJ);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}hv(){let e,t=this._instance.get_property(rJ);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return aj.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!J(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}rv(e){var t,r,n,i;if(!this.ev&&this.nv&&this._instance.sessionManager){if(!(null==(t=x.__PosthogExtensions__)?void 0:t.initSessionRecording))return aj.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[n_]:!0});if(this.Xd||(this.Xd=null==(i=x.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance,this.Xe),this.Xd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.hv()){if("missing_config"===this.Yd||"awaiting_config"===this.Yd)return;return this.Yd="awaiting_config",aj.info("persisted remote config is stale, requesting fresh config before starting"),void new sN(this._instance).load()}this.Yd=aC,null==(r=(n=this.Xd).setDocumentWasEverVisible)||r.call(n,this.Xe),this.Xd.start(e)}else this.Yd=aA}onRRwebEmit(e){var t,r;null==(t=this.Xd)||null==(r=t.onRRwebEmit)||r.call(t,e)}overrideLinkedFlag(){var e,t;this.Xd||null==(t=this.Ml)||t.register({$replay_override_linked_flag:!0}),null==(e=this.Xd)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Xd||null==(t=this.Ml)||t.register({$replay_override_sampling:!0}),null==(e=this.Xd)||e.overrideSampling()}overrideTrigger(e){var t,r;this.Xd||null==(r=this.Ml)||r.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null==(t=this.Xd)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Xd)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!!(null==(r=this.Xd)?void 0:r.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;null==(e=this.Xd)||null==(t=e.flushBeforeIdentityReset)||t.call(e)}}}),{autocapture:class extends ay{constructor(e){super(new ab(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.dv=this.vv()}initialize(){this.startIfEnabled()}get isEnabled(){let e=this.fv();return!!(e.path||e.search||this.pv(e))}startIfEnabled(){this.isEnabled&&(rx.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.dv=this.vv(),this.startIfEnabled()}stop(){this.gv&&this.gv(),this.gv=void 0,this.mv&&this.mv(),this.mv=void 0,rx.info("History API monitoring stopped")}monitorHistoryChanges(){h&&h.history&&(this.yv("pushState"),this.yv("replaceState"),this.bv(),this.pv()&&this._v())}yv(e){var t;if(!h||(null==(t=h.history[e])?void 0:t.__posthog_wrapped__))return;let r=this;ax(h.history,e,t=>function(n,i,s){t.call(this,n,i,s),r.wv(e)})}vv(){let e=null==h?void 0:h.location;if(null==e?void 0:e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}fv(){let e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:W(e)?e:{}}pv(e=this.fv()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}Sv(e){let t=this.fv(),r=this.dv;return!(!r||!(t.path&&e.pathname!==r.pathname||t.search&&e.search!==r.search||this.pv(t)&&e.hash!==r.hash))}wv(e){try{let t=this.vv();if(!t)return;this.Sv(t)&&this._instance.capture(nT,{navigation_type:e}),this.dv=t}catch(t){rx.error(`Error capturing ${e} pageview`,t)}}bv(){if(this.gv)return;let e=()=>{this.wv("popstate")};nB(h,"popstate",e),this.gv=()=>{h&&h.removeEventListener("popstate",e)}}_v(){if(this.mv)return;let e=()=>{this.wv("hashchange")};nB(h,"hashchange",e),this.mv=()=>{h&&h.removeEventListener("hashchange",e)}}},heatmaps:class{get Rr(){return this.instance.config}constructor(e){var t;this.xv=!1,this.xo=!1,this.Cv=null,this.instance=e,this.xv=!!(null==(t=this.instance.persistence)?void 0:t.props[rB]),this.rageclicks=new af(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return W(this.Rr.capture_heatmaps)&&this.Rr.capture_heatmaps.flush_interval_milliseconds&&(e=this.Rr.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return J(this.Rr.capture_heatmaps)?J(this.Rr.enable_heatmaps)?this.xv:this.Rr.enable_heatmaps:!1!==this.Rr.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.xo||(aO.info("starting..."),this.$v(),this.ln());else{var e;clearInterval(null!=(e=this.Cv)?e:void 0),this.Tv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("heatmaps"in t))return;let r=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[rB]:r}),this.xv=r,this.startIfEnabled()}getAndClearBuffer(){let e=this.Rt;return this.Rt=void 0,e}Iv(e){a$(e.originalEvent)&&this.Tr(e.originalEvent,"deadclick")}ln(){this.Cv&&clearInterval(this.Cv),this.Cv="visible"===(null==f?void 0:f.visibilityState)?setInterval(this.bl.bind(this),this.flushIntervalMilliseconds):null}$v(){h&&f&&(this.Mv=this.bl.bind(this),nB(h,nR,this.Mv),this.Ev=e=>this.Tr(e||(null==h?void 0:h.event)),nB(f,"click",this.Ev,{capture:!0}),this.Pv=e=>this.Rv(e||(null==h?void 0:h.event)),nB(f,"mousemove",this.Pv,{capture:!0}),this.Av=new iG(this.instance,iH,this.Iv.bind(this)),this.Av.startIfEnabledOrStop(),this.Fv
45=this.ln.bind(this),nB(f,nP,this.Fv),this.xo=!0)}Tv(){var e;h&&f&&(this.Mv&&h.removeEventListener(nR,this.Mv),this.Ev&&f.removeEventListener("click",this.Ev,{capture:!0}),this.Pv&&f.removeEventListener("mousemove",this.Pv,{capture:!0}),this.Fv&&f.removeEventListener(nP,this.Fv),clearTimeout(this.Ov),null==(e=this.Av)||e.stop(),this.xo=!1)}Dv(e,t){let r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=function(e,t,r){let n=e;for(;n&&il(n)&&!iu(n,"body");){let e;if(n===r)break;try{var i,s,o;e=null==(i=null!=(s=null==(o=n.ownerDocument)?void 0:o.defaultView)?s:h)?void 0:i.getComputedStyle(n).position}catch(e){break}if(I(t,e))return!0;n=ik(n)}return!1}(iy(e),["fixed","sticky"],i);return{x:e.clientX+(s?0:n),y:e.clientY+(s?0:r),target_fixed:s,type:t}}Tr(e,t="click"){var r;if(ia(e.target)||!a$(e))return;let n=this.Dv(e,t);(null==(r=this.rageclicks)?void 0:r.isRageClick(e.clientX,e.clientY,(new Date).getTime()))&&iA(iy(e),this.instance.config.rageclick)&&this.Zs(tk(tk({},n),{},{type:"rageclick"})),this.Zs(n)}Rv(e){!ia(e.target)&&a$(e)&&(clearTimeout(this.Ov),this.Ov=setTimeout(()=>{this.Zs(this.Dv(e,"mousemove"))},500))}Zs(e){if(!h)return;let t=this.Rr.disable_capture_url_hashes?tg(h.location.href):h.location.href,r=this.Rr.custom_personal_data_properties,n=i5(t,this.Rr.mask_personal_data_properties?[...se,...r||[]]:[],sr);this.Rt=this.Rt||{},this.Rt[n]||(this.Rt[n]=[]),this.Rt[n].push(e)}bl(){this.Rt&&!H(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:iG,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.xv=!1,this.xo=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Lv=()=>{clearTimeout(this.Nv),this.Nv=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",tk({$current_url:this.Rt.url},this.Rt.metrics.reduce((e,t)=>tk(tk({},e),{},{[`$web_vitals_${t.name}_event`]:tk({},t),[`$web_vitals_${t.name}_value`]:t.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.qv=e=>{var t;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},J(null==e?void 0:e.name)||J(null==e?void 0:e.value))return void aS.error("Invalid metric received",e);let r="string"==typeof e.navigationURL?e.navigationURL:void 0,n=this.jv(r);if(q(n))return;let i=Y(e.navigationId)||"string"==typeof e.navigationId?`navigation:${e.navigationId}`:`url:${n}`;if(this.Bv&&e.value>=this.Bv)return void aS.error("Ignoring metric with value >= "+this.Bv,e);this.Rt.navigationKey!==i&&(this.Lv(),this.Nv=setTimeout(this.Lv,this.flushToCaptureTimeoutMs)),q(this.Rt.navigationKey)&&(this.Rt.navigationKey=i,this.Rt.url=n),this.Rt.firstMetricTimestamp=q(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;let s=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),o=tk(tk(tk({},e),r?{navigationURL:n}:{}),{},{$current_url:n,timestamp:Date.now()});if(delete o.entries,W(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){let t={};for(let r of aT){let n="url"===r&&"string"==typeof e.attribution[r]?this.jv(e.attribution[r]):e.attribution[r];q(n)||(t[r]=n)}o.attribution=t}else delete o.attribution;q(s)||(o.$session_id=s.sessionId,o.$window_id=s.windowId),this.Rt.metrics.push(o),this.Rt.metrics.length===this.allowedMetrics.length&&this.Lv()},this.Hv=()=>{if(this.xo)return;let e,t,r,n,i=!1,s=x.__PosthogExtensions__,o=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,a=(null==o?void 0:o[this.zv])||("web-vitals"===this.zv&&q(o)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!q(a)){let s=a.withoutAttribution,o=this.attributionMetrics;i=!q(s),e=o.indexOf("LCP")>-1?a.onLCP:(null==s?void 0:s.onLCP)||a.onLCP,t=o.indexOf("CLS")>-1?a.onCLS:(null==s?void 0:s.onCLS)||a.onCLS,r=o.indexOf("FCP")>-1?a.onFCP:(null==s?void 0:s.onFCP)||a.onFCP,n=o.indexOf("INP")>-1?a.onINP:(null==s?void 0:s.onINP)||a.onINP}if(!(e&&t&&r&&n))return void aS.error("web vitals callbacks not loaded - not starting");let l={reportSoftNavs:this.useSoftNavs},u=i&&this.attributionMetrics.indexOf("INP")>-1?tk(tk({},l),{},{includeProcessedEventEntries:!1}):l;this.allowedMetrics.indexOf("LCP")>-1&&e(this.qv.bind(this),l),this.allowedMetrics.indexOf("CLS")>-1&&t(this.qv.bind(this),l),this.allowedMetrics.indexOf("FCP")>-1&&r(this.qv.bind(this),l),this.allowedMetrics.indexOf("INP")>-1&&n(this.qv.bind(this),u),this.xo=!0},this.xv=!!(null==(t=this._instance.persistence)?void 0:t.props[rH]),this.startIfEnabled()}get Uv(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;let r=W(this.Uv)?null==(e=this.Uv)?void 0:e.web_vitals_allowed_metrics:void 0;return J(r)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||aP:r}get flushToCaptureTimeoutMs(){return(W(this.Uv)?this.Uv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){let e=W(this.Uv)?this.Uv.web_vitals_attribution:void 0;return Z(e)?e?aP:[]:U(e)?e:aR}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){let e=W(this.Uv)?this.Uv.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get Bv(){let e=W(this.Uv)&&Y(this.Uv.__web_vitals_max_value)?this.Uv.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){let e=null==g?void 0:g.protocol;if("http:"!==e&&"https:"!==e)return aS.info("Web Vitals are disabled on non-http/https protocols"),!1;let t=W(this.Uv)?this.Uv.web_vitals:Z(this.Uv)?this.Uv:void 0;return Z(t)?t:this.xv}startIfEnabled(){this.isEnabled&&!this.xo&&(aS.info("enabled, starting..."),this.zo(this.Hv))}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("capturePerformance"in t))return;let r=W(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=W(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[rH]:r}),this._instance.persistence.register({[rK]:n}
45)),this.xv=r,this.startIfEnabled()}get zv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}zo(e){var t;let r=x.__PosthogExtensions__,n=this.zv,i=null==r?void 0:r.postHogWebVitalsCallbacksByFlavor;(null==i?void 0:i[n])||"web-vitals"===n&&q(i)&&(null==r?void 0:r.postHogWebVitalsCallbacks)?e():null==r||null==(t=r.loadExternalDependency)||t.call(r,this._instance,n,t=>{t?aS.error("failed to load script",t):e()})}jv(e){let t=e||(null==h?void 0:h.location.href);if(!t)return void aS.error("Could not determine current URL");let r=this._instance.config.disable_capture_url_hashes?tg(t):t,n=this._instance.config.custom_personal_data_properties;return i5(r,this._instance.config.mask_personal_data_properties?[...se,...n||[]]:[],sr)}}}),{exceptionObserver:class{constructor(e){var t;this.Hv=()=>{var e;if(!h||!this.isEnabled||!(null==(e=x.__PosthogExtensions__)?void 0:e.errorWrappingFunctions))return;let t=x.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=x.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=x.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Wv&&this.Rr.capture_unhandled_errors&&(this.Wv=t(this.captureException.bind(this))),!this.Vv&&this.Rr.capture_unhandled_rejections&&(this.Vv=r(this.captureException.bind(this))),!this.Gv&&this.Rr.capture_console_errors&&(this.Gv=n(this.captureException.bind(this)))}catch(e){a_.error("failed to start",e),this.Zv()}},this._instance=e,this.Qv=!!(null==(t=this._instance.persistence)?void 0:t.props[rU]),this.wt=new ep(tk(tk({},function(e={}){var t,r,n,i;return{refillRate:null!=(t=null!=(r=e.exceptionRateLimiterRefillRate)?r:e.__exceptionRateLimiterRefillRate)?t:1,bucketSize:null!=(n=null!=(i=e.exceptionRateLimiterBucketSize)?i:e.__exceptionRateLimiterBucketSize)?n:10}}(this._instance.config.error_tracking)),{},{refillInterval:1e4,$:a_})),this.Rr=this.Jv(),this.startIfEnabledOrStop()}Jv(){let e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return W(e)?t=tk(tk({},t),e):(q(e)?this.Qv:e)&&(t=tk(tk({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Rr.capture_console_errors||this.Rr.capture_unhandled_errors||this.Rr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(a_.info("enabled"),this.Zv(),this.zo(this.Hv)):this.Zv()}zo(e){var t,r,n;(null==(t=x.__PosthogExtensions__)?void 0:t.errorWrappingFunctions)?e():null==(r=x.__PosthogExtensions__)||null==(n=r.loadExternalDependency)||n.call(r,this._instance,"exception-autocapture",t=>{if(t)return a_.error("failed to load script",t);e()})}Zv(){var e,t,r;null==(e=this.Wv)||e.call(this),this.Wv=void 0,null==(t=this.Vv)||t.call(this),this.Vv=void 0,null==(r=this.Gv)||r.call(this),this.Gv=void 0}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"autocaptureExceptions"in t&&(this.Qv=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[rU]:this.Qv}),this.Rr=this.Jv(),this.startIfEnabledOrStop())}onConfigChange(){this.Rr=this.Jv()}captureException(e){try{var t,r,n;let i=null!=(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)?t:"Exception";if(this.wt.consumeRateLimit(i))return void a_.info("Skipping exception capture because of client rate limiting.",{exception:i});null==(n=this._instance.exceptions)||n.sendExceptionEvent(e)}catch(e){}}},exceptions:class{constructor(e){var t,r;this.Kv=[],this.Xv=new tx([new tF,new tJ,new tU,new tB,new tz,new tG,new tW,new tK],function(e,...t){return(r,n=0)=>{let i=[],s=r.split("\n"),o=Math.min(s.length,n+1e3),a=[];for(let r=n;o>r;r++){let n=s[r];if(n.length>1024)continue;let o=tL.test(n)?n.replace(tL,"$1"):n;if(!o.match(/\S*Error: /)){for(let r of t){let t=r(o,e);if(t){i.push(t);let e=function(e){for(let t=1;10>=t;t++){let r=e.length-2*t;if(0>r)break;let n=!0;for(let i=0;t>i;i++)if(!tM(e[r+i],e[r+t+i])){n=!1;break}if(n){for(let n=0;t>n;n++)e[r+n]=e[r+t+n];return e.length=r+t,{start:r,length:t}}}}(i);if(e){for(let t=a.length-1;t>=0;t--){let r=a[t];if(e.start>=r.start+r.length)break;a.pop()}a.push(e)}break}}if(function(e,t){let r=t[0],n=e.length-(r?tD(e,r):0);for(let r of t)n-=tN(e,r);return n}(i,a)>=50)break}}let l=[...a].sort((e,t)=>
45t.start-e.start),u=l[l.length-1];if(u){let e=tD(i,u);for(let t of(i.splice(u.start-e,e),l))t.start-=e}for(let e of l)!function(e,t){let r=t.start+t.length,n=tN(e,t);n&&e.splice(r+n===e.length?r:t.start,n)}(i,e);return a.some(e=>0===e.start&&i.length===e.length)&&function(e){let t=e.map(e=>`${e.function}|${e.filename}|${e.lineno}|${e.colno}|${e.module}`),r=0;for(let e=1;t.length>e;e++)(function(e,t,r){for(let n=0;e.length>n;n++){let i=e[(t+n)%e.length],s=e[(r+n)%e.length];if(i!==s)return s>i}return!1})(t,e,r)&&(r=e);e.push(...e.splice(0,r))}(i),function(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>tk(tk({},e),{},{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(i)}}("web:javascript",tj,tI)),this._instance=e,this.Kv=null!=(t=null==(r=this._instance.persistence)?void 0:r.get_property("$error_tracking_suppression_rules"))?t:[],this.Yv=t0(this.tf()),this.ef=new t1(this.Yv)}onConfigChange(){this.Yv=t0(this.tf()),this.ef.setConfig(this.Yv)}onRemoteConfig(e){var t,r,n;if(!e.ok)return;let i=e.config;if(!("errorTracking"in i))return;let s=null!=(t=null==(r=i.errorTracking)?void 0:r.suppressionRules)?t:[],o=null==(n=i.errorTracking)?void 0:n.captureExtensionExceptions;this.Kv=s,this._instance.persistence&&this._instance.persistence.register({[rV]:this.Kv,[rW]:o})}get if(){var e;let t=!!this._instance.get_property(rW),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=r?r:t)&&e}buildProperties(e,t){return this.Xv.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.Yv.enabled)try{if(!G(e)||0===e.trim().length)return void a7.warn("Ignoring exception step because message must be a non-empty string");let{sanitizedProperties:r,droppedKeys:n}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};let t=[];return{sanitizedProperties:Object.keys(e).reduce((r,n)=>(tZ.has(n)?t.push(n):r[n]=e[n],r),{}),droppedKeys:t}}(this.nf(t));n.length>0&&a7.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.ef.add(tk({[tY]:e,[tX]:(new Date).toISOString()},r))}catch(e){a7.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{let t,r=e.$exception_list;if(this.sf(r)){if(this.rf(r))return this.af("Exception dropped: matched a suppression rule"),void a7.info("Skipping exception capture because a suppression rule matched");if(!this.if&&this.lf(r))return this.af("Exception dropped: thrown by a browser extension"),void a7.info("Skipping exception capture because it was thrown by an extension");if(!this.if&&this.uf(r))return this.af("Exception dropped: thrown by an injected browser script"),void a7.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.hf(r))return this.af("Exception dropped: thrown by the PostHog SDK"),void a7.info("Skipping exception capture because it was thrown by the PostHog SDK")}let n=this.Yv.enabled&&J(e.$exception_steps)?this.cf(e):e,i=(t=globalThis._posthogReleaseId,"string"==typeof t&&t.length>0?t:void 0);i&&(n.$release_id=i);try{let e=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",fh:!0});return e&&this.ef.clear(),e}catch(e){return a9(e)||a7.error("Failed to capture exception event. Dropping this exception.",e),void this.ef.clear()}}catch(e){return void(a9(e)||a7.error("Failed to process exception event. Ignoring this exception.",e))}}cf(e){try{let t=this.ef.getAttachable();return 0===t.length?e:tk(tk({},e),{},{$exception_steps:t})}catch(t){return a7.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}af(e){this.Yv.enabled&&this.ef.add({[tY]:e,[tX]:(new Date).toISOString()})}nf(e){return W(e)?tk({},e):{}}tf(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}rf(e){if(0===e.length)return!1;try{let t=e.reduce((e,{type:t,value:r})=>(G(t)&&t.length>0&&e.$exception_types.push(t),G(r)&&r.length>0&&e.$exception_values.push(r),e),{$exception_types:[],$exception_values:[]});return this.Kv.some(e=>{let r=e.values.map(e=>{let r=oV[e.operator],n=t[e.key];if(!r||!n)return!1;let i=U(e.value)?e.value:[e.value];return i.length>0&&r(i,n)});return"OR"===e.type?r.some(Boolean):r.every(Boolean)})}catch(e){return a7.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}lf(e){let t=e.flatMap(e=>{var t,r;return null!=(t=null==(r=e.stacktrace)?void 0:r.frames)?t:[]}),r=t.filter(({filename:e})=>!!e&&lr.some(t=>e.startsWith(t)));return 0!==r.length&&(!r.every(({filename:e})=>!!e&&e.startsWith(le))||e.some(({type:e,value:t})=>"NoResponse"===e||G(t)&&lt.some(({value:e,exact:r})=>r?t===e:t.includes(e)))&&!t.some(({in_app:e,filename:t})=>e&&!(null==t?void 0:t.startsWith(le))))}uf(e){return e.some(({value:e})=>G(e)&&ln.some(t=>e.includes(t)))}hf(e){if(e.length>0){var t,r,n,i;let s=null!=(t=null==(r=e[0].stacktrace)?void 0:r.frames)?t:[],o=s[s.length-1];return null!=(n=null==o||null==(i=o.filename)?void 0:i.includes("posthog.com/static"))&&n}return!1}sf(e){return!J(e)&&U(e)}}}),lx),{siteApps:class{constructor(e){this._instance=e,this.pf=0,this.gf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}mf(e,t){if(!t)return;let r=this.globalsForEvent(t);this.gf.push(r),this.gf.length>1e3&&(this.gf=this.gf.slice(10))}get siteAppLoaders(){var e;return null==(e=x._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){let e=this._instance._addCaptureHook(this.mf.bind(this));this.yf=()=>{e(),this.gf=[],this.yf=void 0}}}globalsForEvent(e){var t,r,n,i,s,o,a;if(!e)throw Error("Event payload is required");let l={},u=this._instance.get_property("$groups")||[];for(let[e,t]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[e]={id:u[e],type:e,properties:t};let{$set_once:c,$set:h}=e;return{event:tk(tk({},rn(e,aM)),{},{properties:tk(tk(tk({},e.properties),h?{$set:tk(tk({},null!=(t=null==(r=e.properties)?void 0:r.$set)?t:{}),h)}:{}),c?{$set_once:tk(tk({},null!=(n=null==(i=e.properties)?void 0:i.$set_once)?n:{}),c)}:{}),elements_chain:null!=(s=null==(o=e.properties)?void 0:o.$elements_chain)?s:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}bf(e){var t;let r=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(aD.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(aD.error("prepare_external_dependency_script returned null"),null):e}_f(){var e,t,r,n,i,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};let l=null==f?void 0:f.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.pf++,this.wf)return this.kf();let c=[],h=this,d=new WeakSet,p=(e,t,r)=>{if(!(null==e?void 0:e[t]))return;let n=e[t];e[t]=r(n),c.push(()=>{e[t]=n})},g=e=>{if(d.has(e))return e;let t=h.bf(e);return t&&d.add(t),t},m=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!K(e));return p(u,"appendChild",e=>function(t){let r=g(t);return r?e.call(this,r):t}),p(u,"insertBefore",e=>function(t,r){let n=g(t);return n?e.call(this,n,r):t}),p(u,"replaceChild",e=>function(t,r){let n=g(t);return n?e.call(this,n,r):r}),[null==(t=l.Element)?void 0:t.prototype,null==(r=l.Document)?void 0:r.prototype,null==(n=l.DocumentFragment)?void 0:n.prototype].forEach(e
45=>{p(e,"append",e=>function(...t){return e.apply(this,m(t))}),p(e,"prepend",e=>function(...t){return e.apply(this,m(t))})}),[null==(i=l.Element)?void 0:i.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach(e=>{p(e,"before",e=>function(...t){return e.apply(this,m(t))}),p(e,"after",e=>function(...t){return e.apply(this,m(t))}),p(e,"replaceWith",e=>function(...t){let r=m(t);return t.length&&!r.length?void 0:e.apply(this,r)})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",e=>function(t,r){let n=g(r);return n?e.call(this,t,n):null}),this.wf=()=>{c.forEach(e=>e()),this.wf=void 0},this.kf()}kf(){let e=!1;return()=>{var t;e||(e=!0,this.pf--,0===this.pf&&(null==(t=this.wf)||t.call(this)))}}Sf(e,t=!0){let r=this._f();try{let n=e(r);return t&&r(),n}catch(e){throw r(),e}}setupSiteApp(e){let t=this.apps[e.id],r=()=>{var r;!t.errored&&this.gf.length&&(aD.info(`Processing ${this.gf.length} events for site app with id ${e.id}`),this.gf.forEach(e=>this.Sf(()=>{var r;return null==(r=t.processEvent)?void 0:r.call(t,e)})),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(r=this.yf)||r.call(this))},n=!1,i=i=>{t.errored=!i,t.loaded=!0,aD.info(`Site app with id ${e.id} ${i?"loaded":"errored"}`),n&&r()};try{let{processEvent:r}=this.Sf(t=>e.init({posthog:this._instance,callback(e){t(),i(e)}}),!1);r&&(t.processEvent=r),n=!0}catch(t){aD.error(aN+e.id,t),i(!1)}if(n&&t.loaded)try{r()}catch(r){aD.error(`Error while processing buffered events PostHog app with config id ${e.id}`,r),t.errored=!0}}xf(){let e=this.siteAppLoaders||[];for(let t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(let t of e)this.setupSiteApp(t)}Cf(e){if(0===Object.keys(this.apps).length)return;let t=this.globalsForEvent(e);for(let r of Object.values(this.apps))try{this.Sf(()=>{var e;return null==(e=r.processEvent)?void 0:e.call(r,t)})}catch(t){aD.error(`Error while processing event ${e.event} for site app ${r.id}`,t)}}onRemoteConfig(e){var t,r,n,i,s;if(null==(t=this.siteAppLoaders)?void 0:t.length)return this.isEnabled?(this.xf(),void this._instance.on("eventCaptured",e=>this.Cf(e))):void aD.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.yf)||r.call(this),!e.ok)return;let o=e.config;if(null==(n=o.siteApps)?void 0:n.length)if(this.isEnabled)for(let{id:e,url:t}of o.siteApps)x[`__$$ph_site_app_${e}`]=this._instance,null==(i=x.__PosthogExtensions__)||null==(s=i.loadSiteApp)||s.call(i,this._instance,t,t=>{if(t)return aD.error(aN+e,t)});else aD.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}),lE),{tracingHeaders:class{constructor(e){this._instance=e,this.$f=void 0,this.Tf=void 0,this.If=void 0,this.Hv=()=>{var e,t;let r=this.Mf();r?(q(this.$f)&&(this.$f=null==(e=x.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),q(this.Tf)&&(this.Tf=null==(t=x.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Zv()}}initialize(){this.startIfEnabledOrStop()}zo(e){var t,r,n;(null==(t=x.__PosthogExtensions__)?void 0:t.tracingHeadersPatchFns)?e():null==(r=x.__PosthogExtensions__)||null==(n=r.loadExternalDependency)||n.call(r,this._instance,"tracing-headers",t=>{if(t)return aE.error("failed to load script",t);e()})}Ef(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}Mf(){let e=this.Ef();return U(e)?(U(this.If)?this.If.splice(0,this.If.length,...e):this.If=[...e],e.length>0?this.If:void 0):(U(this.If)&&this.If.splice(0),this.If=e||void 0,this.If)}Zv(){var e,t;null==(e=this.$f)||e.call(this),null==(t=this.Tf)||t.call(this),this.$f=void 0,this.Tf=void 0}startIfEnabledOrStop(){this.Mf()?this.zo(this.Hv):this.Zv()}}}),{toolbar:class{constructor(e){this.instance=e}Pf(e){x.ph_toolbar_state=e}Rf(){var e;return null!=(e=x.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){var n,i;if(nU(this.instance.config)||!h||!f)return!1;e=null!=(n=e)?n:h.location,r=null!=(i=r)?i:h.history;try{let n;if(!t){try{h.localStorage.setItem("test","test"),h.localStorage.removeItem("test")}catch(e){return!1}t=null==h?void 0:h.localStorage}let i=aJ||i4(e.hash,"__posthog")||i4(e.hash,"state"),s=i?tm(()=>JSON.parse(atob(decodeURIComponent(i))))||tm(()=>JSON.parse(decodeURIComponent(i))):null;return s&&"ph_authorize"===s.action?((n=s).source="url",n&&Object.keys(n).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((n=JSON.parse(t.getItem(aY)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token||(this.loadToolbar(n),0))}catch(e){return!1}}Af(e){let t=x.ph_load_toolbar||x.ph_load_editor;!J(t)&&V(t)?t(e,this.instance):aX.warn("No toolbar load function found")}loadToolbar(e){let t=!!(null==f?void 0:f.getElementById("__POSTHOG_TOOLBAR__"));if(!h||t)return!1;let r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=tk(tk({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(h.localStorage.setItem(aY,JSON.stringify(tk(tk({},n),{},{source:void 0}))),2===this.Rf())this.Af(n);else if(0===this.Rf()){var i,s;this.Pf(1),null==(i=x.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this.instance,"toolbar",e=>{e?(aX.error("[Toolbar] Failed to load",e),this.Pf(0)):(this.Pf(2),this.Af(n))}),nB(h,"turbolinks:load",()=>{this.Pf(0),this.loadToolbar(n)})}return!0}Ff(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return this.maybeLoadToolbar(e,t,r)}}}),lS),{conversations:class{constructor(e){this._instance=e,this.Hf=void 0,this._conversationsManager=null,this.zf=!1,this.ne=null,this.Uf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations||(this.Wf=e.ok,!e.ok))return;let t=e.config.conversations;J(t)||(Z(t)?this.Hf=t:(this.Hf=t.enabled,this.ne=t),this.loadIfEnabled())}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Hf=void 0,this.ne=null,this.Wf=void 0,this.Uf=!1}loadIfEnabled(){if(this._conversationsManager||this.zf||this._instance.config.disable_conversations||nU(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;let e=null==x?void 0:x.__PosthogExtensions__;if(e&&!q(this.Hf)&&this.Hf)if(this.ne&&this.ne.token){this.zf=!0;try{let t=e.initConversations;
45if(t)return this.Vf(t),void(this.zf=!1);let r=e.loadExternalDependency;if(!r)return void this.Gf(nk);r(this._instance,"conversations",t=>{t||!e.initConversations?this.Gf("Could not load conversations script",t):this.Vf(e.initConversations),this.zf=!1})}catch(e){this.Gf("Error initializing conversations",e),this.zf=!1}}else lo.error("Conversations enabled but missing token in remote config.")}Vf(e){if(this.ne)try{this._conversationsManager=e(this.ne,this._instance),this.Uf=!1,lo.info("Conversations loaded successfully")}catch(e){this.Gf("Error completing conversations initialization",e)}else lo.error("Cannot complete initialization: remote config is null")}Gf(e,t){lo.error(e,t),this._conversationsManager=null,this.zf=!1,this.Uf=!0}show(){this._conversationsManager?this._conversationsManager.show():lo.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Hf&&!K(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":nU(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Wf?"remote_config_failed":q(this.Hf)?this.Wf?"disabled_in_project":"remote_config_pending":this.Hf?J(this.ne)||!this.ne.token?"missing_token":(null==x?void 0:x.__PosthogExtensions__)?this.zf?"initializing":this.Uf?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,r){var n=this;return eu(function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,t,r):(lo.warn(la),null)})()}getMessages(e,t){var r=this;return eu(function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,t):(lo.warn(la),null)})()}markAsRead(e){var t=this;return eu(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(lo.warn(la),null)})()}getTickets(e){var t=this;return eu(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(lo.warn(la),null)})()}requestRestoreLink(e){var t=this;return eu(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(lo.warn(la),null)})()}restoreFromToken(e){var t=this;return eu(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(lo.warn(la),null)})()}restoreFromUrlToken(){var e=this;return eu(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(lo.warn(la),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}Sh(){var e;null==(e=this._conversationsManager)||e.setIdentity()}xh(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}}),{logs:class{constructor(e){var t;this._instance=e,this.name="logs",this.Zf=!1,this.Qf=!1,this.Jf=!1,this.$=rE("[logs]"),this.Kf=tk(tk({},this.$),{},{error:(...e)=>{e.some(lf)||this.$.error(...e)}}),this.al=[],this.Xf=[],this.hd=0,this.Io=!1,this.Yf=[],this.tp=[],this.ep=!1,this.np=!1,this.sp=()=>{var e,t;this.Io||(this.hd=0,null==(e=this.rp)||e.onReconnect(),null==(t=this.op)||t.onReconnect())},this._instance&&(null==(t=this._instance.config.logs)?void 0:t.captureConsoleLogs)&&(this.Zf=!0),h&&nB(h,"online",this.sp)}ap(e,t,r,n){var i;let s=ll(null==(i=this._instance)||null==(i=i.config)?void 0:i.logs,r);return[new rv(this.lp(e,t),s,this.Kf,()=>this.up(),e=>e(),void 0,n),s]}hp(){var e,t;let r=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.rp&&this.cp===r||(null==(t=this.rp)||t.reset(),this.cp=r,[this.rp,this.dp]=this.ap(()=>this.al,e=>{this.al=e})),this.rp}vp(){var e,t;let r=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.op&&this.fp===r||(null==(t=this.op)||t.reset(),this.fp=r,[this.op,this.pp]=this.ap(()=>this.Xf,e=>{this.Xf=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},lh)),this.op}setup(e){var t;if(this.Io)return;this.wo=e,(null==(t=this._instance)||null==(t=t.config)||null==(t=t.logs)?void 0:t.captureConsoleLogs)&&(this.Zf=!0),(this.Zf||this.gp()&&this.mp())&&this.yp();let r=!1,n=e.onRemoteConfig(e=>{var t;r=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),this.onRemoteConfig(e)});this.Io?n.dispose():(this.Po=n,r||this.loadIfEnabled())}dispose(){var e,t,r,n;this.Io||(this.Io=!0,this.bp(),null==(e=this.Po)||e.dispose(),this.Po=void 0,this.wo=void 0,this.Jf=!1,null==h||h.removeEventListener("online",this.sp),null==(t=this._p)||t.call(this),this._p=void 0,null==(r=this.rp)||r.reset(),null==(n=this.op)||n.reset())}onRemoteConfig(e){var t,r;if(this.Io)return;let n=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;J(n)?this.wp():(null==(r=this._instance)||null==(r=r.persistence)||r.register({$logs_capture_enabled_server_side:!!n}),n?(this.Zf=!0,this.Qf||this.yp(),this.loadIfEnabled()):this.wp())}reset(){var e,t,r,n;this.bp(),null==(e=this.rp)||e.clearQueue(),this.al=[],null==(t=this.rp)||t.reset(),null==(r=this.op)||r.clearQueue(),this.Xf=[],null==(n=this.op)||n.reset(),this.hd=0}captureLog(e){this.Io||this.hp().captureLog(e)}captureConsoleLog(e){this.Io||this.vp().captureLog(e)}captureBufferedConsoleLog(e,t,r){this.Io||this.vp().captureLog(e,{context:t,occurredAtMs:r})}mp(){var e;return!!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)?void 0:e[rz])}gp(){var e,t,r;return!(null==(e=this._instance)||null==(t=e.nl)?void 0:t.call(e))||!!(null==(r=x._POSTHOG_REMOTE_CONFIG)||null==(r=r[this._instance.config.token])?void 0:r.config)}$h(){var e;this.bp(),null==(e=this.op)||e.clearQueue(),this.Xf=[]}wp(){this.Zf||this.bp()}yp(){var e;if(this.ep||!(null==x?void 0:x.console))return;let t=ll(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,r=!0;for(let e of(this.tp.push(()=>{r=!1}),lu)){let n;try{n=lc(x.console[e])}catch(e){continue}n&&this.tp.push(ax(x.console,e,i=>{let s=(...n)=>{try{r&&this.kp(e,n,t)}catch(e){}return i.apply(x.console,n)};return s.__rrweb_original__=n,s}))}this.ep=!0,this.Sp=setTimeout(()=>{this.bp()},3e4)}kp(e,t,r){var n;if(this.ep&&!this.np&&0!==t.length)if(null==(n=this._instance)?void 0:n.is_capturing()){if(r>this.Yf.length){this.np=!0;try{this.Yf.push({level:e,args:t,occurredAtMs:Date.now(),context:this.up()})}finally{this.np=!1}}}else this.bp()}bp(){if(this.Yf=[],this.ep){for(let e of(this.ep=!1,this.Sp&&(clearTimeout(this.Sp),this.Sp=void 0),this.tp))e();this.tp=[]}}xp(){let e=this.Yf;return this.bp(),e}get logger(){return this.Cp||(this.Cp={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>
45this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Cp}flushLogs(e){e?this.$p(e):(this.rp&&this.rp.flush().catch(e=>this.Tp(e)),this.op&&this.op.flush().catch(e=>this.Tp(e)))}Tp(e){lf(e)||this.$.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.Io||!this.Zf||this.Qf||this.Jf)return;let e=null==x?void 0:x.__PosthogExtensions__;if(!e)return this.$.error("PostHog Extensions not found."),void this.bp();let t=e.loadExternalDependency;if(!t)return this.$.error(nk),void this.bp();this.Jf=!0;try{t(this._instance,"logs",t=>{if(this.Jf=!1,this.Io||!this.Zf)return;let r=e.logs;if(!t&&(null==r?void 0:r.initializeLogs)){var n,i,s;let e=this.xp();this._p=r.initializeLogs(null!=(n=this.wo)?n:this._instance),this.Qf=!0,e.length>0&&(null==(i=r.replayConsoleBuffer)||i.call(r,null!=(s=this.wo)?s:this._instance,e))}else this.$.error("Could not load logs script",t),this.bp()})}catch(e){throw this.Jf=!1,e}}lp(e,t){let r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:t=>t===C.LogsQueue?e():void 0,setPersistedProperty(e,r){e===C.LogsQueue&&t(null!=r?r:[])},js:e=>this.js(e),getLibraryId:()=>S.LIB_NAME,getLibraryVersion:()=>S.LIB_VERSION}}js(e){return new Promise(t=>{if(i9(this.hd,3))return void t({kind:"fatal",error:lp(void 0,"logs endpoint is unreachable, dropping batch")});let r=!1,n=e=>{r||(r=!0,clearTimeout(i),t(e))},i=setTimeout(()=>{this.$.warn("Logs request timed out before receiving a response"),n({kind:"retry-later",error:lp(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Ip(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{let t=e.statusCode;if(this.Mp(t),t>=200&&300>t)n({kind:"ok"});else if(413===t)n({kind:"too-large"});else if(0!==t&&408!==t&&429!==t&&500>t)n({kind:"fatal",error:Error(`logs request failed with status ${t}`)});else{var r;0===t?(e.error||this.$.warn("Logs request failed before receiving an HTTP response"),n({kind:"retry-later",error:lp(e.error,"logs request failed before receiving an HTTP response")})):n({kind:"retry-later",error:null!=(r=e.error)?r:Error(`logs request failed with status ${t}`)})}}})})}Mp(e){(0!==e||this._instance.__loaded)&&(this.hd=i7(e,this.hd,3,()=>this.$.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}$p(e){this.al.length>0&&this.Ep(e,this.al,this.dp,S.LIB_NAME,e=>{this.al=e}),this.Xf.length>0&&this.Ep(e,this.Xf,this.pp,lh,e=>{this.Xf=e})}Ep(e,t,r,n,i){if(0===t.length)return;let s=t.map(e=>e.record);i([]);let o=rp(s,ra(r,S.LIB_NAME,S.LIB_VERSION),n,S.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Ip(),data:o,compression:"best-available",batchKey:"logs",transport:e})}Ip(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}up(){var e;let t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){let{sessionId:e,windowId:r,sessionStartTimestamp:n,lastActivityTimestamp:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=e,t.windowId=r,J(n)||(t.sessionStartTimestamp=n),J(i)||(t.lastActivityTimestamp=i)}if((null==x||null==(e=x.location)?void 0:e.href)&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tg(x.location.href):x.location.href),this._instance.featureFlags){let e=this._instance.featureFlags.getFlags();e&&e.length>0&&(t.activeFeatureFlags=e)}return t}}}),{metrics:class{constructor(e){this._instance=e,this.$=rE("[metrics]"),this.Io=!1}initialize(){this.onConfigChange()}onConfigChange(){var e,t;let r,n,i,s;if(this.Io)return;let o=!!(null==(e=this._instance.config.metrics)?void 0:e.network);o&&!this.Pp?this.Pp=(t=this._instance,r=!0,n=()=>{var e;let n;return r?!0===(n=null==(e=t.config.metrics)?void 0:e.network)?{}:n||void 0:void 0},i=V(null==h?void 0:h.fetch)?ax(h,"fetch",e=>function(...r){let i=lm(),s=e.apply(this,r);if(!n())return s;try{var o,a,l;let[e,u]=r,c=lb(null!=(o=null!=(a=null==u?void 0:u.method)?a:null==e?void 0:e.method)?o:"GET",null!=(l=null==e?void 0:e.url)?l:e);return s.then(e=>(l_(t,c,null==e?void 0:e.status,i,n,void 0,!0),e),e=>{throw l_(t,c,void 0,i,n,e),e})}catch(e){return lg.error("Failed to observe fetch",e),s}}):lw,s=((e,t)=>{var r;let n=null==h||null==(r=h.XMLHttpRequest)?void 0:r.prototype;if(!n)return lw;let i=new WeakMap,s=ax(n,"open",e=>function(...t){try{ol.has(this)||i.set(this,lb(t[0],t[1]))}catch(e){lg.error("Failed to observe XHR open",e)}return e.apply(this,t)}),o=ax(n,"send",r=>function(...n){let s;try{let r=i.get(this);if(r&&t()){let n=lm();s=()=>{this.removeEventListener("loadend",s),l_(e,r,this.status,n,t)},nB(this,"loadend",s)}}catch(e){lg.error("Failed to observe XHR send",e)}try{return r.apply(this,n)}catch(e){throw s&&this.removeEventListener("loadend",s),e}});return()=>{s(),o()}})(t,n),()=>{r=!1,i(),s()}):!o&&this.Pp&&(this.Pp(),this.Pp=void 0)}hp(){var e,t,r,n,i,s,o;let a,l=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.rp&&this.cp===l||(null==(t=this.rp)||t.reset(),this.cp=l,this.rp=new rw(this.lp(),{serviceName:null!=(r=null==(a=null==l?void 0:l.resourceAttributes)?void 0:a["service.name"])?r:null==l?void 0:l.serviceName,serviceVersion:null!=(n=null==a?void 0:a["service.version"])?n:null==l?void 0:l.serviceVersion,environment:null!=(i=null==a?void 0:a["deployment.environment"])?i:null==l?void 0:l.environment,resourceAttributes:a,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(s=null==l?void 0:l.flushIntervalMs)?s:1e4,maxSeriesPerFlush:null!=(o=null==l?void 0:l.maxSeriesPerFlush)?o:1e3},this.$)),this.rp}count(e,t=1,r){this.hp().count(e,t,r)}gauge(e,t,r){this.hp().gauge(e,t,r)}histogram(e,t,r){this.hp().histogram(e,t,r)}flush(e){if(!this.rp)return Promise.resolve();if(e){let t=this.rp.drainWindow();return t&&this.Ys(t,e),Promise.resolve()}return this.rp.flush().catch(e=>this.$.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.rp)||e.reset()}dispose(){var e,t;this.Io=!0,null==(e=this.Pp)||e.call(this),this.Pp=void 0,null==(t=this.rp)||t.reset()}lp(){let e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Ys:e=>t.Ys(e),getLibraryId:()=>S.LIB_NAME,getLibraryVersion:()=>S.LIB_VERSION}}Ys(e,t){return new Promise(r=>{let n=!1,i=e=>{n||(n=!0,clearTimeout(s),r(e))},s=setTimeout(()=>i({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(tk(tk({method:"POST",url:this.Rp(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(e){let t=e.statusCode;if(t>=200&&300>t)i({kind:"ok"});else if(413===t)i({kind:"too-large"});else if(0!==t&&408!==t&&429!==t&&500>t)i({kind:"fatal",error:Error(`metrics request failed with status ${t}`)});else{var r;i({kind:"retry-later",error:null!=(r=e.error)?r:Error(`metrics request failed with status ${t}`)})}}}))})}Rp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}}));var lP=(S.SDK_DIST_CHANNEL="npm",c=o4[al]=new ap,function(){function e(){e.done||(e.done=!0,oP=!1,n$(o4,function(e){e._dom_loaded()}))}(null==f?void 0:f.addEventListener)?"complete"===f.readyState?e():nB(f,"DOMContentLoaded",e,{capture:!1}):h&&rx.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),c)},71623:(e,t,r)=>{"use strict";function n(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(n&&(n+=" "),n+=t);return n}r.d(t,{$:()=>n,A:()=>i});let i=n},71837:(e,t,r)=>{"use strict";r.d(t,{C:()=>l});var n=r(76430),i=r(52652),s=Object.defineProperty,o=(e,t)=>s(e,"name",{value:t,configurable:!0});function a(e,t){return n.useReducer((e,r)=>t[e][r]??e,e)}o(a,"useStateMachine");var l=o(e=>{let{present:t,children:r}=e,i=u(t),s="function"==typeof r?r({present:i.isPresent}):n.Children.only(r),o=h(i.ref,p(s));return"function"==typeof r||i.isPresent?n.cloneElement(s,{ref:o}):null},"Presence");function u(e){let[t,r]=n.useState(),s=n.useRef(null),l=n.useRef(e),u=n.useRef("none"),c=n.useRef(void 0),[h,p]=a(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{"mounted"===h?(u.current=c.current??d(s.current),c.current=void 0):u.current="none"},[h]),(0,i.N)(()=>{let t=s.current,r=l.current;if(r!==e){let n=u.current,i=d(t);e?(c.current=i,p("MOUNT")):"none"===i||t?.display==="none"?p("UNMOUNT"):r&&n!==i?p("ANIMATION_OUT"):p("UNMOUNT"),l.current=e}},[e,p]),(0,i.N)(()=>
45{if(t){let e,r=t.ownerDocument.defaultView??window,n=o(n=>{let i=d(s.current).includes(CSS.escape(n.animationName));if(n.target===t&&i&&(p("ANIMATION_END"),!l.current)){let n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},"handleAnimationEnd"),i=o(e=>{e.target===t&&(u.current=d(s.current))},"handleAnimationStart");return t.addEventListener("animationstart",i),t.addEventListener("animationcancel",n),t.addEventListener("animationend",n),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",i),t.removeEventListener("animationcancel",n),t.removeEventListener("animationend",n)}}p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:n.useCallback(e=>{if(e){let t=getComputedStyle(e);s.current=t,c.current=d(t)}else s.current=null;r(e)},[])}}function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function h(...e){let t=n.useRef(e);return t.current=e,n.useCallback(e=>{let r=t.current,n=!1,i=r.map(t=>{let r=c(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():c(r[e],null)}}},[])}function d(e){return e?.animationName||"none"}function p(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}o(u,"usePresence"),o(c,"setRef"),o(h,"useStableComposedRefs"),o(d,"getAnimationName"),o(p,"getElementRef")},71934:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u,b:()=>c});var n=r(76430),i=r(54569),s=r(73846),o=r(52652),a=r(75038),l=Object.defineProperty,u=n.forwardRef(l(function(e,t){let{container:r,...l}=e,[u,c]=n.useState(!1);(0,o.N)(()=>c(!0),[]);let h=r||u&&globalThis?.document?.body;return h?i.createPortal((0,a.jsx)(s.sG.div,{...l,ref:t}),h):null},"name",{value:"Portal",configurable:!0})),c=u},72022:(e,t,r)=>{"use strict";r.d(t,{Oh:()=>l});var n=r(76430),i=Object.defineProperty,s=(e,t)=>i(e,"name",{value:t,configurable:!0}),o=0,a=null;function l(){n.useEffect(()=>{a||(a={start:u(),end:u()});let{start:e,end:t}=a;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),o++,()=>{1===o&&(a?.start.remove(),a?.end.remove(),a=null),o=Math.max(0,o-1)}},[])}function u(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}s(function(e){return l(),e.children},"FocusGuards"),s(l,"useFocusGuards"),s(u,"createFocusGuard")},72651:(e,t,r)=>{"use strict";r.d(t,{B4:()=>P,Ii:()=>c,Oe:()=>d,Qp:()=>k,RP:()=>E,SV:()=>h,US:()=>p,aX:()=>S,ad:()=>f,fN:()=>g,fR:()=>x,i6:()=>w,ku:()=>b,u4:()=>u.u4,vq:()=>u.vq,yN:()=>y,yq:()=>_});var n=r(75038),i=r(46001),s=r.n(i),o=r(90060),a=r.n(o),l=r(62260);r(70081);var u=r(79998);let c=()=>window.Rewardful&&window.Rewardful.referral||"checkout_"+new Date().getTime(),h=async({url:e,body:t})=>fetch(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then(async e=>await e.json()),d=({x:e,y:t})=>({startVelocity:30,spread:360,ticks:60,zIndex:0,particleCount:150,origin:{x:Math.random()*(e-t)+e,y:Math.random()-.2}}),p=({onClick:e,size:t,className:r,title:i})=>(0,n.jsx)("div",{title:i??"",className:s()("not-italic w-6 h-6 bg-white p-1 ring-1 ring-gray-300 rounded flex items-center justify-center cursor-pointer dark:bg-gray-800 dark:text-gray-600 duration-200 md:hover:scale-[1.05] text-gray-400 dark:shadow-black/60 dark:ring-gray-600 text-xl",{[t]:t},{"w-6 h-6":!t},{[r]:r}),onClick:e,children:(0,n.jsx)(l.A,{size:14,weight:"bold"})}),f=()=>(0,n.jsx)("span",{className:"ml-1 text-xs bg-pink-200 text-pink-500 px-2 py-px rounded-md dark:bg-pink-600/30 dark:text-pink-400",children:"Pro"}),g=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),m=async e=>{try{await document.fonts?.ready}catch(e){}let t=Array.from(e?.querySelectorAll?.("img")||[]);await Promise.all(t.map(e=>e.decode?.().catch(()=>{})))},v=(e,t)=>
45{let r="number"==typeof t?t:"2x"===t?4:2;return{height:e.offsetHeight*r,width:e.offsetWidth*r,style:{transform:"scale("+r+")",transformOrigin:"top left",width:e.offsetWidth+"px",height:e.offsetHeight+"px"}}},y=async({ref:e,customScale:t})=>(await m(e),a().toBlob(e,v(e,t))),b=async(e,t=.92)=>{try{let r=await createImageBitmap(e),n=document.createElement("canvas");n.width=r.width,n.height=r.height,n.getContext("2d").drawImage(r,0,0),r.close?.();let i=await new Promise(e=>n.toBlob(e,"image/webp",t));return i?.type==="image/webp"&&i.size<e.size?i:e}catch(t){return e}},_=async({ref:e,onSuccess:t,onError:r,customScale:n})=>{let i=/^((?!chrome|android).)*safari/i.test(navigator?.userAgent),s=navigator?.userAgent?.indexOf("Firefox")<0;if(i)return void navigator.clipboard.write([new ClipboardItem({"image/png":new Promise(async(t,r)=>{try{await y({ref:e,customScale:n});let r=await y({ref:e,customScale:n});t(r)}catch(e){r(e)}})})]).then(()=>{t()}).catch(e=>{r(e)});try{await y({ref:e,customScale:n});let i=await y({ref:e,customScale:n});if(s){let e=await navigator?.permissions?.query({name:"clipboard-write"});if(e&&"granted"!==e.state&&"prompt"!==e.state)return void r(Error(`Clipboard permission ${e.state}`))}await navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),t()}catch(e){r(e)}},w=async({ref:e,onSuccess:t,onError:r,format:n,customScale:i,fileNamePrefix:s,fileNameType:o,inputFileName:l})=>{let u,c="png",h=v(e,i),d=(e,t)=>{var r=document.createElement("A");r.href=e,r.download="as-input"===o&&l?`${l}.${t}`:`${s||"pika"}-${+new Date}-${i||"1x"}.${t}`,document.body.appendChild(r),r.click(),document.body.removeChild(r)};if("webp"===n){try{await y({ref:e,customScale:i});let n=await y({ref:e,customScale:i}),s=URL.createObjectURL(n),o=new Image;o.onload=()=>{URL.revokeObjectURL(s);let e=document.createElement("canvas");e.width=o.naturalWidth,e.height=o.naturalHeight,e.getContext("2d").drawImage(o,0,0),d(e.toDataURL("image/webp",1),"webp"),t()},o.onerror=e=>{URL.revokeObjectURL(s),r(e)},o.src=s}catch(e){r(e)}return}"jpeg"===n?(u=a().toJpeg,c="jpg"):"svg"===n?(u=a().toSvg,c="svg"):u=a().toPng;try{await m(e),await u(e);let r=await u(e,h);d(r,c||"png"),t()}catch(e){r(e)}},k=e=>new Promise((t,r)=>{let n=Array.from((e?.clipboardData||e?.originalEvent?.clipboardData)?.items||e?.target?.files||e?.dataTransfer?.files||[]).find(e=>e?.type?.startsWith("image/")),i=n?.kind?n.getAsFile():n;if(!i)return void r(Error("No image found"));let s=new FileReader;s.onload=e=>{t({baseData:e.target.result,fileInfo:i})},s.onerror=()=>r(s.error),s.readAsDataURL(i)}),x=e=>{var t=new RegExp(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi);return e.match(t)},E=({url:e})=>e?.startsWith("http://")||e?.startsWith("https://")?e.toLowerCase():`https://${e}`.toLowerCase(),S=e=>{let t=e?.match(/^(?:https?:\/\/)?(?:www\.)?([^/]+)(?:\/|$)/);return t&&t.length>=2?t[1]:null},P=e=>Math.abs(Number(e))>=1e9?(Math.abs(Number(e))/1e9).toFixed(1)+"B":Math.abs(Number(e))>=1e6?(Math.abs(Number(e))/1e6).toFixed(1)+"M":Math.abs(Number(e))>=1e3?(Math.abs(Number(e))/1e3).toFixed(1)+"K":Math.abs(Number(e))},73234:(e,t,r)=>{"use strict";let n,i,s;r.d(t,{UU:()=>np});let o=Symbol.for("@supabase/supabase-js.traceContextExtractor");var a,l,u,c,h,d,p,f,g,m,v,y,b,_,w=r(82643);class k extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class x extends k{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class E extends k{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class S extends k{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}(a=p||(p={})).Any="any",a.ApNortheast1="ap-northeast-1",a.ApNortheast2="ap-northeast-2",a.ApSouth1="ap-south-1",a.ApSoutheast1="ap-southeast-1",a.ApSoutheast2="ap-southeast-2",a.CaCentral1="ca-central-1",a.EuCentral1="eu-central-1",a.EuWest1="eu-west-1",a.EuWest2="eu-west-2",a.EuWest3="eu-west-3",a.SaEast1="sa-east-1",a.UsEast1="us-east-1",a.UsWest1="us-west-1",a.UsWest2="us-west-2";class P{constructor(e,{headers:t={},customFetch:r,region:n=p.Any}={}){this.url=e,this.headers=t,this.region=n,this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return(0,w.sH)(this,arguments,void 0,function*(e,t={}){var r,n;let i,s,o;try{let n,{headers:a,method:l,body:u,signal:c,timeout:h}=t,d={},{region:p}=t;p||(p=this.region);let f=new URL(`${this.url}/${e}`);p&&"any"!==p&&(d["x-region"]=p,f.searchParams.set("forceFunctionRegion",p));let g=!!a&&Object.keys(a).some(e=>
45"content-type"===e.toLowerCase());u&&!g?"u">typeof Blob&&u instanceof Blob||u instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",n=u):"string"==typeof u?(d["Content-Type"]="text/plain",n=u):"u">typeof FormData&&u instanceof FormData?n=u:(d["Content-Type"]="application/json",n=JSON.stringify(u)):n=!u||"string"==typeof u||"u">typeof Blob&&u instanceof Blob||u instanceof ArrayBuffer||"u">typeof FormData&&u instanceof FormData?u:JSON.stringify(u);let m=c;h&&(s=new AbortController,i=setTimeout(()=>s.abort(),h),c?(m=s.signal,o=()=>s.abort(),c.addEventListener("abort",o)):m=s.signal);let v=yield this.fetch(f.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),a),body:n,signal:m}).catch(e=>{throw new x(e)}),y=v.headers.get("x-relay-error");if(y&&"true"===y)throw new E(v);if(!v.ok)throw new S(v);let b=(null!=(r=v.headers.get("Content-Type"))?r:"text/plain").split(";")[0].trim().toLowerCase();return{data:"application/json"===b?yield v.json():"application/octet-stream"===b||"application/pdf"===b?yield v.blob():"text/event-stream"===b?v:"multipart/form-data"===b?yield v.formData():yield v.text(),error:null,response:v}}catch(e){return{data:null,error:e,response:e instanceof S||e instanceof E?e.context:void 0}}finally{i&&clearTimeout(i),o&&(null==(n=t.signal)||n.removeEventListener("abort",o))}})}}var R=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
45de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};let T=e=>Math.min(1e3*2**e,3e4),A=[520,503],C=["GET","HEAD","OPTIONS"];function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=j(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=j(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==j(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function I(e,t){return new Promise(r=>{if(null==t?void 0:t.aborted)return void r();let n=setTimeout(()=>{null==t||t.removeEventListener("abort",i),r()},e);function i(){clearTimeout(n),r()}null==t||t.addEventListener("abort",i)})}async function L(e,t,r,n){let i=0;for(;;){var s,o,a,l,u;let c,h=$({},r.headers);i>0&&(h["X-Retry-Count"]=String(i));try{c=await e(t,{method:r.method,headers:h,body:r.body,signal:r.signal})}catch(e){if((null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.code)==="ABORT_ERR"||!C.includes(r.method))throw e;if(n&&i<3){let e=T(i);i++,await I(e,r.signal);continue}throw e}if(s=r.method,o=c.status,a=i,n&&!(a>=3)&&C.includes(s)&&A.includes(o)&&1){let e=null!=(l=null==(u=c.headers)?void 0:u.get("Retry-After"))?l:null,t=null!==e?1e3*Math.max(0,parseInt(e,10)||0):T(i);await c.text(),i++,await I(t,r.signal);continue}return c}}var M=class{constructor(e){var t,r,n,i,s;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=null!=(t=e.shouldThrowOnError)&&t,this.signal=e.signal,this.isMaybeSingle=null!=(r=e.isMaybeSingle)&&r,this.shouldStripNulls=null!=(n=e.shouldStripNulls)&&n,this.urlLengthLimit=null!=(i=e.urlLengthLimit)?i:8e3,this.retryEnabled=null==(s=e.retry)||s,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if("text/csv"===this.headers.get("Accept"))throw Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){let e=this.headers.get("Accept");"application/vnd.pgrst.object+json"===e?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):e&&"application/json"!==e||this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let n=this.fetch,i=(async()=>{let e={};r.headers.forEach((t,r)=>{e[r]=t});let t=await L(n,r.url.toString(),{method:r.method,headers:e,body:JSON.stringify(r.body,(e,t)=>"bigint"==typeof t?t.toString():t),signal:r.signal},r.retryEnabled);return await r.processResponse(t)})();return this.shouldThrowOnError||(i=i.catch(e=>{var t,r,n,i,s,o;let a="",l="",u="",c=null==e?void 0:e.cause;if(c){let t=null!=(r=null==c?void 0:c.message)?r:"",o=null!=(n=null==c?void 0:c.code)?n:"";a=`${null!=(i=null==e?void 0:e.name)?i:"FetchError"}: ${null==e?void 0:e.message}
46
47Caused by: ${null!=(s=null==c?void 0:c.name)?s:"Error"}: ${t}`,o&&(a+=` (${o})`),(null==c?void 0:c.stack)&&(a+=`
48${c.stack}`)}else a=null!=(o=null==e?void 0:e.stack)?o:"";let h=this.url.toString().length;return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.code)==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",h>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${h} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((null==c?void 0:c.name)==="HeadersOverflowError"||(null==c?void 0:c.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",h>this.urlLengthLimit&&(l+=`. Your request URL is ${h} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${null!=(t=null==e?void 0:e.name)?t:"FetchError"}: ${null==e?void 0:e.message}`,details:a,hint:l,code:u},data:null,count:null,status:0,statusText:""}}
48)),i.then(e,t)}async processResponse(e){var t,r,n,i;let s=null,o=null,a=null,l=e.status,u=e.statusText;if(e.ok){if("HEAD"!==this.method){let t=await e.text();if(""===t);else if("text/csv"===this.headers.get("Accept"))o=t;else if(this.headers.get("Accept")&&(null==(n=this.headers.get("Accept"))?void 0:n.includes("application/vnd.pgrst.plan+text")))o=t;else try{o=JSON.parse(t)}catch(e){if(s={message:t},o=null,this.shouldThrowOnError)throw new R({message:t,details:"",hint:"",code:""})}}let c=null==(t=this.headers.get("Prefer"))?void 0:t.match(/count=(exact|planned|estimated)/),h=null==(r=e.headers.get("content-range"))?void 0:r.split("/");if(c&&h&&h.length>1&&(a=parseInt(h[1])),this.isMaybeSingle&&Array.isArray(o))if(o.length>1){if(s={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,a=null,l=406,u="Not Acceptable",this.shouldThrowOnError)throw new R($($({},s),{},{hint:null!=(i=s.hint)?i:""}))}else o=1===o.length?o[0]:null}else{let t=await e.text();try{s=JSON.parse(t),Array.isArray(s)&&404===e.status&&(o=[],s=null,l=200,u="OK")}catch(r){404===e.status&&""===t?(l=204,u="No Content"):s={message:t}}if(s&&this.shouldThrowOnError)throw new R(s)}return{success:null===s,error:s,data:o,count:a,status:l,statusText:u}}returns(){return this}overrideTypes(){return this}},D=class extends M{throwOnError(){return super.throwOnError()}select(e){let t=!1,r=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:i=n}={}){let s=i?`${i}.order`:"order",o=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${void 0===r?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let n=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){let i=void 0===n?"offset":`${n}.offset`,s=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(s,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:i=!1,format:s="text"}={}){var o;let a=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),l=null!=(o=this.headers.get("Accept"))?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${l}"; options=${a};`),this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};let N=RegExp("[,()]");var F=class extends D{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&N.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&N.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let i="";"plain"===n?i="pl":"phrase"===n?i="ph":"websearch"===n&&(i="w");let s=void 0===r?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${s}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>void 0!==t).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},B=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:i=8e3,retry:s}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=i,this.retry=s}
48cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:r=!1,count:n}=null!=t?t:{},i=!1,s=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!i?"":('"'===e&&(i=!i),e)).join(""),{url:o,headers:a}=this.cloneRequestState();return o.searchParams.set("select",s),n&&a.append("Prefer",`count=${n}`),new F({method:r?"HEAD":"GET",url:o,headers:a,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;let{url:i,headers:s}=this.cloneRequestState();if(t&&s.append("Prefer",`count=${t}`),r||s.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);i.searchParams.set("columns",e.join(","))}}return new F({method:"POST",url:i,headers:s,schema:this.schema,body:e,fetch:null!=(n=this.fetch)?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:i=!0}={}){var s;let{url:o,headers:a}=this.cloneRequestState();if(a.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),void 0!==t&&o.searchParams.set("on_conflict",t),n&&a.append("Prefer",`count=${n}`),i||a.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);o.searchParams.set("columns",e.join(","))}}return new F({method:"POST",url:o,headers:a,schema:this.schema,body:e,fetch:null!=(s=this.fetch)?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;let{url:n,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new F({method:"PATCH",url:n,headers:i,schema:this.schema,body:e,fetch:null!=(r=this.fetch)?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;let{url:r,headers:n}=this.cloneRequestState();return e&&n.append("Prefer",`count=${e}`),new F({method:"DELETE",url:r,headers:n,schema:this.schema,fetch:null!=(t=this.fetch)?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function U(e,t,r){var n;return{success:!1,error:new R({message:`${null!=(n=null==e?void 0:e.name)?n:"FetchError"}: ${null==e?void 0:e.message}`,details:"",hint:"",code:""}),data:null,count:null,status:t,statusText:r}}var V=class e{constructor(e,{headers:t={},schema:r,fetch:n,timeout:i,urlLengthLimit:s=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=r,this.urlLengthLimit=s;const a=null!=n?n:globalThis.fetch;void 0!==i&&i>0?this.fetch=(e,t)=>{let r=new AbortController,n=setTimeout(()=>r.abort(),i),s=null==t?void 0:t.signal;if(s){if(s.aborted)return clearTimeout(n),a(e,t);let i=()=>{clearTimeout(n),r.abort()};return s.addEventListener("abort",i,{once:!0}),a(e,$($({},t),{},{signal:r.signal})).finally(()=>{clearTimeout(n),s.removeEventListener("abort",i)})}return a(e,$($({},t),{},{signal:r.signal})).finally(()=>clearTimeout(n))}:this.fetch=a,this.retry=o}from(e){if(!e||"string"!=typeof e||""===e.trim())throw Error("Invalid relation name: relation must be a non-empty string.");return new B(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}async getOpenApiSpec(){var e,t;let r,n,i=new Headers(this.headers);i.set("Accept","application/openapi+json"),this.schemaName&&i.set("Accept-Profile",this.schemaName);let s={};i.forEach((e,t)=>{s[t]=e});let o=null!=(e=this.fetch)?e:globalThis.fetch;try{r=await L(o,`${this.url}/`,{method:"GET",headers:s},null==(t=this.retry)||t)}catch(e){return U(e,0,"")}try{n=await r.text()}catch(e){return U(e,r.status,r.statusText)}if(r.ok)try{return{success:!0,error:null,data:JSON.parse(n),count:null,status:r.status,statusText:r.statusText}}catch(e){}return{success:!1,error:function(e,t){try{let t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t)){var r,n,i,s;return new R({message:String(null!=(r=t.message)?r:e),details:null!=(n=t.details)?n:"",hint:null!=(i=t.hint)?i:"",code:null!=(s=t.code)?s:""})}}catch(e){}return new R({message:e||t,details:"",hint:"",code:""})}(n,r.statusText),data:null,count:null,status:r.status,statusText:r.statusText}}rpc(e,t={},{head:r=!1,get:n=!1,count:i}={}){var s;let o,a,l=new URL(`${this.url}/rpc/${e}`),u=e=>null!==e&&"object"==typeof e&&(!Array.isArray(e)||e.some(u)),c=r&&Object.values(t).some(u);c?(o="POST",a=t):r||n?(o=r?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}
48`]).forEach(([e,t])=>{l.searchParams.append(e,t)})):(o="POST",a=t);let h=new Headers(this.headers);return c?h.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&h.set("Prefer",`count=${i}`),new F({method:o,url:l,headers:h,schema:this.schemaName,body:a,fetch:null!=(s=this.fetch)?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class W{static detectEnvironment(){var e;if("u">typeof WebSocket)return{type:"native",wsConstructor:WebSocket};let t=globalThis;if("u">typeof globalThis&&void 0!==t.WebSocket)return{type:"native",wsConstructor:t.WebSocket};let n=void 0!==r.g?r.g:void 0;if(n&&void 0!==n.WebSocket)return{type:"native",wsConstructor:n.WebSocket};if("u">typeof globalThis&&void 0!==t.WebSocketPair&&void 0===globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("u">typeof globalThis&&t.EdgeRuntime||"u">typeof navigator&&(null==(e=navigator.userAgent)?void 0:e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let i=globalThis.process;if(i){let e=i.versions;if(e&&e.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`
49
50Suggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{let e=this.detectEnvironment();return"native"===e.type}catch(e){return!1}}}let H="2.0.0",q="errored",G="joined",z={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"};class K{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}encode(e,t){return e.event!==this.BROADCAST_EVENT||e.payload instanceof ArrayBuffer||"string"!=typeof e.payload.event?t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload])):t(this._binaryEncodeUserBroadcastPush(e))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer(null==(t=e.payload)?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,n)}_encodeJsonUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:{},i=new TextEncoder().encode(JSON.stringify(n)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(e,t,r){let n=new TextEncoder,i=n.encode(e.topic),s=n.encode(null!=(g=e.ref)?g:""),o=n.encode(null!=(m=e.join_ref)?m:""),a=n.encode(e.payload.event),l=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},u=n.encode(0===Object.keys(l).length?"":JSON.stringify(l));if(o.length>255)throw Error(`joinRef length ${o.length} exceeds maximum of 255`);if(s.length>255)throw Error(`ref length ${s.length} exceeds maximum of 255`);if(i.length>255)throw Error(`topic length ${i.length} exceeds maximum of 255`);if(a.length>255)throw Error(`userEvent length ${a.length} exceeds maximum of 255`);if(u.length>255)throw Error(`metadata length ${u.length} exceeds maximum of 255`);let c=this.USER_BROADCAST_PUSH_META_LENGTH+o.length+s.length+i.length+a.length+u.length,h=new ArrayBuffer(this.HEADER_LENGTH+c),d=new DataView(
50h),p=new Uint8Array(h),f=0;d.setUint8(f++,this.KINDS.userBroadcastPush),d.setUint8(f++,o.length),d.setUint8(f++,s.length),d.setUint8(f++,i.length),d.setUint8(f++,a.length),d.setUint8(f++,u.length),d.setUint8(f++,t),p.set(o,f),f+=o.length,p.set(s,f),f+=s.length,p.set(i,f),f+=i.length,p.set(a,f),f+=a.length,p.set(u,f),f+=u.length;var g,m,v=new Uint8Array(h.byteLength+r.byteLength);return v.set(new Uint8Array(h),0),v.set(new Uint8Array(r),h.byteLength),v.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if("string"==typeof e){let[r,n,i,s,o]=JSON.parse(e);return t({join_ref:r,ref:n,topic:i,event:s,payload:o})}return t({})}_binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,n)}_decodeUserBroadcast(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),s=t.getUint8(3),o=t.getUint8(4),a=this.HEADER_LENGTH+4,l=r.decode(e.slice(a,a+n));a+=n;let u=r.decode(e.slice(a,a+i));a+=i;let c=r.decode(e.slice(a,a+s));a+=s;let h=e.slice(a,e.byteLength),d=o===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,p={type:this.BROADCAST_EVENT,event:u,payload:d};return s>0&&(p.meta=JSON.parse(c)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||(null==(t=null==e?void 0:e.constructor)?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e))):{}}}(l=f||(f={})).abstime="abstime",l.bool="bool",l.date="date",l.daterange="daterange",l.float4="float4",l.float8="float8",l.int2="int2",l.int4="int4",l.int4range="int4range",l.int8="int8",l.int8range="int8range",l.json="json",l.jsonb="jsonb",l.money="money",l.numeric="numeric",l.oid="oid",l.reltime="reltime",l.text="text",l.time="time",l.timestamp="timestamp",l.timestamptz="timestamptz",l.timetz="timetz",l.tsrange="tsrange",l.tstzrange="tstzrange";let J=(e,t,r={})=>{var n;let i=null!=(n=r.skipTypes)?n:[];return t?Object.keys(t).reduce((r,n)=>(r[n]=Y(n,e,t,i),r),{}):{}},Y=(e,t,r,n)=>{let i=t.find(t=>t.name===e),s=null==i?void 0:i.type,o=r[e];return s&&!n.includes(s)?X(s,o):Z(o)},X=(e,t)=>{if("_"===e.charAt(0))return er(t,e.slice(1,e.length));switch(e){case f.bool:return Q(t);case f.float4:case f.float8:case f.int2:case f.int4:case f.int8:case f.numeric:case f.oid:return ee(t);case f.json:case f.jsonb:return et(t);case f.timestamp:return en(t);case f.abstime:case f.date:case f.daterange:case f.int4range:case f.int8range:case f.money:case f.reltime:case f.text:case f.time:case f.timestamptz:case f.timetz:case f.tsrange:case f.tstzrange:default:return Z(t)}},Z=e=>e,Q=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},ee=e=>{if("string"==typeof e){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},et=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},er=(e,t)=>{if("string"!=typeof e)return e;let r=e.length-1,n=e[r];if("{"===e[0]&&"}"===n){let n,i=e.slice(1,r);try{n=JSON.parse("["+i+"]")}catch(e){n=i?i.split(","):[]}return n.map(e=>X(t,e))}return e},en=e=>"string"==typeof e?e.replace(" ","T"):e,ei=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),""===t.pathname||"/"===t.pathname?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var es=e=>"function"==typeof e?e:function(){return e},eo="u">typeof window?window:null,ea=("u">typeof self?self:null)||eo||globalThis,el="closed",eu="errored",ec="joined",eh="joining",ed="leaving",ep="phx_close",ef="phx_error",eg="phx_reply",em="phx_leave",ev="websocket",ey="base64url.bearer.phx.",eb=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,j
50oin_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},e_=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},ew=class{constructor(e,t,r){this.state=el,this.topic=e,this.params=es(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new eb(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new e_(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=ec,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive("error",e=>{this.state=eu,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=el,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=eu,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new eb(this,em,es({}),this.timeout).send(),this.state=eu,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(eg,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(!this.joinedOnce)return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush;throw Error("tried to join multiple times. 'join' can only be called a single time per channel instance")}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=el,this.bindings=[]}onClose(e){this.on(ep,e)}onError(e){return this.on(ef,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>r.event!==e||void 0!==t&&t!==r.ref)}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new eb(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=ed;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ep,"leave")},r=new eb(this,em,es({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic===e&&(!n||n===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=eh,this.joinPush.resend(e))}trigger(e,t,r,n){let i=this.onMessage(e,t,r,n);if(t&&!i)throw Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(n=>n.event===e&&this.filterBindings(n,t,r));for(let e=0;e<s.length;e++)s[e].callback(i,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===el}isErrored(){return this.state===eu}isJoined(){return this.state===ec}isJoining(){return this.state===eh}isLeaving(){return this.state===ed}},ek=class{static request(e,t,r,n,i,s,o){if(ea.XDomainRequest){let r=new ea.XDomainRequest;return this.xdomainRequest(r,e,t,n,i,s,o)}if(ea.XMLHttpRequest){let a=new ea.XMLHttpRequest;return this.xhrRequest(a,e,t,r,n,i,s,o)}if(ea.fetch&&ea.AbortController)return this.fetchRequest(e,t,r,n,i,s,o);throw Error("No suitable XMLHttpRequest implementation found")}static fetchRequest(e,t,r,n,i,s,o){let a={method:e,headers:r,body:n},l=null;return i&&(l=new AbortController,setTimeout(()=>l.abort(),i),a.signal=l.signal),ea.fetch(t,a).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{"AbortError"===e.name&&s?s():o&&o(null)}),l}static xdomainRequest(e,t,r,n,i,s,o){return e.timeout=i,e.open(t,r),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},s&&(e.ontimeout=s),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,i,s,o,a){for(let[i,o]of(e.open(t,r,!0),e.timeout=s,Object.entries(n)))e.setRequestHeader(i,o);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{4===e.readyState&&a&&a(this.parseJSON(e.responseText))},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let i=t?`${t}[${n}]`:n,s=e[n];"object"==typeof s?r.push(this.serialize(s,i)):r.push(encodeURIComponent(i)+"="+encodeURIComponent(s))}return r.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}}
50,ex=class{constructor(e,t){t&&2===t.length&&t[1].startsWith(ey)&&(this.authToken=atob(t[1].slice(ey.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(RegExp("(.*)/"+ev),"$1/longpoll")}endpointURL(){return ek.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){let e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:r,messages:n}=e;if(410===t&&null!==this.token){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else t=0;switch(t){case 200:n.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;
50case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){"string"!=typeof e&&(e=(e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let e=0;e<n;e++)t+=String.fromCharCode(r[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e,t=0){this.awaitingBatchAck=!0;let r=t+100,n=e.slice(t,r);this.ajax("POST",{"Content-Type":"application/x-ndjson"},n.join("\n"),()=>this.onerror("timeout"),t=>{t&&200===t.status?r<e.length?this.batchSend(e,r):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1:(this.awaitingBatchAck=!1,this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,r){for(let e of this.reqs)e.abort();this.readyState=3;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"u">typeof CloseEvent?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,i){let s,o=()=>{this.reqs.delete(s),n()};s=ek.request(e,this.endpointURL(),t,r,this.timeout,o,e=>{this.reqs.delete(s),this.isActive()&&i(e)}),this.reqs.add(s)}},eE=class e{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state=Object.create(null),this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,t=>{let{onJoin:r,onLeave:n,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,r,n),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,r,n)}),this.pendingDiffs=[],i()}),this.channel.on(n.diff,t=>{let{onJoin:r,onLeave:n,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,r,n),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,r,n){let i=this.toNullProtoObj(this.clone(e));t=this.toNullProtoObj(t);let s=Object.create(null),o=Object.create(null);return this.map(i,(e,r)=>{t[e]||(o[e]=r)}),this.map(t,(e,t)=>{let r=i[e];if(r){let n=t.metas.map(e=>e.phx_ref),i=r.metas.map(e=>e.phx_ref),a=t.metas.filter(e=>0>i.indexOf(e.phx_ref)),l=r.metas.filter(e=>0>n.indexOf(e.phx_ref));a.length>0&&(s[e]=t,s[e].metas=a),l.length>0&&(o[e]=this.clone(r),o[e].metas=l)}else s[e]=t}),this.syncDiff(i,{joins:s,leaves:o},r,n)}static syncDiff(e,t,r,n){e=this.toNullProtoObj(e);let{joins:i,leaves:s}=this.clone(t);return r||(r=function(){}),n||(n=function(){}),this.map(i,(t,n)=>{let i=e[t];if(e[t]=this.clone(n),i){let r=e[t].metas.map(e=>e.phx_ref),n=i.metas.filter(e=>0>r.indexOf(e.phx_ref));e[t].metas.unshift(...n)}r(t,i,n)}),this.map(s,(t,r)=>{let i=e[t];if(!i)return;let s=r.metas.map(e=>e.phx_ref);i.metas=i.metas.filter(e=>0>s.indexOf(e.phx_ref)),n(t,i,r),0===i.metas.length&&delete e[t]}),e}static list(e,t){return t||(t=function(e,t){return t}),this.map(e,(e,r)=>t(e,r))}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static toNullProtoObj(e){if(null===Object.getPrototypeOf(e))return e;let t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(r=>{t[r]=e[r]}),t}static clone(e){return JSON.parse(JSON.stringify(e))}},eS={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){return e.payload.constructor===ArrayBuffer?t(this.binaryEncode(e)):t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload]))},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,i,s,o]=JSON.parse(e);return t({join_ref:r,ref:n,topic:i,event:s,payload:o})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:i,payload:s}=e,o=new TextEncoder,a=o.encode(t),l=o.encode(r),u=o.encode(i),c=o.encode(n);this.assertFieldSize(a.byteLength,"join_ref"),this.assertFieldSize(l.byteLength,"ref"),this.assertFieldSize(u.byteLength,"topic"),this.assertFieldSize(c.byteLength,"event");let h=this.META_LENGTH+a.byteLength+l.byteLength+u.byteLength+c.byteLength,d=new ArrayBuffer(this.HEADER_LENGTH+h),p=new Uint8Array(d),f=new DataView(d),g=0;f.setUint8(g++,this.KINDS.push),f.setUint8(g++,a.byteLength),f.setUint8(g++,l.byteLength),f.setUint8(g++,u.byteLength),f.setUint8(g++,c.byteLength),p.set(a,g),g+=a.byteLength,p.set(l,g),g+=l.byteLength,p.set(u,g),g+=u.byteLength,p.set(c,g),g+=c.byteLength;var m=new Uint8Array(d.byteLength+s.byteLength);return m.set(p,0),m.set(new Uint8Array(s),d.byteLength),m.buffer},assertFieldSize(e,t){if(e>255)throw Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;
50switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),s=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=r.decode(e.slice(o,o+n));o+=n;let l=r.decode(e.slice(o,o+i));o+=i;let u=r.decode(e.slice(o,o+s));return o+=s,{join_ref:a,ref:null,topic:l,event:u,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),s=t.getUint8(3),o=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(e.slice(a,a+n));a+=n;let u=r.decode(e.slice(a,a+i));a+=i;let c=r.decode(e.slice(a,a+s));a+=s;let h=r.decode(e.slice(a,a+o));return a+=o,{join_ref:l,ref:u,topic:c,event:eg,payload:{status:h,response:e.slice(a,e.byteLength)}}},decodeBroadcast(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),s=this.HEADER_LENGTH+2,o=r.decode(e.slice(s,s+n));s+=n;let a=r.decode(e.slice(s,s+i));return s+=i,{join_ref:null,ref:null,topic:o,event:a,payload:e.slice(s,e.byteLength)}}},eP=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||1e4,this.transport=t.transport||ea.WebSocket||ex,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=ea&&ea.sessionStorage}catch{}this.sessionStore=t.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=eS.encode.bind(eS),this.defaultDecoder=eS.decode.bind(eS),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==ex?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;eo&&eo.addEventListener&&(eo.addEventListener("pagehide",e=>{this.conn&&(this.disconnect(),n=this.connectClock)}),eo.addEventListener("pageshow",e=>{n===this.connectClock&&(n=null,this.connect())}),eo.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?this.pageHidden=!0:(this.pageHidden=!1,this.isConnected()||this.closeWasClean||this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,r)=>{console.log(`${e}: ${t}`,r)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=es(t.params||{}),this.endPoint=`${e}/${ev}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new e_(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken&&es(t.authToken)}getLongPollTransport(){return ex}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=ek.appendParams(ek.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=es(e)),(!this.conn||this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==ex?this.connectWithF
vendor: 4,323 bytes, line 50
50allback(ex,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(i=>{i.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){return e===ex?"LongPoll":e.name}transportConnect(){let e;this.connectClock++,this.closeWasClean=!1,this.authToken&&(e=["phoenix",`${ey}${btoa(this.authToken()).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){let r,n;clearTimeout(this.fallbackTimer);let i=!1,s=!0,o=this.transportName(e),a=t=>{this.log("transport",`falling back to ${o}...`,t),this.off([r,n]),s=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),n=this.onError(e=>{this.log("transport","error",e),s&&!i&&(clearTimeout(this.fallbackTimer),a(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(i=!0,!s){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,"true"),this.log("transport",`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();let n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){5!==r&&e.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r):t()}waitForSocketClosed(e,t,r=1){5===r||3===e.readyState?t():setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError(e)}
50triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(ef,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>-1===e.indexOf(t))}channel(e,t={}){let r=new ew(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:i,join_ref:s}=e;this.log("push",`${t} ${r} (${s}, ${i})`,n)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef)return void this.heartbeatTimeout();this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:r,payload:n,ref:i,join_ref:s}=e;if(i&&i===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback("ok"===n.status?"ok":"error",e)}catch(e){this.log("error","error in heartbeat callback",e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${n.status||""} ${t} ${r} ${i&&"("+i+")"||""}`.trim(),n);for(let e=0;e<this.channels.length;e++){let o=this.channels[e];o.isMember(t,r,n,s)&&o.trigger(r,n,i,s)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(t){this.log("error",`error in ${e} callback`,t)}})}catch(t){this.log("error",`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class eR{constructor(e,t){const r=function(e){return(null==e?void 0:e.events)&&{events:e.events}}(t);this.presence=new eE(e.getChannel(),r),this.presence.onJoin((t,r,n)=>{let i=eR.onJoinPayload(t,r,n);e.getChannel().trigger("presence",i)}),this.presence.onLeave((t,r,n)=>{let i=eR.onLeavePayload(t,r,n);e.getChannel().trigger("presence",i)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return eR.transformState(this.presence.state)}static transformState(e){return Object.getOwnPropertyNames(e=JSON.parse(JSON.stringify(e))).reduce((t,r)=>{let n=e[r];return t[r]=eT(n),t},{})}static onJoinPayload(e,t,r){return{event:"join",key:e,currentPresences:eA(t),newPresences:eT(r)}}static onLeavePayload(e,t,r){return{event:"leave",key:e,currentPresences:eA(t),leftPresences:eT(r)}}}function eT(e){return e.metas.map(e=>{let t=Object.defineProperties({},Object.getOwnPropertyDescriptors(e));return t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t})}function eA(e){return(null==e?void 0:e.metas)?eT(e):[]}(u=g||(g={})).SYNC="sync",u.JOIN="join",u.LEAVE="leave";class eC{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new eR(this.channel.channelAdapter,t)}}class ej{constructor(e,t,r){const n=function(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}(r);this.channel=e.getSocket().channel(t,n),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,r){let n;try{n=this.channel.push(e,t,r)}catch(t){throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${e.event}`,e.payload())}return n}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===G}isJoined(){return this.state===G}isJoining(){return"joining"===this.state}isClosed(){return"closed"===this.state}isLeaving(){return"leaving"===this.state}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}let eO=/[,()"\\]/,e$=e=>{let t=null===e?"null":String(e);return eO.test(t)||t!==t.trim()?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:t};class eI{constructor(){this.filters=[]}add(e,t,r,n=!1){return this.filters.push(`${e}=${n?"not.":""}${((e,t)=>{if("in"===e){let e=Array.isArray(t)?t:[t];if(0===e.length)throw Error("Realtime `in` filter requires at least one value.");let r=Array.from(new Set(e)).map(e=>e$(e)).join(",");return`in.(${r})`}if("is"===e)return`is.${null===t?"null":String(t)}`;return`${e}.${e$(t)}`})(t,r)}`),this}eq(e,t){return this.add(e,"eq",t)}neq(e,t){return this.add(e,"neq",t)}gt(e,t){return this.add(e,"gt",t)}gte(e,t){return this.add(e,"gte",t)}lt(e,t){return this.add(e,"lt",t)}lte(e,t){return this.add(e,"lte",t)}in(e,t){return this.add(e,"in",t)}like(e,t){return this.add(e,"like",t)}ilike(e,t){return this.add(e,"ilike",t)}match(e,t){return this.add(e,"match",t)}imatch(e,t){return this.add(e,"imatch",t)}is(e,t){return this.add(e,"is",t)}isDistinct(e,t){return this.add(e,"isdistinct",t)}not(e,t,r){return this.add(e,t,r,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}(c=m||(m={})).ALL="*",c.INSERT="INSERT",c.UPDATE="UPDATE",c.DELETE="DELETE",(h=v||(v={})).BROADCAST="broadcast",h.PRESENCE="presence",h.POSTGRES_CHANGES="postgres_changes",h.SYSTEM="system",(d=y||(y={})).SUBSCRIBED="SUBSCRIBED",d.TIMED_OUT="TIMED_OUT",d.CLOSED="CLOSED",d.CHANNEL_ERROR="CHANNEL_ERROR";class eL{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},r){var n,i;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new ej(this.socket.socketAdapter,e,this.params),this.presence=new eC(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=ei(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(null==(i=null==(n=this.params.config)?void 0:n.broadcast)?void 0:i.replay))throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){var r,n,i,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:o,presence:a,private:l,postgres_changes_options:u}}=this.params,c=null!=(n=null==(r=this.bindings.postgres_changes)?void 0:r.map(e=>e.filter))?n:[],h=!!this.bindings[v.PRESENCE]&&this.bindings[v.PRESENCE].length>0||(null==(i=this.params.config.presence)?void 0:i.enabled)===!0,d={},p=Object.assign({broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:h}),postgres_changes:c,private:l},u?{postgres_changes_options:u}:{});this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(t=>{null==e||e(y.CHANNEL_ERROR,function(e){if(e instanceof Error)return e;if("string"==typeof e)return Error(e);
50if(e&&"object"==typeof e){if("number"==typeof e.code){let t="string"==typeof e.reason&&e.reason?` (${e.reason})`:"";return Error(`socket closed: ${e.code}${t}`,{cause:e})}return Error("channel error: transport failure",{cause:e})}return Error("channel error: connection lost")}(t))}),this._onClose(()=>null==e?void 0:e(y.CLOSED)),this.updateJoinPayload(Object.assign({config:p},d)),this._updateFilterMessage();let f=(null==u?void 0:u.wait)&&c.length>0?Math.max(t,(null!=(s=u.timeout)?s:15e3)+1e4):t;this.channelAdapter.subscribe(f).receive("ok",async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),void 0===t){null==e||e(y.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive("error",t=>{this.state=q;let r=Object.values(t).join(", ")||"error";null==e||e(y.CHANNEL_ERROR,Error(r,{cause:t}))}).receive("timeout",()=>{null==e||e(y.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var r;let n=this.bindings.postgres_changes,i=null!=(r=null==n?void 0:n.length)?r:0,s=[];for(let r=0;r<i;r++){let i=n[r],{filter:{event:o,schema:a,table:l,filter:u}}=i,c=e&&e[r];if(c&&c.event===o&&eL.isFilterValueEqual(c.schema,a)&&eL.isFilterValueEqual(c.table,l)&&eL.isFilterValueEqual(c.filter,u))s.push(Object.assign(Object.assign({},i),{id:c.id}));else{this.unsubscribe(),this.state=q,null==t||t(y.CHANNEL_ERROR,Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=s,this.state!=q&&t&&t(y.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){let n=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===v.PRESENCE||e===v.POSTGRES_CHANGES;if(n&&i)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,r)}async httpSend(e,t,r={}){var n;if(null==t)return Promise.reject(Error("Payload is required for httpSend()"));let i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":i?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);let o=new URL(this.broadcastEndpointURL);o.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&o.searchParams.set("private","true");let a={method:"POST",headers:s,body:i?t:JSON.stringify(t)},l=await this._fetchWithTimeout(o.toString(),a,null!=(n=r.timeout)?n:this.timeout);if(202===l.status)return{success:!0};if(404===l.status)return Promise.reject(Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let u=l.statusText;try{let e=await l.json();u=e.error||e.message||u}catch(e){}return Promise.reject(Error(u))}async send(e,t={}){var r,n;if(this.channelAdapter.canPush()||"broadcast"!==e.type)return new Promise(r=>{var n,i,s;let o=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null==(s=null==(i=null==(n=this.params)?void 0:n.config)?void 0:i.broadcast)?void 0:s.ack)||r("ok"),o.receive("ok",()=>r("ok")),o.receive("error",()=>r("error")),o.receive("timeout",()=>r("timed out"))});{let i="Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
50in the future. Please use httpSend() explicitly for REST delivery.";this.socket.hasLogger()?this.socket.log("channel",i):console.warn(i);let{event:s,payload:o}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);let l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:o,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,l,null!=(r=t.timeout)?r:this.timeout);return await (null==(n=e.body)?void 0:n.cancel()),e.ok?"ok":"error"}catch(e){if(e instanceof Error&&"AbortError"===e.name)return"timed out";return"error"}}}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,r){let n=new AbortController,i=setTimeout(()=>n.abort(),r),s=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:n.signal}));return clearTimeout(i),s}_on(e,t,r){var n;let i=e.toLocaleLowerCase(),s=null==t?void 0:t.filter;if((s instanceof eI||"object"==typeof s&&null!==s&&"function"==typeof s.build)&&(t=Object.assign(Object.assign({},t),{filter:s.build()})),i===v.POSTGRES_CHANGES&&(null==(n=this.bindings[i])?void 0:n.find(e=>eL.isSamePostgresFilter(e.filter,t))))return this.socket.log("error",`duplicate \`postgres_changes\` binding for ${this.topic} ignored`,t),this;let o=this.channelAdapter.on(e,r),a={type:i,filter:t,callback:r,ref:o};return this.bindings[i]?this.bindings[i].push(a):this.bindings[i]=[a],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,r)=>{var n,i,s,o,a,l,u;let c=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(c,r))return!1;let h=null==(n=this.bindings[c])?void 0:n.find(t=>t.ref===e.ref);if(!h)return!0;if(!["broadcast","presence","postgres_changes"].includes(c))return h.type.toLocaleLowerCase()===c;if("id"in h){let e=h.id,r=null==(i=h.filter)?void 0:i.event;return e&&(null==(s=t.ids)?void 0:s.includes(e))&&("*"===r||(null==r?void 0:r.toLocaleLowerCase())===(null==(o=t.data)?void 0:o.type.toLocaleLowerCase()))}{let e=null==(l=null==(a=null==h?void 0:h.filter)?void 0:a.event)?void 0:l.toLocaleLowerCase();return"*"===e||e===(null==(u=null==t?void 0:t.event)?void 0:u.toLocaleLowerCase())}})}_notThisChannelEvent(e,t){let{close:r,error:n,leave:i,join:s}=z;return t&&[r,n,i,s].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,r)=>{if("object"==typeof t&&"ids"in t){let e=t.data,{schema:r,table:n,commit_timestamp:i,type:s,errors:o}=e;return Object.assign(Object.assign({},{schema:r,table:n,commit_timestamp:i,eventType:s,new:{},old:{},errors:o}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error("cannot copy bindings into joined channel");for(let t in e.bindings)for(let r of e.bindings[t])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)}static isSamePostgresFilter(e,t){var r,n,i,s;let o=null!=(n=null==(r=null==e?void 0:e.select)?void 0:r.join())?n:void 0,a=null!=(s=null==(i=null==t?void 0:t.select)?void 0:i.join())?s:void 0;return(null==e?void 0:e.event)===(null==t?void 0:t.event)&&eL.isFilterValueEqual(null==e?void 0:e.schema,null==t?void 0:t.schema)&&eL.isFilterValueEqual(null==e?void 0:e.table,null==t?void 0:t.table)&&eL.isFilterValueEqual(null==e?void 0:e.filter,null==t?void 0:t.filter)&&o===a}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=J(e.columns,e.record)),("UPDATE"===e.type||"DELETE"===e.type)&&(t.old=J(e.columns,e.old_record)),t}}class eM{constructor(e,t){this.socket=new eP(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,r,n=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),n),this.socket.disconnect(()=>{e(),i("ok")},t,r)})}push(e){this.socket.push(e)}log(e,t,r){this.socket.log(e,t,r)}hasLogger(){return this.socket.hasLogger()}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return"connecting"==this.socket.connectionState()}isDisconnecting(){return"closing"==this.socket.connectionState()}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}let eD=[1e3,2e3,5e3,1e4],eN=`
51  addEventListener("message", (e) => {
52    if (e.data.event === "start") {
53      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
54    }
55  });`;class eF{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){var r;if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
55,this.ref=0,this.serializer=new K,this._manuallySetToken=!1,this._authPromise=null,this._authGeneration=0,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!(null==(r=null==t?void 0:t.params)?void 0:r.apikey))throw Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey;const n=this._initializeOptions(t);this.socketAdapter=new eM(e,n),this.httpEndpoint=ei(e),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){let e=t.message;throw Error(`WebSocket not available: ${e}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return(this._cancelPendingDisconnect(),this.isDisconnecting())?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return"ok"===t&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,r){this.socketAdapter.log(e,t,r)}hasLogger(){return this.socketAdapter.hasLogger()}connectionState(){return this.socketAdapter.connectionState()||"closed"}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let r=`realtime:${e}`,n=this.getChannels().find(e=>e.topic===r);if(n)return n;{let r=new eL(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(r),r}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){let t=++this._authGeneration,r=this._performAuth(e,t);t===this._authGeneration&&(this._authPromise=r);try{await r}finally{this._authPromise===r&&(this._authPromise=null)}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),0===this.channels.length&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),0===this._disconnectOnEmptyChannelsAfterMs){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
55this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,0===this.channels.length&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){null!==this._pendingDisconnectTimer&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e,t){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(e){this.log("error","Error fetching access token from callback",e),r=this.accessTokenValue}else r=this.accessTokenValue;t===this._authGeneration&&(this.accessToken?this._manuallySetToken=!1:n&&(this._manuallySetToken=!0),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(e=>{let t={access_token:r,version:"realtime-js/2.116.0"};e.updateJoinPayload(t),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(z.access_token,{access_token:r})})))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log("error","error waiting for auth on connect",e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,r)=>{"disconnected"!==t&&("sent"==t&&this._setAuthSafely(),e&&e(t,r))}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([eN],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_initializeOptions(e){var t,r,n,i,s,o,a,l,u,c,h,d;let p,f;this.worker=null!=(t=null==e?void 0:e.worker)&&t,this.accessToken=null!=(r=null==e?void 0:e.accessToken)?r:null;let g={};g.timeout=null!=(n=null==e?void 0:e.timeout)?n:1e4,g.heartbeatIntervalMs=null!=(i=null==e?void 0:e.heartbeatIntervalMs)?i:25e3,this._disconnectOnEmptyChannelsAfterMs=null!=(s=null==e?void 0:e.disconnectOnEmptyChannelsAfterMs)?s:2*(null!=(o=null==e?void 0:e.heartbeatIntervalMs)?o:25e3),g.transport=null!=(a=null==e?void 0:e.transport)?a:W.getWebSocketConstructor(),g.params=null==e?void 0:e.params,g.logger=null==e?void 0:e.logger,g.heartbeatCallback=this._wrapHeartbeatCallback(null==e?void 0:e.heartbeatCallback),g.sessionStorage=null!=(l=null==e?void 0:e.sessionStorage)?l:function(){let e;try{if("u">typeof globalThis&&globalThis.sessionStorage)return globalThis.sessionStorage}catch(e){}return e=new Map,{get length(){return e.size},clear(){e.clear()},getItem:t=>e.has(t)?e.get(t):null,key(t){var r;return null!=(r=Array.from(e.keys())[t])?r:null},removeItem(t){e.delete(t)},setItem(t,r){e.set(t,String(r))}}}(),g.reconnectAfterMs=null!=(u=null==e?void 0:e.reconnectAfterMs)?u:e=>eD[e-1]||1e4;let m=null!=(c=null==e?void 0:e.vsn)?c:H;switch(m){case"1.0.0":p=(e,t)=>t(JSON.stringify(e)),f=(e,t)=>t(JSON.parse(e));break;case H:p=this.serializer.encode.bind(this.serializer),f=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${g.vsn}`)}if(g.vsn=m,g.encode=null!=(h=null==e?void 0:e.encode)?h:p,g.decode=null!=(d=null==e?void 0:e.decode)?d:f,g.beforeReconnect=this._reconnectAuth.bind(this),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,g.params=Object.assign(Object.assign({},g.params),{log_level:this.logLevel})),this.worker){if("u">typeof window&&!window.Worker)throw Error("Web Worker is not supported");this.workerUrl=null==e?void 0:e.workerUrl,g.autoSendHeartbeat=!this.worker}return g}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
55var eB=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown="CommitStateUnknownException"===t.icebergType||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return 404===this.status}isConflict(){return 409===this.status}isAuthenticationTimeout(){return 419===this.status}};async function eU(e){return e&&"none"!==e.type?"bearer"===e.type?{Authorization:`Bearer ${e.token}`}:"header"===e.type?{[e.name]:e.value}:"custom"===e.type?await e.getHeaders():{}:{}}function eV(e){return e.join("\x1f")}var eW=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:eV(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let r={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${eV(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${eV(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${eV(e.namespace)}`}),!0}catch(e){if(e instanceof eB&&404===e.status)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof eB&&409===e.status)return;throw e}}};function eH(e){return e.join("\x1f")}var eq=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${eH(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${eH(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${eH(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${eH(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${eH(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${eH(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof eB&&404===e.status)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof eB&&409===r.status)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},eG=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=function(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:s,headers:o}){let a=function(e,t,r){let n=new URL(t,e);if(r)for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);return n.toString()}(e.baseUrl,n,i),l=await eU(e.auth),u=await t(a,{method:r,headers:{...s?{"Content-Type":"application/json"}:{},...l,...o},body:s?JSON.stringify(s):void 0}),c=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),d=h&&c?JSON.parse(c):c;if(!u.ok){let e=h?d:void 0,t=e?.error;throw new eB(t?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:u.status,headers:u.headers,data:d}}}}({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new eW(this.client,t),this.tableOps=new eq(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
55async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},ez=r(51247).Buffer;function eK(e){return(eK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eJ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eJ(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=eK(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eK(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==eK(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eJ(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var eX=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name="vectors"===t?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function eZ(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var eQ=class extends eX{constructor(e,t,r,n="storage",i){super(e,n,t,r),this.name="vectors"===n?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r,this.co
55de=i}toJSON(){return eY(eY({},super.toJSON()),{},{code:this.code})}},e0=class extends eX{constructor(e,t,r="storage"){super(e,r),this.name="vectors"===r?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function e1(e,t,r){let n=eY({},e),i=t.toLowerCase();for(let e of Object.keys(n))e.toLowerCase()===i&&delete n[e];return n[i]=r,n}let e2=e=>{if(Array.isArray(e))return e.map(e=>e2(e));if("function"==typeof e||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,r])=>{t[e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""))]=e2(r)}),t},e8=e=>e.split("/").map(encodeURIComponent).join("/"),e6=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.msg)return e.msg;if("string"==typeof e.message)return e.message;if("string"==typeof e.error_description)return e.error_description;if("string"==typeof e.error)return e.error;if("object"==typeof e.error&&null!==e.error){let t=e.error;if("string"==typeof t.message)return t.message}}return JSON.stringify(e)},e3=async(e,t,r,n)=>{if(null!==e&&"object"==typeof e&&"json"in e&&"function"==typeof e.json){let r=parseInt(String(e.status),10);Number.isFinite(r)||(r=500),e.json().then(e=>{let i=(null==e?void 0:e.statusCode)||(null==e?void 0:e.code)||r+"";t(new eQ(e6(e),r,i,n,null==e?void 0:e.code))}).catch(()=>{let i=r+"";t(new eQ(e.statusText||`HTTP ${r} error`,r,i,n))})}else t(new e0(e6(e),e,n))};async function e5(e,t,r,n,i,s,o){return new Promise((a,l)=>{e(r,((e,t,r,n)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};if("GET"===e||"HEAD"===e||!n)return eY(eY({},i),r);if((e=>{if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)})(n)){var s;let e,r=(null==t?void 0:t.headers)||{};for(let[t,n]of Object.entries(r))"content-type"===t.toLowerCase()&&(e=n);i.headers=e1(r,"Content-Type",null!=(s=e)?s:"application/json"),i.body=JSON.stringify(n)}else i.body=n;return(null==t?void 0:t.duplex)&&(i.duplex=t.duplex),eY(eY({},i),r)})(t,n,i,s)).then(e=>{if(!e.ok)throw e;if(null==n?void 0:n.noResolveJson)return e;if("vectors"===o){let t=e.headers.get("content-type");if("0"===e.headers.get("content-length")||204===e.status||!t||!t.includes("application/json"))return{}}return e.json()}).then(e=>a(e)).catch(e=>e3(e,l,n,o))})}function e4(e="storage"){return{get:async(t,r,n,i)=>e5(t,"GET",r,n,i,void 0,e),post:async(t,r,n,i,s)=>e5(t,"POST",r,i,s,n,e),put:async(t,r,n,i,s)=>e5(t,"PUT",r,i,s,n,e),head:async(t,r,n,i)=>e5(t,"HEAD",r,eY(eY({},n),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,r,n,i,s)=>e5(t,"DELETE",r,i,s,n,e)}}let{get:e9,post:e7,put:te,head:tt,remove:tr}=e4("storage"),tn=e4("vectors");var ti=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=function(e){let t={};for(let[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}(t),this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=e1(this.headers,e,t),this}async handleOperation(e){try{return{data:await e(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(eZ(e))return{data:null,error:e};throw e}}};n=Symbol.toStringTag;var ts=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[n]="StreamDownloadBuilder",this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:(await this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(eZ(e))return{data:null,error:e};throw e}}};i=Symbol.toStringTag;var to=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[i]="BlobDownloadBuilder",this.promise=null}asStream(){return new ts(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:await (await this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(eZ(e))return{data:null,error:e};throw e}}};let ta={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},tl={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var tu=class extends ti{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var i=this;return i.handleOperation(async()=>{let s,o=eY(eY({},tl),n),a=eY(eY({},i.headers),"POST"===e&&{"x-upsert":String(o.upsert)}),l=o.metadata;if("u">typeof Blob&&r instanceof Blob?((s=new FormData).append("cacheControl",o.cacheControl),l&&s.append("metadata",i.encodeMetadata(l)),s.append("",r)):"u">typeof FormData&&r instanceof FormData?((s=r).has("cacheControl")||s.append("cacheControl",o.cacheControl),l&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(l))):(s=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=i.toBase64(i.encodeMetadata(l))),("u">typeof ReadableStream&&s instanceof ReadableStream||s&&"object"==typeof s&&"pipe"in s&&"function"==typeof s.pipe)&&!o.duplex&&(o.duplex="half")),null==n?void 0:n.headers)for(let[e,t]of Object.entries(n.headers))a=e1(a,e,t);let u=i._removeEmptyFolders(t),c=i._getFinalPath(u),h=await ("PUT"==e?te:e7)(i.fetch,`${i.url}/object/${c}`,s,eY({headers:a},(null==o?void 0:o.duplex)?{duplex:o.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var i=this;let s=i._removeEmptyFolders(e),o=i._getFinalPath(s),a=new URL(i.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",t),i.handleOperation(async()=>{let e,t=eY(eY({},tl),n),o=eY(eY({},i.headers),{"x-upsert":String(t.upsert)}),l=t.metadata;if("u">typeof Blob&&r instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),l&&e.append("metadata",i.encodeMetadata(l)),e.append("",r)):"u">typeof FormData&&r instanceof FormData?((e=r).has("cacheControl")||e.append("cacheControl",t.cacheControl),l&&!e.has("metadata")&&e.append("metadata",i.encodeMetadata(l))):(e=r,o["cache-control"]=`max-age=${t.cacheControl}`,o["content-type"]=t.contentType,l&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(l))),("u">typeof ReadableStream&&e instanceof ReadableStream||e&&"object"==typeof e&&"pipe"in e&&"function"==typeof e.pipe)&&!t.duplex&&(t.duplex="half")),null==n?void 0:n.headers)for(let[e,t]of Object.entries(n.headers))o=e1(o,e,t);return{path:s,fullPath:(await te(i.fetch,a.toString(),e,eY({headers:o},(null==t?void 0:t.duplex)?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e),i=eY({},r.headers);(null==t?void 0:t.upsert)&&(i["x-upsert"]="true");let s=await e7(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(r.url+s.url),a=o.searchParams.get("token");if(!a)throw new eX("No token returned by API");return{signedUrl:o.toString(),path:e,token:a}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await e7(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
55stinationBucket:null==r?void 0:r.destinationBucket,sourceVersionId:null==r?void 0:r.sourceVersionId},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await e7(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==r?void 0:r.destinationBucket,sourceVersionId:null==r?void 0:r.sourceVersionId},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let i=n._getFinalPath(e),s="object"==typeof(null==r?void 0:r.transform)&&null!==r.transform&&Object.keys(r.transform).length>0,o=await e7(n.fetch,`${n.url}/object/sign/${i}`,eY(eY({expiresIn:t},s?{transform:r.transform}:{}),(null==r?void 0:r.versionId)!=null?{versionId:r.versionId}:{}),{headers:n.headers}),a=new URLSearchParams;(null==r?void 0:r.download)&&a.set("download",!0===r.download?"":r.download),(null==r?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));let l=a.toString();return{signedUrl:encodeURI(`${n.url}${o.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{let i=await e7(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),s=new URLSearchParams;(null==r?void 0:r.download)&&s.set("download",!0===r.download?"":r.download),(null==r?void 0:r.cacheNonce)!=null&&s.set("cacheNonce",String(r.cacheNonce));let o=s.toString();return i.map(e=>eY(eY({},e),{},{signedUrl:e.signedURL?encodeURI(`${n.url}${e.signedURL}${o?`&${o}`:""}`):null}))})}download(e,t,r){let n="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",i=new URLSearchParams;(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(i,t.transform),(null==t?void 0:t.cacheNonce)!=null&&i.set("cacheNonce",String(t.cacheNonce)),(null==t?void 0:t.versionId)!=null&&i.set("versionId",String(t.versionId));let s=i.toString(),o=this._getFinalPath(e);return new to(()=>e9(this.fetch,`${this.url}/${n}/${o}${s?`?${s}`:""}`,{headers:this.headers,noResolveJson:!0},r),this.shouldThrowOnError)}async info(e,t){var r=this;let n=r._getFinalPath(e),i=new URLSearchParams;(null==t?void 0:t.versionId)!=null&&i.set("versionId",String(t.versionId));let s=i.toString();return r.handleOperation(async()=>e2(await e9(r.fetch,`${r.url}/object/info/${n}${s?`?${s}`:""}`,{headers:r.headers})))}async exists(e){var t;let r=this._getFinalPath(e);try{return await tt(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(eZ(e)){let r=e instanceof eQ?e.status:e instanceof e0?null==(t=e.originalError)?void 0:t.status:void 0;if(void 0!==r&&[400,404].includes(r))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let r=this._getFinalPath(e),n=new URLSearchParams;(null==t?void 0:t.download)&&n.set("download",!0===t.download?"":t.download),(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(n,t.transform),(null==t?void 0:t.cacheNonce)!=null&&n.set("cacheNonce",String(t.cacheNonce)),(null==t?void 0:t.versionId)!=null&&n.set("versionId",String(t.versionId));let i=n.toString(),s="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${r}`)+(i?`?${i}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await tr(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,r){var n=this;return n.handleOperation(async()=>{let i=e8(n._getFinalPath(e)),s=new URLSearchParams;(null==t?void 0:t.transformations)&&s.set("transformations","true");let o=s.toString();return await tr(n.fetch,`${n.url}/cdn/${i}${o?`?${o}`:""}`,{},{headers:n.headers},r)})}async list(e,t,r){var n=this;return n.handleOperation(async()=>{let i=(null==t?void 0:t.sortBy)?eY(eY({},ta.sortBy),t.sortBy):ta.sortBy,s=eY(eY(eY({},ta),t),{},{sortBy:i,prefix:e||""});return await e7(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{let n=eY({},e);return await e7(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return void 0!==ez?ez.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("qual
55ity",t.quality.toString()),e}};let tc={"X-Client-Info":"storage-js/2.116.0"};var th=class extends ti{constructor(e,t={},r,n){const i=new URL(e);(null==n?void 0:n.useNewHostname)&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),super(i.href.replace(/\/$/,""),eY(eY({},tc),t),r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=t.listBucketOptionsToQueryString(e);return await e9(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await e9(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await e7(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes,versioning_status:t.versioningStatus},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await te(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes,versioning_status:t.versioningStatus},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await e7(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await tr(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async getBucketLifecycle(e){var t=this;return t.handleOperation(async()=>await e9(t.fetch,t.bucketLifecycleUrl(e),{headers:t.headers}))}async updateBucketLifecycle(e,t){var r=this;return r.handleOperation(async()=>await te(r.fetch,r.bucketLifecycleUrl(e),t,{headers:r.headers}))}async deleteBucketLifecycle(e){var t=this;return t.handleOperation(async()=>await tr(t.fetch,t.bucketLifecycleUrl(e),{},{headers:t.headers}))}async purgeBucketCache(e,t,r){var n=this;return n.handleOperation(async()=>{let i=new URLSearchParams;(null==t?void 0:t.transformations)&&i.set("transformations","true");let s=i.toString();return await tr(n.fetch,`${n.url}/cdn/${e8(e)}${s?`?${s}`:""}`,{},{headers:n.headers},r)})}bucketLifecycleUrl(e){return`${this.url}/bucket/${e8(e)}/lifecycle`}listBucketOptionsToQueryString(e){let t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},td=class extends ti{constructor(e,t={},r){super(e.replace(/\/$/,""),eY(eY({},tc),t),r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await e7(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=new URLSearchParams;(null==e?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(null==e?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),(null==e?void 0:e.sortColumn)&&r.set("sortColumn",e.sortColumn),(null==e?void 0:e.sortOrder)&&r.set("sortOrder",e.sortOrder),(null==e?void 0:e.search)&&r.set("search",e.search);let n=r.toString(),i=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await e9(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await tr(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!(!(!e||"string"!=typeof e||0===e.length||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\"))&&/^[\w!.\*'() &$@=;:+,?-]+$/.test(e)))throw new eX("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new eG({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(e,t){let r=e[t];return"function"!=typeof r?r:async(...t)=>{try{return{data:await r.apply(e,t),error:null}}catch(e){if(n)throw e;return{data:null,error:e}}}}})}},tp=class extends ti{constructor(e,t={},r){super(e.replace(/\/$/,""),eY(eY({},tc),{},{"Content-Type":"application/json"},t),r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await tn.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await tn.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},tf=class extends ti{constructor(e,t={},r){super(e.replace(/\/$/,""),eY(eY({},tc),{},{"Content-Type":"application/json"},t),r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(void 0!==e.segmentCount){if(e.segmentCount<1||e.segmentCount>16)throw Error("segmentCount must be between 1 and 16");
55if(void 0!==e.segmentIndex&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},tg=class extends ti{constructor(e,t={},r){super(e.replace(/\/$/,""),eY(eY({},tc),{},{"Content-Type":"application/json"},t),r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await tn.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},tm=class extends tg{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new tv(this.url,this.headers,e,this.fetch)}async createBucket(e){return super.createBucket.call(this,e)}async getBucket(e){return super.getBucket.call(this,e)}async listBuckets(e={}){return super.listBuckets.call(this,e)}async deleteBucket(e){return super.deleteBucket.call(this,e)}},tv=class extends tp{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){return super.createIndex.call(this,eY(eY({},e),{},{vectorBucketName:this.vectorBucketName}))}async listIndexes(e={}){return super.listIndexes.call(this,eY(eY({},e),{},{vectorBucketName:this.vectorBucketName}))}async getIndex(e){return super.getIndex.call(this,this.vectorBucketName,e)}async deleteIndex(e){return super.deleteIndex.call(this,this.vectorBucketName,e)}index(e){return new ty(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},ty=class extends tf{constructor(e,t,r,n,i){super(e,t,i),this.vectorBucketName=r,this.indexName=n}async putVectors(e){return super.putVectors.call(this,eY(eY({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async getVectors(e){return super.getVectors.call(this,eY(eY({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async listVectors(e={}){return super.listVectors.call(this,eY(eY({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async queryVectors(e){return super.queryVectors.call(this,eY(eY({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async deleteVectors(e){return super.deleteVectors.call(this,eY(eY({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}},tb=class extends th{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new tu(this.url,this.headers,e,this.fetch)}get vectors(){return new tm(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new td(this.url+"/iceberg",this.headers,this.fetch)}};let t_="2.116.0",tw={"X-Client-Info":`gotrue-js/${t_}`},tk="X-Supabase-Api-Version",tx={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},tE=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,tS="sb_flow_id";class tP extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function tR(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class tT extends tP{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}function tA(e){return tR(e)&&"AuthApiError"===e.name}class tC extends tP{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class tj extends tP{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class tO extends tj{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function t$(e){return tR(e)&&"AuthSessionMissingError"===e.name}class tI extends tj{constructor(){super("Auth session or user missing","AuthInvalidToken
55ResponseError",500,void 0)}}class tL extends tj{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class tM extends tj{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class tD extends tj{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class tN extends tj{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class tF extends tj{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function tB(e){return tR(e)&&"AuthRetryableFetchError"===e.name}class tU extends tj{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}}function tV(e){return tR(e)&&"AuthRefreshDiscardedError"===e.name}class tW extends tj{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class tH extends tj{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}let tq="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),tG=" 	\n\r=".split(""),tz=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<tG.length;t+=1)e[tG[t].charCodeAt(0)]=-2;for(let t=0;t<tq.length;t+=1)e[tq[t].charCodeAt(0)]=t;return e})();function tK(e,t,r){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)r(tq[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)r(tq[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function tJ(e,t,r){let n=tz[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(-2===n)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function tY(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=e=>{!function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}}(e,n,r)};for(let t=0;t<e.length;t+=1)tJ(e.charCodeAt(t),i,s);return t.join("")}function tX(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)tJ(e.charCodeAt(t),r,n);return new Uint8Array(t)}function tZ(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};return e.forEach(e=>tK(e,r,n)),tK(null,r,n),t.join("")}function tQ(e){return Math.round(Date.now()/1e3)+e}let t0=()=>"u">typeof window&&"u">typeof document,t1={tested:!1,writable:!1},t2=()=>{if(!t0())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(t1.tested)return t1.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),t1.tested=!0,t1.writable=!0}catch(e){t1.tested=!0,t1.writable=!1}return t1.writable};function t8(e){let t={},r=new URL(e);if(r.hash&&"#"===r.hash[0])try{new URLSearchParams(r.hash.substring(1)).forEach((e,r)=>{t[r]=e})}catch(e){}return r.searchParams.forEach((e,r)=>{t[r]=e}),t}let t6=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),t3=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},t5=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return null}},t4=async(e,t)=>{await e.removeItem(t)};class t9{constructor(){this.promise=new t9.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function t7(e){let t=e.split(".");if(3!==t.length)throw new tH("Invalid JWT structure");for(let e=0;e<t.length;e++)if(!tE.test(t[e]))throw new tH("JWT not in base64url format");return{header:JSON.parse(tY(t[0])),payload:JSON.parse(tY(t[1])),signature:tX(t[2]),raw:{header:t[0],payload:t[1]}}}async function re(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function rt(e){return("0"+e.toString(16)).substr(-2)}async function rr(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>String.fromCharCode(e)).join("")}async function rn(e){return"u">typeof crypto&&void 0!==crypto.subtle&&"u">typeof TextEncoder?btoa(await rr(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):(console.warn("WebCrypto API is not supported. Code 
55challenge method will default to use plain instead of sha256."),e)}t9.promiseConstructor=Promise;let ri=/^[a-zA-Z0-9_-]{8,64}$/;function rs(e){return"string"==typeof e&&ri.test(e)?e:null}let ro=(e,t)=>`${e}-flow-${t}-code-verifier`,ra=e=>`${e}-flows-code-verifier`;async function rl(e,t){let r=await t5(e,ra(t));return Array.isArray(r)?r.filter(e=>null!==rs(e)):[]}async function ru(e,t,r,n,i){await t3(e,ro(t,r),n);let s=(await rl(e,t)).filter(e=>e!==r);for(s.push(r);s.length>5;){let r=s.shift();await t4(e,ro(t,r)),null==i||i(r)}await t3(e,ra(t),s),await t3(e,`${t}-code-verifier`,n)}async function rc(e,t,r){if(r){let n=await t5(e,ro(t,r));return{verifier:"string"==typeof n?n:null,flowId:r}}let n=await t5(e,`${t}-code-verifier`);return{verifier:"string"==typeof n?n:null,flowId:null}}async function rh(e,t,r){let n=`${t}-code-verifier`;if(!r)return void await t4(e,n);let i=ro(t,r),s=await t5(e,i);await t4(e,i);let o=await rl(e,t),a=o.filter(e=>e!==r);a.length!==o.length&&(a.length>0?await t3(e,ra(t),a):await t4(e,ra(t))),null!=s&&s===await t5(e,n)&&await t4(e,n)}async function rd(e,t){for(let r of(await rl(e,t)))await t4(e,ro(t,r));await t4(e,ra(t)),await t4(e,`${t}-code-verifier`)}async function rp(e,t,r=!1,n){let i=function(){let e=new Uint32Array(56);if("u"<typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,r="";for(let n=0;n<56;n++)r+=e.charAt(Math.floor(Math.random()*t));return r}return crypto.getRandomValues(e),Array.from(e,rt).join("")}(),s=i;r&&(s+="/recovery");let o=function(){if("u">typeof crypto&&"function"==typeof crypto.getRandomValues){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,rt).join("")}let e="";for(let t=0;t<32;t++)e+=Math.floor(16*Math.random()).toString(16);return e}();await ru(e,t,o,s,n);let a=await rn(i),l=i===a?"plain":"s256";return[a,l,o]}let rf=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i,rg=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function rm(e){if(!rg.test(e))throw Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function rv(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function ry(e){if(!e.recoveryCodes)throw Error("@supabase/auth-js: the MFA recovery codes API is experimental and disabled by default. Enable it by passing `auth: { experimental: { recoveryCodes: true } }` to createClient (or to the GoTrueClient constructor).")}function rb(){return new Proxy({},{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"==typeof t){let e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function r_(e){return JSON.parse(JSON.stringify(e))}let rw=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.msg)return e.msg;if("string"==typeof e.message)return e.message;if("string"==typeof e.error_description)return e.error_description;if("string"==typeof e.error)return e.error}return JSON.stringify(e)},rk=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function rx(e){var t;let r,n;if(!("object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json))throw new tF(rw(e),0);try{r=await e.json()}catch(t){if(rk.includes(e.status))throw new tF(e.statusText||`HTTP ${e.status}`,e.status);throw new tC(rw(t),t)}if(rk.includes(e.status))throw new tF(rw(r),e.status);let i=function(e){let t=e.headers.get(tk);if(!t||!t.match(rf))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch(e){return null}}(e);if(i&&i.getTime()>=tx["2024-01-01"].timestamp&&"object"==typeof r&&r&&"string"==typeof r.code?n=r.code:"object"==typeof r&&r&&"string"==typeof r.error_code&&(n=r.error_code),n){if("weak_password"===n)throw new tW(rw(r),e.status,(null==(t=r.weak_password)?void 0:t.reasons)||[]);else if("session_not_found"===n)throw new tO}else if("object"==typeof r&&r&&"object"==typeof r.weak_password&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((e,t)=>
55e&&"string"==typeof t,!0))throw new tW(rw(r),e.status,r.weak_password.reasons);throw new tT(rw(r),e.status||500,n)}async function rE(e,t,r,n){var i;let s=Object.assign({},null==n?void 0:n.headers);s[tk]||(s[tk]=tx["2024-01-01"].name),(null==n?void 0:n.jwt)&&(s.Authorization=`Bearer ${n.jwt}`);let o=null!=(i=null==n?void 0:n.query)?i:{};(null==n?void 0:n.redirectTo)&&(o.redirect_to=n.redirectTo);let a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await rS(e,t,r+a,{headers:s,noResolveJson:null==n?void 0:n.noResolveJson},{},null==n?void 0:n.body);return(null==n?void 0:n.xform)?null==n?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function rS(e,t,r,n,i,s){let o,a,l=(a={method:t,headers:(null==n?void 0:n.headers)||{}},"GET"===t?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==n?void 0:n.headers),a.body=JSON.stringify(s),Object.assign(Object.assign({},a),i)));try{o=await e(r,Object.assign({},l))}catch(e){throw new tF(rw(e),0)}if(o.ok||await rx(o),null==n?void 0:n.noResolveJson)return o;try{return await o.json()}catch(e){await rx(e)}}function rP(e){var t,r;let n=null;return(r=e).access_token&&r.refresh_token&&r.expires_in&&(n=Object.assign({},e),e.expires_at||(n.expires_at=tQ(e.expires_in))),{data:{session:n,user:null!=(t=e.user)?t:"string"==typeof(null==e?void 0:e.id)?e:null},error:null}}function rR(e){let t=rP(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function rT(e){var t;return{data:{user:null!=(t=e.user)?t:e},error:null}}function rA(e){return{data:e,error:null}}function rC(e){let{action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s}=e;return{data:{properties:{action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s},user:Object.assign({},(0,w.Tt)(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]))},error:null}}function rj(e){return e}let rO=["global","local","others"];class r${constructor({url:e="",headers:t={},fetch:r,experimental:n}){this.url=e,this.headers=t,this.fetch=t6(r),this.experimental=null!=n?n:{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=rO[0]){if(0>rO.indexOf(t))throw Error(`@supabase/auth-js: Parameter scope must be one of ${rO.join(", ")}`);try{return await rE(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(tR(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await rE(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:rT})}catch(e){if(tR(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=(0,w.Tt)(e,["options"]),n=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(n.new_email=null==r?void 0:r.newEmail,delete n.newEmail),await rE(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:rC,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(tR(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await rE(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:rT})}catch(e){if(tR(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,n,i,s,o,a;try{let l={nextPage:null,lastPage:0,total:0},u=await rE(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(i=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?i:""},xform:rj});if(u.error)throw u.error;let c=await u.json(),h=null!=(s=u.headers.get("x-total-count"))?s:0,d=null!=(a=null==(o=u.headers.get("link"))?void 0:o.split(","))?a:[];return d.length>
550&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(tR(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){rm(e);try{return await rE(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:rT})}catch(e){if(tR(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){rm(e);try{return await rE(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:rT})}catch(e){if(tR(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){rm(e);try{return await rE(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:rT})}catch(e){if(tR(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){rm(e.userId);try{let{data:t,error:r}=await rE(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:r}}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _deleteFactor(e){rm(e.userId),rm(e.id);try{return{data:await rE(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){var t,r,n,i,s,o,a;try{let l={nextPage:null,lastPage:0,total:0},u=await rE(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(i=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?i:""},xform:rj});if(u.error)throw u.error;let c=await u.json(),h=null!=(s=u.headers.get("x-total-count"))?s:0,d=null!=(a=null==(o=u.headers.get("link"))?void 0:o.split(","))?a:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(tR(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await rE(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await rE(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await rE(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await rE(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await rE(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return(null==e?void 0:e.type)&&(t.type=e.type),await rE(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>{var t;return{data:{providers:null!=(t=null==e?void 0:e.providers)?t:[]},error:null}}})}catch(e){if(tR(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await rE(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await rE(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await rE(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await rE(this.fetch,"DELET
55E",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){rv(this.experimental),rm(e.userId);try{return await rE(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(tR(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){rv(this.experimental),rm(e.userId),rm(e.passkeyId);try{return await rE(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(tR(e))return{data:null,error:e};throw e}}}function rI(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}globalThis&&t2()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class rL extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}function rM(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}class rD extends Error{constructor({message:e,code:t,cause:r,name:n}){var i;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=null!=(i=null!=n?n:r instanceof Error?r.name:void 0)?i:"Unknown Error",this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class rN extends rD{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}class rF{createNewAbortSignal(){if(this.controller){let e=Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}let rB=new rF;function rU(e){if(!e)throw Error("Credential creation options are required");if("u">typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:n}=e,i=(0,w.Tt)(e,["challenge","user","excludeCredentials"]),s=tX(t).buffer,o=Object.assign(Object.assign({},r),{id:tX(r.id).buffer}),a=Object.assign(Object.assign({},i),{challenge:s,user:o});if(n&&n.length>0){a.excludeCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];a.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:tX(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return a}function rV(e){if(!e)throw Error("Credential request options are required");if("u">typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,n=(0,w.Tt)(e,["challenge","allowCredentials"]),i=tX(t).buffer,s=Object.assign(Object.assign({},n),{challenge:i});if(r&&r.length>0){s.allowCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];s.allowCredentials[e]=Object.assign(Object.assign({},t),{id:tX(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return s}function rW(e){var t;return"toJSON"in e&&"function"==typeof e.toJSON?e.toJSON():{id:e.id,rawId:e.id,response:{attestationObject:tZ(new Uint8Array(e.response.attestationObject)),clientDataJSON:tZ(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function rH(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();let r=e.getClientExtensionResults(),n=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:tZ(new Uint8Array(n.authenticatorData)),clientDataJSON:tZ(new Uint8Array(n.clientDataJSON)),signature:tZ(new Uint8Array(n.signature)),userHandle:n.userHandle?tZ(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function rq(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function rG(){var e,t;return!!(t0()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&"function"==typeof(null==(e=null==navigator?void 0:navigator.credentials)?void 0:e.create)&&"function"==typeof(null==(t=null==navigator?void 0:navigator.credentials)?void 0:t.get))}async function rz(e){try{let t=await navigator.credentials.create(e);if(!t)return{data:null,error:new rN("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new rN("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){var r,n,i;let{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new rD({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if((null==(r=s.authenticatorSelection)?void 0:r.requireResidentKey)===!0)return new rD({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});else if("conditional"===t.mediation&&(null==(n=s.authenticatorSelection)?void 0:n.userVerification)==="required")return new rD({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});else if((null==(i=s.authenticatorSelection)?void 0:i.userVerification)==="required")return new rD({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if("InvalidStateError"===e.name)return new rD({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new rD({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new rD(0===s.pubKeyCredParams.filter(e=>"public-key"===e.type).length?{message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}:{message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!rq(t))return new rD({message:`${window.location.hostname}
55 is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(s.rp.id!==t)return new rD({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new rD({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new rD({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new rD({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}async function rK(e){try{let t=await navigator.credentials.get(e);if(!t)return{data:null,error:new rN("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new rN("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new rD({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new rD({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!rq(t))return new rD({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new rD({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new rD({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new rD({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}let rJ={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},rY={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function rX(...e){let t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),n={};for(let i of e)if(i)for(let e in i){let s=i[e];if(void 0!==s)if(Array.isArray(s))n[e]=s;else if(r(s))n[e]=s;else if(t(s)){let r=n[e];t(r)?n[e]=rX(r,s):n[e]=rX(s)}else n[e]=s}return n}class rZ{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:r,signal:n},i){var s,o,a,l,u;try{let{data:c,error:h}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!c)return{data:null,error:h};let d=null!=n?n:rB.createNewAbortSignal();if("create"===c.webauthn.type){let{user:e}=c.webauthn.credential_options.publicKey;if(!e.name)if(r)e.name=`${e.id}:${r}`;else{let t=(await this.client.getUser()).data.user,r=(null==(s=null==t?void 0:t.user_metadata)?void 0:s.name)||(null==t?void 0:t.email)||(null==t?void 0:t.id)||"User";e.name=`${e.id}:${r}`}e.displayName||(e.displayName=e.name)}switch(c.webauthn.type){case"create":{let t=(o=c.webauthn.credential_options.publicKey,a=null==i?void 0:i.create,rX(rJ,o,a||{})),{data:r,error:n}=await rz({publicKey:t,signal:d});if(r)return{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}case"request":{let t=(l=c.webauthn.credential_options.publicKey,u=null==i?void 0:i.request,rX(rY,l,u||{})),{data:r,error:n}=await rK(Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:t,signal:d}));if(r)return{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}}}catch(e){if(tR(e))return{data:null,error:e};return{data:null,error:new tC("Unexpected error in challenge",e)}}}async _verify({challengeId:e,factorId:t,webauthn:r}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:t="u">typeof window?window.location.hostname:void 0,rpOrigins:r="u">typeof window?[window.location.origin]:void 0,signal:n}={}},i){if(!t)return{data:null,error:new tP("rpId is required for WebAuthn authentication")};try{if(!rG())return{data:null,error:new tC("Browser does not support WebAuthn",null)};let{data:s,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:r},signal:n},{request:i});if(!s)return{data:null,error:o};let{webauthn:a}=s;return this._verify({factorId:e,challengeId:s.challengeId,webauthn:{type:a.type,rpId:t,rpOrigins:r,credential_response:a.credential_response}})}catch(e){if(tR(e))return{data:null,error:e};return{data:null,error:new tC("Unexpected error in authenticate",e)}}}async _register({friendlyName:e,webauthn:{rpId:t="u">typeof window?window.location.hostname:void 0,rpOrigins:r="u">typeof window?[window.location.origin]:void 0,signal:n}={}},i){if(!t)return{data:null,error:new tP("rpId is required for WebAuthn registration")};try{if(!rG())return{data:null,error:new tC("Browser does not support WebAuthn",null)};let{data:s,error:o}=await this._enroll({friendlyName:e});if(!s)return await this.client.mfa.listFactors().then(t=>{var r;return null==(r=t.data)?void 0:r.all.find(t=>"webauthn"===t.factor_type&&t.friendly_name===e&&"unverified"===t.status)}).then(e=>e?this.client.mfa.unenroll({factorId:null==e?void 0:e.id}):void 0),{data:null,error:o};let{data:a,error:l}=await this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:t,rpOrigins:r},signal:n},{create:i});if(!a)return{data:null,error:l};return this._verify({factorId:s.id,challengeId:a.challengeId,webauthn:{rpId:t,rpOrigins:r,type:a.webauthn.type,credential_response:a.webauthn.credential_response}})}catch(e){if(tR(e))return{data:null,error:e};return{data:null,error:new tC("Unexpected error in register",e)}}}}if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"u">typeof self&&(self.globalThis=self)}let rQ={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:tw,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},r0={},r1=!1;class r2{get jwks(){var e,t;return null!=(t=null==(e=r0[this.storageKey])?void 0:e.jwks)?t:{keys:[]}}set jwks(e){r0[this.storageKey]=Object.assign(Object.assign({},r0[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!=(t=null==(e=r0[this.storageKey])?void 0:e.cachedAt)?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){r0[this.storageKey]=Object.assign(Object.assign({},r0[this.storageKey]),{cachedAt:e})}constructor(e){var t,r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},rQ),e);if(this.storageKey=i.storageKey,this.instanceID=null!=(t=r2.nextInstanceID[this.storageKey])?t:0,r2.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,"function"==typeof i.debug&&(this.logger=i.debug),this.instanceID>0&&t0()){const e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.experimental=null!=(r=i.experimental)?r:{},this.admin=new r$({url:i.url,headers:i.headers,fetch:i.fetch,experimental:this.experimental}),this.url=i.url,this.headers=i.headers,this.fetch=t6(i.fetch),this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,null!=i.lock&&(this.lock=i.lock,r1||(r1=!0,console.warn(`${this._logPrefix()} The "lock" option is deprecated and will be removed in v3. The client now coordinates session refreshes without a lock, so most apps can drop the option. See https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/migrations/lockless-coordination.md`))),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new rZ(this),recoveryCodes:{getStatus:this._getRecoveryCodesStatus.bind(this),generate:this._generateRecoveryCodes.bind(this),verify:this._verifyRecoveryCode.bind(this),regenerate:this._regenerateRecoveryCodes.bind(this),unenroll:this._unenrollRecoveryCodes.bind(this)}}
55,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:t2()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=rI(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=rI(this.memoryStorage)),t0()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null==(n=this.broadcastChannel)||n.addEventListener("message",async e=>{this._debug("received broadcast notification from other tab or client",e),("TOKEN_REFRESHED"===e.data.event||"SIGNED_IN"===e.data.event)&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug("#broadcastChannel","error",e)}})}i.skipAutoInitialize||this.initialize().catch(e=>{this._debug("#initialize()","error",e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${t_}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){var e;if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>null!=this.lock?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())();let t=await this.initializePromise,r=null!=(e=this._pendingInitNotifications)?e:[];for(let e of(this._pendingInitNotifications=null,r))await this._notifyAllSubscribers(e.event,e.session,e.broadcast);return t}async _initialize(){var e;try{let t={},r="none";if(t0()&&(t=t8(window.location.href),this._isImplicitGrantCallback(t)?r="implicit":await this._isPKCECallback(t)&&(r="pkce")),t0()&&this.detectSessionInUrl&&"none"!==r){let{data:n,error:i}=await this._getSessionFromURL(t,r);if(i){(this._debug("#_initialize()","error detecting session from URL",i),tR(i)&&"AuthImplicitGrantRedirectError"===i.name)&&(null==(e=i.details)||e.code);return{error:i}}let{session:s,redirectType:o}=n;return this._debug("#_initialize()","detected session in URL",s,"redirect type",o),await this._saveSession(s),setTimeout(async()=>{"recovery"===o?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){if(tR(e))return this._returnResult({error:e});return this._returnResult({error:new tC("Unexpected error during initialization",e)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,n;try{let{data:i,error:s}=await rE(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!=(r=null==(t=null==e?void 0:e.options)?void 0:t.data)?r:{},gotrue_meta_security:{captcha_token:null==(n=null==e?void 0:e.options)?void 0:n.captchaToken}},xform:rP});if(s||!i)return this._returnResult({data:{user:null,session:null},error:s});let o=i.session,a=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",o)),this._returnResult({data:{user:a,session:o},error:null})}catch(e){if(tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){var t,r,n;let i=null;try{let s;if("email"in e){let{email:r,password:n,options:o}=e,a=null,l=null;"pkce"===this.flowType&&([a,l,i]=await this._getCodeChallengeAndMethod()),s=await rE(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(null==o?void 0:o.emailRedirectTo,i),body:{email:r,password:n,data:null!=(t=null==o?void 0:o.data)?t:{},gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken},code_challenge:a,code_challenge_method:l},xform:rP})}else if("phone"in e){let{phone:t,password:i,options:o}=e;s=await rE(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:i,data:null!=(r=null==o?void 0:o.data)?r:{},channel:null!=(n=null==o?void 0:o.channel)?n:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:rP})}else throw new tL("You must provide either an email or phone number and a password");let{data:o,error:a}=s;
55if(a||!o)return await rh(this.storage,this.storageKey,i),this._returnResult({data:{user:null,session:null},error:a});let l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(e){if(await rh(this.storage,this.storageKey,i),tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if("email"in e){let{email:r,password:n,options:i}=e;t=await rE(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:rR})}else if("phone"in e){let{phone:r,password:n,options:i}=e;t=await rE(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:rR})}else throw new tL("You must provide either an email or phone number and a password");let{data:r,error:n}=t;if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!r||!r.session||!r.user){let e=new tI;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:n})}catch(e){if(tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){var t,r,n,i;return await this._handleProviderSignIn(e.provider,{redirectTo:null==(t=e.options)?void 0:t.redirectTo,scopes:null==(r=e.options)?void 0:r.scopes,queryParams:null==(n=e.options)?void 0:n.queryParams,skipBrowserRedirect:null==(i=e.options)?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e,t){return(await this.initializePromise,null!=this.lock)?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e,t)):this._exchangeCodeForSession(e,t)}async signInWithWeb3(e){let{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,r,n,i,s,o,a,l,u,c,h,d;let p,f;if("message"in e)p=e.message,f=e.signature;else{let c,{chain:h,wallet:g,statement:m,options:v}=e;if(t0())if("object"==typeof g)c=g;else{let e=window;if("ethereum"in e&&"object"==typeof e.ethereum&&"request"in e.ethereum&&"function"==typeof e.ethereum.request)c=e.ethereum;else throw Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if("object"!=typeof g||!(null==v?void 0:v.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");c=g}let y=new URL(null!=(t=null==v?void 0:v.url)?t:window.location.href),b=await c.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!b||0===b.length)throw Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let _=rM(b[0]),w=null==(r=null==v?void 0:v.signInWithEthereum)?void 0:r.chainId;w||(w=parseInt(await c.request({method:"eth_chainId"}),16)),p=function(e){var t;let{chainId:r,domain:n,expirationTime:i,issuedAt:s=new Date,nonce:o,notBefore:a,requestId:l,resources:u,scheme:c,uri:h,version:d}=e;if(!Number.isInteger(r))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if("1"!==d)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(null==(t=e.statement)?void 0:t.includes("\n"))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let p=rM(e.address),f=c?`${c}://${n}`:n,g=e.statement?`${e.statement}
56`:"",m=`${f} wants you to sign in with your Ethereum account:
57${p}
58
59${g}`,v=`URI: ${h}
60Version: ${d}
61Chain ID: ${r}${o?`
62Nonce: ${o}`:""}
63Issued At: ${s.toISOString()}`;if(i&&(v+=`
64Expiration Time: ${i.toISOString()}`),a&&(v+=`
65Not Before: ${a.toISOString()}`),l&&(v+=`
66Request ID: ${l}`),u){let e="\nResources:";for(let t of u){if(!t||"string"!=typeof t)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`
67- ${t}`}v+=e}return`${m}
68${v}`}({domain:y.host,address:_,statement:m,uri:y.href,version:"1",chainId:w,nonce:null==(n=null==v?void 0:v.signInWithEthereum)?void 0:n.nonce,issuedAt:null!=(s=null==(i=null==v?void 0:v.signInWithEthereum)?void 0:i.issuedAt)?s:new Date,expirationTime:null==(o=null==v?void 0:v.signInWithEthereum)?void 0:o.expirationTime,notBefore:null==(a=null==v?void 0:v.signInWithEthereum)?void 0:a.notBefore,requestId:null==(l=null==v?void 0:v.signInWithEthereum)?void 0:l.requestId,resources:null==(u=null==v?void 0:v.signInWithEthereum)?void 0:u.resources}),f=await c.request({method:"personal_sign",params:[(d=p,"0x"+Array.from(new TextEncoder().encode(d),e=>e.toString(16).padStart(2,"0")).join("")),_]})}try{let{data:t,error:r}=await rE(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:f},(null==(c=e.options)?void 0:c.captchaToken)?{gotrue_meta_security:{captcha_token:null==(h=e.options)?void 0:h.captchaToken}}:null),xform:rP});if(r)throw r;if(!t||!t.session||!t.user){let e=new tI;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){var t,r,n,i,s,o,a,l,u,c,h,d;let p,f;if("message"in e)p=e.message,f=e.signature;else{let h,{chain:d,wallet:g,statement:m,options:v}=e;if(t0())if("object"==typeof g)h=g;else{let e=window;if("solana"in e&&"object"==typeof e.solana&&("signIn"in e.solana&&"function"==typeof e.solana.signIn||"signMessage"in e.solana&&"function"==typeof e.solana.signMessage))h=e.solana;else throw Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if("object"!=typeof g||!(null==v?void 0:v.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");h=g}let y=new URL(null!=(t=null==v?void 0:v.url)?t:window.location.href);if("signIn"in h&&h.signIn){let e,t=await h.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},null==v?void 0:v.signInWithSolana),{version:"1",domain:y.host,uri:y.href}),m?{statement:m}:null));if(Array.isArray(t)&&t[0]&&"object"==typeof t[0])e=t[0];else if(t&&"object"==typeof t&&"signedMessage"in t&&"signature"in t)e=t;else throw Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in e&&"signature"in e&&("string"==typeof e.signedMessage||e.signedMessage instanceof Uint8Array)&&e.signature instanceof Uint8Array)p="string"==typeof e.signedMessage?e.signedMessage:new TextDecoder().decode(e.signedMessage),f=e.signature;else throw Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in h)||"function"!=typeof h.signMessage||!("publicKey"in h)||"object"!=typeof h||!h.publicKey||!("toBase58"in h.publicKey)||"function"!=typeof h.publicKey.toBase58)throw Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");p=[`${y.host} wants you to sign in with your Solana account:`,h.publicKey.toBase58(),...m?["",m,""]:[""],"Version: 1",`URI: ${y.href}`,`Issued At: ${null!=(n=null==(r=null==v?void 0:v.signInWithSolana)?void 0:r.issuedAt)?n:new Date().toISOString()}`,...(null==(i=null==v?void 0:v.signInWithSolana)?void 0:i.notBefore)?[`Not Before: ${v.signInWithSolana.notBefore}`]:[],...(null==(s=null==v?void 0:v.signInWithSolana)?void 0:s.expirationTime)?[`Expiration Time: ${v.signInWithSolana.expirationTime}`]:[],...(null==(o=null==v?void 0:v.signInWithSolana)?void 0:o.chainId)?[`Chain ID: ${v.signInWithSolana.chainId}`]:[],...(null==(a=null==v?void 0:v.signInWithSolana)?void 0:a.nonce)?[`Nonce: ${v.signInWithSolana.nonce}`]:[],...(null==(l=null==v?void 0:v.signInWithSolana)?void 0:l.requestId)?[`Request ID: ${v.signInWithSolana.requestId}`]:[],...(null==(c=null==(u=null==v?void 0:v.signInWithSolana)?void 0:u.resources)?void 0:c.length)?["Resources",...v.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");let e=await h.signMessage(new TextEncoder().encode(p),"utf8");if(!e||!(e instanceof Uint8Array))throw Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");f=e}}try{let{data:t,error:r}=await rE(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:tZ(f)},(null==(h=e.options)?void 0:h.captchaToken)?{gotrue_meta_security:{captcha_token:null==(d=e.options)?void 0:d.captchaToken}}:null),xform:rP});if(r)throw r;if(!t||!t.session||!t.user){let e=new tI;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e,t){let r=(null==t?void 0:t.flowId)!=null,n=r?rs(null==t?void 0:t.flowId):t0()?rs(t8(window.location.href)[tS]):null;r&&!n&&this._debug("#_exchangeCodeForSession()","provided flowId is not a valid flow id",null==t?void 0:t.flowId);let{verifier:i,flowId:s}=r&&!n?{verifier:null,flowId:null}:await rc(this.storage,this.storageKey,n),[o,a]=(null!=i?i:"").split("/");try{if(!o&&"pkce"===this.flowType)throw new tN;let{data:t,error:r}=await rE(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:o},xform:rP});if(await rh(this.storage,this.storageKey,s),r)throw r;if(!t||!t.session||!t.user){let e=new tI;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("recovery"===a?"PASSWORD_RECOVERY":"SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=a?a:null}),error:r})}catch(e){if(await rh(this.storage,this.storageKey,s),tR(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:r,token:n,access_token:i,nonce:s}=e,{data:o,error:a}=await rE(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:i,nonce:s,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:rP});if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!o||!o.session||!o.user){let e=new tI;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),this._returnResult({data:o,error:a})}catch(e){if(tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){var t,r,n,i,s;let o=null;try{if("email"in e){let{email:n,options:i}=e,s=null,a=null;"pkce"===this.flowType&&([s,a,o]=await this._getCodeChallengeAndMethod());let{error:l}=await rE(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:n,data:null!=(t=null==i?void 0:i.data)?t:{},create_user:null==(r=null==i?void 0:i.shouldCreateUser)||r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:s,code_challenge_method:a},redirectTo:this._maybeAppendFlowIdToRedirect(null==i?void 0:i.emailRedirectTo,o)});return this._returnResult({data:{user:null,session:null},error:l})}if("phone"in e){let{phone:t,options:r}=e,{data:o,error:a}=await rE(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!=(n=null==r?void 0:r.data)?n:{},create_user:null==(i=null==r?void 0:r.shouldCreateUser)||i,gotrue_meta_security:{captcha_token:null==r?void 0:r.captchaToken},channel:null!=(s=null==r?void 0:r.channel)?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:a})}throw new tL("You must provide either an email or phone number.")}catch(e){if(await rh(this.storage,this.storageKey,o),tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){var t,r;try{let n,i;"options"in e&&(n=null==(t=e.options)?void 0:t.redirectTo,i=null==(r=e.options)?void 0:r.captchaToken);let{data:s,error:o}=await rE(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:n,xform:rP});if(o)throw o;if(!s)throw Error("An error occurred on token verification.");let a=s.session,l=s.user;return(null==a?void 0:a.access_token)&&(await this._saveSession(a),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(e){if(tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){var t,r,n,i;let s=null;try{let o=null,a=null;"pkce"===this.flowType&&([o,a,s]=await this._getCodeChallengeAndMethod());let l=await rE(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:this._maybeAppendFlowIdToRedirect(null==(t=e.options)?void 0:t.redirectTo,s)}),(null==(r=null==e?void 0:e.options)?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}
68:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:rA});return(null==(n=l.data)?void 0:n.url)&&t0()&&!(null==(i=e.options)?void 0:i.skipBrowserRedirect)&&window.location.assign(l.data.url),this._returnResult(l)}catch(e){if(await rh(this.storage,this.storageKey,s),tR(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return(await this.initializePromise,null!=this.lock)?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new tO;let{error:n}=await rE(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:n})})}catch(e){if(tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){let t=null;try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:s}=e,o=null,a=null;"pkce"===this.flowType&&([o,a,t]=await this._getCodeChallengeAndMethod());let{error:l}=await rE(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:o,code_challenge_method:a},redirectTo:this._maybeAppendFlowIdToRedirect(null==s?void 0:s.emailRedirectTo,t)});return l&&await rh(this.storage,this.storageKey,t),this._returnResult({data:{user:null,session:null},error:l})}if("phone"in e){let{phone:t,type:n,options:i}=e,{data:s,error:o}=await rE(this.fetch,"POST",r,{headers:this.headers,body:{phone:t,type:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==s?void 0:s.message_id},error:o})}throw new tL("You must provide either an email or phone number and a type")}catch(e){if(await rh(this.storage,this.storageKey,t),tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return(await this.initializePromise,null!=this.lock)?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch(e){}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),null==this.lock||this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let t=null,r=await t5(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),null!==r&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let n=!!t.expires_at&&1e3*t.expires_at-Date.now()<9e4;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){let e=await t5(this.userStorage,this.storageKey+"-user");(null==e?void 0:e.user)?t.user=e.user:t.user=rb()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){var e;let r={value:this.suppressGetSessionWarning};t.user=(e=t.user,new Proxy(e,{get:(e,t,n)=>{if("__isInsecureUserWarningProxy"===t)return!0;
68if("symbol"==typeof t){let r=t.toString();if("Symbol(Symbol.toPrimitive)"===r||"Symbol(Symbol.toStringTag)"===r||"Symbol(util.inspect.custom)"===r||"Symbol(nodejs.util.inspect.custom)"===r)return Reflect.get(e,t,n)}return r.value||"string"!=typeof t||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),r.value=!0),Reflect.get(e,t,n)}})),r.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}let{data:i,error:s}=await this._callRefreshToken(t.refresh_token);if(s){if(t.expires_at&&1e3*t.expires_at>Date.now()){let e=await t5(this.storage,this.storageKey);if(e&&e.refresh_token===t.refresh_token)return this._returnResult({data:{session:t},error:null})}return this._returnResult({data:{session:null},error:s})}return this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){let t;return e?await this._getUser(e):(await this.initializePromise,(t=null!=this.lock?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):await this._getUser()).data.user&&(this.suppressGetSessionWarning=!0),t)}async _getUser(e){try{if(e)return await rE(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:rT});return await this._useSession(async e=>{var t,r,n;let{data:i,error:s}=e;if(s)throw s;return(null==(t=i.session)?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await rE(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!=(n=null==(r=i.session)?void 0:r.access_token)?n:void 0,xform:rT}):{data:{user:null},error:new tO}})}catch(e){if(tR(e))return t$(e)&&await this._removeSession(),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return(await this.initializePromise,null!=this.lock)?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t)):await this._updateUser(e,t)}async _updateUser(e,t={}){let r=null;try{return await this._useSession(async n=>{let{data:i,error:s}=n;if(s)throw s;if(!i.session)throw new tO;let o=i.session,a=null,l=null;"pkce"===this.flowType&&null!=e.email&&([a,l,r]=await this._getCodeChallengeAndMethod());let{data:u,error:c}=await rE(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(null==t?void 0:t.emailRedirectTo,r),body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:rT});if(c)throw c;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(e){if(await rh(this.storage,this.storageKey,r),tR(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return(await this.initializePromise,null!=this.lock)?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new tO;let t=Date.now()/1e3,r=t,n=!0,i=null,{payload:s}=t7(e.access_token);if(s.exp&&(n=(r=s.exp)<=t),n){let{data:t,error:r}=await this._callRefreshToken(e.refresh_token);if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:n,error:s}=await this._getUser(e.access_token);if(s)return this._returnResult({data:{user:null,session:null},error:s});i={access_token:e.access_token,refresh_token:e.refresh_token,user:n.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if(tR(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return(await this.initializePromise,null!=this.lock)?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:n,error:i}=t;if(i)throw i;e=null!=(r=n.session)?r:void 0}if(!(null==e?void 0:e.refresh_token))throw new tO;let{data:n,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){var r;try{if(!t0())throw new tM("No browser detected.");
68if(e.error||e.error_description||e.error_code)throw new tM(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if("pkce"===this.flowType)throw new tD("Not a valid PKCE flow url.");break;case"pkce":if("implicit"===this.flowType)throw new tM("Not a valid implicit grant flow url.")}if("pkce"===t){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new tD("No code detected.");let{data:t,error:n}=await this._exchangeCodeForSession(e.code,{flowId:e[tS]});if(n)throw n;let i=new URL(window.location.href);return i.searchParams.delete("code"),i.searchParams.delete(tS),window.history.replaceState(window.history.state,"",i.toString()),{data:{session:t.session,redirectType:null!=(r=t.redirectType)?r:null},error:null}}let{provider_token:n,provider_refresh_token:i,access_token:s,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=e;if(!s||!a||!o||!u)throw new tM("No session defined in URL");let c=Math.round(Date.now()/1e3),h=parseInt(a),d=c+h;l&&(d=parseInt(l));let p=d-c;1e3*p<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${h}s`);let f=d-h;c-f>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",f,d,c):c-f<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",f,d,c);let{data:g,error:m}=await this._getUser(s);if(m)throw m;let v={provider_token:n,provider_refresh_token:i,access_token:s,expires_in:h,expires_at:d,refresh_token:o,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:v,redirectType:e.type},error:null})}catch(e){if(tR(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return"function"==typeof this.detectSessionInUrl?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){if(!e.code)return!1;let t=rs(e[tS]);return!!(t&&await t5(this.storage,ro(this.storageKey,t)))||!!await t5(this.storage,`${this.storageKey}-code-verifier`)}async signOut(e={scope:"global"}){return(await this.initializePromise,null!=this.lock)?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let n=async()=>{await this._removeSession()},{data:i,error:s}=t;if(s&&!t$(s))return this._returnResult({error:s});let o=null==(r=i.session)?void 0:r.access_token;if(o){let{error:t}=await this.admin.signOut(o,e);if(t&&!(tA(t)&&(404===t.status||401===t.status||403===t.status)||t$(t)))return"others"!==e&&await n(),this._returnResult({error:t})}return"others"!==e&&await n(),this._returnResult({error:null})})}onAuthStateChange(e){let t=Symbol("auth-callback"),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>{await this.initializePromise,null!=this.lock?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)}):await this._emitInitialSession(t)})(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{let{data:{session:n},error:i}=t;if(i)throw i;await (null==(r=this.stateChangeEmitters.get(e))?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(t){if(await (null==(n=this.stateChangeEmitters.get(e))?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),tV(t))return;t$(t)||tB(t)||tA(t)&&("refresh_token_not_found"===t.code||"refresh_token_already_used"===t.code||"session_expired"===t.code)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null,i=null;"pkce"===this.flowType&&([r,n,i]=await this._getCodeChallengeAndMethod(!0));try{return await rE(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:n,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(t.redirectTo,i)})}catch(e){if(await rh(this.storage,this.storageKey,i),tR(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){var e;try{let{data:t,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:null!=(e=t.user.identities)?e:[]},error:null})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;let r=null;try{let{data:n,error:i}=await this._useSession(async t=>{var n,i,s,o,a;let{data:l,error:u}=t;if(u)throw u;let{url:c,flowId:h}=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null==(n=e.options)?void 0:n.redirectTo,scopes:null==(i=e.options)?void 0:i.scopes,queryParams:null==(s=e.options)?void 0:s.queryParams,skipBrowserRedirect:!0});return r=h,await rE(this.fetch,"GET",c,{headers:this.headers,jwt:null!=(a=null==(o=l.session)?void 0:o.access_token)?a:void 0})});if(i)throw i;return!t0()||(null==(t=e.options)?void 0:t.skipBrowserRedirect)||window.location.assign(null==n?void 0:n.url),this._returnResult({data:{provider:e.provider,url:null==n?void 0:n.url,flowId:r},error:null})}catch(t){if(tR(t))return this._returnResult({data:{provider:e.provider,url:null,flowId:r},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var r;try{let{error:n,data:{session:i}}=t;if(n)throw n;let{options:s,provider:o,token:a,access_token:l,nonce:u}=e,{data:c,error:h}=await rE(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:null!=(r=null==i?void 0:i.access_token)?r:void 0,body:{provider:o,id_token:a,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:rP});if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!c||!c.session||!c.user)return this._returnResult({data:{user:null,session:null},error:new tI});return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("USER_UPDATED",c.session)),this._returnResult({data:c,error:h})}catch(e){if(await rh(this.storage,this.storageKey,null),tR(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,n;let{data:i,error:s}=t;if(s)throw s;
68return await rE(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!=(n=null==(r=i.session)?void 0:r.access_token)?n:void 0})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t="#_refreshAccessToken()";this._debug(t,"begin");try{var r,n;let i=Date.now();return await (r=async r=>(r>0&&await re(200*Math.pow(2,r-1)),this._debug(t,"refreshing attempt",r),await rE(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:rP})),n=(e,t)=>{let r=200*Math.pow(2,e);return t&&tB(t)&&Date.now()+r-i<3e4},new Promise((e,t)=>{(async()=>{for(let i=0;i<1/0;i++)try{let t=await r(i);if(!n(i,null))return void e(t)}catch(e){if(!n(i,e))return void t(e)}})()}))}catch(e){if(this._debug(t,"error",e),tR(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let{url:r,flowId:n}=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),t0()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r,flowId:n},error:null}}async _recoverAndRefresh(){var e,t;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await t5(this.storage,this.storageKey);if(n&&this.userStorage){let t=await t5(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!t&&(t={user:n.user},await t3(this.userStorage,this.storageKey+"-user",t)),n.user=null!=(e=null==t?void 0:t.user)?e:rb()}else if(n&&!n.user&&!n.user){let e=await t5(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(n.user=e.user,await t4(this.storage,this.storageKey+"-user"),await t3(this.storage,this.storageKey,n)):n.user=rb()}if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),null!==n&&await this._removeSession();return}let i=(null!=(t=n.expires_at)?t:1/0)*1e3-Date.now()<9e4;if(this._debug(r,`session has${i?"":" not"} expired with margin of 90000s`),i){if(this.autoRefreshToken&&n.refresh_token){let{error:e}=await this._callRefreshToken(n.refresh_token);e&&(tV(e)?this._debug(r,"refresh discarded by commit guard",e):this._debug(r,"refresh failed",e))}}else if(n.user&&!0===n.user.__isUserNotAvailableProxy)try{let{data:e,error:t}=await this._getUser(n.access_token);!t&&(null==e?void 0:e.user)?(n.user=e.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(e){console.error("Error getting user data:",e),this._debug(r,"error getting user data, skipping SIGNED_IN notification",e)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(e){this._debug(r,"error",e),tB(e)?console.warn(e):console.error(e);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new tO;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;let n="#_callRefreshToken()";this._debug(n,"begin");try{this.refreshingDeferred=new t9,this.refreshingDeferred.promise.then(void 0,()=>{});let t=await t5(this.storage,this.storageKey),{data:r,error:i}=await this._refreshAccessToken(e);if(i)throw i;if(!r.session)throw new tO;let s=await t5(this.storage,this.storageKey);if(null!==t&&(null===s||s.refresh_token!==t.refresh_token)){this._debug(n,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:s?"replaced":"cleared"});let e={data:null,error:new tU};return this.refreshingDeferred.resolve(e),e}let o=this._sessionRemovalEpoch;if(await this._saveSession(r.session),this._sessionRemovalEpoch!==o){this._debug(n,"commit guard (post-save): _removeSession ran during _saveSession, und
68oing write"),await t4(this.storage,this.storageKey),this.userStorage&&await t4(this.userStorage,this.storageKey+"-user");let e={data:null,error:new tU};return this.refreshingDeferred.resolve(e),e}await this._notifyAllSubscribers("TOKEN_REFRESHED",r.session);let a={data:r.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(n,"error",i),tR(i)){let r={data:null,error:i};if(!tB(i)){let e=await t5(this.storage,this.storageKey);(null==e?void 0:e.expires_at)&&1e3*e.expires_at>Date.now()?this._debug(n,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:r,expiresAt:Date.now()+6e4},null==(t=this.refreshingDeferred)||t.resolve(r),r}throw null==(r=this.refreshingDeferred)||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){if(null!==this._pendingInitNotifications&&r)return void this._pendingInitNotifications.push({event:e,session:t,broadcast:r});let n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let n=[],i=Array.from(this.stateChangeEmitters.values()).map(async r=>{try{await r.callback(e,t)}catch(e){n.push(e)}});if(await Promise.all(i),n.length>0){for(let e=0;e<n.length;e+=1)console.error(n[e]);throw n[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;let t=Object.assign({},e),r=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!r&&t.user&&await t3(this.userStorage,this.storageKey+"-user",{user:t.user});let e=Object.assign({},t);delete e.user;let n=r_(e);await t3(this.storage,this.storageKey,n)}else{let e=r_(t);await t3(this.storage,this.storageKey,e)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await t4(this.storage,this.storageKey),await rd(this.storage,this.storageKey),await t4(this.storage,this.storageKey+"-user"),this.userStorage&&await t4(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&t0()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(e){console.error("removing visibilitychange callback failed",e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&"object"==typeof t&&"function"==typeof t.unref?t.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),null==(e=this.broadcastChannel)||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),null!=this.lock){try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");let n=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),n<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof rL)this._debug("auto refresh token tick lock not available");else throw e}return}if(null!==this.refreshingDeferred)return void this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");try{let e=Date.now();try{await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");let n=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),n<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!t0()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;if(this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,null!=this.lock)await this._acquireLock(this.lockAcquireTimeout,async()=>{"visible"!==document.visibilityState?this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting"):await this._recoverAndRefresh()});else{if("visible"!==document.visibilityState)return void this._debug(t,"visibilityState is no longer visible, skipping recovery");await this._recoverAndRefresh()}}else"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){let n=null==r?void 0:r.redirectTo,i=null,s=null,o=null;"pkce"===this.flowType&&([i,s,o]=await this._getCodeChallengeAndMethod(),n=this._maybeAppendFlowIdToRedirect(n,o));let a=[`provider=${encodeURIComponent(t)}`];if(n&&a.push(`redirect_to=${encodeURIComponent(n)}`),(null==r?void 0:r.scopes)&&a.push(`scopes=${encodeURIComponent(r.scopes)}`),null!=i&&null!=s){let e=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(s)}`});a.push(e.toString())}if(null==r?void 0:r.queryParams){let e=new URLSearchParams(r.queryParams);a.push(e.toString())}return(null==r?void 0:r.skipBrowserRedirect)&&a.push(`skip_http_redirect=${r.skipBrowserRedirect}`),{url:`${e}?${a.join("&")}`,flowId:o}}_maybeAppendFlowIdToRedirect(e,t){return e&&t&&this.experimental.appendPkceFlowIdToRedirects?function(e,t){let r=e.indexOf("#"),n=-1===r?e:e.slice(0,r),i=-1===r?"":e.slice(r),s=n.indexOf("?");if(-1!==s){let e=n.slice(0,s),t=n.slice(s+1).split("&").filter(e=>
68""!==e&&e!==tS&&!e.startsWith(`${tS}=`));n=t.length>0?`${e}?${t.join("&")}`:e}let o=n.includes("?")?"&":"?";return`${n}${o}${tS}=${encodeURIComponent(t)}${i}`}(e,t):null!=e?e:void 0}async _getCodeChallengeAndMethod(e=!1){return rp(this.storage,this.storageKey,e,e=>this._debug("#_getCodeChallengeAndMethod()","evicted oldest pending PKCE verifier slot",e))}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:n,error:i}=t;return i?this._returnResult({data:null,error:i}):await rE(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;let{data:i,error:s}=t;if(s)return this._returnResult({data:null,error:s});let o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:a,error:l}=await rE(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:null==(r=null==i?void 0:i.session)?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):("totp"===e.factorType&&"totp"===a.type&&(null==(n=null==a?void 0:a.totp)?void 0:n.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){let t=async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:i}=t;if(i)return this._returnResult({data:null,error:i});let s=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?rW(e.webauthn.credential_response):rH(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:a}=await rE(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:s,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});return a?this._returnResult({data:null,error:a}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:a}))})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}};return null!=this.lock?this._acquireLock(this.lockAcquireTimeout,t):t()}async _challenge(e){let t=async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:i}=t;if(i)return this._returnResult({data:null,error:i});let s=await rE(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});if(s.error)return s;let{data:o}=s;if("webauthn"!==o.type)return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:rU(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:rV(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}};return null!=this.lock?this._acquireLock(this.lockAcquireTimeout,t):t()}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;let{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};let n={all:[],phone:[],totp:[],webauthn:[],recovery_code:[]};for(let r of null!=(e=null==t?void 0:t.factors)?e:[])n.all.push(r),"verified"===r.status&&r.factor_type in n&&Array.isArray(n[r.factor_type])&&n[r.factor_type].push(r);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,r,n,i;if(e)try{let{payload:n}=t7(e),i=null;n.aal&&(i=n.aal);let s=i,{data:{user:o},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});(null!=(r=null==(t=null==o?void 0:o.factors)?void 0:t.filter(e=>"verified"===e.status))?r:[]).length>0&&(s="aal2");let l=n.amr||[];return{data:{currentLevel:i,nextLevel:s,currentAuthenticationMethods:l},error:null}}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:s},error:o}
68=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:a}=t7(s.access_token),l=null;a.aal&&(l=a.aal);let u=l;return(null!=(i=null==(n=s.user.factors)?void 0:n.filter(e=>"verified"===e.status))?i:[]).length>0&&(u="aal2"),{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:a.amr||[]},error:null}}async _getRecoveryCodesStatus(){ry(this.experimental);try{return await this._useSession(async e=>{var t;let{data:r,error:n}=e;if(n)return this._returnResult({data:null,error:n});let{data:i,error:s}=await rE(this.fetch,"GET",`${this.url}/factors/recovery-codes`,{headers:this.headers,jwt:null==(t=null==r?void 0:r.session)?void 0:t.access_token});return s?this._returnResult({data:null,error:s}):this._returnResult({data:i,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _generateRecoveryCodes(e){ry(this.experimental);try{return await this._useSession(async t=>{var r;let{data:n,error:i}=t;if(i)return this._returnResult({data:null,error:i});let{data:s,error:o}=await rE(this.fetch,"POST",`${this.url}/factors/recovery-codes`,{body:(null==e?void 0:e.friendlyName)?{friendly_name:e.friendlyName}:void 0,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _verifyRecoveryCode(e){ry(this.experimental);let t=async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:i}=t;if(i)return this._returnResult({data:null,error:i});let{data:s,error:o}=await rE(this.fetch,"POST",`${this.url}/factors/recovery-codes/verify`,{body:{code:e.code},headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});if(o)return this._returnResult({data:null,error:o});let a=Object.assign({expires_at:tQ(s.expires_in)},s);return await this._saveSession(a),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:s,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}};return null!=this.lock?this._acquireLock(this.lockAcquireTimeout,t):t()}async _regenerateRecoveryCodes(){ry(this.experimental);try{return await this._useSession(async e=>{var t;let{data:r,error:n}=e;if(n)return this._returnResult({data:null,error:n});let{data:i,error:s}=await rE(this.fetch,"POST",`${this.url}/factors/recovery-codes/regenerate`,{headers:this.headers,jwt:null==(t=null==r?void 0:r.session)?void 0:t.access_token});return s?this._returnResult({data:null,error:s}):this._returnResult({data:i,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _unenrollRecoveryCodes(){ry(this.experimental);try{return await this._useSession(async e=>{var t;let{data:r,error:n}=e;if(n)return this._returnResult({data:null,error:n});let{data:i,error:s}=await rE(this.fetch,"DELETE",`${this.url}/factors/recovery-codes`,{headers:this.headers,jwt:null==(t=null==r?void 0:r.session)?void 0:t.access_token});return s?this._returnResult({data:null,error:s}):this._returnResult({data:i,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await rE(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new tO})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async r=>{let{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new tO});let s=await rE(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url&&t0()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async r=>{let{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new tO});let s=await rE(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url&&t0()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;return r?this._returnResult({data:null,error:r}):t?await rE(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new tO})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}
68):r?(await rE(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new tO})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(t=>t.kid===e);if(r)return r;let n=Date.now();if((r=this.jwks.keys.find(t=>t.kid===e))&&this.jwks_cached_at+6e5>n)return r;let{data:i,error:s}=await rE(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return i.keys&&0!==i.keys.length&&(this.jwks=i,this.jwks_cached_at=n,r=i.keys.find(t=>t.kid===e))?r:null}async getClaims(e,t={}){try{let i,s=e;if(!s){let{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});s=e.session.access_token}let{header:o,payload:a,signature:l,raw:{header:u,payload:c}}=t7(s);if(!(null==t?void 0:t.allowExpired))try{var r,n=a.exp;if(!n)throw Error("Missing exp claim");if(n<=Math.floor(Date.now()/1e3))throw Error("JWT has expired")}catch(e){throw new tH(e instanceof Error?e.message:"JWT validation failed")}let h=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks);if(!h){let{error:e}=await this.getUser(s);if(e)throw e;return{data:{claims:a,header:o,signature:l},error:null}}let d=function(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw Error("Invalid alg claim")}}(o.alg),p=await crypto.subtle.importKey("jwk",h,d,!0,["verify"]);if(!await crypto.subtle.verify(d,p,l,(r=`${u}.${c}`,i=[],!function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(r,e=>i.push(e)),new Uint8Array(i))))throw new tH("Invalid JWT signature");return{data:{claims:a,header:o,signature:l},error:null}}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){var t,r,n;rv(this.experimental);try{if(!rG())return this._returnResult({data:null,error:new tC("Browser does not support WebAuthn",null)});let{data:i,error:s}=await this._startPasskeyAuthentication({options:{captchaToken:null==(t=null==e?void 0:e.options)?void 0:t.captchaToken}});if(s||!i)return this._returnResult({data:null,error:s});let o=rV(i.options),a=null!=(n=null==(r=null==e?void 0:e.options)?void 0:r.signal)?n:rB.createNewAbortSignal(),{data:l,error:u}=await rK({publicKey:o,signal:a});if(u||!l)return this._returnResult({data:null,error:null!=u?u:new tC("WebAuthn ceremony failed",null)});let c=rH(l);return this._verifyPasskeyAuthentication({challengeId:i.challenge_id,credential:c})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){var t,r;rv(this.experimental);try{if(!rG())return this._returnResult({data:null,error:new tC("Browser does not support WebAuthn",null)});let{data:n,error:i}=await this._startPasskeyRegistration();if(i||!n)return this._returnResult({data:null,error:i});let s=rU(n.options),o=null!=(r=null==(t=null==e?void 0:e.options)?void 0:t.signal)?r:rB.createNewAbortSignal(),{data:a,error:l}=await rz({publicKey:s,signal:o});if(l||!a)return this._returnResult({data:null,error:null!=l?l:new tC("WebAuthn ceremony failed",null)});let u=rW(a);return this._verifyPasskeyRegistration({challengeId:n.challenge_id,credential:u})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){rv(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new tO});let{data:n,error:i}=await rE(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:n,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){rv(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new tO});let{data:i,error:s}=await rE(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:i,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){var t;rv(this.experimental);try{let{data:r,error:n}=await rE(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:null==(t=null==e?void 0:e.options)?void 0:t.captchaToken}}});if(n)return this._returnResult({data:null,error:n});return this._returnResult({data:r,error:null})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){rv(this.experimental);try{let{data:t,error:r}=await rE(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:rP});if(r)return this._returnResult({data:null,error:r});return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:t,error:null})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){rv(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new tO});let{data:n,error:i}=await rE(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:n,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){rv(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new tO});let{data:i,error:s}=await rE(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:e.friendlyName}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:i,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){rv(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new tO});let{error:i}
68=await rE(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(e){if(tR(e))return this._returnResult({data:null,error:e});throw e}}}r2.nextInstanceID={};let r8=r2,r6="";if("u">typeof Deno)r6="deno",s=null==(b=Deno.version)?void 0:b.deno;else if("u">typeof document)r6="web";else if("u">typeof navigator&&"ReactNative"===navigator.product)r6="react-native";else{r6="node";let e=globalThis.process;s=null==e||null==(_=e.version)?void 0:_.replace(/^v/,"")}let r3=[`runtime=${r6}`];s&&r3.push(`runtime-version=${s}`);let r5={headers:{"X-Client-Info":`supabase-js/2.116.0; ${r3.join("; ")}`}},r4={schema:"public"},r9={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},r7={},ne={enabled:!1,respectSamplingDecision:!0};function nt(e){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function nn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nr(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=nt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=nt(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==nt(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nr(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}let ni=e=>e.startsWith("sb_publishable_")||e.startsWith("sb_secret_"),ns=new Set,no=(e,t,r,n,i,s)=>{let a=n?(...e)=>n(...e):(...e)=>fetch(...e),l=Headers,u=(null==i?void 0:i.enabled)===!0,c=(null==i?void 0:i.respectSamplingDecision)!==!1,h=u?function(e){let t=[];try{let r=new URL(e);t.push(r.hostname)}catch(e){}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}(t):null,d=!((null==s?void 0:s.omitApiKeyAsBearer)&&ni(e));return async(t,n)=>{let i=await r(),s=new l(null==n?void 0:n.headers);if(s.has("apikey")||s.set("apikey",e),!s.has("Authorization")){let t=null!=i?i:d?e:null;t&&s.set("Authorization",`Bearer ${t}`)}if(h){let e=function(e,t,r){let n=globalThis[o];if(!n)return na||(na=!0,console.warn("@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at your application entry point (requires the OpenTelemetry API package to be installed). The CDN/UMD build does not support trace propagation.")),null;if(!function(e,t){let r;if(!e||!t||0===t.length)return!1;if(e instanceof URL)r=e;else try{r=new URL(e)}catch(e){return!1}for(let e of t)try{if("string"==typeof e){if(function(e,t){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(2);if(e.endsWith(r)&&(e===r||e.endsWith("."+r)))return!0}return!1}(r.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(r.hostname))return!0}else if("function"==typeof e&&e(r))return!0}catch(e){continue}return!1}("string"==typeof e||e instanceof URL?e:e.url,t))return null;let i=n();if(!i||!i.traceparent){var s;if((null==i||null==(s=i.carrierKeys)?void 0:s.length)&&!nl){nl=!0;let e=i.carrierKeys.includes("sentry-trace")?" Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.":" Configure your tracing SDK to emit W3C trace context on outgoing requests.";console.warn(`@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its propagator wrote [${i.carrierKeys.join(", ")}] and no W3C traceparent header, so trace headers will not be attached.`+e)}return null}if(r){let e=function(e){if(!e||"string"!=typeof e)return null;let t=e.split("-");if(4!==t.length)return null;let[r,n,i,s]=t;if(2!==r.length||32!==n.length||16!==i.length||2!==s.length)return null;let o=/^[0-9a-f]+$/i;return o.test(r)&&o.test(n)&&o.test(i)&&o.test(s)&&"00000000000000000000000000000000"!==n&&"0000000000000000"!==i?{version:r,traceId:n,parentId:i,traceFlags:s,isSampled:(1&parseInt(s,16))==1}:null}(i.traceparent);if(e&&!e.isSampled)return{traceparent:i.traceparent}}return i}(t,h,c);e&&(e.traceparent&&!s.has("traceparent")&&s.set("traceparent",e.traceparent),e.tracestate&&!s.has("tracestate")&&s.set("tracestate",e.tracestate),e.baggage&&!s.has("baggage")&&s.set("baggage",e.baggage))}return a(t,nn(nn({},n),{},{headers:s}))}},na=!1,nl=!1;function nu(e){return"boolean"==typeof e?{enabled:e}:e}let nc=!1;var nh=class extends r8{constructor(e){super(e)}},nd=class{constructor(e,t,r){var n,i,s;this.supabaseUrl=e,this.supabaseKey=t;const o=function(e){let t=null==e?void 0:e.trim();if(!t)throw Error("supabaseUrl is required.");
68if(!t.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(t.endsWith("/")?t:t+"/")}catch(e){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}(e);if(!t)throw Error("supabaseKey is required.");(e=>{var t,r;if(!e.startsWith("sb_")||ni(e)||e.startsWith("sb_temp_"))return;let n=null!=(t=null==(r=e.match(/^sb_[a-zA-Z0-9]+_/))?void 0:r[0])?t:"unknown";ns.has(n)||(ns.add(n),console.warn("@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type."))})(t),function(e){nc||"object"==typeof e&&null!==e&&"schema"in e&&void 0!==e.schema&&(nc=!0,console.warn('@supabase/supabase-js: The "schema" option must be nested under "db", e.g. createClient(url, key, { db: { schema: \'myschema\' } }). A top-level "schema" is ignored and queries go to the default schema.'))}(r),this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const a=`sb-${o.hostname.split(".")[0]}-auth-token`,l=function(e,t){var r,n,i,s,o,a;let{db:l,auth:u,realtime:c,global:h}=e,{db:d,auth:p,realtime:f,global:g}=t,m=nu(e.tracePropagation),v=nu(t.tracePropagation),y={db:nn(nn({},d),l),auth:nn(nn({},p),u),realtime:nn(nn({},f),c),storage:{},global:nn(nn(nn({},g),h),{},{headers:nn(nn({},null!=(r=null==g?void 0:g.headers)?r:{}),null!=(n=null==h?void 0:h.headers)?n:{})}),tracePropagation:{enabled:null!=(i=null!=(s=null==m?void 0:m.enabled)?s:null==v?void 0:v.enabled)&&i,respectSamplingDecision:null==(o=null!=(a=null==m?void 0:m.respectSamplingDecision)?a:null==v?void 0:v.respectSamplingDecision)||o},accessToken:async()=>""};return e.accessToken?y.accessToken=e.accessToken:delete y.accessToken,y}(null!=r?r:{},{db:r4,realtime:r7,auth:nn(nn({},r9),{},{storageKey:a}),global:r5,tracePropagation:ne});this.settings=l,this.storageKey=null!=(n=l.auth.storageKey)?n:"",this.headers=null!=(i=l.global.headers)?i:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!=(s=l.auth)?s:{},this.headers,l.global.fetch),this.fetch=no(t,e,this._getSessionToken.bind(this),l.global.fetch,l.tracePropagation),this.functionsFetch=no(t,e,this._getSessionToken.bind(this),l.global.fetch,l.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(nn({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn("Failed to set initial Realtime auth token:",e)),this.rest=new V(new URL("rest/v1",o).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit,retry:l.db.retry}),this.storage=new tb(this.storageUrl.href,this.headers,this.fetch,null==r?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new P(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}getOpenApiSpec(){return this.rest.getOpenApiSpec()}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var e,t;if(this.accessToken)return await this.accessToken();let{data:r}=await this.auth.getSession();return null!=(e=null==(t=r.session)?void 0:t.access_token)?e:null}async _getAccessToken(){var e;return null!=(e=await this._getSessionToken())?e:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,storageKey:s,flowType:o,lock:a,debug:l,throwOnError:u,experimental:c,lockAcquireTimeout:h,skipAutoInitialize:d},p,f){let g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new nh({url:this.authUrl.href,headers:nn(nn({},g),p),storageKey:s,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,flowType:o,lock:a,debug:l,throwOnError:u,experimental:c,fetch:f,lockAcquireTimeout:h,skipAutoInitialize:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new eF(this.realtimeUrl.href,nn(nn({},e),{},{params:nn(nn({},{apikey:this.supabaseKey}),null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,r){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e||"INITIAL_SESSION"===e)&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}};let np=(e,t,r)=>new nd(e,t,r);(function(){if("u">typeof window||void 0!==globalThis.Deno)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(null==t)return!1;let r=t.match(/^v(\d+)\./);return!!r&&20>=parseInt(r[1],10)})()&&console.warn("⚠️  Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
68ode.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715")},73789:()=>{},73846:(e,t,r)=>{"use strict";r.d(t,{hO:()=>u,sG:()=>l});var n=r(76430),i=r(54569),s=r(36859),o=r(75038),a=Object.defineProperty,l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=(0,s.TL)(`Primitive.${t}`),i=n.forwardRef((e,n)=>{let{asChild:i,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(i?r:t,{...s,ref:n})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function u(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}a(u,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0})},74883:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return d}});let n=r(75591)._(r(76430)),i=r(22609),s=[],o=[],a=!1;function l(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class u{constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}}function c(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),s=null;function l(){if(!s){let t=new u(e,r);s={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return s.promise()}if(!a){let e=r.webpack&&1?r.webpack():r.modules;e&&o.push(t=>{for(let r of e)if(t.includes(r))return l()})}function c(e,t){let o;l(),(o=n.default.useContext(i.LoadableContext))&&Array.isArray(r.modules)&&r.modules.forEach(e=>{o(e)});let a=n.default.useSyncExternalStore(s.subscribe,s.getCurrentValue,s.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:s.retry}),[]),n.default.useMemo(()=>{var t;return a.loading||a.error?n.default.createElement(r.loading,{isLoading:a.loading,pastDelay:a.pastDelay,timedOut:a.timedOut,error:a.error,retry:s.retry}):a.loaded?n.default.createElement((t=a.loaded)&&t.default?t.default:t,e):null},[e,a])}return c.preload=()=>l(),c.displayName="LoadableComponent",n.default.forwardRef(c)}(l,e)}function h(e,t){let r=[];for(;e.length;){let n=e.pop();r.push(n(t))}return Promise.all(r).then(()=>{if(e.length)return h(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{h(s).then(e,t)}),c.preloadReady=(e=[])=>new Promise(t=>{let r=()=>(a=!0,t());h(o,e).then(r,r)}),window.__NEXT_PRELOADREADY=c.preloadReady;let d=c},75141:(e,t,r)=>{e.exports=r(51379)},75242:(e,t,r)=>{"use strict";r.d(t,{F:()=>s});let n=async(e,t="GET",r)=>{let n=await fetch(e,{method:t,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0}),i=await n.json().catch(()=>null);if(!n.ok)throw Error(i?.error||"Something went wrong with your team");return i},i=(e,t="")=>`/api/teams/${e}${t}`,s={checkout:({name:e,seats:t,interval:r,clientReferenceId:i})=>n("/api/teams/checkout","POST",{name:e,seats:t,interval:r,clientReferenceId:i}),join:e=>n("/api/teams/join","POST",{token:e}),previewInvite:e=>n(`/api/teams/join?token=${encodeURIComponent(e)}`),byCheckout:e=>n(`/api/teams/checkout?key=${encodeURIComponent(e)}`),get:e=>n(i(e)),rename:(e,t)=>
68n(i(e),"PATCH",{name:t}),invite:(e,{email:t,role:r,projectId:s})=>n(i(e,"/invites"),"POST",{email:t,role:r,projectId:s}),revokeInvite:(e,t)=>n(i(e,"/invites"),"DELETE",{inviteId:t}),removeMember:(e,t)=>n(i(e,"/members"),"DELETE",{memberId:t}),createProject:(e,t)=>n(i(e,"/projects"),"POST",{name:t}),updateProject:(e,t,r)=>n(i(e,"/projects"),"PATCH",{projectId:t,...r}),setProjectRole:(e,t,r,s)=>n(i(e,"/projects"),"PUT",{projectId:t,memberId:r,role:s}),removeFromProject:(e,t,r)=>n(i(e,"/projects"),"DELETE",{projectId:t,memberId:r}),changeSeats:(e,t)=>n(i(e,"/billing"),"PATCH",{seats:t}),billingPortal:e=>n(i(e,"/billing"),"POST")}},75623:(e,t,r)=>{"use strict";r.d(t,{j4:()=>i,pG:()=>o,rm:()=>l});let n=e=>t=>"string"==typeof t&&t.startsWith(e),i=n("--"),s=n("var(--"),o=e=>!!s(e)&&a.test(e.split("/*")[0].trim()),a=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function l(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}},76242:(e,t,r)=>{"use strict";r.d(t,{e0:()=>g,qW:()=>f});var n,i=r(76430),s=r(17440),o=r(73846),a=r(5701),l=r(11212),u=r(75038),c=Object.defineProperty,h=(e,t)=>c(e,"name",{value:t,configurable:!0}),d="dismissableLayer.update",p=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),f=i.forwardRef(h(function(e,t){let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:_,onDismiss:w,...k}=e,x=i.useContext(p),[E,S]=i.useState(null),P=E?.ownerDocument??globalThis?.document,[,R]=i.useState({}),T=(0,a.s)(t,S),A=Array.from(x.layers),[C]=[...x.layersWithOutsidePointerEventsDisabled].slice(-1),j=C?A.indexOf(C):-1,O=E?A.indexOf(E):-1,$=x.layersWithOutsidePointerEventsDisabled.size>0,I=O>=j,L=i.useRef(!1),M=v(e=>{g?.(e),_?.(e),e.defaultPrevented||w?.()},{ownerDocument:P,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:L,dismissableSurfaces:x.dismissableSurfaces,shouldHandlePointerDownOutside:i.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...x.branches].some(t=>t.contains(e));return I&&!t},[x.branches,I])}),D=y(e=>{if(c&&L.current)return;let t=e.target;![...x.branches].some(e=>e.contains(t))&&(m?.(e),_?.(e),e.defaultPrevented||w?.())},P),N=!!E&&O===A.length-1,F=(0,l.c)(e=>{"Escape"===e.key&&(f?.(e),!e.defaultPrevented&&w&&(e.preventDefault(),w()))});return i.useEffect(()=>{if(N)return P.addEventListener("keydown",F,{capture:!0}),()=>P.removeEventListener("keydown",F,{capture:!0})},[P,N,F]),i.useEffect(()=>{if(E)return r&&(0===x.layersWithOutsidePointerEventsDisabled.size&&(n=P.body.style.pointerEvents,P.body.style.pointerEvents="none"),x.layersWithOutsidePointerEventsDisabled.add(E)),x.layers.add(E),b(),()=>{r&&(x.layersWithOutsidePointerEventsDisabled.delete(E),0===x.layersWithOutsidePointerEventsDisabled.size&&(P.body.style.pointerEvents=n))}},[E,P,r,x]),i.useEffect(()=>()=>{E&&(x.layers.delete(E),x.layersWithOutsidePointerEventsDisabled.delete(E),b())},[E,x]),i.useEffect(()=>{let e=h(()=>R({}),"handleUpdate");return document.addEventListener(d,e),()=>document.removeEventListener(d,e)},[]),(0,u.jsx)(o.sG.div,{...k,ref:T,style:{pointerEvents:$?I?"auto":"none":void 0,...e.style},onFocusCapture:(0,s.mK)(e.onFocusCapture,D.onFocusCapture),onBlurCapture:(0,s.mK)(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:(0,s.mK)(e.onPointerDownCapture,M.onPointerDownCapture)})},"DismissableLayer"));function g(){let e=i.useContext(p),[t,r]=i.useState(null);return i.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}h(g,"useDismissableLayerSurface");var m=h(()=>!0,"IS_TRUE");function v(e,t){let{ownerDocument:r=globalThis?.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:o,shouldHandlePointerDownOutside:a=m}=t,u=(0,l.c)(e),c=i.useRef(!1),d=i.useRef(!1),p=i.useRef(new Map),f=i.useRef(()=>{});return i.useEffect(()=>{function e(){d.current=!1,s.current=!1,p.current.clear()}function t(){return Array.from(p.current.values()).some(Boolean)}function i(e){if(!d.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||p.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{d.current&&f.current()},0)}function l(e){d.current&&p.current.set(e.type,!1)}h(e,"resetOutsideInteraction"),h(t,"isOutsideInteractionIntercepted"),h(i,"handleInteractionCapture"),h(l,"handleInteractionBubble");let g=h(i=>{if(i.target&&!c.current){let o=function(){r.removeEventListener("click",f.current);let n=t();e(),n||_("dismissableLayer.pointerDownOutside",u,l,{discrete:!0})};if(h(o,"handleAndDispatchPointerDownOutsideEvent"),!a(i.target)){r.removeEventListener("click",f.current),e(
68),c.current=!1;return}let l={originalEvent:i};d.current=!0,s.current=n&&0===i.button,p.current.clear(),n&&0===i.button?(r.removeEventListener("click",f.current),f.current=o,r.addEventListener("click",f.current,{once:!0})):o()}else r.removeEventListener("click",f.current),e();c.current=!1},"handlePointerDown"),m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)r.addEventListener(e,i,!0),r.addEventListener(e,l);let v=window.setTimeout(()=>{r.addEventListener("pointerdown",g)},0);return()=>{for(let e of(window.clearTimeout(v),r.removeEventListener("pointerdown",g),r.removeEventListener("click",f.current),m))r.removeEventListener(e,i,!0),r.removeEventListener(e,l)}},[r,u,n,s,o,a]),{onPointerDownCapture:h(()=>c.current=!0,"onPointerDownCapture")}}function y(e,t=globalThis?.document){let r=(0,l.c)(e),n=i.useRef(!1);return i.useEffect(()=>{let e=h(e=>{e.target&&!n.current&&_("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:h(()=>n.current=!0,"onFocusCapture"),onBlurCapture:h(()=>n.current=!1,"onBlurCapture")}}function b(){let e=new CustomEvent(d);document.dispatchEvent(e)}function _(e,t,r,{discrete:n}){let i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?(0,o.hO)(i,s):i.dispatchEvent(s)}h(v,"usePointerDownOutside"),h(y,"useFocusOutside"),h(b,"dispatchUpdate"),h(_,"handleAndDispatchCustomEvent")},76598:(e,t,r)=>{"use strict";r.d(t,{vC:()=>b});var n=r(76430);r(75038);var i=["shift","alt","meta","mod","ctrl","control"],s={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function o(e){return(s[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function a(e){return i.includes(e)}function l(e,t=","){return e.toLowerCase().split(t)}function u(e,t="+",r=">",n=!1,s,a){let l=[],c=!1;(e=e.trim()).includes(r)?(c=!0,l=e.toLocaleLowerCase().split(r).map(e=>o(e))):l=e.toLocaleLowerCase().split(t).map(e=>o(e));let h={alt:l.includes("alt"),ctrl:l.includes("ctrl")||l.includes("control"),shift:l.includes("shift"),meta:l.includes("meta"),mod:l.includes("mod"),useKey:n},d=l.filter(e=>!i.includes(e));return{...h,keys:d,description:s,isSequence:c,hotkey:e,metadata:a}}"u">typeof document&&(document.addEventListener("keydown",e=>{void 0!==e.code&&d([o(e.code)])}),document.addEventListener("keyup",e=>{void 0!==e.code&&p([o(e.code)])})),"u">typeof window&&(window.addEventListener("blur",()=>{c.clear()}),window.addEventListener("focus",()=>{c.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{c.clear()},0)})),"u">typeof document&&document.addEventListener("visibilitychange",()=>{c.clear()});var c=new Set;function h(e){return Array.isArray(e)}function d(e){let t=Array.isArray(e)?e:[e];c.has("meta")&&c.forEach(e=>{a(e)||c.delete(e.toLowerCase())}),t.forEach(e=>{c.add(e.toLowerCase())})}function p(e){"meta"===e?c.clear():(Array.isArray(e)?e:[e]).forEach(e=>{c.delete(e.toLowerCase())})}var f=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"];function g(e,t=!1){var r;let{target:n,composed:i}=e,s,o;return(r=n).tagName&&!r.tagName.startsWith("-")&&r.tagName.includes("-")&&i?(s=e.composedPath()[0]&&e.composedPath()[0].tagName,o=e.composedPath()[0]&&e.composedPath()[0].role):(s=n&&n.tagName,o=n&&n.role),h(t)?!!(s&&t?.some(e=>e.toLowerCase()===s.toLowerCase()||e===o)):!!(s&&t&&t)}var m=(0,n.createContext)(void 0),v=(0,n.createContext)({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),y="u">typeof window?n.useLayoutEffect:n.useEffect;function b(e,t,r,i){var s;let b,[_,w]=(0,n.useState)(null),k=(0,n.useCallback)(e=>(w(e),()=>w(null)),[]),x=(0,n.useRef)(!1),E=Array.isArray(r)?Array.isArray(i)?void 0:i:r,S=h(e)?e.join(E?.delimiter):e,P=Array.isArray(r)?r:Array.isArray(i)?i:void 0,R=(0,n.useCallback)(t,P??[]),T=(0,n.useRef)(R);P?T.current=R:T.current=t;let A=(s=function(e){if(!e)return;let{enabled:t,preventDefault:r,ignoreEventWhen:n,...i}=e;return"function"==typeof t?i:{...i,enabled:t}}(E),function e(t,r){return t&&r&&"object"==typeof t&&"object"==typeof r?Object.keys(t).length===Object.keys(r).length&&Object.keys(t).reduce((n,i)=>n&&e(t[i],r[i]),!0):t===r}((b=(0,n.useRef)(void 0)).current,s)||(b.current=s),b.current),C=(0,n.useRef)(E?.enabled);C.current=E?.enabled;let j=(0,n.useRef)(E?.preventDefault);j.current=E?.preventDefault;let O=(0,n.useRef)(E?.ignoreEventWhen);O.current=E?.ignoreEventWhen;let{activeScopes:$}=(0,n.useContext)(v),I=(0,n.useContext)(m);return y(()=>{var e;if(!1===C.current||(e=A?.scopes,!((0!==$.length||!e)&&(!e||$.some(t=>e.includes(t))||$.includes("*")))))return;let t=[],r,n=(e,n=!1)=>
68{if(!(g(e,f)&&!g(e,A?.enableOnFormTags))){if(null!==_){let t=_.getRootNode();if((t instanceof Document||t instanceof ShadowRoot)&&t.activeElement!==_&&!_.contains(t.activeElement))return void(e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation())}e.target?.isContentEditable&&!A?.enableOnContentEditable||l(S,A?.delimiter).forEach(i=>{if(i.includes(A?.splitKey??"+")&&i.includes(A?.sequenceSplitKey??">"))return void console.warn(`Hotkey ${i} contains both ${A?.splitKey??"+"} and ${A?.sequenceSplitKey??">"} which is not supported.`);let s=u(i,A?.splitKey,A?.sequenceSplitKey,A?.useKey,A?.description,A?.metadata);if(s.isSequence){r=setTimeout(()=>{t=[]},A?.sequenceTimeoutMs??1e3);let n=s.useKey?e.key:o(e.code);if(a(n.toLowerCase()))return;if(t.push(n),n!==s.keys?.[t.length-1]){t=[],r&&clearTimeout(r);return}t.length===s.keys?.length&&(T.current(e,s),r&&clearTimeout(r),t=[])}else if(((e,t,r=!1)=>{let{alt:n,meta:i,mod:s,shift:a,ctrl:l,keys:u,useKey:d}=t,{code:p,key:f,ctrlKey:g,metaKey:m,shiftKey:v,altKey:y}=e,b=o(p),_="function"==typeof e.getModifierState&&e.getModifierState("AltGraph");if(!d&&!u?.includes(b)&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(b))return!1;if(!r){if(n!==y&&"alt"!==b||a!==v&&"shift"!==b)return!1;if(s){if(!(typeof navigator>"u")&&/mac/i.test(navigator.userAgent)&&!/iphone|ipad|ipod/i.test(navigator.userAgent)?!m:!g)return!1}else if(i!==m&&"meta"!==b&&"os"!==b||l!==g&&"ctrl"!==b&&"control"!==b)return!1;if(_&&!n&&!l&&!s&&!["alt","ctrl","control"].includes(b))return!1}return!!(d&&u?.length===1&&u.includes(f.toLowerCase())||u&&1===u.length&&u.includes(b))||(u&&u.length>0?!!u.includes(b)&&function(e,t=","){return(h(e)?e:e.split(t)).every(e=>c.has(e.trim().toLowerCase()))}(u):!u||0===u.length)})(e,s,A?.ignoreModifiers)||s.keys?.includes("*")){var l,d;if(O.current?.(e)||n&&x.current||(("function"==typeof(l=j.current)&&l(e,s)||!0===l)&&e.preventDefault(),"function"==typeof(d=C.current)?!d(e,s):!0!==d&&void 0!==d))return;T.current(e,s),n||(x.current=!0)}})}},i=e=>{void 0!==e.code&&(d(o(e.code)),(A?.keydown===void 0&&A?.keyup!==!0||A?.keydown)&&n(e))},s=e=>{void 0!==e.code&&(p(o(e.code)),x.current=!1,A?.keyup&&n(e,!0))},m=_||E?.document||document;return m.addEventListener("keyup",s,E?.eventListenerOptions),m.addEventListener("keydown",i,E?.eventListenerOptions),I&&l(S,A?.delimiter).forEach(e=>{I.addHotkey(u(e,A?.splitKey,A?.sequenceSplitKey,A?.useKey,A?.description,A?.metadata))}),()=>{m.removeEventListener("keyup",s,E?.eventListenerOptions),m.removeEventListener("keydown",i,E?.eventListenerOptions),I&&l(S,A?.delimiter).forEach(e=>{I.removeHotkey(u(e,A?.splitKey,A?.sequenceSplitKey,A?.useKey,A?.description,A?.metadata))}),t=[],r&&clearTimeout(r)}},[_,A,$,S]),k}},76902:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var n=r(75038),i=r(76430),s=r(2272),o=r(46001),a=r.n(o),l=r(72651),u=r(76598),c=r(34530),h=r(61869),d=r(71623);let p=i.memo(function(){let{c_Modals:e,c_SetModals:t}=(0,i.useContext)(s.A);(0,i.useEffect)(()=>{e.length?document.body.style.overflow="hidden":document.body.style.overflow="unset"},[e]),(0,u.vC)("esc",t=>{e?.length&&r()},[e]);let r=()=>{t([])};return(0,n.jsx)(h.N,{children:e?.length&&(0,n.jsx)("div",{className:a()("z-103 fixed top-0 left-0 flex items-center justify-center w-full h-screen overflow-auto",{"pointer-events-none":!e.length}),children:(0,n.jsx)(n.Fragment,{children:e?.map((e,t)=>(0,n.jsxs)("div",{className:(0,d.A)("w-full px-2 md:px-3 flex items-center justify-center",e.width??"max-w-[760px]"),children:[(0,n.jsx)(c.T8,{type:"custom",initial:{opacity:0}
68,animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0},onClick:r,style:{zIndex:`${40+t}`},className:a()("fixed top-0 left-0 w-full h-full overflow-hidden backdrop-blur-sm",{"bg-gray-900/60 dark:bg-gray-800/90":0==t},{"bg-gray-900/40":0!==t})}),(0,n.jsxs)(c.T8,{type:"custom",initial:{y:-20,opacity:0,scale:1.08},animate:{y:0,opacity:1,scale:1,transition:{duration:.32,type:"spring"}},exit:{y:0,opacity:0,scale:.8,transition:{duration:.25,type:"spring"}},className:a()("w-full relative bg-white h-full max-h-[95vh] overflow-x-hidden md:overflow-auto shadow-2xl rounded-2xl dark:bg-gray-900 dark:shadow-black/50 mx-auto"),style:{zIndex:`${50+t}`},children:[(0,n.jsx)("div",{className:"sticky top-0 right-0 z-50",children:(0,n.jsx)(l.US,{onClick:r,className:"absolute not-italic mr-4 mt-2 md:mt-4 top-0 right-0"})}),e.content]})]},e.id))})})})})},78142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return l}});let n=r(76430),i=r(75885),s="function"==typeof IntersectionObserver,o=new Map,a=[];function l({rootRef:e,rootMargin:t,disabled:r}){let u=r||!s,[c,h]=(0,n.useState)(!1),d=(0,n.useRef)(null),p=(0,n.useCallback)(e=>{d.current=e},[]);return(0,n.useEffect)(()=>{if(s){if(u||c)return;let r=d.current;if(r&&r.tagName)return function(e,t,r){let{id:n,observer:i,elements:s}=function(e){let t,r={root:e.root||null,margin:e.rootMargin||""},n=a.find(e=>e.root===r.root&&e.margin===r.margin);if(n&&(t=o.get(n)))return t;let i=new Map;return t={id:r,observer:new IntersectionObserver(e=>{e.forEach(e=>{let t=i.get(e.target),r=e.isIntersecting||e.intersectionRatio>0;t&&r&&t(r)})},e),elements:i},a.push(r),o.set(r,t),t}(r);return s.set(e,t),i.observe(e),function(){if(s.delete(e),i.unobserve(e),0===s.size){i.disconnect(),o.delete(n);let e=a.findIndex(e=>e.root===n.root&&e.margin===n.margin);e>-1&&a.splice(e,1)}}}(r,e=>e&&h(e),{root:e?.current,rootMargin:t})}else if(!c){let e=(0,i.requestIdleCallback)(()=>h(!0));return()=>(0,i.cancelIdleCallback)(e)}},[u,t,e,c,d.current]),[p,c,(0,n.useCallback)(()=>{h(!1)},[])]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},79335:(e,t,r)=>{"use strict";r.d(t,{A:()=>J});var n,i,s,o,a,l,u,c=r(82643),h=r(76430),d="right-scroll-bar-position",p="width-before-scroll-bar";function f(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var g="u">typeof window?h.useLayoutEffect:h.useEffect,m=new WeakMap,v=(void 0===n&&(n={}),(void 0===i&&(i=function(e){return e}),s=[],o=!1,a={read:function(){if(o)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:null},useMedium:function(e){var t=i(e,o);return s.push(t),function(){s=s.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(o=!0;s.length;){var t=s;s=[],t.forEach(e)}s={push:function(t){return e(t)},filter:function(){return s}}},assignMedium:function(e){o=!0;var t=[];if(s.length){var r=s;s=[],r.forEach(e),t=s}var n=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(n)};i(),s={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),s}}}}).options=(0,c.Cl)({async:!0,ssr:!1},n),a),y=function(){},b=h.forwardRef(function(e,t){var r,n,i,s,o=h.useRef(null),a=h.useState({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:y}),l=a[0],u=a[1],d=e.forwardProps,p=e.children,b=e.className,_=e.removeScrollBar,w=e.enabled,k=e.shards,x=e.sideCar,E=e.noRelative,S=e.noIsolation,P=e.inert,R=e.allowPinchZoom,T=e.as,A=e.gapMode,C=(0,c.Tt)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=(r=[o,t],n=function(e){return r.forEach(function(t){return f(t,e)})},(i=(0,h.useState)(function(){return{value:null,callback:n,facade:{get current(){return i.value},set current(value){var e=i.value;e!==value&&(i.value=value,i.callback(value,e))}}}})[0]).callback=n,s=i.facade,g(function(){var e=m.get(s);if(e){var t=new Set(e),n=new Set(r),i=s.current;t.forEach(function(e){n.has(e)||f(e,null)}
68),n.forEach(function(e){t.has(e)||f(e,i)})}m.set(s,r)},[r]),s),O=(0,c.Cl)((0,c.Cl)({},C),l);return h.createElement(h.Fragment,null,w&&h.createElement(x,{sideCar:v,removeScrollBar:_,shards:k,noRelative:E,noIsolation:S,inert:P,setCallbacks:u,allowPinchZoom:!!R,lockRef:o,gapMode:A}),d?h.cloneElement(h.Children.only(p),(0,c.Cl)((0,c.Cl)({},O),{ref:j})):h.createElement(void 0===T?"div":T,(0,c.Cl)({},O,{className:b,ref:j}),p))});b.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},b.classNames={fullWidth:p,zeroRight:d};var _=function(e){var t=e.sideCar,r=(0,c.Tt)(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return h.createElement(n,(0,c.Cl)({},r))};_.isSideCarExport=!0;var w=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=u||r.nc;return t&&e.setAttribute("nonce",t),e}())){var i,s;(i=t).styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n)),s=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(s)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},k=function(){var e=w();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},x=function(){var e=k();return function(t){return e(t.styles,t.dynamic),null}},E={left:0,top:0,right:0,gap:0},S=function(e){return parseInt(e||"",10)||0},P=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[S(r),S(n),S(i)]},R=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return E;var t=P(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},T=x(),A="data-scroll-locked",C=function(e,t,r,n){var i=e.left,s=e.top,o=e.right,a=e.gap;return void 0===r&&(r="margin"),"\n  .".concat("with-scroll-bars-hidden"," {\n   overflow: hidden ").concat(n,";\n   padding-right: ").concat(a,"px ").concat(n,";\n  }\n  body[").concat(A,"] {\n    overflow: hidden ").concat(n,";\n    overscroll-behavior: contain;\n    ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n    padding-left: ".concat(i,"px;\n    padding-top: ").concat(s,"px;\n    padding-right: ").concat(o,"px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(a,"px ").concat(n,";\n    "),"padding"===r&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),"\n  }\n  \n  .").concat(d," {\n    right: ").concat(a,"px ").concat(n,";\n  }\n  \n  .").concat(p," {\n    margin-right: ").concat(a,"px ").concat(n,";\n  }\n  \n  .").concat(d," .").concat(d," {\n    right: 0 ").concat(n,";\n  }\n  \n  .").concat(p," .").concat(p," {\n    margin-right: 0 ").concat(n,";\n  }\n  \n  body[").concat(A,"] {\n    ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n  }\n")},j=function(){var e=parseInt(document.body.getAttribute(A)||"0",10);return isFinite(e)?e:0},O=function(){h.useEffect(function(){return document.body.setAttribute(A,(j()+1).toString()),function(){var e=j()-1;e<=0?document.body.removeAttribute(A):document.body.setAttribute(A,e.toString())}},[])},$=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=void 0===n?"margin":n;O();var s=h.useMemo(function(){return R(i)},[i]);return h.createElement(T,{styles:C(s,!t,i,r?"":"!important")})},I=!1;if("u">typeof window)try{var L=Object.defineProperty({},"passive",{get:function(){return I=!0,!0}});window.addEventListener("test",L,L),window.removeEventListener("test",L,L)}catch(e){I=!1}var M=!!I&&{passive:!1},D=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},N=function(e,t){var r=t.ownerDocument,n=t;do{if("u">typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),F(e,n)){var i=B(e,n);if(i[1]>i[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},F=function(e,t){return"v"===e?D(t,"overflowY"):D(t,"overflowX")},B=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},U=function(e,t,r,n,i){var s,o=(s=window.getComputedStyle(t).direction,"h"===e&&"rtl"===s?-1:1),a=o*n,l=r.target,u=t.contains(l),c=!1,h=a>0,d=0,p=0;
68do{if(!l)break;var f=B(e,l),g=f[0],m=f[1]-f[2]-o*g;(g||m)&&F(e,l)&&(d+=m,p+=g);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return h&&(i&&1>Math.abs(d)||!i&&a>d)?c=!0:!h&&(i&&1>Math.abs(p)||!i&&-a>p)&&(c=!0),c},V=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},W=function(e){return[e.deltaX,e.deltaY]},H=function(e){return e&&"current"in e?e.current:e},q=0,G=[];let z=(l=function(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),i=h.useState(q++)[0],s=h.useState(x)[0],o=h.useRef(e);h.useEffect(function(){o.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=(0,c.fX)([e.lockRef.current],(e.shards||[]).map(H),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var i,s=V(e),a=r.current,l="deltaX"in e?e.deltaX:a[0]-s[0],u="deltaY"in e?e.deltaY:a[1]-s[1],c=e.target,h=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===h&&"range"===c.type)return!1;var d=window.getSelection(),p=d&&d.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var f=N(h,c);if(!f)return!0;if(f?i=h:(i="v"===h?"h":"v",f=N(h,c)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||u)&&(n.current=i),!i)return!0;var g=n.current||i;return U(g,t,e,"h"===g?l:u,!0)},[]),l=h.useCallback(function(e){if(G.length&&G[G.length-1]===s){var r="deltaY"in e?W(e):V(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var i=(o.current.shards||[]).map(H).filter(Boolean).filter(function(t){return t.contains(e.target)});(i.length>0?a(e,i[0]):!o.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=h.useCallback(function(e,r,n,i){var s={name:e,delta:r,target:n,should:i,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),d=h.useCallback(function(e){r.current=V(e),n.current=void 0},[]),p=h.useCallback(function(t){u(t.type,W(t),t.target,a(t,e.lockRef.current))},[]),f=h.useCallback(function(t){u(t.type,V(t),t.target,a(t,e.lockRef.current))},[]);h.useEffect(function(){return G.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",l,M),document.addEventListener("touchmove",l,M),document.addEventListener("touchstart",d,M),function(){G=G.filter(function(e){return e!==s}),document.removeEventListener("wheel",l,M),document.removeEventListener("touchmove",l,M),document.removeEventListener("touchstart",d,M)}},[]);var g=e.removeScrollBar,m=e.inert;return h.createElement(h.Fragment,null,m?h.createElement(s,{styles:"\n  .block-interactivity-".concat(i," {pointer-events: none;}\n  .allow-interactivity-").concat(i," {pointer-events: all;}\n")}):null,g?h.createElement($,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},v.useMedium(l),_);var K=h.forwardRef(function(e,t){return h.createElement(b,(0,c.Cl)({},e,{ref:t,sideCar:z}))});K.classNames=b.classNames;let J=K},79998:(e,t,r)=>{"use strict";r.d(t,{gm:()=>c,oV:()=>h,sx:()=>a,u4:()=>d,vq:()=>p});var n=r(70799);let i=/\(?\s*[^\s()@]+@[^\s()@]+\.[^\s()@]+\s*\)?/g,s=e=>"string"==typeof e?e.replace(i,"").trim():e,o=(...e)=>{window.datafast=window.datafast||function(){(window.datafast.q=window.datafast.q||[]).push(arguments)},window.datafast(...e)},a=(e,t={},{teamId:r}={})=>
68{if(!e)return;let i=(e=>{let t={};for(let[r,n]of Object.entries(e||{})){let e=s(n);null!=e&&""!==e&&(t[r]=e)}return t})(t);try{n.Ay.__loaded&&n.Ay.capture(e,r?{...i,$groups:{team:String(r)}}:i)}catch(e){console.log("Error tracking event (PostHog)",e)}try{let t=String(e).toLowerCase().replace(/[^a-z0-9_:-]+/g,"_").replace(/^_+|_+$/g,"").slice(0,64);t&&o(t,Object.fromEntries(Object.entries(i).slice(0,10).map(([e,t])=>[e.toLowerCase().replace(/[^a-z0-9_-]+/g,"_").slice(0,64),("string"==typeof t?t:JSON.stringify(t)).slice(0,255)])))}catch(e){console.log("Error tracking event (DataFast)",e)}},l=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e)),u=new Set,c=({id:e,email:t,name:r,...i})=>{if(!e)return;let s=JSON.stringify([e,l({email:t,name:r,...i})]);if(!u.has(s)){u.add(s);try{n.Ay.__loaded&&n.Ay.identify(e,l({email:t,name:r,...i}))}catch(e){console.log("Error identifying user (PostHog)",e)}try{o("identify",{user_id:e,...t?{email:t}:{},...r?{name:r}:{}})}catch(e){console.log("Error identifying user (DataFast)",e)}}},h=()=>{u.clear();try{n.Ay.__loaded&&n.Ay.reset()}catch(e){console.log("Error resetting analytics",e)}},d=({event:e,meta:t})=>a(e,t&&"object"==typeof t?t:{meta:t??""}),p=(e,t)=>a(e,t)},82643:(e,t,r)=>{"use strict";r.d(t,{Cl:()=>n,Tt:()=>i,fX:()=>o,sH:()=>s});var n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function s(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function o(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError},85509:(e,t,r)=>{"use strict";r.d(t,{I:()=>s});var n=r(96151);let i=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function s(e,t){let r=!1,s=!0,o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,l=i.reduce((e,t)=>(e[t]=function(e){let t=new Set,r=new Set,n=!1,i=!1,s=new Set,o={delta:0,timestamp:0,isProcessing:!1};function a(t){s.has(t)&&(r.add(t),e()),t(o)}let l={schedule:(e,i=!1,o=!1)=>{let a=o&&n?t:r;return i&&s.add(e),a.add(e),e},cancel:e=>{r.delete(e),s.delete(e)},process:e=>{if(o=e,n){i=!0;return}n=!0;let s=t;t=r,r=s,t.forEach(a),t.clear(),n=!1,i&&(i=!1,l.process(e))}};return l}(a),e),{}),{setup:u,read:c,resolveKeyframes:h,preUpdate:d,update:p,preRender:f,render:g,postRender:m}=l,v=()=>{let i=n.W.useManualTiming,a=i?o.timestamp:performance.now();r=!1,i||(o.delta=s?1e3/60:Math.max(Math.min(a-o.timestamp,40),1)),o.timestamp=a,o.isProcessing=!0,u.process(o),c.process(o),h.process(o),d.process(o),p.process(o),f.process(o),g.process(o),m.process(o),o.isProcessing=!1,r&&t&&(s=!1,e(v))};return{schedule:i.reduce((t,n)=>{let i=l[n];return t[n]=(t,n=!1,a=!1)=>(!r&&(r=!0,s=!0,o.isProcessing||e(v)),i.schedule(t,n,a)),t},{}),cancel:e=>{for(let t=0;t<i.length;t++)l[i[t]].cancel(e)},state:o,steps:l}}},85735:(e,t,r)=>{"use strict";r.d(t,{$:()=>s,q:()=>o});var n=r(39643);let i=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,s=(e,t)=>r=>!!("string"==typeof r&&i.test(r)&&r.startsWith(e)||t&&null!=r&&Object.prototype.hasOwnProperty.call(r,t)),o=(e,t,r)=>i=>{if("string"!=typeof i)return i;let[s,o,a,l]=i.match(n.S);return{[e]:parseFloat(s),[t]:parseFloat(o),[r]:parseFloat(a),alpha:void 0!==l?parseFloat(l):1}}},86955:(e,t,r)=>{"use strict";r.d(t,{F:()=>n});let n=(...e)=>e.reduce((e,t)=>
68r=>t(e(r)))},87206:(e,t,r)=>{e.exports=r(77186)},88061:(e,t,r)=>{"use strict";r.d(t,{HK:()=>s,NA:()=>i,Nl:()=>l,Sr:()=>o,zL:()=>a});var n=r(75038);let i=(0,n.jsx)("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M21 11C20.4 11 20 11.4 20 12C20 14.9 18.5 17.5 16 18.9C12.2 21.1 7.3 19.8 5.1 16C2.9 12.2 4.2 7.3 8 5.1C11.3 3.2 15.3 3.9 17.8 6.5H15.4C14.8 6.5 14.4 6.9 14.4 7.5C14.4 8.1 14.8 8.5 15.4 8.5H19.9C20.5 8.5 20.9 8.1 20.9 7.5V3C20.9 2.4 20.5 2 19.9 2C19.3 2 18.9 2.4 18.9 3V4.8C17 3 14.6 2 12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22C17.5 22 22 17.5 22 12C22 11.4 21.6 11 21 11Z"})}),s=(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",strokeWidth:"2.4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M6 12H18.5M18.5 12L12.5 6M18.5 12L12.5 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),o=(0,n.jsx)("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2ZM16.2 10.3L11.4 15.1C11 15.5 10.4 15.5 10 15.1L7.8 12.9C7.4 12.5 7.4 11.9 7.8 11.5C8.2 11.1 8.8 11.1 9.2 11.5L10.7 13L14.8 8.9C15.2 8.5 15.8 8.5 16.2 8.9C16.6 9.3 16.6 9.9 16.2 10.3Z"})}),a=(0,n.jsx)("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.9999 9.17019C16.8126 8.98394 16.5591 8.87939 16.2949 8.87939C16.0308 8.87939 15.7773 8.98394 15.5899 9.17019L11.9999 12.7102L8.45995 9.17019C8.27259 8.98394 8.01913 8.87939 7.75495 8.87939C7.49076 8.87939 7.23731 8.98394 7.04995 9.17019C6.95622 9.26315 6.88183 9.37375 6.83106 9.49561C6.78029 9.61747 6.75415 9.74818 6.75415 9.88019C6.75415 10.0122 6.78029 10.1429 6.83106 10.2648C6.88183 10.3866 6.95622 10.4972 7.04995 10.5902L11.2899 14.8302C11.3829 14.9239 11.4935 14.9983 11.6154 15.0491C11.7372 15.0998 11.8679 15.126 11.9999 15.126C12.132 15.126 12.2627 15.0998 12.3845 15.0491C12.5064 14.9983 12.617 14.9239 12.7099 14.8302L16.9999 10.5902C17.0937 10.4972 17.1681 10.3866 17.2188 10.2648C17.2696 10.1429 17.2957 10.0122 17.2957 9.88019C17.2957 9.74818 17.2696 9.61747 17.2188 9.49561C17.1681 9.37375 17.0937 9.26315 16.9999 9.17019Z"})}),l=(0,n.jsx)("svg",{version:"1.0",width:"100%",height:"100%",viewBox:"0 0 128 128",children:(0,n.jsxs)("g",{children:[(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#000"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#ccc",transform:"rotate(30 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#ccc",transform:"rotate(60 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#ccc",transform:"rotate(90 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#ccc",transform:"rotate(120 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#b2b2b2",transform:"rotate(150 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#999",transform:"rotate(180 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#7f7f7f",transform:"rotate(210 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#666",transform:"rotate(240 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#4c4c4c",transform:"rotate(270 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#333",transform:"rotate(300 64 64)"}),(0,n.jsx)("path",{d:"M59.6 0h8v40h-8V0z",fill:"#191919",transform:"rotate(330 64 64)"}),(0,n.jsx)("animateTransform",{attributeName:"transform",type:"rotate",values:"0 64 64;30 64 64;60 64 64;90 64 64;120 64 64;150 64 64;180 64 64;210 64 64;240 64 64;270 64 64;300 64 64;330 64 64",calcMode:"discrete",dur:"500ms",repeatCount:"indefinite"})]})})},88065:e=>{class t{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function n(e,...t){let r=Object.create(null);for(let t in e)r[t]=e[t];return t.forEach(function(e){for(let t in e)r[t]=e[t]}),r}class i{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=r(e)}openNode(e){if(!e.scope)return;let t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let r=e.split(".");return[`${t}${r.shift()}`,...r.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){e.scope&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}let s=(e={})=>{let t={children:[]};return Object.assign(t,e),t};class o{constructor(){this.rootNode=s(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=s({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEac
68h(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"==typeof e||e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{o._collapse(e)}))}}class a extends o{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let r=e.root;t&&(r.scope=`language:${t}`),this.add(r)}toHTML(){return new i(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function l(e){return e?"string"==typeof e?e:e.source:null}function u(e){return d("(?=",e,")")}function c(e){return d("(?:",e,")*")}function h(e){return d("(?:",e,")?")}function d(...e){return e.map(e=>l(e)).join("")}function p(...e){let t;return"("+(("object"==typeof(t=e[e.length-1])&&t.constructor===Object?(e.splice(e.length-1,1),t):{}).capture?"":"?:")+e.map(e=>l(e)).join("|")+")"}function f(e){return RegExp(e.toString()+"|").exec("").length-1}let g=new RegExp(p(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function m(e,{joinWith:t}){let r=0;return e.map(e=>{let t=r+=1,n=l(e),i="";for(;n.length>0;){let e=g.exec(n);if(!e){i+=n;break}i+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],("("===e[0]||/^\(\?[<']/.test(e[0]))&&r++)}return i}).map(e=>`(${e})`).join(t)}let v="[a-zA-Z]\\w*",y="[a-zA-Z_]\\w*",b="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",w="\\b(0b[01]+)",k={begin:"\\\\[\\s\\S]",relevance:0},x=function(e,t,r={}){let i=n({scope:"comment",begin:e,end:t,contains:[]},r);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});
68let s=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:d(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},E=x("//","$"),S=x("/\\*","\\*/"),P=x("#","$");var R=Object.freeze({__proto__:null,APOS_STRING_MODE:{scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[k]},BACKSLASH_ESCAPE:k,BINARY_NUMBER_MODE:{scope:"number",begin:w,relevance:0},BINARY_NUMBER_RE:w,COMMENT:x,C_BLOCK_COMMENT_MODE:S,C_LINE_COMMENT_MODE:E,C_NUMBER_MODE:{scope:"number",begin:_,relevance:0},C_NUMBER_RE:_,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:P,IDENT_RE:v,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+y,relevance:0},NUMBER_MODE:{scope:"number",begin:b,relevance:0},NUMBER_RE:b,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:{scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[k]},REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[k,{begin:/\[/,end:/\]/,relevance:0,contains:[k]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=d(t,/.*\b/,e.binary,/\b.*/)),n({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:{scope:"title",begin:v,relevance:0},UNDERSCORE_IDENT_RE:y,UNDERSCORE_TITLE_MODE:{scope:"title",begin:y,relevance:0}});function T(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function A(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function C(e,t){!t||e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=T,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function j(e,t){Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function O(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function $(e,t){void 0===e.relevance&&(e.relevance=1)}let I=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let r=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=r.keywords,e.begin=d(r.beforeMatch,u(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},L=["of","and","for","in","not","or","if","then","parent","list","value"],M={},D=e=>{console.error(e)},N=(e,...t)=>{console.log(`WARN: ${e}`,...t)},F=(e,t)=>{M[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),M[`${e}/${t}`]=!0)},B=Error();function U(e,t,{key:r}){let n=0,i=e[r],s={},o={};for(let e=1;e<=t.length;e++)o[e+n]=i[e],s[e+n]=!0,n+=f(t[e-1]);e[r]=o,e[r]._emit=s,e[r]._multi=!0}function V(e){if(e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw D("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),B;if("object"!=typeof e.beginScope||null===e.beginScope)throw D("beginScope must be object"),B;U(e,e.begin,{key:"beginScope"}),e.begin=m(e.begin,{joinWith:""})}if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw D("skip, excludeEnd, returnEnd not compatible with endScope: {}"),B;if("object"!=typeof e.endScope||null===e.endScope)throw D("endScope must be object"),B;U(e,e.end,{key:"endScope"}),e.end=m(e.end,{joinWith:""})}}class W extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}let H=Symbol("nomatch"),q=function(e){let i=Object.create(null),s=Object.create(null),o=[],g=!0,v="Could not find the language '{}', did you forget to load/include a language module?",y={disableAutodetect:!0,name:"Plain text",contains:[]},b={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:a};function _(e){return b.noHighlightRe.test(e)}function w(e,t,r){let n="",i="";"object"==typeof t?(n=e,r=t.ignoreIllegals,i=t.language):(F("10.7.0","highlight(lang, code, ...args) has been deprecated."),F("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,n=t),void 0===r&&(r=!0);let s={code:n,language:i};U("before:highlight",s);let o=s.result?s.result:k(s.language,s.code,r);return o.code=s.code,U("after:highlight",o),o}function k(e,s,o,a){let u=Object.create(null);function c(){if(!R.keywords)return void N.addText(B);let e=0;R.keywordPatternRe.lastIndex=0;
68let t=R.keywordPatternRe.exec(B),r="";for(;t;){r+=B.substring(e,t.index);let n=E.case_insensitive?t[0].toLowerCase():t[0],i=R.keywords[n];if(i){let[e,s]=i;if(N.addText(r),r="",u[n]=(u[n]||0)+1,u[n]<=7&&(U+=s),e.startsWith("_"))r+=t[0];else{let r=E.classNameAliases[e]||e;d(t[0],r)}}else r+=t[0];e=R.keywordPatternRe.lastIndex,t=R.keywordPatternRe.exec(B)}r+=B.substring(e),N.addText(r)}function h(){null!=R.subLanguage?function(){if(""===B)return;let e=null;if("string"==typeof R.subLanguage){if(!i[R.subLanguage])return N.addText(B);e=k(R.subLanguage,B,!0,M[R.subLanguage]),M[R.subLanguage]=e._top}else e=x(B,R.subLanguage.length?R.subLanguage:null);R.relevance>0&&(U+=e.relevance),N.__addSublanguage(e._emitter,e.language)}():c(),B=""}function d(e,t){""!==e&&(N.startScope(t),N.addText(e),N.endScope())}function p(e,t){let r=1,n=t.length-1;for(;r<=n;){if(!e._emit[r]){r++;continue}let n=E.classNameAliases[e[r]]||e[r],i=t[r];n?d(i,n):(B=i,c(),B=""),r++}}function y(e,t){return e.scope&&"string"==typeof e.scope&&N.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(d(B,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),B=""):e.beginScope._multi&&(p(e.beginScope,t),B="")),R=Object.create(e,{parent:{value:R}})}let _={};function w(r,n){let i=n&&n[0];if(B+=r,null==i)return h(),0;if("begin"===_.type&&"end"===n.type&&_.index===n.index&&""===i){if(B+=s.slice(n.index,n.index+1),!g){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=_.rule,t}return 1}if(_=n,"begin"===n.type){let e=n[0],r=n.rule,i=new t(r);for(let t of[r.__beforeBegin,r["on:begin"]])if(t&&(t(n,i),i.isMatchIgnored))return 0===R.matcher.regexIndex?(B+=e[0],1):(G=!0,0);return r.skip?B+=e:(r.excludeBegin&&(B+=e),h(),r.returnBegin||r.excludeBegin||(B=e)),y(r,n),r.returnBegin?0:e.length}if("illegal"!==n.type||o){if("end"===n.type){let e=function(e){let r=e[0],n=s.substring(e.index),i=function e(r,n,i){var s;let o,a=(s=r.endRe,(o=s&&s.exec(i))&&0===o.index);if(a){if(r["on:end"]){let e=new t(r);r["on:end"](n,e),e.isMatchIgnored&&(a=!1)}if(a){for(;r.endsParent&&r.parent;)r=r.parent;return r}}if(r.endsWithParent)return e(r.parent,n,i)}(R,e,n);if(!i)return H;let o=R;R.endScope&&R.endScope._wrap?(h(),d(r,R.endScope._wrap)):R.endScope&&R.endScope._multi?(h(),p(R.endScope,e)):o.skip?B+=r:(o.returnEnd||o.excludeEnd||(B+=r),h(),o.excludeEnd&&(B=r));do R.scope&&N.closeNode(),R.skip||R.subLanguage||(U+=R.relevance),R=R.parent;while(R!==i.parent);return i.starts&&y(i.starts,e),o.returnEnd?0:r.length}(n);if(e!==H)return e}}else{let e=Error('Illegal lexeme "'+i+'" for mode "'+(R.scope||"<unnamed>")+'"');throw e.mode=R,e}if("illegal"===n.type&&""===i)return n.index===s.length||(B+="\n"),1;if(q>1e5&&q>3*n.index)throw Error("potential infinite loop, way more iterations than matches");return B+=i,i.length}let E=T(e);if(!E)throw D(v.replace("{}",e)),Error('Unknown language: "'+e+'"');let S=function(e){function t(t,r){return RegExp(l(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(r?"g":""))}
68class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=f(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(m(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let r=t.findIndex((e,t)=>t>0&&void 0!==e),n=this.matchIndexes[r];return t.splice(0,r),Object.assign(t,n)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new r;return this.rules.slice(e).forEach(([e,r])=>t.addRule(e,r)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let r=t.exec(e);if(this.resumingScanAtSamePosition())if(r&&r.index===this.lastIndex);else{let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,r=t.exec(e)}return r&&(this.regexIndex+=r.position+1,this.regexIndex===this.count&&this.considerAll()),r}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return e.classNameAliases=n(e.classNameAliases||{}),function r(s,o){let a;if(s.isCompiled)return s;[A,O,V,I].forEach(e=>e(s,o)),e.compilerExtensions.forEach(e=>e(s,o)),s.__beforeBegin=null,[C,j,$].forEach(e=>e(s,o)),s.isCompiled=!0;let u=null;return"object"==typeof s.keywords&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),u=s.keywords.$pattern,delete s.keywords.$pattern),u=u||/\w+/,s.keywords&&(s.keywords=function e(t,r,n="keyword"){let i=Object.create(null);return"string"==typeof t?s(n,t.split(" ")):Array.isArray(t)?s(n,t):Object.keys(t).forEach(function(n){Object.assign(i,e(t[n],r,n))}),i;function s(e,t){r&&(t=t.map(e=>e.toLowerCase())),t.forEach(function(t){var r,n,s;let o=t.split("|");i[o[0]]=[e,(r=o[0],(n=o[1])?Number(n):+(s=r,!L.includes(s.toLowerCase())))]})}}(s.keywords,e.case_insensitive)),s.keywordPatternRe=t(u,!0),o&&(s.begin||(s.begin=/\B|\b/),s.beginRe=t(s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(s.endRe=t(s.end)),s.terminatorEnd=l(s.end)||"",s.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(s.end?"|":"")+o.terminatorEnd)),s.illegal&&(s.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(e){var t;return((t="self"===e?s:e).variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return n(t,{variants:null},e)})),t.cachedVariants)?t.cachedVariants:!function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(t)?Object.isFrozen(t)?n(t):t:n(t,{starts:t.starts?n(t.starts):null})})),s.contains.forEach(function(e){r(e,s)}),s.starts&&r(s.starts,o),a=new i,s.contains.forEach(e=>a.addRule(e.begin,{rule:e,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),s.matcher=a,s}(e)}(E),P="",R=a||S,M={},N=new b.__emitter(b),F=[];for(let e=R;e!==E;e=e.parent)e.scope&&F.unshift(e.scope);F.forEach(e=>N.openNode(e));let B="",U=0,W=0,q=0,G=!1;try{if(E.__emitTokens)E.__emitTokens(s,N);else{for(R.matcher.considerAll();;){q++,G?G=!1:R.matcher.considerAll(),R.matcher.lastIndex=W;let e=R.matcher.exec(s);if(!e)break;let t=s.substring(W,e.index),r=w(t,e);W=e.index+r}w(s.substring(W))}return N.finalize(),P=N.toHTML(),{language:e,value:P,relevance:U,illegal:!1,_emitter:N,_top:R}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:r(s),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:W,context:s.slice(W-100,W+100),mode:t.mode,resultSoFar:P},_emitter:N};if(g)return{language:e,value:r(s),illegal:!1,relevance:0,errorRaised:t,_emitter:N,_top:R};throw t}}function x(e,t){let n;t=t||b.languages||Object.keys(i);let s=((n={value:r(e),illegal:!1,relevance:0,_top:y,_emitter:new b.__emitter(b)}
68)._emitter.addText(e),n),o=t.filter(T).filter(B).map(t=>k(t,e,!1));o.unshift(s);let[a,l]=o.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(T(e.language).supersetOf===t.language)return 1;else if(T(t.language).supersetOf===e.language)return -1}return 0});return a.secondBest=l,a}function E(e){var t;let r,n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let r=b.languageDetectRe.exec(t);if(r){let t=T(r[1]);return t||(N(v.replace("{}",r[1])),N("Falling back to no-highlight mode for this block.",e)),t?r[1]:"no-highlight"}return t.split(/\s+/).find(e=>_(e)||T(e))}(e);if(_(n))return;if(U("before:highlightElement",{el:e,language:n}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(b.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),b.throwUnescapedHTML))throw new W("One of your co
68de blocks includes unescaped HTML.",e.innerHTML);let i=e.textContent,o=n?w(i,{language:n,ignoreIllegals:!0}):x(i);e.innerHTML=o.value,e.dataset.highlighted="yes",t=o.language,r=n&&s[n]||t,e.classList.add("hljs"),e.classList.add(`language-${r}`),e.result={language:o.language,re:o.relevance,relevance:o.relevance},o.secondBest&&(e.secondBest={language:o.secondBest.language,relevance:o.secondBest.relevance}),U("after:highlightElement",{el:e,result:o,text:i})}let S=!1;function P(){if("loading"===document.readyState){S||window.addEventListener("DOMContentLoaded",function(){P()},!1),S=!0;return}document.querySelectorAll(b.cssSelector).forEach(E)}function T(e){return i[e=(e||"").toLowerCase()]||i[s[e]]}function M(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{s[e.toLowerCase()]=t})}function B(e){let t=T(e);return t&&!t.disableAutodetect}function U(e,t){o.forEach(function(r){r[e]&&r[e](t)})}for(let t in Object.assign(e,{highlight:w,highlightAuto:x,highlightAll:P,highlightElement:E,highlightBlock:function(e){return F("10.7.0","highlightBlock will be removed entirely in v12.0"),F("10.7.0","Please use highlightElement now."),E(e)},configure:function(e){b=n(b,e)},initHighlighting:()=>{P(),F("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")},initHighlightingOnLoad:function(){P(),F("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")},registerLanguage:function(t,r){let n=null;try{n=r(e)}catch(e){if(D("Language definition for '{}' could not be registered.".replace("{}",t)),g)D(e);else throw e;n=y}n.name||(n.name=t),i[t]=n,n.rawDefinition=r.bind(null,e),n.aliases&&M(n.aliases,{languageName:t})},unregisterLanguage:function(e){for(let t of(delete i[e],Object.keys(s)))s[t]===e&&delete s[t]},listLanguages:function(){return Object.keys(i)},getLanguage:T,registerAliases:M,autoDetection:B,inherit:n,addPlugin:function(e){var t;(t=e)["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))}),o.push(e)},removePlugin:function(e){let t=o.indexOf(e);-1!==t&&o.splice(t,1)}}),e.debugMode=function(){g=!1},e.safeMode=function(){g=!0},e.versionString="11.12.0",e.regex={concat:d,lookahead:u,either:p,optional:h,anyNumberOfTimes:c},R)"object"==typeof R[t]&&function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r],i=typeof n;"object"!==i&&"function"!==i||Object.isFrozen(n)||e(n)}),t}(R[t]);return Object.assign(e,R),e},G=q({});G.newInstance=()=>q({}),e.exports=G,G.HighlightJS=G,G.default=G},89693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return E},useLinkStatus:function(){return x}};for(var i in n)Object.defineProperty(t,i,{enumerable:!0,get:n[i]});let s=r(66476),o=r(75038),a=s._(r(76430)),l=r(14987),u=r(94723),c=r(60566),h=r(37620),d=r(97081),p=r(36598),f=r(78142),g=r(47083),m=r(98690),v=r(4719),y=new Set;function b(e,t,r,n){if((0,u.isLocalURL)(t)){if(!n.bypassPrefetchedCheck){let i=t+"%"+r+"%"+(void 0!==n.locale?n.locale:"locale"in e?e.locale:void 0);if(y.has(i))return;y.add(i)}e.prefetch(t,r,n).catch(e=>{})}}function _(e){return"string"==typeof e?e:(0,c.formatUrl)(e)}let w=a.default.forwardRef(function(e,t){let r,n,{href:i,as:s,children:c,prefetch:y=null,passHref:w,replace:k,shallow:x,scroll:E,locale:S,onClick:P,onNavigate:R,onMouseEnter:T,onTouchStart:A,legacyBehavior:C=!1,transitionTypes:j,...O}=e;r=c,C&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let $=a.default.useContext(p.RouterContext),I=!1!==y,{href:L,as:M}=a.default.useMemo(()=>{if(!$){let e=_(i);return{href:e,as:s?_(s):e}}let[e,t]=(0,l.resolveHref)($,i,!0);return{href:e,as:s?(0,l.resolveHref)($,s):t||e}},[$,i,s]),D=a.default.useRef(L),N=a.default.useRef(M);C&&(n=a.default.Children.only(r));let F=C?n&&"object"==typeof n&&n.ref:t,[B,U,V]=(0,f.useIntersection)({rootMargin:"200px"}),W=a.default.useCallback(e=>{(N.current!==M||D.current!==L)&&(V(),N.current=M,D.current=L),B(e)},[M,L,V,B]),H=(0,v.useMergedRef)(W,F);a.default.useEffect(()=>{!$||U&&I&&b($,L,M,{bypassPrefetchedCheck:!1,locale:S})},[M,L,U,S,I,$?.locale,$]);let q={ref:H,onClick(e){C||"function"!=typeof P||P(e),C&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),!$||e.defaultPrevented||function(e,t,r,n,i,s,o,a,l){let c,{nodeName:h}=e.currentTarget;if(!("A"===h.toUpperCase()&&((c=e.currentTarget.getAttribute("target"))&&"_self"!==c||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute("download"))){if
68(!(0,u.isLocalURL)(r)){i&&(e.preventDefault(),location.replace(r));return}e.preventDefault(),(()=>{if(l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let e=o??!0;"beforePopState"in t?t[i?"replace":"push"](r,n,{shallow:s,locale:a,scroll:e}):t[i?"replace":"push"](n||r,{scroll:e})})()}}(e,$,L,M,k,x,E,S,R)},onMouseEnter(e){C||"function"!=typeof T||T(e),C&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),$&&b($,L,M,{locale:S,priority:!0,bypassPrefetchedCheck:!0})},onTouchStart:function(e){C||"function"!=typeof A||A(e),C&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),$&&b($,L,M,{locale:S,priority:!0,bypassPrefetchedCheck:!0})}};if((0,h.isAbsoluteUrl)(M))q.href=M;else if(!C||w||"a"===n.type&&!("href"in n.props)){let e=void 0!==S?S:$?.locale;q.href=$?.isLocaleDomain&&(0,g.getDomainLocale)(M,e,$?.locales,$?.domainLocales)||(0,m.addBasePath)((0,d.addLocale)(M,e,$?.defaultLocale))}return C?a.default.cloneElement(n,q):(0,o.jsx)("a",{...O,...q,children:r})}),k=(0,a.createContext)({pending:!1}),x=()=>(0,a.useContext)(k),E=w;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},90026:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(76430),i=r(25393),s=r(20142),o=new Map;o.set("bold",function(e){return n.createElement(n.Fragment,null,n.createElement("polygon",{points:"96 240 112 160 48 136 160 16 144 96 208 120 96 240",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}))}),o.set("duotone",function(e){return n.createElement(n.Fragment,null,n.createElement("polygon",{points:"96 240 112 160 48 136 160 16 144 96 208 120 96 240",opacity:"0.2"}),n.createElement("polygon",{points:"96 240 112 160 48 136 160 16 144 96 208 120 96 240",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))}),o.set("fill",function(){return n.createElement(n.Fragment,null,n.createElement("path",{d:"M215.8,118.2a8,8,0,0,0-5-5.7L153.2,90.9l14.6-73.3a8.1,8.1,0,0,0-4.1-8.7,7.9,7.9,0,0,0-9.5,1.6l-112,120a7.9,7.9,0,0,0-2,7.3,8.2,8.2,0,0,0,5,5.7l57.6,21.6L88.2,238.4a8.1,8.1,0,0,0,4.1,8.7,8.4,8.4,0,0,0,3.7.9,7.9,7.9,0,0,0,5.8-2.5l112-120A7.9,7.9,0,0,0,215.8,118.2Z"}))}),o.set("light",function(e){return n.createElement(n.Fragment,null,n.createElement("polygon",{points:"96 240 112 160 48 136 160 16 144 96 208 120 96 240",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}))}),o.set("thin",function(e){return n.createElement(n.Fragment,null,n.createElement("polygon",{points:"96 240 112 160 48 136 160 16 144 96 208 120 96 240",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}))}),o.set("regular",function(e){return n.createElement(n.Fragment,null,n.createElement("polygon",{points:"96 240 112 160 48 136 160 16 144 96 208 120 96 240",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))});var a=function(e,t){return(0,i.$)(e,t,o)},l=(0,n.forwardRef)(function(e,t){return n.createElement(s.A,Object.assign({ref:t},e,{renderPath:a}))});l.displayName="Lightning";let u=l},90060:function(e){!function(){"use strict";var t=function(){var e;return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){return({woff:"application/font-woff",woff2:"application/font-woff",ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[t(e).toLowerCase()]||""},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return -1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise(function(t){e.toBlob(t)}):new Promise(function(t){for(var r=window.atob(e.toDataURL().split(",")[1]),n=r.length,i=new Uint8Array(n),s=0;s<n;s++)i[s]=r.charCodeAt(s);t(new Blob([i],{type:"image/png"}))})},resolveUrl:function(e,t){var r=document.implementation.createHTMLDocument(),n=r.createElement("base");r.head.appendChild(n);var i=r.createElement("a");return r.body.appendChild(i),n.href=t,i.href=e,i.href},getAndEncode:function(e){return o.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime()),new Promise(function(t){var r,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState){if(200!==n.status)return void(r?t(r):s("cannot fetch resource: "+e+", status: "+n.status));var i=new FileReader;i.onloadend=function(){t(i.result.split(/,/)[1])},i.readAsDataURL(n.response)}},n.ontimeout=function(){r?t(r):s("timeout of 30000ms occured while fetching resource: "+e)},n.responseType="blob",n.timeout=3e4,n.open("GET",e,!0),n.send(),o.impl.options.imagePlaceholder){var i=o.impl.options.imagePlaceholder.split(/,/);i&&i[1]&&(r=i[1])}function s(e){console.error(e),t("")}})},uid:(e=0,function(){return"u"+("0000"+(1679616*Math.random()|0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise(function(r){setTimeout(function(){r(t)},e)})}},asArray:function(e){for(var t=[],r=e.length,n=0;n<r;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise(function(t,r){var n=new Image;n.onload=function(){t(n)},n.onerror=r,n.src=e})},width:function(e){var t=r(e,"border-left-width"),n=r(e,"border-right-width");return e.scrollWidth+t+n},height:function(e){var t=r(e,"border-top-width"),n=r(e,"border-bottom-width");return e.scrollHeight+t+n}};function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function r(e,t){return parseFloat(window.getComputedStyle(e).getPropertyValue(t).replace("px",""))}}(),r=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,t,s){return r(e)?Promise.resolve(e).then(n).then(function(r){var n=Promise.resolve(e);return r.forEach(function(e){n=n.then(function(r){return i(r,e,t,s)})}),n}):Promise.resolve(e)},shouldProcess:r,impl:{readUrls:n,inline:i}};function r(t){return -1!==t.search(e)}function n(r){for(var n,i=[];null!==(n=e.exec(r));)i.push(n[1]);return i.filter(function(e){return!t.isDataUrl(e)})}function i(e,r,n,i){return Promise.resolve(r).then(function(e){return n?t.resolveUrl(e,n):e}).then(i||t.getAndEncode).then(function(e){return t.dataAsUrl(e,t.mimeType(r))}).then(function(n){var i;return e.replace((i=r,RegExp("(url\\(['\"]?)("+t.escape(i)+")(['\"]?\\))","g")),"$1"+n+"$3")})}}(),n=function(){return{resolveAll:function(){return e(document).then(function(e){return Promise.all(e.map(function(e){return e.resolve()}))}).then(function(e){return e.join("\n")})},impl:{readAll:e}};function e(){return Promise.resolve(t.asArray(document.styleSheets)).then(function(e){var r=[];return e.forEach(function(e){try{t.asArray(e.cssRules||[]).forEac
68h(r.push.bind(r))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}}),r}).then(function(e){return e.filter(function(e){return e.type===CSSRule.FONT_FACE_RULE}).filter(function(e){return r.shouldProcess(e.style.getPropertyValue("src"))})}).then(function(t){return t.map(e)});function e(e){return{resolve:function(){var t=(e.parentStyleSheet||{}).href;return r.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue("src")}}}}}(),i=function(){return{inlineAll:function n(i){var s,o;return i instanceof Element?((o=(s=i).style.getPropertyValue("background"))?r.inlineAll(o).then(function(e){s.style.setProperty("background",e,s.style.getPropertyPriority("background"))}).then(function(){return s}):Promise.resolve(s)).then(function(){return i instanceof HTMLImageElement?e(i).inline():Promise.all(t.asArray(i.childNodes).map(function(e){return n(e)}))}):Promise.resolve(i)},impl:{newImage:e}};function e(e){return{inline:function(r){return t.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(r||t.getAndEncode).then(function(r){return t.dataAsUrl(r,t.mimeType(e.src))}).then(function(t){return new Promise(function(r,n){e.onload=r,e.onerror=n,e.src=t})})}}}}(),s=void 0,o={toSvg:a,toPng:function(e,t){return l(e,t||{}).then(function(e){return e.toDataURL()})},toJpeg:function(e,t){return l(e,t=t||{}).then(function(e){return e.toDataURL("image/jpeg",t.quality||1)})},toBlob:function(e,r){return l(e,r||{}).then(t.canvasToBlob)},toPixelData:function(e,r){return l(e,r||{}).then(function(r){return r.getContext("2d").getImageData(0,0,t.width(e),t.height(e)).data})},impl:{fontFaces:n,images:i,util:t,inliner:r,options:{}}};function a(e,r){var n;return void 0===(n=r=r||{}).imagePlaceholder?o.impl.options.imagePlaceholder=s:o.impl.options.imagePlaceholder=n.imagePlaceholder,void 0===n.cacheBust?o.impl.options.cacheBust=!1:o.impl.options.cacheBust=n.cacheBust,Promise.resolve(e).then(function(e){return function e(r,n,i){return i||!n||n(r)?Promise.resolve(r).then(function(e){return e instanceof HTMLCanvasElement?t.makeImage(e.toDataURL()):e.cloneNode(!1)}).then(function(i){var s,o,a,l,u,c,h,d;return s=r,o=i,a=n,0===(l=s.childNodes).length?Promise.resolve(o):(u=o,c=t.asArray(l),h=a,d=Promise.resolve(),c.forEach(function(t){d=d.then(function(){return e(t,h)}).then(function(e){e&&u.appendChild(e)})}),d).then(function(){return o})}).then(function(e){var n,i;return n=r,(i=e)instanceof Element?Promise.resolve().then(function(){var e,r,s,o;e=window.getComputedStyle(n),r=i.style,e.cssText?r.cssText=e.cssText:(s=e,o=r,t.asArray(s).forEac
68h(function(e){o.setProperty(e,s.getPropertyValue(e),s.getPropertyPriority(e))}))}).then(function(){[":before",":after"].forEach(function(e){!function(e){var r=window.getComputedStyle(n,e),s=r.getPropertyValue("content");if(""!==s&&"none"!==s){var o,a,l,u,c,h,d,p=t.uid();i.className=i.className+" "+p;var f=document.createElement("style");f.appendChild((o=p,a=e,d=(l=r).cssText?(c=(u=l).getPropertyValue("content"),u.cssText+" content: "+c+";"):(h=l,t.asArray(h).map(function(e){return e+": "+h.getPropertyValue(e)+(h.getPropertyPriority(e)?" !important":"")}).join("; ")+";"),document.createTextNode("."+o+":"+a+"{"+d+"}"))),i.appendChild(f)}}(e)})}).then(function(){n instanceof HTMLTextAreaElement&&(i.innerHTML=n.value),n instanceof HTMLInputElement&&i.setAttribute("value",n.value)}).then(function(){!(i instanceof SVGElement)||(i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i instanceof SVGRectElement&&["width","height"].forEach(function(e){var t=i.getAttribute(e);t&&i.style.setProperty(e,t)}))}).then(function(){return i}):i}):Promise.resolve()}(e,r.filter,!0)}).then(u).then(c).then(function(e){return r.bgcolor&&(e.style.backgroundColor=r.bgcolor),r.width&&(e.style.width=r.width+"px"),r.height&&(e.style.height=r.height+"px"),r.style&&Object.keys(r.style).forEach(function(t){e.style[t]=r.style[t]}),e}).then(function(n){var i,s,o;return i=n,s=r.width||t.width(e),o=r.height||t.height(e),Promise.resolve(i).then(function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(e)}).then(t.escapeXhtml).then(function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"}).then(function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+s+'" height="'+o+'">'+e+"</svg>"}).then(function(e){return"data:image/svg+xml;charset=utf-8,"+e})})}function l(e,r){return a(e,r).then(t.makeImage).then(t.delay(100)).then(function(n){var i=function(e){var n=document.createElement("canvas");if(n.width=r.width||t.width(e),n.height=r.height||t.height(e),r.bgcolor){var i=n.getContext("2d");i.fillStyle=r.bgcolor,i.fillRect(0,0,n.width,n.height)}return n}(e);return i.getContext("2d").drawImage(n,0,0),i})}function u(e){return n.resolveAll().then(function(t){var r=document.createElement("style");return e.appendChild(r),r.appendChild(document.createTextNode(t)),e})}function c(e){return i.inlineAll(e).then(function(){return e})}e.exports=o}()},92376:(e,t,r)=>{e.exports=r(16540)},94223:function(e,t){var r,n;void 0===(n="function"==typeof(r=function(){return function(e){var t={};function r(e,r,n){if(t[e])return t[e];var i=[];t[e]=i,n=n||"";for(var s=0;s<r.length;s++)-1!==r[s].$languages.indexOf(e.toLowerCase())&&-1===n.indexOf(r[s].$name)&&i.push(r[s]);return i}String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n=/\r*\n/,i=["tag","void-tags","html-tag"],s=[{$languages:"js html",$name:"comment",$startPatterns:[/\<\!\-\-/],$endPatterns:[/\-\-\>/],$ignoreRules:!0,$consumeEndMatch:!0},{$languages:"html",$name:"doctype",$startPatterns:[/\<\!doctype html>/i],$endPatterns:[n],$ignoreRules:!0,$consumeEndMatch:!0},{$languages:"js html",$name:"void-tags",$startPatterns:[/\<(area|base|br|col|command|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)/i],$endPatterns:[/>/],$indent:!0,$consumeEndMatch:!0},{$languages:"html",$name:"mode switch js",$startPatterns:[function(e){var t=/<script[\s>].*/i.exec(e),r=/<\/script>/i.exec(e);return t&&(!r||r.index<t.index)?{matchIndex:t.index,length:t[0].length}:null}],$endPatterns:[/<\/script>/i],$switchRules:"js",$consumeEndMatch:!0,$indent:!0,$newScope:!0},{$languages:"html",$name:"mode switch css",$startPatterns:[function(e){var t=/<style[\s>].*/i.exec(e),r=/<\/style>/i.exec(e);return t&&(!r||r.index<t.index)?{matchIndex:t.index,length:t[0].length}:null}],$endPatterns:[/<\/style>/i],$switchRules:"css",$consumeEndMatch:!0,$indent:!0,$newScope:!0},{$languages:"html",$name:"html-tag",$startPatterns:[/<html[^A-Za-z0-9]/i],$endPatterns:[/<\/html>/i],$consumeEndMatch:!0},{$languages:"js html",$name:"tag",$startPatterns:[function(e,t,r){var n=e.match(/<([A-Za-z][A-Za-z0-9\-\.]*)/);
68return n?(r.openingTag=n[1],{matchIndex:n.index,length:n[0].length}):null}],$endPatterns:[function(e,t,r){var n=RegExp("</"+r.openingTag+">|\\s/>","i"),i=e.match(n);return i?{matchIndex:i.index,length:i[0].length}:null}],$indent:!0,$consumeEndMatch:!0},{$languages:"js",$name:"line-comment",$startPatterns:[/\/\//],$endPatterns:[n],$ignoreRules:!0},{$languages:"js css",$name:"block-comment",$startPatterns:[/\/\*/],$endPatterns:[/\*\//],$ignoreRules:!0,$consumeEndMatch:!0},{$languages:"js",$name:"regex",$startPatterns:[function(e,t){var r=e.search(/[(,=:[!&|?{};][\s]*\/[^/]|^[\s]*\/[^/]/);if(-1!=r){r=e.indexOf("/",r);var n=e.substring(r+1),i=c(n,t.$endPatterns,t);if(-1!=i.matchIndex){n=n.substring(0,i.matchIndex);try{return new RegExp(n),{matchIndex:r,length:1}}catch(e){}}}return null}],$endPatterns:[function(e){for(var t=0,r=e.indexOf("/");-1!=r;)try{new RegExp(e.substring(0,r));break}catch(n){t=(r=e.indexOf("/",t))+1}return -1===r?null:{matchIndex:r,length:1}}],$ignoreRules:!0,$consumeEndMatch:!0},{$languages:"js html",$name:"quotes",$excludeIf:i,$startPatterns:[/"/],$endPatterns:[/"/,n],$ignoreRules:!0,$consumeEndMatch:!0},{$languages:"js html",$name:"quotes",$excludeIf:i,$startPatterns:[/'/],$endPatterns:[/'/,n],$ignoreRules:!0,$consumeEndMatch:!0},{$languages:"js css",$name:"string",$startPatterns:[/(''|""|``)/],$endPatterns:[/./,n]},{$languages:"js css",$name:"string",$startPatterns:[/\"(?=[^"])/],$endPatterns:[/[^\\]\"/,n],$ignoreRules:!0,$consumeEndMatch:!0},{$languages:"js css",$name:"string",$startPatterns:[/\'(?=[^'])/],$endPatterns:[/[^\\]\'/,n],$ignoreRules:!0,$consumeEndMatch:!0},{$languages:"js css",$name:"string",$startPatterns:[/\`(?=[^`])/],$endPatterns:[/[^\\]\`/],$ignoreRules:!0,$consumeEndMatch:!0},{$languages:"js",$name:"if",$startPatterns:[/^if\s*(?=\()/,/[\s]+if\s*(?=\()/],$endPatterns:[/else[\s]+/,u,/[{;]/],$indent:!0},{$languages:"js",$name:"for|while",$startPatterns:[/^(for|while)\s*(?=\()/],$endPatterns:[u,/[{;]/],$indent:!0},{$languages:"js",$name:"else",$startPatterns:[/else[\s]+/],$endPatterns:[/if[^\w$]/,u,/[{;]/],$indent:!0},{$languages:"js css",$name:"bracket",$startPatterns:[/\(\s*(var|let|const)?\s*/],$endPatterns:[/\)/],$indent:!0,$consumeEndMatch:!0,$newScope:!0},{$languages:"js",$name:"dot-chain",$startPatterns:[/^\.[A-Za-z$_]/],$endPatterns:[/[\.;]/,n],$indent:!0,$matchBeginning:!0,$lineOffset:-1},{$languages:"js",$name:"dot-chain",$startPatterns:[/\.\s*\r*\n/],$endPatterns:[/[\.;})\]]/,/[^\s]\s*\r*\n/],$indent:!0},{$languages:"js css",$name:"array",$startPatterns:[/\[/],$endPatterns:[/\]/],$indent:!0,$consumeEndMatch:!0,$newScope:!0},{$languages:"js css",$name:"block",$startPatterns:[/\{/],$endPatterns:[/\}/],$indent:!0,$consumeEndMatch:!0,$newScope:!0},{$languages:"js",$name:"var/let/const",$startPatterns:[/(var|let|const)[\s]*\r*\n/],$endPatterns:[u],$indent:!0,$endPatternIndent:!0},{$languages:"js",$name:"var/let/const",$startPatterns:[/(var|let|const)\s+(?=[\w$])/],$endPatterns:[/[,;=]/,u],$indent:!0},{$languages:"js",$name:"var/let/const",$lastRule:["var/let/const","="],$startPatterns:[/,[\s]*\r*\n/],$endPatterns:[/[,;]/,u],$indent:!0,callback:l},{$languages:"js",$name:"var/let/const",$lastRule:["var/let/const","="],$startPatterns:[/^,/],$endPatterns:[/[,;]/,u],$matchBeginning:!0,$indent:!0,$lineOffset:-1,callback:l},{$languages:"js",$name:"equality",$startPatterns:[/[=<>!]=(=)?/],$endPatterns:[/./]},{$languages:"js",$name:"=",$excludeIf:i,$startPatterns:[/=/],$endPatterns:[/[,;\)\]}]/,n]},{$languages:"js",$name:"?:",$startPatterns:[/\?/],$endPatterns:[/[:;]/],$endPatternIndent:!0,$indent:!0},{$languages:"js",$name:"case",$startPatterns:[/^(case|default)[\s:]/],$endPatterns:[/break[\s;\r\n]/,/^return[\s;\r\n]/,/^case[\s]+/,/^default[\s:]/,/}/],$endPatternIndent:function(e){return e.endPatternIndex<=1},$indent:!0,$newScope:!0},{$languages:"js",$name:"semicolon",$startPatterns:[/;/],$endPatterns:[/./]}];return{css:function(e,t){return o(e,r("css",s),t)},js:function(e,t){return o(e,r("js",s),t)},ts:function(e,t){return o(e,r("js",s),t)},html:function(e,t){return o(e,t&&t.indentHtmlTag?r("html",s,"html-tag"):r("html",s),t)}};function o(e,t,n){e=e||"";var i,o=n&&null!=n.tabString?n.tabString:"	",l=e.split(/[\r]?\n/gi),u=l.length,h=a(u),d=a(u),p=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=[];return t}(u),f=[],g=[null],m=0,v=0,y=null;for(n&&(n.debug={buffers:{ignore:h,indent:d,dedent:p,active:f}});m<u;){if(w=l[m].trim().replace(/\\(u[0-9A-Za-z]{4}|u\{[0-9A-Za-z]{1,6}]\}|x[0-9A-Za-z]{2}|.)/g,"0")+"\r\n",k=f[f.length-1],_=function(e,t,r){e=e.substring(r,e.length);for(var n,i,s,o=null,a=e.length,l=g[g.length-1],u=l?l.rule.$name:"",h=(function(e,t){var r,n=[];for(r=0;r<e.length;r++)n.push(t(e[r],r,e));return n})(f,function(e){return e.rule.$name}).join("\n"),d=0;d<t.length;d++)(s=t[d]).$excludeIf&&function(e,t){var r,n;for(r=0;r<e.length;r++)if(n=t(e[r],r,e))return n;return!1}(s.$excludeIf,function(e){return -1!=h.indexOf(e)})||(!s.$lastRule||u&&-1!==s.$lastRule.indexOf(u))&&-1!=(i=c(e,s.$startPatterns,s)).matchIndex&&i.matchIndex<a&&(!s.$matchBeginning||0===r)&&(a=i.matchIndex,n=i,o=s);return{rule:o,relativeIndex:o?a:-1,matchIndex:o?a+r:-1,cursor:o?r+n.cursor:-1,state:n?n.state:{},lastMatch:l}}(w,y||t,v),f.length){if(-1===(b=function(e,t,r,n){e=e.substr(r,e.length);var i=t.rule,s=c(e,i.$endPatterns,i,t.state,n),o=i.$consumeEndMatch?s.cursor:s.matchIndex;return{endPatternIndex:s.endPatternIndex,matchIndex:-1===s.matchIndex?-1:s.matchIndex+r,cursor:-1===o?-1:o+r,state:s.state}}(w,k,v,_)).matchIndex){if(k.rule.$ignoreRules){h[m]=1,m++,v=0;continue}}else if(k.rule.$ignoreRules||-1===_.matchIndex||b.matchIndex<=_.matchIndex){(function(){var e=f.pop(),t=e.line,r=e.rule;if(r.$indent){var n=("function"==typeof r.$endPatternIndent?r.$endPatternIndent(b):r.$endPatternIndent)||0!==b.matchIndex?1:0;p[m+n]&&p[m+n].push(t)}r.$switchRules&&(y=null),r.$newScope&&g.pop(),g[g.length-1]=e})(),v=b.cursor;continue}}-1!==_.matchIndex?function(e){v=e.cursor;var t=e.rule,n=m+1+(t.$lineOffset||0);e.line=n,f.push(e),t.$indent&&d[n]++,t.$switchRules&&(y=r(t.$switchRules,s)),t.$newScope&&g.push(null),t.callback&&t.callback(e,d,p)}(_):(m++,v=0)}var b,_,w,k,x,E,S,P,R,T,A=0,C=function(e){for(var t=a(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}(d),j=a(u),O=[];for(R=0;R<u;R++){for(E=p[R],P=0,T=0;T<E.length;T++)(S=E[T])<0?-S!==R&&(j[-S]++,P+=1):C[S]>0&&(C[S]--,P+=S!==R);x=C[R],j[R]=x>P?1:x<P?x-P:0,C[R]=+(x>0)}for(R=0;R<u;R++){1===h[R-1]&&1===h[R]?O.push(l[R]):O.push(((A+=j[R]||0)>0?(i=o,Array(A+1).join(i)):"")+l[R].trim())}return O.join("\r\n")}function a(t){if(e.Int16Array)return new Int16Array(t);for(var r=Array(t),n=0;n<t;n++)r[n]=0;return r}function l(e,t,r){var n=e.lastMatch;n&&"="===n.rule.$name&&r[e.line].push(-n.line)}function u(e,t,r,n){var i;if(r.newline){if(-1!==(i=e.search(/[;
68,=]?\r*\n/)))return{matchIndex:i,length:1}}else r.newline=-1!==(i=e.search(/[^\s\r\n\{\(\[]/))&&(i<=n.relativeIndex||-1===n.relativeIndex);return null}function c(e,t,r,n,i){n=n||{};for(var s,o,a=-1,l=0,u=0;u<t.length;u++)if("function"==typeof(o=t[u])){if(s=o(e,r,n,i)){a=s.matchIndex,l=s.length;break}}else if(s=e.match(o)){a=e.search(o),l=s[0].length;break}return{endPatternIndex:u,matchIndex:a,cursor:a+l,state:n}}}(this)})?r.apply(t,[]):r)||(e.exports=n)},96151:(e,t,r)=>{"use strict";r.d(t,{W:()=>n});let n={}},97048:()=>{},98296:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(76430),i=r(25393),s=r(20142),o=new Map;o.set("bold",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"86 110 128 152 170 110",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),n.createElement("line",{x1:"128",y1:"40",x2:"128",y2:"152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}),n.createElement("path",{d:"M216,152v56a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"24"}))}),o.set("duotone",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"86 110 128 152 170 110",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("line",{x1:"128",y1:"40",x2:"128",y2:"152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M216,152v56a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))}),o.set("fill",function(){return n.createElement(n.Fragment,null,n.createElement("path",{d:"M80.3,115.7a8.2,8.2,0,0,1-1.7-8.7,8,8,0,0,1,7.4-5h34V40a8,8,0,0,1,16,0v62h34a8,8,0,0,1,7.4,5,8.2,8.2,0,0,1-1.7,8.7l-42,42a8.2,8.2,0,0,1-11.4,0ZM216,144a8,8,0,0,0-8,8v56H48V152a8,8,0,0,0-16,0v56a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A8,8,0,0,0,216,144Z"}))}),o.set("light",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"86 110 128 152 170 110",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),n.createElement("line",{x1:"128",y1:"40",x2:"128",y2:"152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),n.createElement("path",{d:"M216,152v56a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}))}),o.set("thin",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"86 110 128 152 170 110",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),n.createElement("line",{x1:"128",y1:"40",x2:"128",y2:"152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}),n.createElement("path",{d:"M216,152v56a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"8"}))}),o.set("regular",function(e){return n.createElement(n.Fragment,null,n.createElement("polyline",{points:"86 110 128 152 170 110",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("line",{x1:"128",y1:"40",x2:"128",y2:"152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),n.createElement("path",{d:"M216,152v56a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V152",fill:"none",stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}))});var a=function(e,t){return(0,i.$)(e,t,o)},l=(0,n.forwardRef)(function(e,t){return n.createElement(s.A,Object.assign({ref:t},e,{renderPath:a}))});l.displayName="DownloadSimple";let u=l},98648:(e,t,r)=>{"use strict";let n;r.d(t,{k:()=>a});var i=r(96151),s=r(38554);function o(){n=void 0}let a={now:()=>(void 0===n&&a.set(s.uv.isProcessing||i.W.useManualTiming?s.uv.timestamp:performance.now()),n),set:e=>{n=e,queueMicrotask(o)}}}},e=>{var t=t=>e(e.s=t);e.O(0,[6593,8792],()=>(t(12425),t(16540))),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.