PageSourceSearch

https://dashboard.browse.ai/assets/index-BVlNHCVc.js

js browse.ai collected 2026-09-24 09:10:37 UTC 602,308 bytes, 108 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0ce9a-fb07-7ff2-ada3-fdddcdb912f3")}catch(e){}}();const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/startRecording-CG3ZwIWs.js","assets/esm-B4hOu2s-.js","assets/profiler-qVbQ38fo.js","assets/GuestRoutes-C6WMjOrK.js","assets/dist-CzSSeqtW.js","assets/dist-CKairbmu.js","assets/log-D39hDywk.js","assets/useUser-5PN-i3wu.js","assets/filter-obj-DgB-IzwZ.js","assets/query-string-BeV3ycyJ.js","assets/UserRoutes-CaWoiSeN.js","assets/react-dom-BhN4ncsv.js","assets/Button-CTvZZm_1.js","assets/stripSpacingProps-C0sNUzkq.js","assets/Icon-B2rY3Om1.js","assets/Paragraph-k-wnt2rE.js","assets/FormField-BpB2a5Li.js","assets/StyledLink-kvdnx-ko.js","assets/prop-types-ClPXNQnK.js","assets/shallowequal-DIC2AyC8.js","assets/selectInputParameter-BeeboNMB.js","assets/getDocumentationUrl-ghvjtYhz.js","assets/lodash-DRSw4i0x.js","assets/defineProperty-DTDe1VRC.js","assets/useDebounce-xpJbnsMA.js","assets/UserRoutes-DgpsmT0n.css"])))=>i.map(i=>d[i]);
2import{a as e,l as t,n,o as r,r as i,s as a,t as o,u as s}from"./dist-CzSSeqtW.js";import{t as c}from"./react-dom-BhN4ncsv.js";import{a as l,f as u,g as d,m as f,p,r as m,s as h}from"./dist-CKairbmu.js";import{c as g,d as _,f as v,i as y,m as b,n as x,o as S,p as C,s as w,t as T}from"./Button-CTvZZm_1.js";import{i as E,n as D,r as O,t as k}from"./log-D39hDywk.js";import{_ as ee,a as A,c as j,f as te,h as ne,i as re,m as ie,n as M,o as ae,p as oe,r as se,s as ce,t as le,u as N}from"./useUser-5PN-i3wu.js";import{n as ue,t as de}from"./stripSpacingProps-C0sNUzkq.js";import{n as fe,t as pe}from"./Icon-B2rY3Om1.js";import{n as me,r as he,t as ge}from"./Paragraph-k-wnt2rE.js";import{$t as _e,At as ve,B as ye,Bt as be,D as xe,Dt as Se,E as Ce,Et as we,F as Te,Gt as Ee,H as De,It as Oe,J as ke,Jt as Ae,K as je,Kt as Me,L as Ne,Lt as Pe,M as Fe,Mt as Ie,Nt as Le,P as Re,Pt as ze,Q as Be,R as Ve,Rt as He,St as Ue,T as We,Tt as Ge,U as Ke,Ut as qe,V as Je,Vt as Ye,Wt as Xe,X as Ze,Zt as Qe,_t as $e,bt as et,c as tt,gt as nt,i as rt,j as it,jt as at,m as ot,mt as st,o as ct,t as lt,tn as ut,vt as dt,xt as ft,y as pt,zt as mt}from"./FormField-BpB2a5Li.js";import{$s as ht,As as gt,Bs as _t,Cc as vt,Cs as yt,Ds as bt,Er as xt,Es as St,F as Ct,Fs as wt,Gs as Tt,Hs as Et,I as Dt,Is as Ot,Js as kt,Kr as At,Ks as jt,Ls as Mt,Mo as Nt,Ms as P,Ns as Pt,Os as Ft,P as It,Ps as Lt,Qn as Rt,Qs as zt,Rs as Bt,Tr as Vt,Ts as Ht,Tt as Ut,Us as Wt,Vs as Gt,Ws as Kt,Xs as qt,Ys as Jt,Zn as Yt,Zs as Xt,_c as Zt,a as F,ac as Qt,ai as $t,bc as en,bt as tn,cc as nn,dc as rn,ec as an,fc as on,gt as sn,hc as cn,hr as ln,i as un,ic as dn,jo as fn,js as pn,lc as mn,lr as hn,ls as gn,lt as _n,m as vn,mc as yn,mr as bn,n as xn,nc as Sn,ni as Cn,nr as wn,o as Tn,oc as En,pc as Dn,pr as On,qn as kn,qs as An,r as jn,rc as Mn,sc as Nn,sr as Pn,t as Fn,tc as In,uc as I,vc as L,wc as R,wr as Ln,ws as Rn,xc as zn,xt as Bn,yc as Vn,zs as Hn}from"./StyledLink-kvdnx-ko.js";import{a as Un,c as Wn,i as Gn,l as Kn,o as qn,r as Jn,s as Yn,t as Xn}from"./selectInputParameter-BeeboNMB.js";import{a as Zn,o as Qn}from"./filter-obj-DgB-IzwZ.js";import{a as $n,n as er,o as tr,p as nr,t as rr}from"./getDocumentationUrl-ghvjtYhz.js";import{$ as ir,C as ar,E as or,F as sr,G as cr,M as lr,N as ur,Q as dr,Y as fr,Z as pr,at as mr,ct as hr,et as gr,it as _r,j as vr,ot as yr,q as br,rt as xr,t as Sr,tt as Cr,z as wr}from"./esm-B4hOu2s-.js";import{t as Tr}from"./query-string-BeV3ycyJ.js";import{n as Er}from"./shallowequal-DIC2AyC8.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var z=s(i()),Dr=e=>{let[t,n]=z.useState(!0);return z.useEffect((()=>{let t=new Image;t.addEventListener(`load`,(()=>{t.complete?n(!0):n(!1)})),t.addEventListener(`error`,(()=>{n(!1)})),t.src=e}),[e]),t},B=n(),Or={"circle-check":`success`,"triangle-alert":`warning`,"circle-x":`danger`,"circle-ellipsis":`primary`,"circle-pause":`light`},kr=({as:e=`div`,alt:t=`User profile picture`,imageSrc:n,statusIcon:r,
2icon:i,size:a=`md`,hasContrastBorder:s,hasTransparentBackground:c=!1,...l})=>{let u=i==null?`user`:i,d=e,f=Dr(n||``),p=o({"h-6 w-6":a===`xs`},{"h-8 w-8":a===`sm`},{"h-10 w-10":a===`md`},{"h-12 w-12":a===`lg`},{"h-14 w-14":a===`xl`},{"h-16 w-16":a===`2xl`}),m=a===`2xl`||a===`xl`?8:a===`lg`?7:a===`md`?6:a===`sm`?5:4,h=a===`2xl`||a===`xl`?5:a===`lg`?4:a===`md`?3:a===`sm`?2:1,g=ue(l),_=de(l),v=!!n&&!0===f,y=c?(0,B.jsx)(pe,{className:`text-gray-600`,name:u,size:m}):(0,B.jsx)(`span`,{className:o(p,`flex items-center justify-center rounded-full bg-gray-100`),children:(0,B.jsx)(pe,{className:`text-gray-600`,name:u,size:m})});return(0,B.jsxs)(d,{className:o(`box-content rounded-full focus:outline-none`,c&&`flex`,(v||!c)&&p,g,{"border-[1.5px] border-white":s}),..._,"aria-label":t,children:[v?(0,B.jsx)(`img`,{className:o(p,`rounded-full`),src:n,alt:t}):y,r&&(0,B.jsx)(pe,{className:`absolute bottom-0 right-0 rounded-full bg-white`,name:r,color:Or[r],size:h})]})},Ar={1:`flex-[0_0_8.333333%] max-w-[8.333333%]`,2:`flex-[0_0_16.666667%] max-w-[16.666667%]`,3:`flex-[0_0_25%] max-w-[25%]`,4:`flex-[0_0_33.333333%] max-w-[33.333333%]`,5:`flex-[0_0_41.666667%] max-w-[41.666667%]`,6:`flex-[0_0_50%] max-w-[50%]`,7:`flex-[0_0_58.333333%] max-w-[58.333333%]`,8:`flex-[0_0_66.666667%] max-w-[66.666667%]`,9:`flex-[0_0_75%] max-w-[75%]`,10:`flex-[0_0_83.333333%] max-w-[83.333333%]`,11:`flex-[0_0_91.666667%] max-w-[91.666667%]`,12:`flex-[0_0_100%] max-w-[100%]`},jr={1:`min-[576px]:flex-[0_0_8.333333%] min-[576px]:max-w-[8.333333%]`,2:`min-[576px]:flex-[0_0_16.666667%] min-[576px]:max-w-[16.666667%]`,3:`min-[576px]:flex-[0_0_25%] min-[576px]:max-w-[25%]`,4:`min-[576px]:flex-[0_0_33.333333%] min-[576px]:max-w-[33.333333%]`,5:`min-[576px]:flex-[0_0_41.666667%] min-[576px]:max-w-[41.666667%]`,6:`min-[576px]:flex-[0_0_50%] min-[576px]:max-w-[50%]`,7:`min-[576px]:flex-[0_0_58.333333%] min-[576px]:max-w-[58.333333%]`,8:`min-[576px]:flex-[0_0_66.666667%] min-[576px]:max-w-[66.666667%]`,9:`min-[576px]:flex-[0_0_75%] min-[576px]:max-w-[75%]`,10:`min-[576px]:flex-[0_0_83.333333%] min-[576px]:max-w-[83.333333%]`,11:`min-[576px]:flex-[0_0_91.666667%] min-[576px]:max-w-[91.666667%]`,12:`min-[576px]:flex-[0_0_100%] min-[576px]:max-w-[100%]`},Mr={1:`md:flex-[0_0_8.333333%] md:max-w-[8.333333%]`,2:`md:flex-[0_0_16.666667%] md:max-w-[16.666667%]`,3:`md:flex-[0_0_25%] md:max-w-[25%]`,4:`md:flex-[0_0_33.333333%] md:max-w-[33.333333%]`,5:`md:flex-[0_0_41.666667%] md:max-w-[41.666667%]`,6:`md:flex-[0_0_50%] md:max-w-[50%]`,7:`md:flex-[0_0_58.333333%] md:max-w-[58.333333%]`,8:`md:flex-[0_0_66.666667%] md:max-w-[66.666667%]`,9:`md:flex-[0_0_75%] md:max-w-[75%]`,10:`md:flex-[0_0_83.333333%] md:max-w-[83.333333%]`,11:`md:flex-[0_0_91.666667%] md:max-w-[91.666667%]`,12:`md:flex-[0_0_100%] md:max-w-[100%]`},Nr={1:`min-[992px]:flex-[0_0_8.333333%] min-[992px]:max-w-[8.333333%]`,2:`min-[992px]:flex-[0_0_16.666667%] min-[992px]:max-w-[16.666667%]`,3:`min-[992px]:flex-[0_0_25%] min-[992px]:max-w-[25%]`,4:`min-[992px]:flex-[0_0_33.333333%] min-[992px]:max-w-[33.333333%]`,5:`min-[992px]:flex-[0_0_41.666667%] min-[992px]:max-w-[41.666667%]`,6:`min-[992px]:flex-[0_0_50%] min-[992px]:max-w-[50%]`,7:`min-[992px]:flex-[0_0_58.333333%] min-[992px]:max-w-[58.333333%]`,8:`min-[992px]:flex-[0_0_66.666667%] min-[992px]:max-w-[66.666667%]`,9:`min-[992px]:flex-[0_0_75%] min-[992px]:max-w-[75%]`,10:`min-[992px]:flex-[0_0_83.333333%] min-[992px]:max-w-[83.333333%]`,11:`min-[992px]:flex-[0_0_91.666667%] min-[992px]:max-w-[91.666667%]`,12:`min-[992px]:flex-[0_0_100%] min-[992px]:max-w-[100%]`},Pr={1:`min-[1200px]:flex-[0_0_8.333333%] min-[1200px]:max-w-[8.333333%]`,2:`min-[1200px]:flex-[0_0_16.666667%] min-[1200px]:max-w-[16.666667%]`,3:`min-[1200px]:flex-[0_0_25%] min-[1200px]:max-w-[25%]`,4:`min-[1200px]:flex-[0_0_33.333333%] min-[1200px]:max-w-[33.333333%]`,5:`min-[1200px]:flex-[0_0_41.666667%] min-[1200px]:max-w-[41.666667%]`,6:`min-[1200px]:flex-[0_0_50%] min-[1200px]:max-w-[50%]`,7:`min-[1200px]:flex-[0_0_58.333333%] min-[1200px]:max-w-[58.333333%]`,8:`min-[1200px]:flex-[0_0_66.666667%] min-[1200px]:max-w-[66.666667%]`,9:`min-[1200px]:flex-[0_0_75%] min-[1200px]:max-w-[75%]`,10:`min-[1200px]:flex-[0_0_83.333333%] min-[1200px]:max-w-[83.333333%]`,11:`min-[1200px]:flex-[0_0_91.666667%] min-[1200px]:max-w-[91.666667%]`,12:`min-[1200px]:flex-[0_0_100%] min-[1200px]:max-w-[100%]`};function Fr(e,t){return t?e.split(` `).filter((e=>!e.includes(`max-w-`))).join(` `):e}var Ir=z.forwardRef((({hidden:e,isCentered:t=!0,xs:n=12,sm:r,md:i,lg:a,xl:s,textAlign:c,align:l,verticalAlign:u,paddingTop:d,paddingBottom:f,paddingLeft:p=!0,paddingRight:m=!0,className:h,...g},_)=>{let v=ue(g),y=de(g),b=l==null?c:l,x=function(e){return!!(e&&/\bitems-(?:start|end|center|baseline|stretch)\b/.test(e))}(h);return(0,B.jsx)(`div`,{ref:_,className:o(`box-border transition duration-300`,Fr(Ar[n],e),r&&Fr(jr[r],e),i&&Fr(Mr[i],e),a&&Fr(Nr[a],e),s&&Fr(Pr[s],e),{"mx-auto":t,"max-w-0 p-0 opacity-0":e,"text-left":c===`left`,"text-center":c===`center`,"text-right":c===`right`,flex:l||u,"justify-start":b===`left`,"justify-center":b===`center`,"justify-end":b===`right`,"items-start":u!==`center`&&u!==`bottom`&&(u===`top`||!x),"items-center":u===`center`,"items-end":u===`bottom`,"pt-2.5 min-[576px]:pt-4":d,"pb-2.5 min-[576px]:pb-4":f,"pl-2.5 min-[576px]:pl-4":p,"pr-2.5 min-[576px]:pr-4":m},v,h),...y})})),Lr={1:`h1`,2:`h2`,3:`h3`,4:`h4`},Rr={1:`font-light text-3xl`,2:`font-medium text-2xl`,3:`font-medium text-xl`,4:`font-medium text-lg`},zr=z.forwardRef((({level:e,as:t=Lr[e]||`span`,isCentered:n,...r},i)=>{let a=ue(r),s=de(r);return(0,B.jsx)(t,{ref:i,...s,className:o(`m-0 p-0`,n&&`text-center`,Rr[e],a)})})),Br=s(c(),1);E();var Vr=(e,t=`text`)=>`{[{${t===`number`?`int:`:``}${e}}]}`,Hr=s(e(((e,t)=>{(function(n,r,i){typeof e==`object`?(t.exports=i(),t.exports.default=i()):typeof define==`function`&&define.amd?define(i):r[n]=i()})(`slugify`,e,function(){var e=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"
2c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ä¢":"G","Ä£":"g","Ĩ":"I","Ä©":"i","Ī":"i","Ä«":"i","Ä®":"I","į":"i","İ":"I","ı":"i","Ķ":"k","Ä·":"k","Ä»":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Å ":"S","Å¡":"s","Å¢":"T","Å£":"t","Ť":"T","Å¥":"t","Ũ":"U","Å©":"u","Ū":"u","Å«":"u","Å®":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Å´":"W","ŵ":"w","Ŷ":"Y","Å·":"y","Ÿ":"Y","Ź":"Z","ź":"z","Å»":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Æ ":"O","Æ¡":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Î¥":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Ð¥":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ò¢":"NG","Ò£":"ng","Ò®":"UE","Ò¯":"ue","Ò°":"U","Ò±":"u","Òº":"H","Ò»":"h","Ә":"AE","ә":"ae","Ó¨":"OE","Ó©":"oe","Ô±":"A","Ô²":"B","Ô³":"G","Ô´":"D","Ôµ":"E","Ô¶":"Z","Ô·":"E'","Ô¸":"Y'","Ô¹":"T'","Ôº":"JH","Ô»":"I","Ô¼":"L","Ô½":"X","Ô¾":"C'","Ô¿":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","Ø¡":"a","Ø¢":"aa","Ø£":"a","ؤ":"u","Ø¥":"i","ئ":"e","ا":"a","ب":"b","Ø©":"h","ت":"t","Ø«":"th","ج":"j","Ø­":"h","Ø®":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","Ø´":"sh","ص":"s","ض":"dh","Ø·":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Ù¾":"p","چ":"ch","ژ":"zh","Ú©":"k","Ú¯":"g","ی":"y","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","á¹¢":"S","á¹£":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","á» ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","á»§":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","á»­":"u","á»®":"U","ữ":"u","á»°":"U","á»±":"u","Ỳ":"Y","ỳ":"y","á»´":"Y","ỵ":"y","á»¶":"Y","á»·":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","â
2‚§":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","ï·¼":"rial","ﻵ":"laa","ï»·":"laa","ﻹ":"lai","ï»»":"la"}`),t=JSON.parse(`{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Ð¥":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","Ã¥":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","Ã¥":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","Ã¥":"aa","ä":"ae","ö":"oe"}}`);function n(n,r){if(typeof n!=`string`)throw Error(`slugify: string argument expected`);r=typeof r==`string`?{replacement:r}:r||{};var i=t[r.locale]||{},a=r.replacement===void 0?`-`:r.replacement,o=r.trim===void 0||r.trim,s=n.normalize().split(``).reduce(function(t,n){var o=i[n];return o===void 0&&(o=e[n]),o===void 0&&(o=n),o===a&&(o=` `),t+o.replace(r.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,``)},``);return r.strict&&(s=s.replace(/[^A-Za-z0-9\s]/g,``)),o&&(s=s.trim()),s=s.replace(/\s+/g,a),r.lower&&(s=s.toLowerCase()),s}return n.extend=function(t){Object.assign(e,t)},n})}))()),Ur=(e,{remove:t=/['!:]/g,replacement:n=`-`}={})=>(0,Hr.default)(e,{replacement:n,remove:t,lower:!0}),Wr=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Gr(e){var t,n;let r=(t=e.innerText)==null?``:t,i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return r;let a=!1;for(let e of i.querySelectorAll(`[hidden],[aria-hidden],[role="img"]`))e.remove(),a=!0;let o=a?(n=i.innerText)==null?``:n:r;return Wr.test(o)&&(o=o.replace(Wr,``)),o}function Kr(e){let t=e.getAttribute(`aria-label`);if(typeof t==`string`)return t.trim();let n=e.getAttribute(`aria-labelledby`);if(n){let e=n.split(` `).map(e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute(`aria-label`);return typeof e==`string`?e.trim():Gr(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(`, `)}return Gr(e).trim()}function qr(e){let t=(0,z.useRef)(``),n=(0,z.useRef)(``);return Ae(()=>{let r=e.current;if(!r)return``;let i=r.innerText;if(t.current===i)return n.current;let a=Kr(r).trim().toLowerCase();return t.current=i,n.current=a,a})}var Jr=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(Jr||{}),Yr=(e=>(e[e.Pointer=0]=`Pointer`,e[e.Other=1]=`Other`,e))(Yr||{}),Xr=(e=>(e[e.OpenMenu=0]=`OpenMenu`,e[e.CloseMenu=1]=`CloseMenu`,e[e.GoToItem=2]=`GoToItem`,e[e.Search=3]=`Search`,e[e.ClearSearch=4]=`ClearSearch`,e[e.RegisterItem=5]=`RegisterItem`,e[e.UnregisterItem=6]=`UnregisterItem`,e))(Xr||{});function Zr(e,t=e=>e){let n=e.activeItemIndex===null?null:e.items[e.activeItemIndex],r=Pe(t(e.items.slice()),e=>e.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{items:r,activeItemIndex:i}}var Qr={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var n;let r=Zr(e),i=$e(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:``,activeItemIndex:i,activationTrigger:(n=t.trigger)==null?1:n}},3:(e,t)=>
2{let n=+(e.searchQuery===``),r=e.searchQuery+t.value.toLowerCase(),i=(e.activeItemIndex===null?e.items:e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n))).find(e=>{var t;return((t=e.dataRef.current.textValue)==null?void 0:t.startsWith(r))&&!e.dataRef.current.disabled}),a=i?e.items.indexOf(i):-1;return a===-1||a===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:a,activationTrigger:1}},4(e){return e.searchQuery===``?e:{...e,searchQuery:``,searchActiveItemIndex:null}},5:(e,t)=>{let n=Zr(e,e=>[...e,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=Zr(e,e=>{let n=e.findIndex(e=>e.id===t.id);return n!==-1&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}}},$r=(0,z.createContext)(null);$r.displayName=`MenuContext`;function ei(e){let t=(0,z.useContext)($r);if(t===null){let t=Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ei),t}return t}function ti(e,t){return qe(t.type,Qr,e,t)}var ni=z.Fragment;function ri(e,t){let{__demoMode:n=!1,...r}=e,i=(0,z.useReducer)(ti,{__demoMode:n,menuState:+!n,buttonRef:(0,z.createRef)(),itemsRef:(0,z.createRef)(),items:[],searchQuery:``,activeItemIndex:null,activationTrigger:1}),[{menuState:a,itemsRef:o,buttonRef:s},c]=i,l=at(t);ze([s,o],(e,t)=>{var n;c({type:1}),Ye(t,mt.Loose)||(e.preventDefault(),(n=s.current)==null||n.focus())},a===0);let u=Ae(()=>{c({type:1})}),d=(0,z.useMemo)(()=>({open:a===0,close:u}),[a,u]),f={ref:l};return z.createElement($r.Provider,{value:i},z.createElement(ft,{value:qe(a,{0:et.Open,1:et.Closed})},Ge({ourProps:f,theirProps:r,slot:d,defaultTag:ni,name:`Menu`})))}var ii=`button`;function ai(e,t){var n;let r=Xe(),{id:i=`headlessui-menu-button-${r}`,...a}=e,[o,s]=ei(`Menu.Button`),c=at(o.buttonRef,t),l=Ee(),u=Ae(e=>{switch(e.key){case st.Space:case st.Enter:case st.ArrowDown:e.preventDefault(),e.stopPropagation(),s({type:0}),l.nextFrame(()=>s({type:2,focus:nt.First}));break;case st.ArrowUp:e.preventDefault(),e.stopPropagation(),s({type:0}),l.nextFrame(()=>s({type:2,focus:nt.Last}))}}),d=Ae(e=>{switch(e.key){case st.Space:e.preventDefault()}}),f=Ae(t=>{if(dt(t.currentTarget))return t.preventDefault();e.disabled||(o.menuState===0?(s({type:1}),l.nextFrame(()=>{var e;return(e=o.buttonRef.current)==null?void 0:e.focus({preventScroll:!0})}
2)):(t.preventDefault(),s({type:0})))}),p=(0,z.useMemo)(()=>({open:o.menuState===0}),[o]),m={ref:c,id:i,type:Ie(e,o.buttonRef),"aria-haspopup":`menu`,"aria-controls":(n=o.itemsRef.current)==null?void 0:n.id,"aria-expanded":o.menuState===0,onKeyDown:u,onKeyUp:d,onClick:f};return Ge({ourProps:m,theirProps:a,slot:p,defaultTag:ii,name:`Menu.Button`})}var oi=`div`,si=we.RenderStrategy|we.Static;function ci(e,t){var n,r;let i=Xe(),{id:a=`headlessui-menu-items-${i}`,...o}=e,[s,c]=ei(`Menu.Items`),l=at(s.itemsRef,t),u=Le(s.itemsRef),d=Ee(),f=Ue(),p=f===null?s.menuState===0:(f&et.Open)===et.Open;(0,z.useEffect)(()=>{let e=s.itemsRef.current;e&&s.menuState===0&&e!==(u==null?void 0:u.activeElement)&&e.focus({preventScroll:!0})},[s.menuState,s.itemsRef,u]),nr({container:s.itemsRef.current,enabled:s.menuState===0,accept(e){return e.getAttribute(`role`)===`menuitem`?NodeFilter.FILTER_REJECT:e.hasAttribute(`role`)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(e){e.setAttribute(`role`,`none`)}});let m=Ae(e=>{var t,n;switch(d.dispose(),e.key){case st.Space:if(s.searchQuery!==``)return e.preventDefault(),e.stopPropagation(),c({type:3,value:e.key});case st.Enter:if(e.preventDefault(),e.stopPropagation(),c({type:1}),s.activeItemIndex!==null){let{dataRef:e}=s.items[s.activeItemIndex];(n=(t=e.current)==null?void 0:t.domRef.current)==null||n.click()}Oe(s.buttonRef.current);break;case st.ArrowDown:return e.preventDefault(),e.stopPropagation(),c({type:2,focus:nt.Next});case st.ArrowUp:return e.preventDefault(),e.stopPropagation(),c({type:2,focus:nt.Previous});case st.Home:case st.PageUp:return e.preventDefault(),e.stopPropagation(),c({type:2,focus:nt.First});case st.End:case st.PageDown:return e.preventDefault(),e.stopPropagation(),c({type:2,focus:nt.Last});case st.Escape:e.preventDefault(),e.stopPropagation(),c({type:1}),Me().nextFrame(()=>{var e;return(e=s.buttonRef.current)==null?void 0:e.focus({preventScroll:!0})});break;case st.Tab:e.preventDefault(),e.stopPropagation(),c({type:1}),Me().nextFrame(()=>{be(s.buttonRef.current,e.shiftKey?He.Previous:He.Next)});break;default:e.key.length===1&&(c({type:3,value:e.key}),d.setTimeout(()=>c({type:4}),350))}}),h=Ae(e=>{switch(e.key){case st.Space:e.preventDefault()}}),g=(0,z.useMemo)(()=>({open:s.menuState===0}),[s]),_={"aria-activedescendant":s.activeItemIndex===null||(n=s.items[s.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(r=s.buttonRef.current)==null?void 0:r.id,id:a,onKeyDown:m,onKeyUp:h,role:`menu`,tabIndex:0,ref:l};return Ge({ourProps:_,theirProps:o,slot:g,defaultTag:oi,features:si,visible:p,name:`Menu.Items`})}var li=z.Fragment;function ui(e,t){let n=Xe(),{id:r=`headlessui-menu-item-${n}`,disabled:i=!1,...a}=e,[o,s]=ei(`Menu.Item`),c=o.activeItemIndex!==null&&o.items[o.activeItemIndex].id===r,l=(0,z.useRef)(null),u=at(t,l);Qe(()=>{if(o.__demoMode||o.menuState!==0||!c||o.activationTrigger===0)return;let e=Me();return e.requestAnimationFrame(()=>{var e,t;(t=(e=l.current)==null?void 0:e.scrollIntoView)==null||t.call(e,{block:`nearest`})}),e.dispose},[o.__demoMode,l,c,o.menuState,o.activationTrigger,o.activeItemIndex]);let d=qr(l),f=(0,z.useRef)({disabled:i,domRef:l,get textValue(){return d()}});Qe(()=>{f.current.disabled=i},[f,i]),Qe(()=>(s({type:5,id:r,dataRef:f}),()=>s({type:6,id:r})),[f,r]);let p=Ae(()=>{s({type:1})}),m=Ae(e=>{if(i)return e.preventDefault();s({type:1}),Oe(o.buttonRef.current)}),h=Ae(()=>{if(i)return s({type:2,focus:nt.Nothing});s({type:2,focus:nt.Specific,id:r})}),g=ve(),_=Ae(e=>g.update(e)),v=Ae(e=>{g.wasMoved(e)&&(i||c||s({type:2,focus:nt.Specific,id:r,trigger:0}))}),y=Ae(e=>{g.wasMoved(e)&&(i||c&&s({type:2,focus:nt.Nothing}))}),b=(0,z.useMemo)(()=>({active:c,disabled:i,close:p}),[c,i,p]);return Ge({ourProps:{id:r,ref:u,role:`menuitem`,tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0||void 0,disabled:void 0,onClick:m,onFocus:h,onPointerEnter:_,onMouseEnter:_,onPointerMove:v,onMouseMove:v,onPointerLeave:y,onMouseLeave:y},theirProps:a,slot:b,defaultTag:li,name:`Menu.Item`})}var di=Se(ri),fi=Se(ai),pi=Se(ci),mi=Se(ui),hi=Object.assign(di,{Button:fi,Items:pi,Item:mi}),gi=z.createContext(null);function _i({name:e,selectedValue:t,disabled:n,children:r,mode:i=`normal`,
2isDotCenter:a=!0,onValueChanged:o}){return(0,B.jsx)(gi.Provider,{value:{name:e,selectedValue:t,disabled:n,mode:i,onValueChanged:o,isDotCenter:a},children:r})}var vi=()=>z.useContext(gi);function yi({inputId:e,label:t,size:n,isDark:r,isBoxMode:i,checked:a,disabled:s}){return(0,B.jsx)(`label`,{htmlFor:e,className:o(`ml-3 flex flex-1 select-none items-center font-medium`,{"text-base":n===`md`,"text-sm":n===`sm`},{"text-gray-700":!r,"text-gray-200":r,"text-primary-700":!r&&i&&a},{"cursor-pointer":i&&!s}),children:t})}var bi=fe(),xi=({size:e=`md`,label:t=``,id:n,isDark:r,disabled:i,onClick:a,leftElement:s,rightElement:c,...l})=>{let[u,d]=z.useState(!1),[f,p]=z.useState(!1),m=ue(l),h=de(l),{selectedValue:g,mode:_,onValueChanged:v,isDotCenter:y=!0,...b}={selectedValue:void 0,...vi()},x=_===`box`,S=(typeof g==`string`||typeof g==`number`)&&g===l.value,C=z.useMemo((()=>n||`common-Radio-component-${bi.next().value}`),[n]);return(0,B.jsxs)(`div`,{onClick:()=>v==null?void 0:v(l.value),onMouseOver:x?()=>p(!0):void 0,onMouseLeave:x?()=>p(!1):void 0,className:o(`flex`,{"items-center":y},m,x?[`rounded-lg transition`,{"cursor-pointer":!i,"border border-gray-200 bg-white p-[15px] hover:border-primary-300":!S&&!i,"cursor-not-allowed border border-gray-200 bg-gray-50 p-[15px] text-gray-600":i,"border-2 border-primary-600 p-[14px] shadow-focus shadow-primary-100":u,"border-2 border-primary-600 bg-primary-50 p-[14px] hover:border-primary-600":S&&!i}]:[]),children:[x&&s,x&&s&&(0,B.jsx)(yi,{inputId:C,label:t,size:e,isDark:r,isBoxMode:x,checked:S,disabled:i}),(0,B.jsx)(`input`,{...b,disabled:i,checked:S,onFocus:x?()=>d(!0):void 0,onBlur:x?()=>
2d(!1):void 0,...h,type:`radio`,id:C,className:o(`form-radio my-0.5 transition-all focus:outline-none focus:ring-0 focus:ring-offset-0`,{"ml-4":x&&s},{"checked:text-primary-50 checked:hover:text-primary-100 checked:disabled:text-gray-100":!r,"checked:text-gray-800 checked:hover:text-gray-900 checked:focus:text-gray-700 checked:disabled:text-gray-700":r},{"bg-white checked:bg-radio-button-inner-dot-checked-light hover:bg-primary-100 disabled:bg-gray-100 checked:disabled:bg-radio-button-inner-dot-disabled-light":!r,"bg-gray-700 checked:bg-radio-button-inner-dot-checked-dark hover:bg-gray-900 disabled:bg-gray-700 checked:disabled:bg-radio-button-inner-dot-disabled-dark":r},{"border-gray-300 checked:border-primary-600 hover:border-primary-600 checked:hover:border-primary-600 focus:border-primary-300 checked:focus:border-primary-600 disabled:border-gray-300 checked:disabled:border-gray-300":!r,"border-gray-200 checked:border-primary-400 hover:border-primary-300 checked:hover:border-primary-400 focus:border-primary-300 checked:focus:border-primary-400 disabled:border-gray-500 checked:disabled:border-gray-500":r},{"border-primary-600 bg-primary-100 checked:border-primary-600 checked:focus:border-primary-600":!r&&f,"border-primary-300 bg-gray-900 checked:border-primary-400 checked:focus:border-primary-400":r&&f},{"focus:shadow-focus":!0,"focus:shadow-primary-100":!r,"focus:shadow-gray-600":r},{"h-5 w-5":e===`md`,"h-4 w-4":e===`sm`},{"cursor-pointer":x&&!i})}),(!x||!s)&&(0,B.jsx)(yi,{inputId:C,label:t,size:e,isDark:r,isBoxMode:x,checked:S,disabled:i}),x&&c]})},Si=z.forwardRef((({isReversed:e,isCentered:t,className:n,...r},i)=>{let a=ue(r),s=de(r);return(0,B.jsx)(`div`,{ref:i,className:o(`-mx-2.5 flex flex-wrap min-[576px]:-mx-4`,{"flex-row-reverse":e,"justify-center":t},a,n),...s})}));function Ci({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`skeleton`,className:o(`bg-muted rounded-md motion-safe:animate-pulse`,e),...t})}var wi=function(){},Ti=function(){},Ei=(e,t)=>n=>Math.max(Math.min(n,t),e),Di=e=>e%1?Number(e.toFixed(5)):e,Oi=/(-)?([\d]*\.?[\d])+/g,ki=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,Ai=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function ji(e){return typeof e==`string`}var Mi={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Ni=Object.assign(Object.assign({},Mi),{transform:Ei(0,1)}),Pi=Object.assign(Object.assign({},Mi),{default:1}),Fi=e=>({test:t=>ji(t)&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ii=Fi(`deg`),Li=Fi(`%`),V=Fi(`px`),Ri=Fi(`vh`),zi=Fi(`vw`),Bi=Object.assign(Object.assign({},Li),{parse:e=>Li.parse(e)/100,transform:e=>Li.transform(e*100)}),Vi=(e,t)=>n=>!!(ji(n)&&Ai.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Hi=(e,t,n)=>r=>{if(!ji(r))return r;let[i,a,o,s]=r.match(Oi);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Ui={test:Vi(`hsl`,`hue`),parse:Hi(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Li.transform(Di(t))+`, `+Li.transform(Di(n))+`, `+Di(Ni.transform(r))+`)`},Wi=Ei(0,255),Gi=Object.assign(Object.assign({},Mi),{transform:e=>Math.round(Wi(e))}),Ki={test:Vi(`rgb`,`red`),parse:Hi(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Gi.transform(e)+`, `+Gi.transform(t)+`, `+Gi.transform(n)+`, `+Di(Ni.transform(r))+`)`};function qi(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Ji={test:Vi(`#`),parse:qi,transform:Ki.transform},Yi={test:e=>Ki.test(e)||Ji.test(e)||Ui.test(e),parse:e=>Ki.test(e)?Ki.parse(e):Ui.test(e)?Ui.parse(e):Ji.parse(e),transform:e=>ji(e)?e:e.hasOwnProperty(`red`)?Ki.transform(e):Ui.transform(e)},Xi="${c}",Zi="${n}";function Qi(e){var t,n,r,i;return isNaN(e)&&ji(e)&&((n=(t=e.match(Oi))==null?void 0:t.length)==null?0:n)+((i=(r=e.match(ki))==null?void 0:r.length)==null?0:i)>0}function $i(e){typeof e==`number`&&(e=`${e}`);let t=[],n=0,r=e.match(ki);r&&(n=r.length,e=e.replace(ki,Xi),t.push(...r.map(Yi.parse)));let i=e.match(Oi);return i&&(e=e.replace(Oi,Zi),t.push(...i.map(Mi.parse))),{values:t,numColors:n,tokenised:e}}function ea(e){return $i(e).values}function ta(e){let{values:t,numColors:n,tokenised:r}=$i(e),i=t.length;return e=>{let t=r;for(let r=0;r<i;r++)t=t.replace(r<n?Xi:Zi,r<n?Yi.transform(e[r]):Di(e[r]));return t}}var na=e=>typeof e==`number`?0:e;function ra(e){let t=ea(e);return ta(e)(t.map(na))}var ia={test:Qi,parse:ea,createTransformer:ta,getAnimatableNone:ra},aa=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function oa(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Oi)||[];if(!r)return e;let i=n.replace(r,``),a=+!!aa.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var sa=/([a-z-]*)\(.*?\)/g,ca=Object.assign(Object.assign({},ia),{getAnimatableNone:e=>{let t=e.match(sa);return t?t.map(oa).join(` `):e}});function la(e){var t={};return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var ua=r((()=>{})),da=a({default:()=>pa}),fa,pa,ma=r((()=>{ua(),fa=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInl
2ine|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,pa=la(function(e){return fa.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),ha=(e,t,n)=>Math.min(Math.max(n,e),t),ga=.001,_a=.01,va=.05;function ya({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a,o=1-t;o=ha(va,1,o),e=ha(_a,10,e/1e3),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Sa(t,o),c=Math.exp(-i);return ga-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Sa(t**2,o);return(-i(t)+ga>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=xa(i,a,s);if(e*=1e3,isNaN(c))return{stiffness:100,damping:10,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var ba=12;function xa(e,t,n){let r=n;for(let n=1;n<ba;n++)r-=e(r)/t(r);return r}function Sa(e,t){return e*Math.sqrt(1-t*t)}var Ca=[`duration`,`bounce`],wa=[`stiffness`,`damping`,`mass`];function Ta(e,t){return t.some(t=>e[t]!==void 0)}function Ea(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Ta(e,wa)&&Ta(e,Ca)){let n=ya(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function Da(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,a=vt(e,[`from`,`to`,`restSpeed`,`restDelta`]);let o={done:!1,value:t},{stiffness:s,damping:c,mass:l,velocity:u,duration:d,isResolvedFromDuration:f}=Ea(a),p=Oa,m=Oa;function h(){let e=u?-(u/1e3):0,r=n-t,a=c/(2*Math.sqrt(s*l)),o=Math.sqrt(s/l)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),a<1){let t=Sa(o,a);p=i=>{let s=Math.exp(-a*o*i);return n-s*((e+a*o*r)/t*Math.sin(t*i)+r*Math.cos(t*i))},m=n=>{let i=Math.exp(-a*o*n);return a*o*i*(Math.sin(t*n)*(e+a*o*r)/t+r*Math.cos(t*n))-i*(Math.cos(t*n)*(e+a*o*r)-t*r*Math.sin(t*n))}}else if(a===1)p=t=>n-Math.exp(-o*t)*(r+(e+o*r)*t);else{let t=o*Math.sqrt(a*a-1);p=i=>{let s=Math.exp(-a*o*i),c=Math.min(t*i,300);return n-s*((e+a*o*r)*Math.sinh(c)+t*r*Math.cosh(c))/t}}}return h(),{next:e=>{let t=p(e);if(f)o.done=e>=d;else{let a=m(e)*1e3,s=Math.abs(a)<=r,c=Math.abs(n-t)<=i;o.done=s&&c}return o.value=o.done?n:t,o},flipTarget:()=>{u=-u,[t,n]=[n,t],h()}}}Da.needsInterpolation=(e,t)=>typeof e==`string`||typeof t==`string`;var Oa=e=>0,ka=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},Aa=(e,t,n)=>-n*e+n*t+e;function ja(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ma({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ja(s,r,e+1/3),a=ja(s,r,e),o=ja(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}var Na=(e,t,n)=>{let r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},Pa=[Ji,Ki,Ui],Fa=e=>Pa.find(t=>t.test(e)),Ia=e=>`'${e}' is not an animatable color. Use the equivalent color code instead.`,La=(e,t)=>{let n=Fa(e),r=Fa(t);Ia(e),Ia(t);let i=n.parse(e),a=r.parse(t);n===Ui&&(i=Ma(i),n=Ki),r===Ui&&(a=Ma(a),r=Ki);let o=Object.assign({},i);return e=>{for(let t in o)t!==`alpha`&&(o[t]=Na(i[t],a[t],e));return o.alpha=Aa(i.alpha,a.alpha,e),n.transform(o)}},Ra=e=>typeof e==`number`,za=(e,t)=>n=>t(e(n)),Ba=(...e)=>e.reduce(za);function Va(e,t){return Ra(e)?n=>Aa(e,t,n):Yi.test(e)?La(e,t):Ga(e,t)}var Ha=(e,t)=>{let n=[...e],r=n.length,i=e.map((e,n)=>Va(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}},Ua=(e,t)=>{let n=Object.assign(Object.assign({},e),t),r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Va(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}};function Wa(e){let t=ia.parse(e),n=t.length,r=0,i=0,a=0;for(let e=0;e<n;e++)r||typeof t[e]==`number`?r++:t[e].hue===void 0?i++:a++;return{parsed:t,numNumbers:r,numRGB:i,numHSL:a}}var Ga=(e,t)=>{let n=ia.createTransformer(t),r=Wa(e),i=Wa(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?Ba(Ha(r.parsed,i.parsed),n):(`${e}${t}`,n=>`${n>0?t:e}`)},Ka=(e,t)=>n=>Aa(e,t,n);function qa(e){if(typeof e==`number`)return Ka;if(typeof e==`string`)return Yi.test(e)?La:Ga;if(Array.isArray(e))return Ha;if(typeof e==`object`)return Ua}function Ja(e,t,n){let r=[],i=n||qa(e[0]),a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Ba(Array.isArray(t)?t[n]:t,a)),r.push(a)}return r}function Ya([e,t],[n]){return r=>n(ka(e,t,r))}function Xa(e,t){let n=e.length,r=n-1;return i=>{let a=0,o=!1;if(i<=e[0]?o=!0:i>=e[r]&&(a=r-1,o=!0),!o){let t=1;for(;t<n&&!(e[t]>i||t===r);t++);a=t-1}let s=ka(e[a],e[a+1],i);return t[a](s)}}function Za(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;t.length,!r||!Array.isArray(r)||(r.length,a-1),e[0]>e[a-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());let o=Ja(t,r,i),s=a===2?Ya(e,o):Xa(e,o);return n?t=>s(ha(e[0],e[a-1],t)):s}var Qa=e=>t=>1-e(1-t),$a=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,eo=e=>t=>t**+e,to=e=>t=>t*t*((e+1)*t-e),no=e=>{let t=to(e);return e=>(e*=2)<1?.5*t(e):.5*(2-2**(-10*(e-1)))},ro=1.525,io=4/11,ao=8/11,oo=9/10,so=e=>e,co=eo(2),lo=Qa(co),uo=$a(co),fo=e=>1-Math.sin(Math.acos(e)),po=Qa(fo),mo=$a(po),ho=to(ro),go=Qa(ho),_o=$a(ho),vo=no(ro),yo=4356/361,bo=35442/1805,xo=16061/1805,So=e=>{if(e===1||e===0)return e;let t=e*e;
2return e<io?7.5625*t:e<ao?9.075*t-9.9*e+3.4:e<oo?yo*t-bo*e+xo:10.8*e*e-20.52*e+10.72},Co=Qa(So),wo=e=>e<.5?.5*(1-So(1-e*2)):.5*So(e*2-1)+.5;function To(e,t){return e.map(()=>t||uo).splice(0,e.length-1)}function Eo(e){let t=e.length;return e.map((e,n)=>n===0?0:n/(t-1))}function Do(e,t){return e.map(e=>e*t)}function Oo({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){let a={done:!1,value:e},o=Array.isArray(t)?t:[e,t],s=Do(r&&r.length===o.length?r:Eo(o),i);function c(){return Za(s,o,{ease:Array.isArray(n)?n:To(o,n)})}let l=c();return{next:e=>(a.value=l(e),a.done=e>=i,a),flipTarget:()=>{o.reverse(),l=c()}}}function ko({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:a}){let o={done:!1,value:t},s=n*e,c=t+s,l=a===void 0?c:a(c);return l!==c&&(s=l-t),{next:e=>{let t=-s*Math.exp(-e/r);return o.done=!(t>i||t<-i),o.value=o.done?l:l+t,o},flipTarget:()=>{}}}var Ao={keyframes:Oo,spring:Da,decay:ko};function jo(e){if(Array.isArray(e.to))return Oo;if(Ao[e.type])return Ao[e.type];let t=new Set(Object.keys(e));return t.has(`ease`)||t.has(`duration`)&&!t.has(`dampingRatio`)?Oo:t.has(`dampingRatio`)||t.has(`stiffness`)||t.has(`mass`)||t.has(`damping`)||t.has(`restSpeed`)||t.has(`restDelta`)?Da:Oo}var Mo=1/60*1e3,No=typeof performance<`u`?()=>performance.now():()=>Date.now(),Po=typeof window<`u`?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(No()),Mo);function Fo(e){let t=[],n=[],r=0,i=!1,a=!1,o=new WeakSet,s={schedule:(e,a=!1,s=!1)=>{let c=s&&i,l=c?t:n;return a&&o.add(e),l.indexOf(e)===-1&&(l.push(e),c&&i&&(r=t.length)),e},cancel:e=>{let t=n.indexOf(e);t!==-1&&n.splice(t,1),o.delete(e)},process:c=>{if(i){a=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let n=0;n<r;n++){let r=t[n];r(c),o.has(r)&&(s.schedule(r),e())}i=!1,a&&(a=!1,s.process(c))}};return s}var Io=40,Lo=!0,Ro=!1,zo=!1,Bo={delta:0,timestamp:0},Vo=[`read`,`update`,`preRender`,`render`,`postRender`],Ho=Vo.reduce((e,t)=>(e[t]=Fo(()=>Ro=!0),e),{}),Uo=Vo.reduce((e,t)=>{let n=Ho[t];return e[t]=(e,t=!1,r=!1)=>(Ro||Jo(),n.schedule(e,t,r)),e},{}),Wo=Vo.reduce((e,t)=>(e[t]=Ho[t].cancel,e),{}),Go=Vo.reduce((e,t)=>(e[t]=()=>Ho[t].process(Bo),e),{}),Ko=e=>Ho[e].process(Bo),qo=e=>{Ro=!1,Bo.delta=Lo?Mo:Math.max(Math.min(e-Bo.timestamp,Io),1),Bo.timestamp=e,zo=!0,Vo.forEach(Ko),zo=!1,Ro&&(Lo=!1,Po(qo))},Jo=()=>{Ro=!0,Lo=!0,zo||Po(qo)},Yo=()=>Bo;function Xo(e,t,n=0){return e-t-n}function Zo(e,t,n=0,r=!0){return r?Xo(t+-e,t,n):t-(e-t)+n}function Qo(e,t,n,r){return r?e>=t+n:e<=-n}var $o=e=>{let t=({delta:t})=>e(t);return{start:()=>Uo.update(t,!0),stop:()=>Wo.update(t)}};function es(e){var t,n,{from:r,autoplay:i=!0,driver:a=$o,elapsed:o=0,repeat:s=0,repeatType:c=`loop`,repeatDelay:l=0,onPlay:u,onStop:d,onComplete:f,onRepeat:p,onUpdate:m}=e,h=vt(e,[`from`,`autoplay`,`driver`,`elapsed`,`repeat`,`repeatType`,`repeatDelay`,`onPlay`,`onStop`,`onComplete`,`onRepeat`,`onUpdate`]);let{to:g}=h,_,v=0,y=h.duration,b,x=!1,S=!0,C,w=jo(h);(n=(t=w).needsInterpolation)!=null&&n.call(t,r,g)&&(C=Za([0,100],[r,g],{clamp:!1}),r=0,g=100);let T=w(Object.assign(Object.assign({},h),{from:r,to:g}));function E(){v++,c===`reverse`?(S=v%2==0,o=Zo(o,y,l,S)):(o=Xo(o,y,l),c===`mirror`&&T.flipTarget()),x=!1,p&&p()}function D(){_.stop(),f&&f()}function O(e){if(S||(e=-e),o+=e,!x){let e=T.next(Math.max(0,o));b=e.value,C&&(b=C(b)),x=S?e.done:o<=0}m==null||m(b),x&&(v===0&&(y!=null||(y=o)),v<s?Qo(o,y,l,S)&&E():D())}function k(){u==null||u(),_=a(O),_.start()}return i&&k(),{stop:()=>{d==null||d(),_.stop()}}}function ts(e,t){return t?1e3/t*e:0}function ns({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:a=750,bounceStiffness:o=500,bounceDamping:s=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:d,onComplete:f,onStop:p}){let m;function h(e){return n!==void 0&&e<n||r!==void 0&&e>r}function g(e){return n===void 0?r:r===void 0||Math.abs(n-e)<Math.abs(r-e)?n:r}function _(e){m==null||m.stop(),m=es(Object.assign(Object.assign({},e),{driver:u,onUpdate:t=>{var n;d==null||d(t),(n=e.onUpdate)==null||n.call(e,t)},onComplete:f,onStop:p}))}function v(e){_(Object.assign({type:`spring`,stiffness:o,damping:s,restDelta:c},e))}if(h(e))v({from:e,velocity:t,to:g(e)});else{let r=i*t+e;l!==void 0&&(r=l(r));let o=g(r),s=o===n?-1:1,u,d;_({type:`decay`,from:e,velocity:t,timeConstant:a,power:i,restDelta:c,modifyTarget:l,onUpdate:h(r)?e=>{u=d,d=e,t=ts(e-u,Yo().delta),(s===1&&e>o||s===-1&&e<o)&&v({from:e,to:o,velocity:t})}:void 0})}return{stop:()=>m==null?void 0:m.stop()}}var rs=e=>e.hasOwnProperty(`x`)&&e.hasOwnProperty(`y`),is=e=>rs(e)&&e.hasOwnProperty(`z`),as=(e,t)=>Math.abs(e-t);function os(e,t){if(Ra(e)&&Ra(t))return as(e,t);if(rs(e)&&rs(t)){let n=as(e.x,t.x),r=as(e.y,t.y),i=is(e)&&is(t)?as(e.z,t.z):0;return Math.sqrt(n**2+r**2+i**2)}}var ss=(e,t)=>1-3*t+3*e,cs=(e,t)=>3*t-6*e,ls=e=>3*e,us=(e,t,n)=>((ss(t,n)*e+cs(t,n))*e+ls(t))*e,ds=(e,t,n)=>3*ss(t,n)*e*e+2*cs(t,n)*e+ls(t),fs=1e-7,ps=10;function ms(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=us(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>fs&&++s<ps);return o}var hs=8,gs=.001;function _s(e,t,n,r){for(let i=0;i<hs;++i){let i=ds(t,n,r);if(i===0)return t;let a=us(t,n,r)-e;t-=a/i}return t}var vs=11,ys=1/10;function bs(e,t,n,r){if(e===t&&n===r)return so;let i=new Float32Array(vs);for(let t=0;t<vs;++t)i[t]=us(t*ys,e,n);function a(t){let r=0,a=1;for(;a!==10&&i[a]<=t;++a)r+=ys;--a;let o=(t-i[a])/(i[a+1]-i[a]),s=r+o*ys,c=ds(s,e,n);return c>=gs?_s(t,s,e,n):c===0?s:ms(t,r,r+ys,e,n)}return e=>e===0||e===1?e:us(a(e),t,r)}var xs=class{setAnimation(e){this.animation=e,e==null||e.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}};function Ss(e,t){e.indexOf(t)===-1&&e.push(t)}var Cs=(e,t,n)=>Math.min(Math.max(n,e),t),ws={duration:.3,delay:0,endDelay:0,repeat:0,easing:`ease`},Ts=e=>typeof e==`number`,Es=e=>Array.isArray(e)&&!Ts(e[0]),Ds=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function Os(e,t){return Es(e)?e[Ds(0,e.length,t)]:e}var ks=(e,t,n)=>-n*e+n*t+e,As=()=>{},js=e=>e,Ms=(e,t,n)=>t-e===0?1:(n-e)/(t-e);function Ns(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Ms(0,t,r);e.push(ks(n,1,i))}}function Ps(e){let t=[0];return Ns(t,e-1),t}function Fs(e,t=Ps(e.length),n=js){let r=e.length,i=r-t.length;return i>0&&Ns(t,i),i=>{let a=0;for(;a<r-2&&!(i<t[a+1]);a++);let o=Cs(0,1,Ms(t[a],t[a+1],i));return o=Os(n,a)(o),ks(e[a],e[a+1],o)}}var Is=e=>Array.isArray(e)&&Ts(e[0]),Ls=e=>typeof e==`object`&&!!e.createAnimation,Rs=e=>typeof e==`function`,zs=e=>typeof e==`string`,Bs={ms:e=>e*1e3,s:e=>e/1e3},Vs=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Hs=1e-7,Us=12;function Ws(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Vs(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Hs&&++s<Us);return o}function Gs(e,t,n,r){if(e===t&&n===r)return js;let i=t=>Ws(t,0,1,e,n);return e=>e===0||e===1?e:Vs(i(e),t,r)}var Ks=(e,t=`end`)=>n=>{n=t===`end`?Math.min(n,.999):Math.max(n,.001);let r=n*e;return Cs(0,1,(t===`end`?Math.floor(r):Math.ceil(r))/e)},qs={ease:Gs(.25,.1,.25,1),"ease-in":Gs(.42,0,1,1),"ease-in-out":Gs(.42,0,.58,1),"ease-out":Gs(0,0,.58,1)},Js=/\((.*?)\)/;function Ys(e){if(Rs(e))return e;if(Is(e))return Gs(...e);let t=qs[e];if(t)return t;if(e.startsWith(`steps`)){let t=Js.exec(e);if(t){let e=t[1].split(`,`);return Ks(parseFloat(e[0]),e[1].trim())}}return js}var Xs=class{constructor(e,t=[0,1],{easing:n,duration:r=ws.duration,delay:i=ws.delay,endDelay:a=ws.endDelay,repeat:o=ws.repeat,offset:s,direction:c=`
2normal`,autoplay:l=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=js,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState=`idle`,this.finished=new Promise((e,t)=>{this.resolve=e,this.reject=t}),n=n||ws.easing,Ls(n)){let e=n.createAnimation(t);n=e.easing,t=e.keyframes||t,r=e.duration||r}this.repeat=o,this.easing=Es(n)?js:Ys(n),this.updateDuration(r);let u=Fs(t,s,Es(n)?n.map(Ys):js);this.tick=t=>{var n;i=i;let r=0;r=this.pauseTime===void 0?(t-this.startTime)*this.rate:this.pauseTime,this.t=r,r/=1e3,r=Math.max(r-i,0),this.playState===`finished`&&this.pauseTime===void 0&&(r=this.totalDuration);let o=r/this.duration,s=Math.floor(o),l=o%1;!l&&o>=1&&(l=1),l===1&&s--;let d=s%2;(c===`reverse`||c===`alternate`&&d||c===`alternate-reverse`&&!d)&&(l=1-l);let f=r>=this.totalDuration?1:Math.min(l,1),p=u(this.easing(f));e(p),this.pauseTime===void 0&&(this.playState===`finished`||r>=this.totalDuration+a)?(this.playState=`finished`,(n=this.resolve)==null||n.call(this,p)):this.playState!==`idle`&&(this.frameRequestId=requestAnimationFrame(this.tick))},l&&this.play()}play(){let e=performance.now();this.playState=`running`,this.pauseTime===void 0?this.startTime||(this.startTime=e):this.startTime=e-this.pauseTime,this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState=`paused`,this.pauseTime=this.t}finish(){this.playState=`finished`,this.tick(0)}stop(){var e;this.playState=`idle`,this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)==null||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}},Zs=z.forwardRef((({icon:e,iconElement:t,children:n,hasBoldLabel:r,rightIcon:i,supportingText:a,badge:s,isSelected:c=!1,link:l,onClick:u,onPointerDown:d,onKeyDown:f,disabled:p=!1,linkComponent:m=(({children:e,...t})=>(0,B.jsx)(`a`,{...t,children:e})),"data-test":h},g)=>{if(e&&t)throw Error(`Cannot use both icon and iconElement at the same time`);let _=(0,B.jsxs)(`li`,{className:o(`group flex min-h-[36px] list-none flex-col rounded-md px-3 py-2 focus:shadow-focus focus:shadow-gray-100 focus:outline-none`,{"bg-white hover:bg-gray-50":!c,"bg-gray-50 hover:bg-gray-modern-100":c,"cursor-not-allowed opacity-50":p}),children:[(0,B.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex w-full items-center`,children:[e&&(0,B.jsx)(pe,{className:`mr-2.5 text-gray-700`,name:e,size:5}),t&&(0,B.jsx)(`div`,{className:`mr-2.5`,children:t}),(0,B.jsx)(`span`,{className:o({"text-gray-700":!p,"text-gray-300":p,"text-md font-medium":r,"text-sm":!r}),children:n}),s&&(0,B.jsx)(ut,{intent:s.intent,size:`sm`,children:s.label})]}),i&&!p&&(0,B.jsx)(pe,{className:o({"text-gray-400 opacity-0 transition-opacity group-hover:opacity-100":i.visibleOnHoverOnly,"opacity-100":!i.visibleOnHoverOnly,"text-gray-700":!i.visibleOnHoverOnly&&!c,"text-primary-600":!i.visibleOnHoverOnly&&c}),name:i.name,size:5})]}),a&&(0,B.jsx)(`span`,{className:o(`mt-0.5 text-left text-sm`,{"ml-[30px]":e||t,"text-gray-300":p,"text-gray-700":!p}),children:a})]});if(!l)return(0,B.jsx)(`button`,{ref:g,type:`button`,disabled:p,className:`w-full focus:outline-none`,onClick:u,onPointerDown:d,onKeyDown:f,"data-test":h,children:_});let v=w(l);return v===`relative`?(0,B.jsx)(m,{ref:g,className:`hover:no-underline`,to:l,"data-test":h,children:_}):(0,B.jsx)(`a`,{ref:g,className:`hover:no-underline`,href:l,target:`_blank`,...S(l,v),"data-test":h,onClick:e=>{if(v===`fragment`)return l!==`#`&&y({element:l}),e.preventDefault(),!1},children:_})})),Qs=({currentIndex:e,items:t,size:n=`md`,type:r=`line`})=>r===`line`?(0,B.jsx)(`ol`,{className:`space-x-0 space-y-4 md:flex md:space-x-4 md:space-y-0 ${{sm:`text-sm`,md:`text-md`,lg:`text-md`}[n]}`,children:t.map(((t,n)=>{let r=e>n,i=e===n,a=e<n;return(0,B.jsxs)(`li`,{className:`relative truncate md:flex-1`,children:[(0,B.jsx)(`span`,{className:`absolute w-full border-2 border-purple-200`}),(0,B.jsx)(`span`,{className:`group border-t-4 `+(r?`absolute w-full border-primary duration-300`:i?`absolute w-2/3 border-primary duration-1000`:`border-purple-200`)}),(0,B.jsx)(`label`,{className:o(`mt-2 block truncate font-semibold`,{"text-gray-700":r,"text-primary-700":i,"text-gray-500":a}),title:t.label,children:t.label})]},n)}))}):null,$s=[/csp_violation/,/ResizeObserver loop completed with undelivered notifications/,/Script error/,/Failed to fetch/,/Load failed/,/signal is aborted without reason/];function ec(e){if(!e||e.source===`graphql`)return!1;let t=e.$exception_list;if(!(t!=null&&t.length))return!1;for(let e of t){var n;if(nc(e.value)||tc((n=e.stacktrace)==null||(n=n.frames)==null?void 0:n.map((e=>
2e.filename)).filter(Boolean).join(`
3`)))return!0}return!1}function tc(e){return!!e&&(e.includes(`chrome-extension://`)||e.includes(`moz-extension://`)||e.includes(`safari-extension://`))}function nc(e){return!!e&&$s.some((t=>t.test(e)))}var rc=k(`dashboard/src/components/PostHogProvider.tsx`);N.init(`phc_Csfo02Bxn5BEjDqxc58rH19GTU7TZlLne2x8T6iXU4k`,{api_host:`https://p.browse.ai`,ui_host:`https://us.posthog.com`,person_profiles:`identified_only`,capture_pageview:!1,enable_recording_console_log:!0,enable_heatmaps:!0,capture_exceptions:!0,autocapture:{dom_event_allowlist:[`click`,`submit`,`change`],capture_copied_text:!0},session_recording:{recordCrossOriginIframes:!0,maskAllInputs:!1,maskInputOptions:{password:!0,text:!0},maskInputFn(e,t){return t!=null&&t.hasAttribute(`data-ph-unmask-input`)?e:`*`.repeat(e.length)}},before_send:e=>(e==null?void 0:e.event)===`$exception`&&ec(e.properties)?null:A(e)}),N.unregister(`packageName`),N.unregister(`version`),N.register_for_session({packageName:`dashboard`,version:`2c7c636c094a33725a321846ab0cf3954c782494`});var ic=[`alpha`,`beta`,`concept`],ac=z.createContext({earlyAccessFeatures:[],loading:!0});function oc(){return z.useContext(ac)}function sc({children:e}){let[t,n]=z.useState([]),[r,i]=z.useState(!0);z.useEffect(()=>{if(!N){i(!1);return}try{N.getEarlyAccessFeatures(e=>{n(e||[]),i(!1)},!0,ic)}catch(e){rc(`error`,`Failed to fetch early access features`,{error:e}),i(!1)}},[]);let a=z.useMemo(()=>({earlyAccessFeatures:t,loading:r}),[t,r]);return(0,B.jsx)(ie,{client:N,children:(0,B.jsx)(ac.Provider,{value:a,children:e})})}function cc(e,t){return(...n)=>{try{return e(...n)}catch(e){hr.error(t,e)}}}function lc(e){let t=_r.queueMicrotask;typeof t==`function`?t(gr(e)):Promise.resolve().then(gr(e))}var uc=class{constructor(e){this.onFirstSubscribe=e,this.observers=[]}subscribe(e){return this.addObserver(e),{unsubscribe:()=>this.removeObserver(e)}}notify(e){this.observers.forEach(t=>t(e))}addObserver(e){this.observers.push(e),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(e){this.observers=this.observers.filter(t=>e!==t),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}},dc=class extends uc{constructor(e){super(),this.maxBufferSize=e,this.buffer=[]}notify(e){this.buffer.push(e),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(e)}subscribe(e){let t=!1;return lc(()=>{for(let n of this.buffer){if(t)return;e(n)}t||this.addObserver(e)}),{unsubscribe:()=>{t=!0,this.removeObserver(e)}}}unbuffer(){lc(()=>{this.maxBufferSize=this.buffer.length=0})}};function fc(e,t,n){let r=n&&n.leading!==void 0?n.leading:!0,i=n&&n.trailing!==void 0?n.trailing:!0,a=!1,o,s;return{throttled:(...n)=>{if(a){o=n;return}r?e(...n):o=n,a=!0,s=pr(()=>{i&&o&&e(...o),a=!1,o=void 0},t)},cancel:()=>{fr(s),a=!1,o=void 0}}}function pc(){}function mc(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function hc(e){return mc(e)===`object`}function gc(e){return e}var _c=`?`;function vc(e){var t,n;let r=[],i=jc(e,`stack`),a=String(e);if(i&&i.startsWith(a)&&(i=i.slice(a.length)),i&&i.split(`
4`).forEach(e=>{let t=Cc(e)||Tc(e)||Dc(e)||Ac(e);t&&(!t.func&&t.line&&(t.func=_c),r.push(t))}),r.length>0&&Pc()&&e instanceof Error){let i=[],a=e;for(;(a=Object.getPrototypeOf(a))&&Mc(a);){let e=((t=a.constructor)==null?void 0:t.name)||_c;i.push(e)}for(let e=i.length-1;e>=0&&((n=r[0])==null?void 0:n.func)===i[e];e--)r.shift()}return{message:jc(e,`message`),name:jc(e,`name`),stack:r}}var yc=`((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)`,bc=`(?::(\\d+))`,xc=RegExp(`^\\s*at (.*?) ?\\(${yc}${bc}?${bc}?\\)?\\s*$`,`i`),Sc=RegExp(`\\((\\S*)${bc}${bc}\\)`);function Cc(e){let t=xc.exec(e);if(!t)return;let n=t[2]&&t[2].indexOf(`native`)===0,r=t[2]&&t[2].indexOf(`eval`)===0,i=Sc.exec(t[2]);return r&&i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||_c,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}var wc=RegExp(`^\\s*at\\s*(?:(.*)?(?: @))?\\s*${yc}${bc}?${bc}??\\s*$`,`i`);function Tc(e){let t=wc.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||_c,line:t[3]?+t[3]:void 0,url:t[2]}}var Ec=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Dc(e){let t=Ec.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||_c,line:+t[3],url:t[2]}}
4var Oc=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,kc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ac(e){let t=Oc.exec(e);if(!t)return;let n=t[3]&&t[3].indexOf(` > eval`)>-1,r=kc.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(`,`):[],column:t[5]?+t[5]:void 0,func:t[1]||_c,line:t[4]?+t[4]:void 0,url:t[3]}}function jc(e,t){return hc(e)&&typeof e[t]==`string`?e[t]:void 0}function Mc(e){return String(e.constructor).startsWith(`class `)}var Nc;function Pc(){if(Nc!==void 0)return Nc;class e extends Error{constructor(){super(),this.name=`Error`}}let[t,n]=[e,Error].map(e=>new e);return Nc=Mc(Object.getPrototypeOf(t))&&n.stack!==t.stack,Nc}function Fc(e){let t=Error(e);t.name=`HandlingStack`;let n;return dr(()=>{let e=vc(t);e.stack=e.stack.slice(2),n=Ic(e)}),n}function Ic(e){let t=Lc(e);return e.stack.forEach(e=>{let n=e.func===`?`?`<anonymous>`:e.func,r=e.args&&e.args.length>0?`(${e.args.join(`, `)})`:``,i=e.line?`:${e.line}`:``,a=e.line&&e.column?`:${e.column}`:``;t+=`\n  at ${n}${r} @ ${e.url}${i}${a}`}),t}function Lc(e){return`${e.name||`Error`}: ${e.message}`}var Rc=1024,zc=1024*Rc;function Bc(e){if(e.length===1)return e[0];let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Vc(e,t,n){if(typeof e!=`object`||!e)return JSON.stringify(e);let r=Hc(Object.prototype),i=Hc(Array.prototype),a=Hc(Object.getPrototypeOf(e)),o=Hc(e);try{return JSON.stringify(e,t,n)}catch{return`<error: unable to serialize object>`}finally{r(),i(),a(),o()}}function Hc(e){let t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):pc}var Uc=`No stack, consider using an instance of Error`;function Wc(e){return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}function Gc(e,t,n){let r=e[t];r&&!r.q&&r.version&&hr.warn(`SDK is loaded more than once. This is unsupported and might have unexpected behavior.`),e[t]=n,r&&r.q&&r.q.forEach(e=>cc(e,`onReady callback threw an error:`)())}function Kc(){let e=Yc();if(e)return{getCapabilities(){var t;return JSON.parse(((t=e.getCapabilities)==null?void 0:t.call(e))||`[]`)},getPrivacyLevel(){var t;return(t=e.getPrivacyLevel)==null?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,r){let i=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:i}))}}}function qc(e){let t=Kc();return!!t&&t.getCapabilities().includes(e)}function Jc(e){var t;e===void 0&&(e=(t=xr().location)==null?void 0:t.hostname);let n=Kc();return!!n&&n.getAllowedWebViewHosts().some(t=>e===t||e.endsWith(`.${t}`))}function Yc(){return xr().DatadogEventBridge}var Xc=`SKIPPED`,Zc={LOG:`log`,CONFIGURATION:`configuration`,USAGE:`usage`},Qc=[`https://www.datadoghq-browser-agent.com`,`https://www.datad0g-browser-agent.com`,`https://d3uc069fcn7uxw.cloudfront.net`,`https://d20xtzwzcl0ceb.cloudfront.net`,`http://localhost`,`<anonymous>`],$c;function el(){return $c||($c=new dc(100)),$c}function tl(e,t){ir(mr.debug,e,t),el().notify({rawEvent:{type:Zc.LOG,message:e,status:`debug`,...t}})}function nl(e,t){el().notify({rawEvent:{type:Zc.LOG,status:`error`,...il(e),...t}})}function rl(e,t){el().notify({rawEvent:{type:Zc.LOG,message:e,status:`debug`,...t},metricName:e})}function il(e){if(Wc(e)){let t=vc(e);return{error:{kind:t.name,stack:Ic(al(t))},message:t.message}}return{error:{stack:Uc},message:`Uncaught ${Vc(e)}`}}function al(e){return e.stack=e.stack.filter(e=>!e.url||Qc.some(t=>e.url.startsWith(t))),e}function ol(e,t,n){return document.readyState===t||document.readyState===`complete`?(n(),{stop:pc}):sr(e,window,t===`complete`?`load`:`DOMContentLoaded`,n,{once:!0})}function sl(e,t){return new Promise(n=>{ol(e,t,n)})}function cl(e,{session:t,viewContext:n,errorType:r}){let i=t?t.id:`no-session-id`,a=[];return r!==void 0&&a.push(`error-type=${r}`),n&&(a.push(`seed=${n.id}`),a.push(`from=${n.startClocks.timeStamp}`)),`${ll(e)}${`/rum/replay/sessions/${i}`}?${a.join(`&`)}`}function ll(e){let t=e.site,n=e.subdomain||ul(e);return`https://${n?`${n}.`:``}${t}`}
4function ul(e){switch(e.site){case ur:case vr:return`app`;case lr:return`dd`;default:return}}var dl;function fl(e){return _l(e).segments_count}function pl(e){_l(e).segments_count+=1}function ml(e){_l(e).records_count+=1}function hl(e,t){_l(e).segments_total_raw_size+=t}function gl(e){return dl==null?void 0:dl.get(e)}function _l(e){dl||(dl=new Map);let t;return dl.has(e)?t=dl.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},dl.set(e,t),dl.size>1e3&&vl()),t}function vl(){if(!dl)return;let e=dl.keys().next().value;e&&dl.delete(e)}function yl(e,t,n){let r=0,i=[],a,o=!0,s=0,c=[],{stop:l}=sr(e,t,`message`,({data:e})=>{if(e.type!==`wrote`||e.streamId!==n)return;let t=c[0];t&&(t.id===e.id?(c.shift(),r+=e.additionalBytesCount,i.push(e.result),a=e.trailer,t.writeCallback?t.writeCallback(e.result.byteLength):t.finishCallback&&t.finishCallback()):t.id<e.id&&l())});function u(){let e=i.length===0?new Uint8Array:Bc(i.concat(a)),t={rawBytesCount:r,output:e,outputBytesCount:e.byteLength,encoding:`deflate`};return r=0,i=[],t}function d(){o||(t.postMessage({action:`reset`,streamId:n}),o=!0)}return{isAsync:!0,get isEmpty(){return o},write(e,r){t.postMessage({action:`write`,id:s,data:e,streamId:n}),c.push({id:s,writeCallback:r,data:e}),o=!1,s+=1},finish(e){d(),c.length?(c.forEach(e=>{delete e.writeCallback}),c[c.length-1].finishCallback=()=>e(u())):e(u())},finishSync(){d();let e=c.map(e=>e.data).join(``);return c.length=0,{...u(),pendingData:e}},estimateEncodedBytesCount(e){return e.length/8},stop(){l()}}}function bl({configuredUrl:e,error:t,source:n,scriptType:r}){if(hr.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&xl(t.message)){let t;t=e?`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:`Please make sure CSP is correctly configured.`,hr.error(`${t} See documentation at ${yr}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r===`worker`&&nl(t)}function xl(e){return e.includes(`Content Security Policy`)||e.includes(`requires 'TrustedScriptURL'`)}var Sl=30*wr;function Cl(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob([`(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([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]),n=new Uint8Array([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]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;
4if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;
vendor: 8,978 bytes, line 4
4for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>
4=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);
4i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.33.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();`])))}var wl={status:0};function Tl(e,t,n){switch(wl.status===0&&Dl(e,t),wl.status){case 1:return wl.initializationFailureCallbacks.push(n),wl.worker;case 3:return wl.worker}}function El(){return wl.status}function Dl(e,t){try{let n=gc(Cl)(e),{stop:r}=sr(e,n,`error`,n=>{Al(e,t,n)}),{stop:i}=sr(e,n,`message`,({data:n})=>{n.type===`errored`?Al(e,t,n.error,n.streamId):n.type===`initialized`&&kl(n.version)});n.postMessage({action:`init`}),pr(()=>Ol(t),Sl),wl={status:1,worker:n,stop:()=>{r(),i()},initializationFailureCallbacks:[]}}catch(n){Al(e,t,n)}}function Ol(e){wl.status===1&&(hr.error(`${e} failed to start: a timeout occurred while initializing the Worker`),wl.initializationFailureCallbacks.forEach(e=>e()),wl={status:2})}function kl(e){wl.status===1&&(wl={status:3,worker:wl.worker,stop:wl.stop,version:e})}function Al(e,t,n,r){wl.status===1||wl.status===0?(bl({configuredUrl:e.workerUrl,error:n,source:t,scriptType:`worker`}),wl.status===1&&wl.initializationFailureCallbacks.forEach(e=>e()),wl={status:2}):nl(n,{worker_version:wl.status===3&&wl.version,stream_id:r})}function jl(){return typeof Array.from==`function`&&typeof CSSSupportsRule==`function`&&typeof URL.createObjectURL==`function`&&`forEac
4h`in NodeList.prototype}function Ml(e,t,n,r){let i=t.findTrackedSession(),a=Nl(i,r);return cl(e,{viewContext:n.findView(),errorType:a,session:i})}function Nl(e,t){if(!jl())return`browser-not-supported`;if(!e)return`rum-not-tracked`;if(e.sessionReplay===0)return`incorrect-session-plan`;if(!t)return`replay-not-started`}function Pl(e,t){if(!e.metricsEnabled)return{stop:pc};let n,r,i,{unsubscribe:a}=t.subscribe(e=>{switch(e.type){case`start`:n={forced:e.forced,timestamp:br()},r=void 0,i=void 0;break;case`document-ready`:n&&(r=cr(n.timestamp,br()));break;case`recorder-settled`:n&&(i=cr(n.timestamp,br()));break;case`aborted`:case`deflate-encoder-load-failed`:case`recorder-load-failed`:case`succeeded`:a(),n&&rl(`Recorder init metrics`,{metrics:Fl(n.forced,i,cr(n.timestamp,br()),e.type,r)})}});return{stop:a}}function Fl(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}var Il=`modulepreload`,Ll=function(e){return`/`+e},Rl={},zl=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute(`nonce`));function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Ll(t,n),t=s(t),t in Rl)return;Rl[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Il,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Bl(){try{return await gc(Vl)()}catch(e){bl({error:e,source:`Recorder`,scriptType:`module`})}}async function Vl(){return(await zl(()=>import(`./startRecording-CG3ZwIWs.js`),__vite__mapDeps([0,1]))).startRecording}function Hl(e,t,n,r,i,a){let o=0,s;t.subscribe(9,()=>{(o===2||o===3)&&(d(),o=1)}),t.subscribe(10,()=>{o===1&&u()});let c=new uc;Pl(a,c);let l=async l=>{c.notify({type:`start`,forced:l});let[u]=await Promise.all([Kl(c,{type:`recorder-settled`},Bl()),Kl(c,{type:`document-ready`},sl(e,`interactive`))]);if(o!==2){c.notify({type:`aborted`});return}if(!u){o=0,c.notify({type:`recorder-load-failed`});return}let d=i();if(!d){o=0,c.notify({type:`deflate-encoder-load-failed`});return}({stop:s}=u(t,e,n,r,d,a)),o=3,c.notify({type:`succeeded`})};function u(e){let t=n.findTrackedSession();if(Ul(t,e)){o=1;return}if(Wl(o))return;o=2;let r=Gl(t,e)||!1;l(r).catch(Cr),r&&n.setForcedReplay()}function d(){o===3&&(s==null||s()),o=0}return{start:u,stop:d,getSessionReplayLink(){return Ml(e,n,r,o!==0)},isRecording:()=>o===3}}function Ul(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function Wl(e){return e===2||e===3}function Gl(e,t){return t&&t.force&&e.sessionReplay===0}async function Kl(e,t,n){try{return await n}finally{e.notify(t)}}function ql(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:pc},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Jl(){if(Jc()&&!qc(`records`)||!jl())return{start:pc,stop:pc,getReplayStats:()=>void 0,onRumStart:pc,isRecording:()=>!1,getSessionReplayLink:()=>void 0};let{strategy:e,shouldStartImmediately:t}=ql();return{start:t=>e.start(t),stop:()=>e.stop(),getSessionReplayLink:()=>e.getSessionReplayLink(),onRumStart:n,isRecording:()=>El()===3&&e.isRecording(),getReplayStats:e=>El()===3?gl(e):void 0};function n(n,r,i,a,o,s){let c;function l(){return c||(o!=null||(o=Tl(r,`Datadog Session Replay`,()=>e.stop())),o&&(c=yl(r,o,1))),c}e=Hl(r,n,i,a,l,s),t(r)&&e.start()}}function Yl(){return xr().Profiler!==void 0}function Xl(e){let t={status:`starting`};return e.register(0,({eventType:e})=>e!==or.VIEW&&e!==or.LONG_TASK&&e!==or.ACTION&&e!==or.VITAL?Xc:{type:e,_dd:{profiling:t}}),{get:()=>t,set:e=>{t=e}}}async function Zl(){try{return await gc(Ql)()}catch(e){bl({error:e,source:`Profiler`,scriptType:`module`})}}async function Ql(){return(await zl(()=>
4import(`./profiler-qVbQ38fo.js`),__vite__mapDeps([2,1]))).createRumProfiler}function $l(){let e;function t(t,n,r,i,a,o){let s=i.findTrackedSession();if(!s||!ar(s.id,r.profilingSampleRate))return;let c=Xl(n);if(!Yl()){c.set({status:`error`,error_reason:`not-supported-by-browser`});return}Zl().then(n=>{if(!n){c.set({status:`error`,error_reason:`failed-to-lazy-load`});return}e=n(r,t,i,c,o,a,void 0),e.start()}).catch(Cr)}return{onRumStart:t,stop:()=>{e==null||e.stop()}}}var eu=Jl(),tu=$l(),nu=Sr(eu,tu,{startDeflateWorker:Tl,createDeflateEncoder:yl,sdkName:`rum`});Gc(xr(),`DD_RUM`,nu);function ru(){nu.init({applicationId:`2417ccd6-3fd8-4928-8fae-1fde0b78780e`,clientToken:`pubdb9c419402c414a4d38ad5f494812459`,service:`dashboard`,env:`prod`,version:`2c7c636c094a33725a321846ab0cf3954c782494`,sessionSampleRate:10,allowedTracingUrls:[/^https:\/\/.*?internal-api\.browse\.ai/],sessionReplaySampleRate:0,trackResources:!0,trackLongTasks:!1,trackUserInteractions:!1,site:`datadoghq.com`,beforeSend:e=>e.type!==`error`&&(e.view.name=iu(e.view.url),!0)})}function iu(e){let t=new URL(e).pathname;
4return t=t.replace(/\/workspaces\/[^/]+/,`/workspaces/WORKSPACE_SLUG`),t.includes(`/robots/new`)||(t=t.replace(/\/robots\/[^/]+/,`/robots/ROBOT_ID`)),t=t.replace(/\/settings\/[^/]+/,`/settings/USER_ID`),t=t.replace(/^\/invitations\/[^/]+/,`/invitations/INVITATION_ID`),t=t.replace(/\/workflows\/[^/]+/,`/workflows/WORKFLOW_ID`),t=t.replace(/\/bulk-rus\/[^/]+/,`/bulk-runs/BULK_RUN_ID`),t=t.replace(/\/history\/[^/]+/,`/history/HISTORY_ID`),t=t.replace(/\/arcades\/[^/]+/,`/arcades/ARCADE_ID`),t=t.replace(/\/new-robot\/[^/]+/,`/new-robot/SHARED_ROBOT_ID`),t}var au={init:ru};function ou(e){return`"${e.replace(su,cu)}"`}var su=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function cu(e){return lu[e.charCodeAt(0)]}var lu=`\\u0000.\\u0001.\\u0002.\\u0003.\\u0004.\\u0005.\\u0006.\\u0007.\\b.\\t.\\n.\\u000B.\\f.\\r.\\u000E.\\u000F.\\u0010.\\u0011.\\u0012.\\u0013.\\u0014.\\u0015.\\u0016.\\u0017.\\u0018.\\u0019.\\u001A.\\u001B.\\u001C.\\u001D.\\u001E.\\u001F...\\"..........................................................\\\\...................................\\u007F.\\u0080.\\u0081.\\u0082.\\u0083.\\u0084.\\u0085.\\u0086.\\u0087.\\u0088.\\u0089.\\u008A.\\u008B.\\u008C.\\u008D.\\u008E.\\u008F.\\u0090.\\u0091.\\u0092.\\u0093.\\u0094.\\u0095.\\u0096.\\u0097.\\u0098.\\u0099.\\u009A.\\u009B.\\u009C.\\u009D.\\u009E.\\u009F`.split(`.`),uu=Object.freeze({});function du(e,t,n=Nn){let r=new Map;for(let e of Object.values(En))r.set(e,fu(t,e));let i,a=Array.isArray(e),o=[e],s=-1,c=[],l=e,u,d,f=[],p=[];do{s++;let e=s===o.length,_=e&&c.length!==0;if(e){if(u=p.length===0?void 0:f[f.length-1],l=d,d=p.pop(),_){if(a){l=l.slice();let e=0;for(let[t,n]of c){let r=t-e;n===null?(l.splice(r,1),e++):l[r]=n}}else{l={...l};for(let[e,t]of c)l[e]=t}}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d){if(u=a?s:o[s],l=d[u],l==null)continue;f.push(u)}let v;if(!Array.isArray(l)){var m,h;nn(l)||mn(!1,`Invalid AST Node: ${dn(l)}.`);let n=e?(m=r.get(l.kind))==null?void 0:m.leave:(h=r.get(l.kind))==null?void 0:h.enter;if(v=n==null?void 0:n.call(t,l,u,d,f,p),v===uu)break;if(v===!1){if(!e){f.pop();continue}}else if(v!==void 0&&(c.push([u,v]),!e)){if(nn(v))l=v;else{f.pop();continue}}}if(v===void 0&&_&&c.push([u,l]),e)f.pop();else{var g;i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(l),o=a?l:(g=n[l.kind])==null?[]:g,s=-1,c=[],d&&p.push(d),d=l}}while(i!==void 0);return c.length===0?e:c[c.length-1][1]}function fu(e,t){let n=e[t];return typeof n==`object`?n:typeof n==`function`?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function pu(e){return du(e,hu)}var mu=80,hu={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>H(e.definitions,`
5
6`)},OperationDefinition:{leave(e){let t=vu(e.variableDefinitions)?U(`(
7`,H(e.variableDefinitions,`
8`),`
9)`):U(`(`,H(e.variableDefinitions,`, `),`)`),n=U(``,e.description,`
10`)+H([e.operation,H([e.name,t]),H(e.directives,` `)],` `);return(n===`query`?``:n+` `)+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>
10U(``,i,`
11`)+e+`: `+t+U(` = `,n)+U(` `,H(r,` `))},SelectionSet:{leave:({selections:e})=>gu(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=U(``,e,`: `)+t,o=a+U(`(`,H(n,`, `),`)`);return o.length>mu&&(o=a+U(`(
12`,_u(H(n,`
13`)),`
14)`)),H([o,H(r,` `),i],` `)}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,directives:t})=>`...`+e+U(` `,H(t,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>H([`...`,U(`on `,e),H(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>U(``,a,`
15`)+`fragment ${e}${U(`(`,H(n,`, `),`)`)} on ${t} ${U(``,H(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Qt(e):ou(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>`[`+H(e,`, `)+`]`},ObjectValue:{leave:({fields:e})=>`{`+H(e,`, `)+`}`},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+U(`(`,H(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>U(``,e,`
16`)+H([`schema`,H(t,` `),gu(n)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>U(``,e,`
17`)+H([`scalar`,t,H(n,` `)],` `)},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>U(``,e,`
18`)+H([`type`,t,U(`implements `,H(n,` & `)),H(r,` `),gu(i)],` `)},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>U(``,e,`
19`)+t+(vu(n)?U(`(
20`,_u(H(n,`
21`)),`
22)`):U(`(`,H(n,`, `),`)`))+`: `+r+U(` `,H(i,` `))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>U(``,e,`
23`)+H([t+`: `+n,U(`= `,r),H(i,` `)],` `)},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>U(``,e,`
24`)+H([`interface`,t,U(`implements `,H(n,` & `)),H(r,` `),gu(i)],` `)},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>U(``,e,`
25`)+H([`union`,t,H(n,` `),U(`= `,H(r,` | `))],` `)},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>U(``,e,`
26`)+H([`enum`,t,H(n,` `),gu(r)],` `)},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>U(``,e,`
27`)+H([t,H(n,` `)],` `)},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>U(``,e,`
28`)+H([`input`,t,H(n,` `),gu(r)],` `)},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>U(``,e,`
29`)+`directive @`+t+(vu(n)?U(`(
30`,_u(H(n,`
31`)),`
32)`):U(`(`,H(n,`, `),`)`))+U(` `,H(r,` `))+(i?` repeatable`:``)+` on `+H(a,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>H([`extend schema`,H(e,` `),gu(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>H([`extend scalar`,e,H(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>H([`extend type`,e,U(`implements `,H(t,` & `)),H(n,` `),gu(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>H([`extend interface`,e,U(`implements `,H(t,` & `)),H(n,` `),gu(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>H([`extend union`,e,H(t,` `),U(`= `,H(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>H([`extend enum`,e,H(t,` `),gu(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>H([`extend input`,e,H(t,` `),gu(n)],` `)},DirectiveExtension:{leave:({name:e,directives:t})=>H([`extend directive @`+e,H(t,` `)],` `)},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>H([e,U(`.`,t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>H([e,U(`.`,t),U(`(`,n,`:)`)])},DirectiveCoordinate:{leave:({name:e})=>H([`@`,e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>H([`@`,e,U(`(`,t,`:)`)])}};function H(e,t=``){var n;return(n=e==null?void 0:e.filter(e=>e).join(t))==null?``:n}function gu(e){return U(`{
33`,_u(H(e,`
34`)),`
35}`)}function U(e,t,n=``){return t!=null&&t!==``?e+t+n:``}function _u(e){return U(`  `,e.replace(/\n/g,`
36  `))}function vu(e){var t;return(t=e==null?void 0:e.some(e=>e.includes(`
37`)))!=null&&t}function yu(e){return e.kind===En.FIELD||e.kind===En.FRAGMENT_SPREAD||e.kind===En.INLINE_FRAGMENT}function bu(e,t){var n=e.directives;return!n||!n.length||wu(n).every(function(e){var n=e.directive,r=e.ifArgument,i=!1;return r.value.kind===`Variable`?(i=t&&t[r.value.name.value],I(i!==void 0,70,n.name.value)):i=r.value.value,n.name.value===`skip`?!i:i})}function xu(e,t,n){var r=new Set(e),i=r.size;return du(t,{Directive:function(e){if(r.delete(e.name.value)&&(!n||!r.size))return uu}}),n?!r.size:r.size<i}function Su(e){return e&&xu([`client`,`export`],e,!0)}function Cu(e){var t=e.name.value;
37return t===`skip`||t===`include`}function wu(e){var t=[];return e&&e.length&&e.forEach(function(e){if(Cu(e)){var n=e.arguments,r=e.name.value;I(n&&n.length===1,71,r);var i=n[0];I(i.name&&i.name.value===`if`,72,r);var a=i.value;I(a&&(a.kind===`Variable`||a.kind===`BooleanValue`),73,r),t.push({directive:e,ifArgument:i})}}),t}var Tu=()=>Object.create(null),{forEach:Eu,slice:Du}=Array.prototype,{hasOwnProperty:Ou}=Object.prototype,ku=class e{constructor(e=!0,t=Tu){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Eu.call(e,e=>t=t.getChildTrie(e)),Ou.call(t,`data`)?t.data:t.data=this.makeData(Du.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){let r=t.mapFor(e[n],!1);t=r&&r.get(e[n])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){let n=e[0],r=this.mapFor(n,!1),i=r&&r.get(n);i&&(t=i.removeArray(Du.call(e,1)),!i.data&&!i.weak&&!(i.strong&&i.strong.size)&&r.delete(n))}else t=this.data,delete this.data;return t}getChildTrie(t){let n=this.mapFor(t,!0),r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r}mapFor(e,t){return this.weakness&&Au(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}};function Au(e){switch(typeof e){case`object`:if(e===null)break;case`function`:return!0}return!1}function ju(e,t){var n=t,r=[];return e.definitions.forEach(function(e){if(e.kind===`OperationDefinition`)throw rn(74,e.operation,e.name?` named '${e.name.value}'`:``);e.kind===`FragmentDefinition`&&r.push(e)}),n===void 0&&(I(r.length===1,75,r.length),n=r[0].name.value),L(L({},e),{definitions:R([{kind:`OperationDefinition`,operation:`query`,selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:n}}]}}],e.definitions,!0)})}function Mu(e){e===void 0&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function Nu(e,t){switch(e.kind){case`InlineFragment`:return e;case`FragmentSpread`:var n=e.name.value;if(typeof t==`function`)return t(n);var r=t&&t[n];return I(r,76,n),r||null;default:return null}}var Pu=Object.assign(function(e){return JSON.stringify(e,Iu)},{reset:function(){Fu=new Jt(kt.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&An(`canonicalStringify`,function(){return Fu.size});var Fu;Pu.reset();function Iu(e,t){if(t&&typeof t==`object`){var n=Object.getPrototypeOf(t);if(n===Object.prototype||n===null){var r=Object.keys(t);if(r.every(Lu))return t;var i=JSON.stringify(r),a=Fu.get(i);if(!a){r.sort();var o=JSON.stringify(r);a=Fu.get(o)||r,Fu.set(i,a),Fu.set(o,a)}var s=Object.create(n);return a.forEach(function(e){s[e]=t[e]}),s}}return t}function Lu(e,t,n){return t===0||n[t-1]<=e}function Ru(e){return{__ref:String(e)}}function W(e){return!!(e&&typeof e==`object`&&typeof e.__ref==`string`)}function zu(e){return ht(e)&&e.kind===`Document`&&Array.isArray(e.definitions)}function Bu(e){return e.kind===`StringValue`}function Vu(e){return e.kind===`BooleanValue`}function Hu(e){return e.kind===`IntValue`}function Uu(e){return e.kind===`FloatValue`}function Wu(e){return e.kind===`Variable`}function Gu(e){return e.kind===`ObjectValue`}function Ku(e){return e.kind===`ListValue`}function qu(e){return e.kind===`EnumValue`}function Ju(e){return e.kind===`NullValue`}function Yu(e,t,n,r){if(Hu(n)||Uu(n))e[t.value]=Number(n.value);else if(Vu(n)||Bu(n))e[t.value]=n.value;else if(Gu(n)){var i={};n.fields.map(function(e){return Yu(i,e.name,e.value,r)}),e[t.value]=i}else if(Wu(n)){var a=(r||{})[n.name.value];e[t.value]=a}else if(Ku(n))e[t.value]=n.values.map(function(e){var n={};return Yu(n,t,e,r),n[t.value]});else if(qu(n))e[t.value]=n.value;else if(Ju(n))e[t.value]=null;else throw rn(85,t.value,n.kind)}function Xu(e,t){var n=null;e.directives&&(n={},e.directives.forEach(function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach(function(r){var i=r.name,a=r.value;return Yu(n[e.name.value],i,a,t)})}));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(function(e){var n=e.name,i=e.value;return Yu(r,n,i,t)})),$u(e.name.value,r,n)}
37var Zu=[`connection`,`include`,`skip`,`client`,`rest`,`export`,`nonreactive`],Qu=Pu,$u=Object.assign(function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(e){i[e]=t[e]}),`${n.connection.key}(${Qu(i)})`}return n.connection.key}var a=e;if(t){var o=Qu(t);a+=`(${o})`}return n&&Object.keys(n).forEach(function(e){Zu.indexOf(e)===-1&&(n[e]&&Object.keys(n[e]).length?a+=`@${e}(${Qu(n[e])})`:a+=`@${e}`)}),a},{setStringify:function(e){var t=Qu;return Qu=e,t}});function ed(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach(function(e){var r=e.name,i=e.value;return Yu(n,r,i,t)}),n}return null}function td(e){return e.alias?e.alias.value:e.name.value}function nd(e,t,n){for(var r,i=0,a=t.selections;i<a.length;i++){var o=a[i];if(rd(o)){if(o.name.value===`__typename`)return e[td(o)]}else r?r.push(o):r=[o]}if(typeof e.__typename==`string`)return e.__typename;if(r)for(var s=0,c=r;s<c.length;s++){var o=c[s],l=nd(e,Nu(o,n).selectionSet,n);if(typeof l==`string`)return l}}function rd(e){return e.kind===`Field`}function id(e){return e.kind===`InlineFragment`}function ad(e){I(e&&e.kind===`Document`,77);var t=e.definitions.filter(function(e){return e.kind!==`FragmentDefinition`}).map(function(e){if(e.kind!==`OperationDefinition`)throw rn(78,e.kind);return e});return I(t.length<=1,79,t.length),e}function od(e){return ad(e),e.definitions.filter(function(e){return e.kind===`OperationDefinition`})[0]}function sd(e){return e.definitions.filter(function(e){return e.kind===`OperationDefinition`&&!!e.name}).map(function(e){return e.name.value})[0]||null}function cd(e){return e.definitions.filter(function(e){return e.kind===`FragmentDefinition`})}function ld(e){var t=od(e);return I(t&&t.operation===`query`,80),t}function ud(e){I(e.kind===`Document`,81),I(e.definitions.length<=1,82);var t=e.definitions[0];return I(t.kind===`FragmentDefinition`,83),t}function dd(e){ad(e);for(var t,n=0,r=e.definitions;n<r.length;n++){var i=r[n];if(i.kind===`OperationDefinition`){var a=i.operation;if(a===`query`||a===`mutation`||a===`subscription`)return i}i.kind===`FragmentDefinition`&&!t&&(t=i)}if(t)return t;throw rn(84)}function fd(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach(function(e){e.defaultValue&&Yu(t,e.variable.name,e.defaultValue)}),t}var pd=()=>Object.create(null),{forEach:md,slice:hd}=Array.prototype,{hasOwnProperty:gd}=Object.prototype,_d=class e{constructor(e=!0,t=pd){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return md.call(e,e=>t=t.getChildTrie(e)),gd.call(t,`data`)?t.data:t.data=this.makeData(hd.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){let r=this.weakness&&vd(e[n])?t.weak:t.strong;t=r&&r.get(e[n])}return t&&t.data}getChildTrie(t){let n=this.weakness&&vd(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r}};function vd(e){switch(typeof e){case`object`:if(e===null)break;case`function`:return!0}return!1}var yd=null,bd={},xd=1,Sd=()=>class{constructor(){this.id=[`slot`,xd++,Date.now(),Math.random().toString(36).slice(2)].join(`:`)}hasValue(){for(let e=yd;e;e=e.parent)if(this.id in e.slots){let t=e.slots[this.id];if(t===bd)break;return e!==yd&&(yd.slots[this.id]=t),!0}return yd&&(yd.slots[this.id]=bd),!1}getValue(){if(this.hasValue())return yd.slots[this.id]}withValue(e,t,n,r){let i={__proto__:null,[this.id]:e},a=yd;
37yd={parent:a,slots:i};try{return t.apply(r,n)}finally{yd=a}}static bind(e){let t=yd;return function(){let n=yd;try{return yd=t,e.apply(this,arguments)}finally{yd=n}}}static noContext(e,t,n){if(yd){let r=yd;try{return yd=null,e.apply(n,t)}finally{yd=r}}else return e.apply(n,t)}};function Cd(e){try{return e()}catch{}}var wd=`@wry/context:Slot`,Td=Cd(()=>globalThis)||Cd(()=>globalThis)||Object.create(null),Ed=Td[wd]||Array[wd]||(function(e){try{Object.defineProperty(Td,wd,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}})(Sd()),{bind:Dd,noContext:Od}=Ed,kd=new Ed,{hasOwnProperty:Ad}=Object.prototype,jd=Array.from||function(e){let t=[];return e.forEach(e=>t.push(e)),t};function Md(e){let{unsubscribe:t}=e;typeof t==`function`&&(e.unsubscribe=void 0,t())}var Nd=[],Pd=100;function Fd(e,t){if(!e)throw Error(t||`assertion failure`)}function Id(e,t){let n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function Ld(e){switch(e.length){case 0:throw Error(`unknown value`);case 1:return e[0];case 2:throw e[1]}}function Rd(e){return e.slice(0)}var zd=class e{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}peek(){if(this.value.length===1&&!Ud(this))return Bd(this),this.value[0]}recompute(e){return Fd(!this.recomputing,`already recomputing`),Bd(this),Ud(this)?Vd(this,e):Ld(this.value)}setDirty(){this.dirty||(this.dirty=!0,Gd(this),Md(this))}dispose(){this.setDirty(),Zd(this),qd(this,(e,t)=>{e.setDirty(),Qd(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=Nd.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(jd(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),Nd.push(this.deps),this.deps=null)}};zd.count=0;function Bd(e){let t=kd.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Ud(e)?Jd(t,e):Yd(t,e),t}function Vd(e,t){return Zd(e),kd.withValue(e,Hd,[e,t]),$d(e,t)&&Wd(e),Ld(e.value)}function Hd(e,t){e.recomputing=!0;let{normalizeResult:n}=e,r;n&&e.value.length===1&&(r=Rd(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!Id(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch{}}catch(t){e.value[1]=t}e.recomputing=!1}function Ud(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function Wd(e){e.dirty=!1,!Ud(e)&&Kd(e)}function Gd(e){qd(e,Jd)}function Kd(e){qd(e,Yd)}function qd(e,t){let n=e.parents.size;if(n){let r=jd(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function Jd(e,t){Fd(e.childValues.has(t)),Fd(Ud(t));let n=!Ud(e);if(!e.dirtyChildren)e.dirtyChildren=Nd.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),n&&Gd(e)}function Yd(e,t){Fd(e.childValues.has(t)),Fd(!Ud(t));let n=e.childValues.get(t);n.length===0?e.childValues.set(t,Rd(t.value)):Id(n,t.value)||e.setDirty(),Xd(e,t),!Ud(e)&&Kd(e)}function Xd(e,t){let n=e.dirtyChildren;n&&(n.delete(t),n.size===0&&(Nd.length<Pd&&Nd.push(n),e.dirtyChildren=null))}function Zd(e){e.childValues.size>0&&e.childValues.forEach((t,n)=>{Qd(e,n)}),e.forgetDeps(),Fd(e.dirtyChildren===null)}function Qd(e,t){t.parents.delete(e),e.childValues.delete(t),Xd(e,t)}function $d(e,t){if(typeof e.subscribe==`function`)try{Md(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}var ef={setDirty:!0,dispose:!0,forget:!0};function tf(e){let t=new Map,n=e&&e.subscribe;function r(e){let r=kd.getValue();if(r){let i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),typeof n==`function`&&(Md(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){let r=t.get(e);if(r){let i=n&&Ad.call(ef,n)?n:`setDirty`;jd(r).forEach(e=>e[i]()),t.delete(e),Md(r)}},r}var nf;function rf(...e){return(nf||(nf=new _d(typeof WeakMap==`function`))).lookupArray(e)}var af=new Set;function of(e,{max:t=2**16,keyArgs:n,makeCacheKey:r=rf,normalizeResult:i,subscribe:a,cache:o=zt}=Object.create(null)){let s=typeof o==`function`?new o(t,e=>e.dispose()):o,c=function(){let t=r.apply(null,n?n.apply(null,arguments):arguments);if(t===void 0)return e.apply(null,arguments);let o=s.get(t);o||(s.set(t,o=new zd(e)),o.normalizeResult=i,o.subscribe=a,o.forget=()=>s.delete(t));let c=o.recompute(Array.prototype.slice.call(arguments));
37return s.set(t,o),af.add(s),kd.hasValue()||(af.forEach(e=>e.clean()),af.clear()),c};Object.defineProperty(c,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:a,cache:s});function l(e){let t=e&&s.get(e);t&&t.setDirty()}c.dirtyKey=l,c.dirty=function(){l(r.apply(null,arguments))};function u(e){let t=e&&s.get(e);if(t)return t.peek()}c.peekKey=u,c.peek=function(){return u(r.apply(null,arguments))};function d(e){return e?s.delete(e):!1}return c.forgetKey=d,c.forget=function(){return d(r.apply(null,arguments))},c.makeCacheKey=r,c.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(c)}function sf(e){return e}var cf=function(){function e(e,t){t===void 0&&(t=Object.create(null)),this.resultCache=Mn?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=t.cache!==!1,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(sf,{cache:!1})},e.split=function(t,n,r){return r===void 0&&(r=e.identity()),Object.assign(new e(function(e){return(t(e)?n:r).transformDocument(e)},{cache:!1}),{left:n,right:r})},e.prototype.resetCache=function(){var t=this;if(this.cached){var n=new ku(Sn);this.performWork=of(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var r=t.getCacheKey(e);if(r)return I(Array.isArray(r),69),n.lookupArray(r)},max:kt[`documentTransform.cache`],cache:Xt})}},e.prototype.performWork=function(e){return ad(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var n=this;return Object.assign(new e(function(e){return t.transformDocument(n.transformDocument(e))},{cache:!1}),{left:this,right:t})},e}(),lf,uf=Object.assign(function(e){var t=lf.get(e);return t||(t=pu(e),lf.set(e,t)),t},{reset:function(){lf=new qt(kt.print||2e3)}});uf.reset(),globalThis.__DEV__!==!1&&An(`print`,function(){return lf?lf.size:0});var df={kind:En.FIELD,name:{kind:En.NAME,value:`__typename`}};function ff(e,t){return!e||e.selectionSet.selections.every(function(e){return e.kind===En.FRAGMENT_SPREAD&&ff(t[e.name.value],t)})}function pf(e){return ff(od(e)||ud(e),Mu(cd(e)))?null:e}function mf(e){var t=new Map,n=new Map;return e.forEach(function(e){e&&(e.name?t.set(e.name,e):e.test&&n.set(e.test,e))}),function(e){var r=t.get(e.name.value);return!r&&n.size&&n.forEach(function(t,n){n(e)&&(r=t)}),r}}function hf(e){var t=new Map;return function(n){n===void 0&&(n=e);var r=t.get(n);return r||t.set(n,r={variables:new Set,fragmentSpreads:new Set}),r}}function gf(e,t){ad(t);for(var n=hf(``),r=hf(``),i=function(e){for(var t=0,i=void 0;t<e.length&&(i=e[t]);++t)if(!Et(i)){if(i.kind===En.OPERATION_DEFINITION)return n(i.name&&i.name.value);if(i.kind===En.FRAGMENT_DEFINITION)return r(i.name.value)}return globalThis.__DEV__!==!1&&I.error(86),null},a=0,o=t.definitions.length-1;o>=0;--o)t.definitions[o].kind===En.OPERATION_DEFINITION&&++a;var s=mf(e),c=function(e){return Wt(e)&&e.map(s).some(function(e){return e&&e.remove})},l=new Map,u=!1,d={enter:function(e){if(c(e.directives))return u=!0,null}},f=du(t,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,a){var o=i(a);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,a){if(c(e.directives))return u=!0,null;var o=i(a);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){l.set(JSON.stringify(r),e)},leave:function(e,t,n,i){if(e===l.get(JSON.stringify(i)))return e;if(a>0&&e.selectionSet.selections.every(function(e){return e.kind===En.FIELD&&e.name.value===`__typename`}))return r(e.name.value).removed=!0,u=!0,null}},Directive:{leave:function(e){if(s(e))return u=!0,null}}});if(!u)return t;var p=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(function(t){p(r(t)).transitiveVars.forEach(function(t){e.transitiveVars.add(t)})}
37)),e},m=new Set;f.definitions.forEach(function(e){e.kind===En.OPERATION_DEFINITION?p(n(e.name&&e.name.value)).fragmentSpreads.forEach(function(e){m.add(e)}):e.kind===En.FRAGMENT_DEFINITION&&a===0&&!r(e.name.value).removed&&m.add(e.name.value)}),m.forEach(function(e){p(r(e)).fragmentSpreads.forEach(function(e){m.add(e)})});var h=function(e){return!!(!m.has(e)||r(e).removed)},g={enter:function(e){if(h(e.name.value))return null}};return pf(du(f,{FragmentSpread:g,FragmentDefinition:g,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return L(L({},e),{variableDefinitions:e.variableDefinitions.filter(function(e){return t.has(e.variable.name.value)})})}}}}))}var _f=Object.assign(function(e){return du(e,{SelectionSet:{enter:function(e,t,n){if(!(n&&n.kind===En.OPERATION_DEFINITION)){var r=e.selections;if(r&&!r.some(function(e){return rd(e)&&(e.name.value===`__typename`||e.name.value.lastIndexOf(`__`,0)===0)})){var i=n;if(!(rd(i)&&i.directives&&i.directives.some(function(e){return e.name.value===`export`})))return L(L({},e),{selections:R(R([],r,!0),[df],!1)})}}}}})},{added:function(e){return e===df}});function vf(e){return dd(e).operation===`query`?e:du(e,{OperationDefinition:{enter:function(e){return L(L({},e),{operation:`query`})}}})}function yf(e){return ad(e),gf([{test:function(e){return e.name.value===`client`},remove:!0}],e)}var bf=Object.prototype.hasOwnProperty;function xf(){return Sf([...arguments])}function Sf(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new wf,i=1;i<n;++i)t=r.merge(t,e[i]);return t}var Cf=function(e,t,n){return this.merge(e[n],t[n])},wf=function(){function e(e){e===void 0&&(e=Cf),this.reconciler=e,this.isObject=ht,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var n=this,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return ht(t)&&ht(e)?(Object.keys(t).forEach(function(i){if(bf.call(e,i)){var a=e[i];if(t[i]!==a){var o=n.reconciler.apply(n,R([e,t,i],r,!1));o!==a&&(e=n.shallowCopyForMerge(e),e[i]=o)}}else e=n.shallowCopyForMerge(e),e[i]=t[i]}),e):t},e.prototype.shallowCopyForMerge=function(e){return ht(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):L({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}();function Tf(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=Ef(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
38In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ef(e,t){if(e){if(typeof e==`string`)return Df(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Df(e,t)}}function Df(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Of(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kf(e,t,n){return t&&Of(e.prototype,t),n&&Of(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var Af=function(){return typeof Symbol==`function`},jf=function(e){return Af()&&!!Symbol[e]},Mf=function(e){return jf(e)?Symbol[e]:`@@`+e};Af()&&!jf(`observable`)&&(Symbol.observable=Symbol(`observable`));var Nf=Mf(`iterator`),Pf=Mf(`observable`),Ff=Mf(`species`);function If(e,t){var n=e[t];if(n!=null){if(typeof n!=`function`)throw TypeError(n+` is not a function`);return n}}function Lf(e){var t=e.constructor;return t!==void 0&&(t=t[Ff],t===null&&(t=void 0)),t===void 0?G:t}function Rf(e){return e instanceof G}function zf(e){zf.log?zf.log(e):setTimeout(function(){throw e})}function Bf(e){Promise.resolve().then(function(){try{e()}catch(e){zf(e)}})}function Vf(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,t))try{if(typeof t==`function`)t();else{var n=If(t,`unsubscribe`);n&&n.call(t)}}catch(e){zf(e)}}function Hf(e){e._observer=void 0,e._queue=void 0,e._state=`closed`}function Uf(e){var t=e._queue;if(t){e._queue=void 0,e._state=`ready`;for(var n=0;n<t.length&&(Wf(e,t[n].type,t[n].value),e._state!==`closed`);++n);}}function Wf(e,t,n){e._state=`running`;var r=e._observer;try{var i=If(r,t);switch(t){case`next`:i&&i.call(r,n);break;case`error`:if(Hf(e),i)i.call(r,n);else throw n;break;case`complete`:Hf(e),i&&i.call(r)}}catch(e){zf(e)}
38e._state===`closed`?Vf(e):e._state===`running`&&(e._state=`ready`)}function Gf(e,t,n){if(e._state!==`closed`){if(e._state===`buffering`){e._queue.push({type:t,value:n});return}if(e._state!==`ready`){e._state=`buffering`,e._queue=[{type:t,value:n}],Bf(function(){return Uf(e)});return}Wf(e,t,n)}}var Kf=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state=`initializing`;var n=new qf(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}this._state===`initializing`&&(this._state=`ready`)}var t=e.prototype;return t.unsubscribe=function(){this._state!==`closed`&&(Hf(this),Vf(this))},kf(e,[{key:`closed`,get:function(){return this._state===`closed`}}]),e}(),qf=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){Gf(this._subscription,`next`,e)},t.error=function(e){Gf(this._subscription,`error`,e)},t.complete=function(){Gf(this._subscription,`complete`)},kf(e,[{key:`closed`,get:function(){return this._subscription._state===`closed`}}]),e}(),G=function(){function e(t){if(!(this instanceof e))throw TypeError(`Observable cannot be called as a function`);if(typeof t!=`function`)throw TypeError(`Observable initializer must be a function`);this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return(typeof e!=`object`||!e)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new Kf(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise(function(n,r){if(typeof e!=`function`){r(TypeError(e+` is not a function`));return}function i(){a.unsubscribe(),n()}var a=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),a.unsubscribe()}},error:r,complete:n})})},t.map=function(e){var t=this;if(typeof e!=`function`)throw TypeError(e+` is not a function`);return new(Lf(this))(function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})})},t.filter=function(e){var t=this;if(typeof e!=`function`)throw TypeError(e+` is not a function`);return new(Lf(this))(function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})})},t.reduce=function(e){var t=this;if(typeof e!=`function`)throw TypeError(e+` is not a function`);var n=Lf(this),r=arguments.length>1,i=!1,a=arguments[1];return new n(function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(TypeError(`Cannot reduce an empty sequence`));n.next(a),n.complete()}})})},t.concat=function(){var e=this,t=[...arguments],n=Lf(this);return new n(function(r){var i,a=0;function o(e){i=e.subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){a===t.length?(i=void 0,r.complete()):o(n.from(t[a++]))}})}return o(e),function(){i&&(i.unsubscribe(),i=void 0)}})},t.flatMap=function(e){var t=this;if(typeof e!=`function`)throw TypeError(e+` is not a function`);var n=Lf(this);return new n(function(r){var i=[],a=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var a=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(a);e>=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){r.error(e)},complete:function(){o()}});function o(){a.closed&&i.length===0&&r.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),a.unsubscribe()}})},t[Pf]=function(){return this},e.from=function(t){var n=typeof this==`function`?this:e;if(t==null)throw TypeError(t+` is not an object`);var r=If(t,Pf);if(r){var i=r.call(t);if(Object(i)!==i)throw TypeError(i+` is not an object`);return Rf(i)&&i.constructor===n?i:new n(function(e){return i.subscribe(e)})}if(jf(`iterator`)&&(r=If(t,Nf),r))return new n(function(e){Bf(function(){if(!e.closed){for(var n=Tf(r.call(t)),i;!(i=n()).done;){var a=i.value;if(e.next(a),e.closed)return}e.complete()}})});if(Array.isArray(t))return new n(function(e){Bf(function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}})});throw TypeError(t+` is not observable`)},e.of=function(){var t=[...arguments];return new(typeof this==`function`?this:e)(function(e){Bf(function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}})})},kf(e,null,[{key:Ff,get:function(){return this}}]),e}();Af()&&Object.defineProperty(G,Symbol(`extensions`),{value:{symbol:Pf,hostReportError:zf},configurable:!0});var Jf=Object.prototype.toString;function Yf(e){return Xf(e)}function Xf(e,t){switch(Jf.call(e)){case`[object Array]`:if(t=t||new Map,t.has(e))return t.get(e);var n=e.slice(0);
38return t.set(e,n),n.forEach(function(e,r){n[r]=Xf(e,t)}),n;case`[object Object]`:if(t=t||new Map,t.has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach(function(n){r[n]=Xf(e[n],t)}),r;default:return e}}function Zf(e,t,n){var r=[];e.forEach(function(e){return e[t]&&r.push(e)}),r.forEach(function(e){return e[t](n)})}function Qf(e,t,n){return new G(function(r){var i={then:function(e){return new Promise(function(t){return t(e())})}};function a(e,t){return function(n){if(e){var a=function(){return r.closed?0:e(n)};i=i.then(a,a).then(function(e){return r.next(e)},function(e){return r.error(e)})}else r[t](n)}}var o={next:a(t,`next`),error:a(n,`error`),complete:function(){i.then(function(){return r.complete()})}},s=e.subscribe(o);return function(){return s.unsubscribe()}})}function $f(e){function t(t){Object.defineProperty(e,t,{value:G})}return In&&Symbol.species&&t(Symbol.species),t(`@@species`),e}function ep(e){return e&&typeof e.then==`function`}var tp=function(e){en(t,e);function t(t){var n=e.call(this,function(e){return n.addObserver(e),function(){return n.removeObserver(e)}})||this;return n.observers=new Set,n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),n.handlers={next:function(e){n.sub!==null&&(n.latest=[`next`,e],n.notify(`next`,e),Zf(n.observers,`next`,e))},error:function(e){var t=n.sub;t!==null&&(t&&setTimeout(function(){return t.unsubscribe()}),n.sub=null,n.latest=[`error`,e],n.reject(e),n.notify(`error`,e),Zf(n.observers,`error`,e))},complete:function(){var e=n,t=e.sub,r=e.sources,i=r===void 0?[]:r;if(t!==null){var a=i.shift();a?ep(a)?a.then(function(e){return n.sub=e.subscribe(n.handlers)},n.handlers.error):n.sub=a.subscribe(n.handlers):(t&&setTimeout(function(){return t.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]===`next`?n.resolve(n.latest[1]):n.resolve(),n.notify(`complete`),Zf(n.observers,`complete`))}}},n.nextResultListeners=new Set,n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.error(e)},n.promise.catch(function(e){}),typeof t==`function`&&(t=[new G(t)]),ep(t)?t.then(function(e){return n.start(e)},n.handlers.error):n.start(t),n}return t.prototype.start=function(e){this.sub===void 0&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),this.sub===null&&t===`next`&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var n=this.nextResultListeners;n.size&&(this.nextResultListeners=new Set,n.forEach(function(n){return n(e,t)}))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add(function(n,r){t||(t=!0,e(n,r))})},t}(G);$f(tp);function np(e){return`incremental`in e}function rp(e){return`hasNext`in e&&`data`in e}function ip(e){return np(e)||rp(e)}function ap(e){return ht(e)&&`payload`in e}function op(e,t){var n=e,r=new wf;return np(t)&&Wt(t.incremental)&&t.incremental.forEach(function(e){for(var t=e.data,i=e.path,a=i.length-1;a>=0;--a){var o=i[a],s=isNaN(+o)?{}:[];s[o]=t,t=s}n=r.merge(n,t)}),n}function sp(e){var t=cp(e);return Wt(t)}function cp(e){var t=Wt(e.errors)?e.errors.slice(0):[];return np(e)&&Wt(e.incremental)&&e.incremental.forEach(function(e){e.errors&&t.push.apply(t,e.errors)}),t}function lp(e){return new G(function(t){t.error(e)})}var up=function(e,t,n){var r=Error(n);throw r.name=`ServerError`,r.response=e,r.statusCode=e.status,r.result=t,r};function dp(e){for(var t=[`query`,`operationName`,`variables`,`extensions`,`context`],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(t.indexOf(i)<0)throw rn(44,i)}return e}function fp(e,t){var n=L({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=typeof e==`function`?L(L({},n),e(n)):L(L({},n),e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return L({},n)}}),t}function pp(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query==`string`?``:sd(t.query)||void 0),t}function mp(e,t){var n=L({},e),r=new Set(Object.keys(e));return du(t,{Variable:function(e,t,n){n&&n.kind!==`VariableDefinition`&&r.delete(e.name.value)}}),r.forEach(function(e){delete n[e]}),n}function hp(e,t){return t?t(e):G.of()}function gp(e){return typeof e==`function`?new vp(e):e}function _p(e){return e.request.length<=1}var vp=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e(function(){return G.of()})},e.from=function(t){return t.length===0?e.empty():t.map(gp).reduce(function(e,t){return e.concat(t)})},e.split=function(t,n,r){var i=gp(n),a=gp(r||new e(hp)),o=_p(i)&&_p(a)?new e(function(e){return t(e)?i.request(e)||G.of():a.request(e)||G.of()}):new e(function(e,n){return t(e)?i.request(e,n)||G.of():a.request(e,n)||G.of()});return Object.assign(o,{left:i,right:a})},e.execute=function(e,t){return e.request(fp(t.context,pp(dp(t))))||G.of()},e.concat=function(t,n){var r=gp(t);if(_p(r))return globalThis.__DEV__!==!1&&I.warn(36,r),r;var i=gp(n),a=_p(i)?new e(function(e){return r.request(e,function(e){return i.request(e)||G.of()})||G.of()}):new e(function(e,t){return r.request(e,function(e){return i.request(e,t)||G.of()})||G.of()});return Object.assign(a,{left:r,right:i})},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(hp)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw rn(37)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),yp=vp.from,bp=vp.execute;function xp(e){var t,n=e[Symbol.asyncIterator]();return t={next:function(){return n.next()}},t[Symbol.asyncIterator]=function(){return this},t}function Sp(e){var t=null,n=null,r=!1,i=[],a=[];
38function o(e){if(!n){if(a.length){var t=a.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function s(e){n=e,a.slice().forEach(function(t){t[1](e)}),!t||t()}function c(){r=!0,a.slice().forEach(function(e){e[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener(`data`,o),e.removeListener(`error`,s),e.removeListener(`end`,c),e.removeListener(`finish`,c),e.removeListener(`close`,c)},e.on(`data`,o),e.on(`error`,s),e.on(`end`,c),e.on(`finish`,c),e.on(`close`,c);function l(){return new Promise(function(e,t){if(n)return t(n);if(i.length)return e({value:i.shift(),done:!1});if(r)return e({value:void 0,done:!0});a.push([e,t])})}var u={next:function(){return l()}};return an&&(u[Symbol.asyncIterator]=function(){return this}),u}function Cp(e){var t=!1,n={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(t,n){e.then(function(e){t({value:e,done:!1})}).catch(n)}))}};return an&&(n[Symbol.asyncIterator]=function(){return this}),n}function wp(e){var t={next:function(){return e.read()}};return an&&(t[Symbol.asyncIterator]=function(){return this}),t}function Tp(e){return!!e.body}function Ep(e){return!!e.getReader}function Dp(e){return!!(an&&e[Symbol.asyncIterator])}function Op(e){return!!e.stream}function kp(e){return!!e.arrayBuffer}function Ap(e){return!!e.pipe}function jp(e){var t=e;if(Tp(e)&&(t=e.body),Dp(t))return xp(t);if(Ep(t))return wp(t.getReader());if(Op(t))return wp(t.stream().getReader());if(kp(t))return Cp(t.arrayBuffer());if(Ap(t))return Sp(t);throw Error(`Unknown body type for responseIterator. Please pass a streamable response.`)}var Mp=Object.prototype.hasOwnProperty;function Np(e,t){return Vn(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T;return zn(this,function(E){switch(E.label){case 0:if(TextDecoder===void 0)throw Error(`TextDecoder must be defined in the environment: please import a polyfill.`);n=new TextDecoder(`utf-8`),r=(T=e.headers)==null?void 0:T.get(`content-type`),i=`boundary=`,a=r!=null&&r.includes(i)?r==null?void 0:r.substring((r==null?void 0:r.indexOf(i))+i.length).replace(/['"]/g,``).replace(/\;(.*)/gm,``).trim():`-`,o=`\r
39--${a}`,s=``,c=jp(e),l=!0,E.label=1;case 1:return l?[4,c.next()]:[3,3];case 2:for(u=E.sent(),d=u.value,f=u.done,p=typeof d==`string`?d:n.decode(d),m=s.length-o.length+1,l=!f,s+=p,h=s.indexOf(o,m);h>-1;){if(g=void 0,C=[s.slice(0,h),s.slice(h+o.length)],g=C[0],s=C[1],_=g.indexOf(`\r
40\r
41`),v=Pp(g.slice(0,_)),y=v[`content-type`],y&&y.toLowerCase().indexOf(`application/json`)===-1)throw Error(`Unsupported patch content type: application/json is required.`);if(b=g.slice(_),b){if(x=Fp(e,b),Object.keys(x).length>1||`data`in x||`incremental`in x||`errors`in x||`payload`in x){if(ap(x)){if(S={},`payload`in x){if(Object.keys(x).length===1&&x.payload===null)return[2];S=L({},x.payload)}`errors`in x&&(S=L(L({},S),{extensions:L(L({},`extensions`in S?S.extensions:null),(w={},w[Ot]=x.errors,w))})),t(S)}else t(x)}else if(Object.keys(x).length===1&&`hasNext`in x&&!x.hasNext)return[2]}h=s.indexOf(o)}return[3,1];case 3:return[2]}})})}function Pp(e){var t={};return e.split(`
42`).forEach(function(e){var n=e.indexOf(`:`);if(n>-1){var r=e.slice(0,n).trim().toLowerCase();t[r]=e.slice(n+1).trim()}}),t}function Fp(e,t){e.status>=300&&up(e,function(){try{return JSON.parse(t)}catch{return t}}(),`Response not successful: Received status code ${e.status}`);try{return JSON.parse(t)}catch(r){var n=r;throw n.name=`ServerParseError`,n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function Ip(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function Lp(e){return function(t){return t.text().then(function(e){return Fp(t,e)}).then(function(n){return!Array.isArray(n)&&!Mp.call(n,`data`)&&!Mp.call(n,`errors`)&&up(t,n,`Server response was missing for query '${Array.isArray(e)?e.map(function(e){return e.operationName}):e.operationName}'.`),n})}}var Rp=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=rn(40,t,e.message);throw r.parseError=e,r}return n},zp={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:`*/*`,"content-type":`application/json`},options:{method:`POST`}},Bp=function(e,t){return t(e)};function Vp(e,t){var n=[...arguments].slice(2),r={},i={};
42n.forEach(function(e){r=L(L(L({},r),e.options),{headers:L(L({},r.headers),e.headers)}),e.credentials&&(r.credentials=e.credentials),i=L(L({},i),e.http)}),r.headers&&(r.headers=Hp(r.headers,i.preserveHeaderCase));var a=e.operationName,o=e.extensions,s=e.variables,c=e.query,l={operationName:a,variables:s};return i.includeExtensions&&(l.extensions=o),i.includeQuery&&(l.query=t(c,uf)),{options:r,body:l}}function Hp(e,t){if(!t){var n={};return Object.keys(Object(e)).forEach(function(t){n[t.toLowerCase()]=e[t]}),n}var r={};Object.keys(Object(e)).forEach(function(t){r[t.toLowerCase()]={originalName:t,value:e[t]}});var i={};return Object.keys(r).forEach(function(e){i[r[e].originalName]=r[e].value}),i}var Up=function(e){if(!e&&typeof fetch>`u`)throw rn(38)},Wp=function(e,t){return e.getContext().uri||(typeof t==`function`?t(e):t||`/graphql`)};function Gp(e,t){var n=[],r=function(e,t){n.push(`${e}=${encodeURIComponent(t)}`)};if(`query`in t&&r(`query`,t.query),t.operationName&&r(`operationName`,t.operationName),t.variables){var i=void 0;try{i=Rp(t.variables,`Variables map`)}catch(e){return{parseError:e}}r(`variables`,i)}if(t.extensions){var a=void 0;try{a=Rp(t.extensions,`Extensions map`)}catch(e){return{parseError:e}}r(`extensions`,a)}var o=``,s=e,c=e.indexOf(`#`);c!==-1&&(o=e.substr(c),s=e.substr(0,c));var l=s.indexOf(`?`)===-1?`?`:`&`;return{newURI:s+l+n.join(`&`)+o}}var Kp=yn(function(){return fetch}),qp=function(e){e===void 0&&(e={});var t=e.uri,n=t===void 0?`/graphql`:t,r=e.fetch,i=e.print,a=i===void 0?Bp:i,o=e.includeExtensions,s=e.preserveHeaderCase,c=e.useGETForQueries,l=e.includeUnusedVariables,u=l!==void 0&&l,d=vt(e,[`uri`,`fetch`,`print`,`includeExtensions`,`preserveHeaderCase`,`useGETForQueries`,`includeUnusedVariables`]);globalThis.__DEV__!==!1&&Up(r||Kp);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new vp(function(e){var t=Wp(e,n),i=e.getContext(),o={};if(i.clientAwareness){var s=i.clientAwareness,l=s.name,d=s.version;l&&(o[`apollographql-client-name`]=l),d&&(o[`apollographql-client-version`]=d)}var p=L(L({},o),i.headers),m={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:p};if(xu([`client`],e.query)){var h=yf(e.query);if(!h)return lp(Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=h}var g=Vp(e,a,zp,f,m),_=g.options,v=g.body;v.variables&&!u&&(v.variables=mp(v.variables,e.query));var y;!_.signal&&typeof AbortController<`u`&&(y=new AbortController,_.signal=y.signal);var b=function(e){return e.kind===`OperationDefinition`&&e.operation===`mutation`},x=function(e){return e.kind===`OperationDefinition`&&e.operation===`subscription`}(dd(e.query)),S=xu([`defer`],e.query);if(c&&!e.query.definitions.some(b)&&(_.method=`GET`),S||x){_.headers=_.headers||{};var C=`multipart/mixed;`;
42x&&S&&globalThis.__DEV__!==!1&&I.warn(39),x?C+=`boundary=graphql;subscriptionSpec=1.0,application/json`:S&&(C+=`deferSpec=20220824,application/json`),_.headers.accept=C}if(_.method===`GET`){var w=Gp(t,v),T=w.newURI,E=w.parseError;if(E)return lp(E);t=T}else try{_.body=Rp(v,`Payload`)}catch(e){return lp(e)}return new G(function(n){var i=r||yn(function(){return fetch})||Kp,a=n.next.bind(n);return i(t,_).then(function(t){var n;e.setContext({response:t});var r=(n=t.headers)==null?void 0:n.get(`content-type`);return r!==null&&/^multipart\/mixed/i.test(r)?Np(t,a):Lp(e)(t).then(a)}).then(function(){y=void 0,n.complete()}).catch(function(e){y=void 0,Ip(e,n)}),function(){y&&y.abort()}})})},Jp=function(e){en(t,e);function t(t){t===void 0&&(t={});var n=e.call(this,qp(t).request)||this;return n.options=t,n}return t}(vp);function Yp(e,t,n,r){var i=t.data,a=vt(t,[`data`]),o=n.data,s=vt(n,[`data`]);return Lt(a,s)&&Xp(dd(e).selectionSet,i,o,{fragmentMap:Mu(cd(e)),variables:r})}function Xp(e,t,n,r){if(t===n)return!0;var i=new Set;return e.selections.every(function(e){if(i.has(e)||(i.add(e),!bu(e,r.variables))||Zp(e))return!0;if(rd(e)){var a=td(e),o=t&&t[a],s=n&&n[a],c=e.selectionSet;if(!c)return Lt(o,s);var l=Array.isArray(o),u=Array.isArray(s);if(l!==u)return!1;if(l&&u){var d=o.length;if(s.length!==d)return!1;for(var f=0;f<d;++f)if(!Xp(c,o[f],s[f],r))return!1;return!0}return Xp(c,o,s,r)}var p=Nu(e,r.fragmentMap);if(p)return Zp(p)?!0:Xp(p.selectionSet,t,n,r)})}function Zp(e){return!!e.directives&&e.directives.some(Qp)}function Qp(e){return e.name.value===`nonreactive`}var $p=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=of(ju,{max:kt[`cache.fragmentQueryDocuments`]||1e3,cache:Xt})}return e.prototype.batch=function(e){var t=this,n=typeof e.optimistic==`string`?e.optimistic:e.optimistic===!1?null:void 0,r;return this.performTransaction(function(){return r=e.update(t)},n),r},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(L(L({},e),{rootId:e.id||`ROOT_QUERY`,optimistic:t}))},e.prototype.watchFragment=function(e){var t=this,n=e.fragment,r=e.fragmentName,i=e.from,a=e.optimistic,o=a===void 0||a,s=vt(e,[`fragment`,`fragmentName`,`from`,`optimistic`]),c=this.getFragmentDoc(n,r),l=L(L({},s),{returnPartialData:!0,id:i===void 0||typeof i==`string`?i:this.identify(i),query:c,optimistic:o}),u;return new G(function(e){return t.watch(L(L({},l),{immediate:!0,callback:function(t){if(!(u&&Yp(c,{data:u==null?void 0:u.result},{data:t.result}))){var n={data:t.result,complete:!!t.complete};t.missing&&(n.missing=Sf(t.missing.map(function(e){return e.missing}))),u=t,e.next(n)}}}))})},e.prototype.readFragment=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read(L(L({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=vt(e,[`id`,`data`]);return this.write(Object.assign(r,{dataId:t||`ROOT_QUERY`,result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,a=vt(e,[`id`,`data`,`fragment`,`fragmentName`]);return this.write(Object.assign(a,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return i==null?r:(n.writeQuery(L(L({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return i==null?r:(n.writeFragment(L(L({},e),{data:i})),i)}})},e}();globalThis.__DEV__!==!1&&($p.prototype.getMemoryInternals=Kt);var em=function(e){en(t,e);function t(n,r,i,a){var o,s=e.call(this,n)||this;if(s.message=n,s.path=r,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var c=s.path.length-1;c>=0;--c)s.missing=(o={},o[s.path[c]]=s.missing,o)}else s.missing=s.path;return s.__proto__=t.prototype,s}return t}(Error),tm=Object.prototype.hasOwnProperty;function nm(e){return e==null}function rm(e,t){var n=e.__typename,r=e.id,i=e._id;if(typeof n==`string`&&(t&&(t.keyObject=nm(r)?nm(i)?void 0:{_id:i}:{id:r}),nm(r)&&!nm(i)&&(r=i),!nm(r)))return`${n}:${typeof r==`number`||typeof r==`string`?r:JSON.stringify(r)}`}var im={dataIdFromObject:rm,addTypename:!0,resultCaching:!0,canonizeResults:!1};function am(e){return _t(im,e)}function om(e){var t=e.canonizeResults;return t===void 0?im.canonizeResults:t}function sm(e,t){return W(t)?e.get(t.__ref,`__typename`):t&&t.__typename}var cm=/^[_a-z][_0-9a-z]*/i;function lm(e){var t=e.match(cm);return t?t[0]:e}function um(e,t,n){return ht(t)?Et(t)?t.every(function(t){return um(e,t,n)}):e.selections.every(function(e){if(rd(e)&&bu(e,n)){var r=td(e);return tm.call(t,r)&&(!e.selectionSet||um(e.selectionSet,t[r],n))}return!0}):!1}function dm(e){return ht(e)&&!W(e)&&!Et(e)}function fm(){return new wf}function pm(e,t){var n=Mu(cd(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var mm=Object.create(null),hm=function(){return mm},gm=Object.create(null),_m=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Gt(W(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return W(e)?n.has(e.__ref):typeof e==`object`},this.toReference=function(e,t){if(typeof e==`string`)return Ru(e);if(W(e))return e;var r=n.policies.identify(e)[0];if(r){var i=Ru(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return L({},this.data)},e.prototype.has=function(e){return this.lookup(e,!0)!==void 0},e.prototype.get=function(e,t){if(this.group.depend(e,t),tm.call(this.data,e)){var n=this.data[e];if(n&&tm.call(n,t))return n[t]}if(t===`__typename`&&tm.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof xm)return this.parent.get(e,t)},e.prototype.lookup=function(e,t){if(t&&this.group.depend(e,`__exists`),tm.call(this.data,e))return this.data[e];if(this instanceof xm)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return Object.create(null)},e.prototype.merge=function(e,t){var n=this,r;W(e)&&(e=e.__ref),W(t)&&(t=t.__ref);var i=typeof e==`string`?this.lookup(r=e):e,a=typeof t==`string`?this.lookup(r=t):t;if(a){I(typeof r==`string`,1);
42var o=new wf(Cm).merge(i,a);if(this.data[r]=o,o!==i&&(delete this.refs[r],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(a).forEach(function(e){if(!i||i[e]!==o[e]){s[e]=1;var t=lm(e);t!==e&&!n.policies.hasKeyArgs(o.__typename,t)&&(s[t]=1),o[e]===void 0&&!(n instanceof xm)&&delete o[e]}}),s.__typename&&!(i&&i.__typename)&&this.policies.rootTypenamesById[r]===o.__typename&&delete s.__typename,Object.keys(s).forEach(function(e){return n.group.dirty(r,e)})}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),a=!1,o=!0,s={DELETE:mm,INVALIDATE:gm,isReference:W,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField(typeof t==`string`?{fieldName:t,from:r||Ru(e)}:t,{store:n})}};if(Object.keys(r).forEach(function(c){var l=lm(c),u=r[c];if(u!==void 0){var d=typeof t==`function`?t:t[c]||t[l];if(d){var f=d===hm?mm:d(Gt(u),L(L({},s),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));if(f===gm)n.group.dirty(e,c);else if(f===mm&&(f=void 0),f!==u&&(i[c]=f,a=!0,u=f,globalThis.__DEV__!==!1)){var p=function(e){if(n.lookup(e.__ref)===void 0)return globalThis.__DEV__!==!1&&I.warn(2,e),!0};if(W(f))p(f);else if(Array.isArray(f))for(var m=!1,h=void 0,g=0,_=f;g<_.length;g++){var v=_[g];if(W(v)){if(m=!0,p(v))break}else typeof v==`object`&&v&&n.policies.identify(v)[0]&&(h=v);if(m&&h!==void 0){globalThis.__DEV__!==!1&&I.warn(3,h);break}}}}u!==void 0&&(o=!1)}}),a)return this.merge(e,i),o&&(this instanceof xm?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,`__exists`)),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var a=this.getFieldValue(i,`__typename`),o=t&&n?this.policies.getStoreFieldName({typename:a,fieldName:t,args:n}):t;return this.modify(e,o?(r={},r[o]=hm,r):hm)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(tm.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof xm&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||`__exists`)),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(t){tm.call(e.policies.rootTypenamesById,t)||n.push(t)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(n){e&&tm.call(e,n)||t.delete(n)}),e){var n=e.__META,r=vt(e,[`__META`]);Object.keys(r).forEach(function(e){t.merge(e,r[e])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof xm?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(r){tm.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])});var r=Object.keys(n);if(r.length){for(var i=this;i instanceof xm;)i=i.parent;r.forEach(function(e){return i.delete(e)})}return r},e.prototype.findChildRefIds=function(e){if(!tm.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach(function(e){W(e)&&(t[e.__ref]=!0),ht(e)&&Object.keys(e).forEach(function(t){var n=e[t];ht(n)&&r.add(n)})})}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),vm=function(){function e(e,t){t===void 0&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?tf():null,this.keyMaker=new ku(Sn)}
42,e.prototype.depend=function(e,t){if(this.d){this.d(ym(e,t));var n=lm(t);n!==t&&this.d(ym(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(ym(e,t),t===`__exists`?`forget`:`setDirty`)},e}();function ym(e,t){return t+`#`+e}function bm(e,t){wm(e)&&e.group.depend(t,`__exists`)}(function(e){e.Root=function(e){en(t,e);function t(t){var n=t.policies,r=t.resultCaching,i=r===void 0||r,a=t.seed,o=e.call(this,n,new vm(i))||this;return o.stump=new Sm(o),o.storageTrie=new ku(Sn),a&&o.replace(a),o}return t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e)})(_m||(_m={}));var xm=function(e){en(t,e);function t(t,n,r,i){var a=e.call(this,n.policies,i)||this;return a.id=t,a.parent=n,a.replay=r,a.group=i,r(a),a}return t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach(function(n){Lt(r[n],i[n])||t.group.dirty(e,n)}
42):(t.group.dirty(e,`__exists`),Object.keys(i).forEach(function(n){t.group.dirty(e,n)})):t.delete(e)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return L(L({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return tm.call(this.data,t)?L(L({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(_m),Sm=function(e){en(t,e);function t(t){return e.call(this,`EntityStore.Stump`,t,function(){},new vm(t.group.caching,t.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(e,t){return this.parent.merge(e,t)},t}(xm);function Cm(e,t,n){var r=e[n],i=t[n];return Lt(r,i)?r:i}function wm(e){return!!(e instanceof _m&&e.group.caching)}function Tm(e){return ht(e)?Et(e)?e.slice(0):L({__proto__:Object.getPrototypeOf(e)},e):e}var Em=function(){function e(){this.known=new(Mn?WeakSet:Set),this.pool=new ku(Sn),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return ht(e)&&this.known.has(e)},e.prototype.pass=function(e){if(ht(e)){var t=Tm(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(ht(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this),i=this.pool.lookupArray(r);return i.array||(this.known.add(i.array=r),globalThis.__DEV__!==!1&&Object.freeze(r)),i.array;case null:case Object.prototype:if(this.known.has(e))return e;var a=Object.getPrototypeOf(e),o=[a],s=this.sortedKeys(e);o.push(s.json);var c=o.length;s.sorted.forEach(function(n){o.push(t.admit(e[n]))});var i=this.pool.lookupArray(o);if(!i.object){var l=i.object=Object.create(a);this.known.add(l),s.sorted.forEach(function(e,t){l[e]=o[c+t]}),globalThis.__DEV__!==!1&&Object.freeze(l)}return i.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}();function Dm(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Om=function(){function e(e){var t=this;this.knownResults=new(Sn?WeakMap:Map),this.config=_t(e,{addTypename:e.addTypename!==!1,canonizeResults:om(e)}),this.canon=e.canon||new Em,this.executeSelectionSet=of(function(e){var n,r=e.context.canonizeResults,i=Dm(e);i[3]=!r;var a=(n=t.executeSelectionSet).peek.apply(n,i);return a?r?L(L({},a),{result:t.canon.admit(a.result)}):a:(bm(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))},{max:this.config.resultCacheMaxSize||kt[`inMemoryCache.executeSelectionSet`]||5e4,keyArgs:Dm,makeCacheKey:function(e,t,n,r){if(wm(n.store))return n.store.makeCacheKey(e,W(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=of(function(e){return bm(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)},{max:this.config.resultCacheMaxSize||kt[`inMemoryCache.executeSubSelectedArray`]||1e4,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(wm(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Em},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=r===void 0?`ROOT_QUERY`:r,a=e.variables,o=e.returnPartialData,s=o===void 0||o,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,u=this.config.cache.policies;a=L(L({},fd(ld(n))),a);var d=Ru(i),f=this.executeSelectionSet({selectionSet:dd(n).selectionSet,objectOrReference:d,enclosingRef:d,context:L({store:t,query:n,policies:u,variables:a,varString:Pu(a),canonizeResults:l},pm(n,this.config.fragments))}),p;if(f.missing&&(p=[new em(km(f.missing),f.missing,n,a)],!s))throw p[0];return{result:f.result,complete:!p,missing:p}},e.prototype.isFresh=function(e,t,n,r){if(wm(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.enclosingRef,a=e.context;if(W(r)&&!a.policies.rootTypenamesById[r.__ref]&&!a.store.has(r.__ref))return{result:this.canon.empty,missing:`Dangling reference to missing ${r.__ref} object`};var o=a.variables,s=a.policies,c=a.store.getFieldValue(r,`__typename`),l=[],u,d=new wf;this.config.addTypename&&typeof c==`string`&&!s.rootIdsByTypename[c]&&l.push({__typename:c}
42);function f(e,t){var n;return e.missing&&(u=d.merge(u,(n={},n[t]=e.missing,n))),e.result}var p=new Set(n.selections);p.forEach(function(e){var n,m;if(bu(e,o)){if(rd(e)){var h=s.readField({fieldName:e.name.value,field:e,variables:a.variables,from:r},a),g=td(e);h===void 0?_f.added(e)||(u=d.merge(u,(n={},n[g]=`Can't find field '${e.name.value}' on ${W(r)?r.__ref+` object`:`object `+JSON.stringify(r,null,2)}`,n))):Et(h)?h.length>0&&(h=f(t.executeSubSelectedArray({field:e,array:h,enclosingRef:i,context:a}),g)):e.selectionSet?h!=null&&(h=f(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:h,enclosingRef:W(h)?h:i,context:a}),g)):a.canonizeResults&&(h=t.canon.pass(h)),h!==void 0&&l.push((m={},m[g]=h,m))}else{var _=Nu(e,a.lookupFragment);if(!_&&e.kind===En.FRAGMENT_SPREAD)throw rn(9,e.name.value);_&&s.fragmentMatches(_,c)&&_.selectionSet.selections.forEach(p.add,p)}}});var m={result:Sf(l),missing:u},h=a.canonizeResults?this.canon.admit(m):Gt(m);return h.result&&this.knownResults.set(h.result,n),h},e.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,r=e.array,i=e.enclosingRef,a=e.context,o,s=new wf;function c(e,t){var n;return e.missing&&(o=s.merge(o,(n={},n[t]=e.missing,n))),e.result}return n.selectionSet&&(r=r.filter(a.store.canRead)),r=r.map(function(e,r){return e===null?null:Et(e)?c(t.executeSubSelectedArray({field:n,array:e,enclosingRef:i,context:a}),r):n.selectionSet?c(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:W(e)?e:i,context:a}),r):(globalThis.__DEV__!==!1&&Am(a.store,n,e),e)}),{result:a.canonizeResults?this.canon.admit(r):r,missing:o}},e}();function km(e){try{JSON.stringify(e,function(e,t){if(typeof t==`string`)throw t;return t})}catch(e){return e}}function Am(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach(function(n){ht(n)&&(I(!W(n),10,sm(e,n),t.name.value),Object.values(n).forEach(r.add,r))})}}var jm=new Ed,Mm=new WeakMap;function Nm(e){var t=Mm.get(e);return t||Mm.set(e,t={vars:new Set,dep:tf()}),t}function Pm(e){Nm(e).vars.forEach(function(t){return t.forgetCache(e)})}function Fm(e){Nm(e).vars.forEach(function(t){return t.attachCache(e)})}function Im(e){var t=new Set,n=new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(e){Nm(e).dep.dirty(r),Lm(e)});var o=Array.from(n);n.clear(),o.forEach(function(t){return t(e)})}}else{var s=jm.getValue();s&&(i(s),Nm(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),Nm(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function Lm(e){e.broadcastWatches&&e.broadcastWatches()}var Rm=Object.create(null);function zm(e){var t=JSON.stringify(e);return Rm[t]||(Rm[t]=Object.create(null))}function Bm(e){var t=zm(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=Hm(e,function(e){var i=Gm(n.storeObject,e,r);return i===void 0&&t!==n.storeObject&&tm.call(t,e[0])&&(i=Gm(t,e,Wm)),I(i!==void 0,4,e.join(`.`),t),i});return`${n.typename}:${JSON.stringify(i)}`})}function Vm(e){var t=zm(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,a=n.fieldName,o=Hm(e,function(e){var n=e[0],a=n.charAt(0);if(a===`@`){if(r&&Wt(r.directives)){var o=n.slice(1),s=r.directives.find(function(e){return e.name.value===o}),c=s&&ed(s,i);return c&&Gm(c,e.slice(1))}return}if(a===`$`){var l=n.slice(1);if(i&&tm.call(i,l)){var u=e.slice(0);return u[0]=l,Gm(i,u)}return}if(t)return Gm(t,e)}),s=JSON.stringify(o);return(t||s!==`{}`)&&(a+=`:`+s),a})}function Hm(e,t){var n=new wf;return Um(e).reduce(function(e,r){var i,a=t(r);if(a!==void 0){for(var o=r.length-1;o>=0;--o)a=(i={},i[r[o]]=a,i);e=n.merge(e,a)}return e},Object.create(null))}function Um(e){var t=zm(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach(function(t,i){Et(t)?(Um(t).forEach(function(e){return n.push(r.concat(e))}),r.length=0):(r.push(t),Et(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function Wm(e,t){return e[t]}function Gm(e,t,n){return n=n||Wm,Km(t.reduce(function e(t,r){return Et(t)?t.map(function(t){return e(t,r)}):t&&n(t,r)},e))}function Km(e){return ht(e)?Et(e)?e.map(Km):Hm(Object.keys(e).sort(),function(t){return Gm(e,t)}):e}function qm(e){return e.args===void 0?e.field?ed(e.field,e.variables):null:e.args}var Jm=function(){},Ym=function(e,t){return t.fieldName},Xm=function(e,t,n){var r=n.mergeObjects;return r(e,t)},Zm=function(e,t){return t},Qm=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=L({dataIdFromObject:rm},e),this.cache=this.config.cache,this.setRootTypename(`Query`),this.setRootTypename(`Mutation`),this.setRootTypename(`Subscription`),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r=this,i=t&&(t.typename||((n=t.storeObject)==null?void 0:n.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return[`ROOT_QUERY`];for(var a=t&&t.storeObject||e,o=L(L({},t),{typename:i,storeObject:a,readField:t&&t.readField||function(){var e=eh(arguments,a);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),s,c=i&&this.getTypePolicy(i),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var u=l(L(L({},e),a),o);if(Et(u))l=Bm(u);else{s=u;break}}return s=s?String(s):void 0,o.keyObject?[s,o.keyObject]:[s]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n],i=r.queryType,a=r.mutationType,o=r.subscriptionType,s=vt(r,[`queryType`,`mutationType`,`subscriptionType`]);i&&t.setRootTypename(`Query`,n),a&&t.setRootTypename(`Mutation`,n),o&&t.setRootTypename(`Subscription`,n),tm.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]})},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge=typeof t==`function`?t:t===!0?Xm:t===!1?Zm
42:e.merge}o(r,t.merge),r.keyFn=i===!1?Jm:Et(i)?Bm(i):typeof i==`function`?i:r.keyFn,a&&Object.keys(a).forEach(function(t){var r=n.getFieldPolicy(e,t,!0),i=a[t];if(typeof i==`function`)r.read=i;else{var s=i.keyArgs,c=i.read,l=i.merge;r.keyFn=s===!1?Ym:Et(s)?Vm(s):typeof s==`function`?s:r.keyFn,typeof c==`function`&&(r.read=c),o(r,l)}r.read&&r.merge&&(r.keyFn=r.keyFn||Ym)})},e.prototype.setRootTypename=function(e,t){t===void 0&&(t=e);var n=`ROOT_`+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(I(!r||r===e,5,e),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(cm);(!r||r[0]!==e)&&t.fuzzySubtypes.set(e,new RegExp(e))})})},e.prototype.getTypePolicy=function(e){var t=this;if(!tm.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);!r&&this.fuzzySubtypes.size&&(r=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(n,i){if(n.test(e)){var a=t.supertypeMap.get(i);a&&a.forEach(function(e){return r.add(e)})}})),r&&r.size&&r.forEach(function(e){var r=t.getTypePolicy(e),i=r.fields,a=vt(r,[`fields`]);Object.assign(n,a),Object.assign(n.fields,i)})}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach(function(n){t.updateTypePolicy(e,n)}),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},l=!!(n&&this.fuzzySubtypes.size),u=!1,d=0;d<s.length;++d){var f=s[d];if(f.has(a))return o.has(a)||(u&&globalThis.__DEV__!==!1&&I.warn(6,t,a),o.add(a)),!0;f.forEach(c),l&&d===s.length-1&&um(e.selectionSet,n,r)&&(l=!1,u=!0,this.fuzzySubtypes.forEach(function(e,n){var r=t.match(e);r&&r[0]===t&&c(n)}))}return!1},e.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(e){var t=e.typename,n=e.fieldName,r=this.getFieldPolicy(t,n,!1),i,a=r&&r.keyFn;if(a&&t)for(var o={typename:t,fieldName:n,field:e.field||null,variables:e.variables},s=qm(e);a;){var c=a(s,o);if(Et(c))a=Vm(c);else{i=c||n;break}}return i===void 0&&(i=e.field?Xu(e.field,e.variables):$u(n,qm(e))),i===!1?n:n===lm(i)?i:n+`:`+i},e.prototype.readField=function(e,t){var n=e.from;if(n&&(e.field||e.fieldName)){if(e.typename===void 0){var r=t.store.getFieldValue(n,`__typename`);r&&(e.typename=r)}var i=this.getStoreFieldName(e),a=lm(i),o=t.store.getFieldValue(n,i),s=this.getFieldPolicy(e.typename,a,!1),c=s&&s.read;if(c){var l=$m(this,n,e,t,t.store.getStorage(W(n)?n.__ref:n,i));return jm.withValue(this.cache,c,[o,l])}return o}},e.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},e.prototype.getMergeFunction=function(e,t,n){var r=this.getFieldPolicy(e,t,!1),i=r&&r.merge;return!i&&n&&(r=this.getTypePolicy(n),i=r&&r.merge),i},e.prototype.runMergeFunction=function(e,t,n,r,i){var a=n.field,o=n.typename,s=n.merge;return s===Xm?th(r.store)(e,t):s===Zm?t:(r.overwrite&&(e=void 0),s(e,t,$m(this,void 0,{typename:o,fieldName:a.name.value,field:a,variables:r.variables},r,i||Object.create(null))))},e}();function $m(e,t,n,r,i){var a=e.getStoreFieldName(n),o=lm(a),s=n.variables||r.variables,c=r.store,l=c.toReference,u=c.canRead;return{args:qm(n),field:n.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:W,toReference:l,storage:i,cache:e.cache,canRead:u,readField:function(){return e.readField(eh(arguments,t,s),r)},mergeObjects:th(r.store)}}function eh(e,t,n){var r=e[0],i=e[1],a=e.length,o;return typeof r==`string`?o={fieldName:r,from:a>1?i:t}:(o=L({},r),tm.call(o,`from`)||(o.from=t)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&I.warn(7,on(Array.from(e))),o.variables===void 0&&(o.variables=n),o}function th(e){return function(t,n){if(Et(t)||Et(n))throw rn(8);if(ht(t)&&ht(n)){var r=e.getFieldValue(t,`__typename`),i=e.getFieldValue(n,`__typename`);if(r&&i&&r!==i)return n;if(W(t)&&dm(n))return e.merge(t.__ref,n),t;if(dm(t)&&W(n))return e.merge(t,n.__ref),n;if(dm(t)&&dm(n))return L(L({},t),n)}return n}}
42function nh(e,t,n){var r=`${t}${n}`,i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:L(L({},e),{clientOnly:t,deferred:n})),i}var rh=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,a=t.dataId,o=t.variables,s=t.overwrite,c=od(r),l=fm();o=L(L({},fd(c)),o);var u=L(L({store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:o,varString:Pu(o)},pm(r,this.fragments)),{overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),d=this.processSelectionSet({result:i||Object.create(null),dataId:a,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:u});if(!W(d))throw rn(11,i);return u.incomingById.forEach(function(t,r){var i=t.storeObject,a=t.mergeTree,o=t.fieldNodeSet,s=Ru(r);if(a&&a.map.size){var c=n.applyMerges(a,s,i,u);if(W(c))return;i=c}if(globalThis.__DEV__!==!1&&!u.overwrite){var l=Object.create(null);o.forEach(function(e){e.selectionSet&&(l[e.name.value]=!0)});var d=function(e){return l[lm(e)]===!0},f=function(e){var t=a&&a.map.get(e);return!!(t&&t.info&&t.info.merge)};
42Object.keys(i).forEach(function(e){d(e)&&!f(e)&&uh(s,i,e,u.store)})}e.merge(r,i)}),e.retain(d.__ref),d},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,c=Object.create(null),l=n&&s.rootTypenamesById[n]||nd(r,i,a.fragmentMap)||n&&a.store.get(n,`__typename`);typeof l==`string`&&(c.__typename=l);var u=function(){var e=eh(arguments,c,a.variables);if(W(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var n=s.readField(L(L({},e),{from:t.storeObject}),a);if(n!==void 0)return n}}return s.readField(e,a)},d=new Set;this.flattenFields(i,r,a,l).forEach(function(e,n){var i,a=r[td(n)];if(d.add(n),a!==void 0){var f=s.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),p=ah(o,f),m=t.processFieldValue(a,n,n.selectionSet?nh(e,!1,!1):e,p),h=void 0;n.selectionSet&&(W(m)||dm(m))&&(h=u(`__typename`,m));var g=s.getMergeFunction(l,n.name.value,h);g?p.info={field:n,typename:l,merge:g}:ch(o,f),c=e.merge(c,(i={},i[f]=m,i))}else globalThis.__DEV__!==!1&&!e.clientOnly&&!e.deferred&&!_f.added(n)&&!s.getReadFunction(l,n.name.value)&&globalThis.__DEV__!==!1&&I.error(12,td(n),r)});try{var f=s.identify(r,{typename:l,selectionSet:i,fragmentMap:a.fragmentMap,storeObject:c,readField:u}),p=f[0],m=f[1];n=n||p,m&&(c=a.merge(c,m))}catch(e){if(!n)throw e}if(typeof n==`string`){var h=Ru(n),g=a.written[n]||(a.written[n]=[]);if(g.indexOf(i)>=0||(g.push(i),this.reader&&this.reader.isFresh(r,h,i,a)))return h;var _=a.incomingById.get(n);return _?(_.storeObject=a.merge(_.storeObject,c),_.mergeTree=oh(_.mergeTree,o),d.forEach(function(e){return _.fieldNodeSet.add(e)})):a.incomingById.set(n,{storeObject:c,mergeTree:sh(o)?void 0:o,fieldNodeSet:d}),h}return c},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return!t.selectionSet||e===null?globalThis.__DEV__===!1?e:Yf(e):Et(e)?e.map(function(e,a){var o=i.processFieldValue(e,t,n,ah(r,a));return ch(r,a),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r})},e.prototype.flattenFields=function(e,t,n,r){r===void 0&&(r=nd(t,e,n.fragmentMap));var i=new Map,a=this.cache.policies,o=new ku(!1);return(function e(s,c){var l=o.lookup(s,c.clientOnly,c.deferred);l.visited||(l.visited=!0,s.selections.forEach(function(o){if(bu(o,n.variables)){var s=c.clientOnly,l=c.deferred;if(!(s&&l)&&Wt(o.directives)&&o.directives.forEach(function(e){var t=e.name.value;if(t===`client`&&(s=!0),t===`defer`){var r=ed(e,n.variables);(!r||r.if!==!1)&&(l=!0)}}),rd(o)){var u=i.get(o);u&&(s=s&&u.clientOnly,l=l&&u.deferred),i.set(o,nh(n,s,l))}else{var d=Nu(o,n.lookupFragment);if(!d&&o.kind===En.FRAGMENT_SPREAD)throw rn(13,o.name.value);d&&a.fragmentMatches(d,r,t,n.variables)&&e(d.selectionSet,nh(n,s,l))}}}))})(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var a,o=this;if(e.map.size&&!W(n)){var s=!Et(n)&&(W(t)||dm(t))?t:void 0,c=n;s&&!i&&(i=[W(s)?s.__ref:s]);var l,u=function(e,t){return Et(e)?typeof t==`number`?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach(function(e,t){var n=u(s,t),a=u(c,t);if(a!==void 0){i&&i.push(t);var d=o.applyMerges(e,n,a,r,i);d!==a&&(l=l||new Map,l.set(t,d)),i&&I(i.pop()===t)}}),l&&(n=Et(c)?c.slice(0):L({},c),l.forEach(function(e,t){n[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(a=r.store).getStorage.apply(a,i)):n},e}(),ih=[];function ah(e,t){var n=e.map;return n.has(t)||n.set(t,ih.pop()||{map:new Map}),n.get(t)}function oh(e,t){if(e===t||!t||sh(t))return e;if(!e||sh(e))return t;var n=e.info&&t.info?L(L({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var a=new Set(t.map.keys());e.map.forEach(function(e,n){i.map.set(n,oh(e,t.map.get(n))),a.delete(n)}),a.forEach(function(n){i.map.set(n,oh(t.map.get(n),e.map.get(n)))})}return i}function sh(e){return!e||!(e.info||e.map.size)}function ch(e,t){var n=e.map,r=n.get(t);r&&sh(r)&&(ih.push(r),n.delete(t))}var lh=new Set;function uh(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return typeof t==`object`&&t},a=i(e);if(a){var o=i(t);if(o&&!W(a)&&!Lt(a,o)&&!Object.keys(a).every(function(e){return r.getFieldValue(o,e)!==void 0})){var s=r.getFieldValue(e,`__typename`)||r.getFieldValue(t,`__typename`),c=lm(n),l=`${s}.${c}`;if(!lh.has(l)){lh.add(l);var u=[];
42!Et(a)&&!Et(o)&&[a,o].forEach(function(e){var t=r.getFieldValue(e,`__typename`);typeof t==`string`&&!u.includes(t)&&u.push(t)}),globalThis.__DEV__!==!1&&I.warn(14,c,s,u.length?`either ensure all objects of type `+u.join(` and `)+` have an ID or a custom merge function, or `:``,l,L({},a),L({},o))}}}}var dh=function(e){en(t,e);function t(t){t===void 0&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new cf(_f),n.assumeImmutableResults=!0,n.makeVar=Im,n.txCount=0,n.config=am(t),n.addTypename=!!n.config.addTypename,n.policies=new Qm({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return t.prototype.init=function(){var e=this.data=new _m.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new rh(this,this.storeReader=new Om({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:om(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=of(function(e,n){return t.broadcastWatch(e,n)},{max:this.config.resultCacheMaxSize||kt[`inMemoryCache.maybeBroadcastWatch`]||5e3,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(wm(n)){var r=e.optimistic,i=e.id,a=e.variables;return n.makeCacheKey(e.query,e.callback,Pu({optimistic:r,id:i,variables:a}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(e){return e.resetCaching()})},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return e===void 0&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=t!==void 0&&t;try{return this.storeReader.diffQueryAgainstStore(L(L({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof em)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{!--this.txCount&&e.broadcast!==!1&&this.broadcastWatches()}},t.prototype.modify=function(e){if(tm.call(e,`id`)&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||`ROOT_QUERY`,e.fields)}finally{!--this.txCount&&e.broadcast!==!1&&this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(L(L({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||`ROOT_QUERY`,config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||Fm(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&Pm(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;Pu.reset(),uf.reset(),this.addTypenameTransform.resetCache(),(t=this.config.fragments)==null||t.resetCaches();var n=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),n},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(W(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){globalThis.__DEV__!==!1&&I.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(tm.call(e,`id`))return!1;e=L(L({},e),{id:`ROOT_QUERY`})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{!--this.txCount&&e.broadcast!==!1&&this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),Pu.reset(),e&&e.discardWatches?(this.watches.forEach(function(e){return t.maybeBroadcastWatch.forget(e)}),this.watches.clear(),Pm(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t=this,n=e.update,r=e.optimistic,i=r===void 0||r,a=e.removeOptimistic,o=e.onWatchUpdated,s,c=function(e){var r=t,i=r.data,a=r.optimisticData;++t.txCount,e&&(t.data=t.optimisticData=e);try{return s=n(t)}finally{--t.txCount,t.data=i,t.optimisticData=a}},l=new Set;return o&&!this.txCount&&this.broadcastWatches(L(L({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),typeof i==`string`?this.optimisticData=this.optimisticData.addLayer(i,
42c):i===!1?c(this.data):c(),typeof a==`string`&&(this.optimisticData=this.optimisticData.removeLayer(a)),o&&l.size?(this.broadcastWatches(L(L({},e),{onWatchUpdated:function(e,t){var n=o.call(this,e,t);return n!==!1&&l.delete(e),n}})),l.size&&l.forEach(function(e){return t.maybeBroadcastWatch.dirty(e)})):this.broadcastWatches(e),s},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||t!==null})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach(function(n){return t.maybeBroadcastWatch(n,e)})},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&typeof t.optimistic==`string`&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&t.onWatchUpdated.call(this,e,r,n)===!1)||(!n||!Lt(n.result,r.result))&&e.callback(e.lastDiff=r,n)},t}($p);globalThis.__DEV__!==!1&&(dh.prototype.getMemoryInternals=jt);var fh=Object.assign,ph=Object.hasOwnProperty,mh=function(e){en(t,e);function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,a=e.call(this,function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=gh)}catch{}var n=!a.observers.size;a.observers.add(e);var r=a.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&a.reobserve().catch(function(){}),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}})||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=r,a.queryManager=n,a.waitForOwnResult=vh(i.fetchPolicy),a.isTornDown=!1,a.subscribeToMore=a.subscribeToMore.bind(a);var o=n.defaultOptions.watchQuery,s=(o===void 0?{}:o).fetchPolicy,c=s===void 0?`cache-first`:s,l=i.fetchPolicy,u=l===void 0?c:l,d=i.initialFetchPolicy,f=d===void 0?u===`standby`?c:u:d;a.options=L(L({},i),{initialFetchPolicy:f,fetchPolicy:u}),a.queryId=r.queryId||n.generateQueryId();var p=od(a.query);return a.queryName=p&&p.name&&p.name.value,a}return Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise(function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout(function(){i.unsubscribe()},0)},error:n},i=e.subscribe(r)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(e){e===void 0&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||P.ready,r=L(L({},t),{loading:Pt(n),networkStatus:n}),i=this.options.fetchPolicy,a=i===void 0?`cache-first`:i;if(!(vh(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers)){if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var o=this.queryInfo.getDiff();(o.complete||this.options.returnPartialData)&&(r.data=o.result),Lt(r.data,{})&&(r.data=void 0),o.complete?(delete r.partial,o.complete&&r.networkStatus===P.loading&&(a===`cache-first`||a===`cache-only`)&&(r.networkStatus=P.ready,r.loading=!1)):r.partial=!0,globalThis.__DEV__!==!1&&!o.complete&&!this.options.partialRefetch&&!r.loading&&!r.data&&!r.error&&_h(o.missing)}}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||(this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Yp(this.query,this.last.result,e,this.variables):!Lt(this.last.result,e))||t&&!Lt(this.last.variables,t)},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||Lt(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast(`result`,e)},t.prototype.getLastError=function(e){return this.getLast(`error`,e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if(n.fetchPolicy=r===`cache-and-network`?r:r===`no-cache`?`no-cache`:`network-only`,globalThis.__DEV__!==!1&&e&&ph.call(e,`variables`)){var i=ld(this.query),a=i.variableDefinitions;
42(!a||!a.some(function(e){return e.variable.name.value===`variables`}))&&globalThis.__DEV__!==!1&&I.warn(20,e,((t=i.name)==null?void 0:t.value)||i)}return e&&!Lt(this.options.variables,e)&&(n.variables=this.options.variables=L(L({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,P.refetch)},t.prototype.fetchMore=function(e){var t=this,n=L(L({},e.query?e:L(L(L(L({},this.options),{query:this.options.query}),e),{variables:L(L({},this.options.variables),e.variables)})),{fetchPolicy:`no-cache`});n.query=this.transformDocument(n.query);var r=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):n.query;var i=this.queryInfo,a=i.networkStatus;i.networkStatus=P.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var o=new Set,s=e==null?void 0:e.updateQuery,c=this.options.fetchPolicy!==`no-cache`;return c||I(s,21),this.queryManager.fetchQuery(r,n,P.fetchMore).then(function(l){if(t.queryManager.removeQuery(r),i.networkStatus===P.fetchMore&&(i.networkStatus=a),c)t.queryManager.cache.batch({update:function(r){var i=e.updateQuery;i?r.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},function(e){return i(e,{fetchMoreResult:l.data,variables:n.variables})}):r.writeQuery({query:n.query,variables:n.variables,data:l.data})},onWatchUpdated:function(e){o.add(e.query)}});else{var u=t.getLast(`result`),d=s(u.data,{fetchMoreResult:l.data,variables:n.variables});t.reportResult(L(L({},u),{data:d}),t.variables)}return l}).finally(function(){c&&!o.has(t.query)&&hh(t)})},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery(function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})})},error:function(t){if(e.onError){e.onError(t);return}globalThis.__DEV__!==!1&&I.error(22,t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=_t(this.options,e||{});fh(this.options,t)},t.prototype.setVariables=function(e){return Lt(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},P.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,r=e(n,{variables:this.variables});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var n=t.fetchPolicy,r=n===void 0?`cache-first`:n,i=t.initialFetchPolicy,a=i===void 0?r:i;r===`standby`||(t.fetchPolicy=typeof t.nextFetchPolicy==`function`?t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:a}):e===`variables-changed`?a:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,e,t,n)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this,n=t.pollingInfo,r=t.options.pollInterval;if(!r||!this.hasObservers()){n&&(clearTimeout(n.timeout),delete this.pollingInfo);return}if(!(n&&n.interval===r)){I(r,23);var i=n||(this.pollingInfo={});i.interval=r;var a=function(){var t,n;e.pollingInfo&&(!Pt(e.queryInfo.networkStatus)&&!((n=(t=e.options).skipPollAttempt)!=null&&n.call(t))?e.reobserve({fetchPolicy:e.options.initialFetchPolicy===`no-cache`?`no-cache`:`network-only`},P.poll).then(o,o):o())},o=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(a,t.interval))};o()}}},t.prototype.updateLastResult=function(e,t){t===void 0&&(t=this.variables);var n=this.getLastError();return n&&this.last&&!Lt(t,this.last.variables)&&(n=void 0),this.last=L({result:this.queryManager.assumeImmutableResults?e:Yf(e),variables:t},n?{error:n}:null)},t.prototype.reobserveAsConcast=function(e,t){var n=this;this.isTornDown=!1;var r=t===P.refetch||t===P.fetchMore||t===P.poll,i=this.options.variables,a=this.options.fetchPolicy,o=_t(this.options,e||{}),s=r?o:fh(this.options,o),c=this.transformDocument(s.query);this.lastQuery=c,r||(this.updatePolling(),e&&e.variables&&!Lt(e.variables,i)&&s.fetchPolicy!==`standby`&&(s.fetchPolicy===a||typeof s.nextFetchPolicy==`function`)&&(this.applyNextFetchPolicy(`variables-changed`,s),t===void 0&&(t=P.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=vh(s.fetchPolicy));var l=function(){n.concast===f&&(n.waitForOwnResult=!1)},u=s.variables&&L({},s.variables),d=this.fetch(s,t,c),f=d.concast,p=d.fromLink,m={next:function(e){Lt(n.variables,u)&&(l(),n.reportResult(e,u))},error:function(e){Lt(n.variables,u)&&(Bt(e)||(e=new wt({networkError:e})),l(),n.reportError(e,u))}};return!r&&(p||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=f,this.observer=m),f.addObserver(m),f},t.prototype.reobserve=function(e,t){return this.reobserveAsConcast(e,t).promise},t.prototype.resubscribeAfterError=function(){var e=[...arguments],t=this.last;this.resetLastResults();var n=this.subscribe.apply(this,e);return this.last=t,n},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError(),r=this.isDifferentFromLastResult(e,t);(n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(n||r)&&Zf(this.observers,`next`,e)},t.prototype.reportError=function(e,t){var n=L(L({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:P.error,loading:!1});this.updateLastResult(n,t),Zf(this.observers,`error`,this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t}(G);$f(mh);function hh(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return n===`cache-and-network`||n===`network-only`?e.reobserve({fetchPolicy:`cache-first`,nextFetchPolicy:function(e,t){return this.nextFetchPolicy=r,typeof this.nextFetchPolicy==`function`?this.nextFetchPolicy(e,t):n}}):e.reobserve()}function gh(e){globalThis.__DEV__!==!1&&I.error(24,e.message,e.stack)}function _h(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&I.debug(25,e)}
42function vh(e){return e===`network-only`||e===`no-cache`||e===`standby`}var yh=new(Sn?WeakMap:Map);function bh(e,t){var n=e[t];typeof n==`function`&&(e[t]=function(){return yh.set(e,(yh.get(e)+1)%0x38d7ea4c68000),n.apply(this,arguments)})}function xh(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Sh=function(){function e(e,t){t===void 0&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;yh.has(n)||(yh.set(n,0),bh(n,`evict`),bh(n,`modify`),bh(n,`reset`))}return e.prototype.init=function(e){var t=e.networkStatus||P.loading;return this.variables&&this.networkStatus!==P.loading&&!Lt(this.variables,e.variables)&&(t=P.setVariables),Lt(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){xh(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&Lt(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var t=this.observableQuery;if(t&&t.options.fetchPolicy===`no-cache`)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(t=this.observableQuery)==null?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n,r=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(n=this.observableQuery)!=null&&n.getLastError()||(this.updateLastDiff(e),!this.dirty&&!Lt(r&&r.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0))))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():hh(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;xh(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Pt(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!==`cache-only`&&e!==`cache-and-network`)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy===`no-cache`)){var r=L(L({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});(!this.lastWatch||!Lt(r,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===yh.get(this.cache)&&Lt(t,n.variables)&&Lt(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,a=new wf,o=Wt(e.errors)?e.errors.slice(0):[];if(this.reset(),`incremental`in e&&Wt(e.incremental))e.data=op(this.getDiff().result,e);else if(`hasNext`in e&&e.hasNext){var s=this.getDiff();e.data=a.merge(s.result,e.data)}this.graphQLErrors=o,n.fetchPolicy===`no-cache`?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):r!==0&&(Ch(e,n.errorPolicy)?this.cache.performTransaction(function(a){if
42(i.shouldWrite(e,n.variables))a.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:r===1}),i.lastWrite={result:e,variables:n.variables,dmCount:yh.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete){e.data=i.lastDiff.diff.result;return}var o=i.getDiffOptions(n.variables),s=a.diff(o);!i.stopped&&Lt(i.variables,n.variables)&&i.updateWatch(n.variables),i.updateLastDiff(s,o),s.complete&&(e.data=s.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=P.ready},e.prototype.markError=function(e){return this.networkStatus=P.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function Ch(e,t){t===void 0&&(t=`none`);var n=t===`ignore`||t===`all`,r=!sp(e);return!r&&n&&e.data&&(r=!0),r}var wh=Object.prototype.hasOwnProperty,Th=Object.create(null),Eh=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new qt(kt[`queryManager.getDocumentInfo`]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new ku(!1);var n=new cf(function(e){return t.cache.transformDocument(e)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var r=e.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(rn(26))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){return Vn(this,arguments,void 0,function(e){var t,n,r,i,a,o,s,c=e.mutation,l=e.variables,u=e.optimisticResponse,d=e.updateQueries,f=e.refetchQueries,p=f===void 0?[]:f,m=e.awaitRefetchQueries,h=m!==void 0&&m,g=e.update,_=e.onQueryUpdated,v=e.fetchPolicy,y=v===void 0?((o=this.defaultOptions.mutate)==null?void 0:o.fetchPolicy)||`network-only`:v,b=e.errorPolicy,x=b===void 0?((s=this.defaultOptions.mutate)==null?void 0:s.errorPolicy)||`none`:b,S=e.keepRootFields,C=e.context;return zn(this,function(e){switch(e.label){case 0:return I(c,27),I(y===`network-only`||y===`no-cache`,28),t=this.generateMutationId(),c=this.cache.transformForLink(this.transform(c)),n=this.getDocumentInfo(c).hasClientExports,l=this.getVariables(c,l),n?[4,this.localState.addExportedVariables(c,l,C)]:[3,2];case 1:l=e.sent(),e.label=2;case 2:return r=this.mutationStore&&(this.mutationStore[t]={mutation:c,variables:l,loading:!0,error:null}),i=u&&this.markMutationOptimistic(u,{mutationId:t,document:c,variables:l,fetchPolicy:y,errorPolicy:x,context:C,updateQueries:d,update:g,keepRootFields:S}),this.broadcastQueries(),a=this,[2,new Promise(function(e,n){return Qf(a.getObservableFromLink(c,L(L({},C),{optimisticResponse:i?u:void 0}),l,{},!1),function(e){if(sp(e)&&x===`none`)throw new wt({graphQLErrors:cp(e)});r&&(r.loading=!1,r.error=null);var n=L({},e);return typeof p==`function`&&(p=p(n)),x===`ignore`&&sp(n)&&delete n.errors,a.markMutationResult({mutationId:t,result:n,document:c,variables:l,fetchPolicy:y,errorPolicy:x,context:C,update:g,updateQueries:d,awaitRefetchQueries:h,refetchQueries:p,removeOptimistic:i?t:void 0,onQueryUpdated:_,keepRootFields:S})}).subscribe({next:function(t){a.broadcastQueries(),(!(`hasNext`in t)||t.hasNext===!1)&&e(t)},error:function(e){r&&(r.loading=!1,r.error=e),i&&a.cache.removeOptimistic(t),a.broadcastQueries(),n(e instanceof wt?e:new wt({networkError:e}))}})})]}})})},e.prototype.markMutationResult=function(e,t){var n=this;t===void 0&&(t=this.cache);var r=e.result,i=[],a=e.fetchPolicy===`no-cache`;if(!a&&Ch(r,e.errorPolicy)){if(np(r)||i.push({result:r.data,dataId:`ROOT_MUTATION`,query:e.document,variables:e.variables}),np(r)&&Wt(r.incremental)){var o=t.diff({id:`ROOT_MUTATION`,query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}
42),s=void 0;o.result&&(s=op(o.result,r)),s!==void 0&&(r.data=s,i.push({result:s,dataId:`ROOT_MUTATION`,query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(e,a){var o=e.observableQuery,s=o&&o.queryName;if(!(!s||!wh.call(c,s))){var l=c[s],u=n.queries.get(a),d=u.document,f=u.variables,p=t.diff({query:d,variables:f,returnPartialData:!0,optimistic:!1}),m=p.result;if(p.complete&&m){var h=l(m,{mutationResult:r,queryName:d&&sd(d)||void 0,queryVariables:f});h&&i.push({result:h,dataId:`ROOT_QUERY`,query:d,variables:f})}}})}if(i.length>0||(e.refetchQueries||``).length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(t){a||i.forEach(function(e){return t.write(e)});var o=e.update,s=!ip(r)||np(r)&&!r.hasNext;if(o){if(!a){var c=t.diff({id:`ROOT_MUTATION`,query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});c.complete&&(r=L(L({},r),{data:c.result}),`incremental`in r&&delete r.incremental,`hasNext`in r&&delete r.hasNext)}s&&o(t,r,{context:e.context,variables:e.variables})}!a&&!e.keepRootFields&&s&&t.modify({id:`ROOT_MUTATION`,fields:function(e,t){var n=t.fieldName,r=t.DELETE;return n===`__typename`?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(e){return l.push(e)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return r})}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r=typeof e==`function`?e(t.variables,{IGNORE:Th}):e;return r!==Th&&(this.cache.recordOptimisticTransaction(function(e){try{n.markMutationResult(L(L({},t),{result:{data:r}}),e)}catch(e){globalThis.__DEV__!==!1&&I.error(e)}},t.mutationId),!0)},e.prototype.fetchQuery=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast.promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},e.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var n={hasClientExports:Su(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:xu([`nonreactive`],e),clientQuery:this.localState.clientQuery(e),serverQuery:gf([{name:`client`,remove:!0},{name:`connection`},{name:`nonreactive`}],e),defaultVars:fd(od(e)),asQuery:L(L({},e),{definitions:e.definitions.map(function(e){return e.kind===`OperationDefinition`&&e.operation!==`query`?L(L({},e),{operation:`query`}):e})})};t.set(e,n)}return t.get(e)},e.prototype.getVariables=function(e,t){return L(L({},this.getDocumentInfo(e).defaultVars),t)},e.prototype.watchQuery=function(e){var t=this.transform(e.query);e=L(L({},e),{variables:this.getVariables(t,e.variables)}),e.notifyOnNetworkStatusChange===void 0&&(e.notifyOnNetworkStatusChange=!1);var n=new Sh(this),r=new mh({queryManager:this,queryInfo:n,options:e});return r.lastQuery=t,this.queries.set(r.queryId,n),n.init({document:t,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var n=this;return t===void 0&&(t=this.generateQueryId()),I(e.query,29),I(e.query.kind===`Document`,30),I(!e.returnPartialData,31),I(!e.pollInterval,32),this.fetchQuery(t,L(L({},e),{query:this.transform(e.query)})).finally(function(){return n.stopQuery(t)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}
42),this.cancelPendingFetches(rn(33)),this.queries.forEach(function(e){e.observableQuery?e.networkStatus=P.loading:e.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;e===void 0&&(e=`active`);var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach(function(e){typeof e==`string`?r.set(e,!1):zu(e)?r.set(t.transform(e),!1):ht(e)&&e.query&&i.add(e)}),this.queries.forEach(function(t,i){var a=t.observableQuery,o=t.document;if(a){if(e===`all`){n.set(i,a);return}var s=a.queryName;if(a.options.fetchPolicy===`standby`||e===`active`&&!a.hasObservers())return;(e===`active`||s&&r.has(s)||o&&r.has(o))&&(n.set(i,a),s&&r.set(s,!0),o&&r.set(o,!0))}}),i.size&&i.forEach(function(e){var r=Dn(`legacyOneTimeQuery`),i=t.getQuery(r).init({document:e.query,variables:e.variables}),a=new mh({queryManager:t,queryInfo:i,options:L(L({},e),{fetchPolicy:`network-only`})});I(a.queryId===r),i.setObservableQuery(a),n.set(r,a)}),globalThis.__DEV__!==!1&&r.size&&r.forEach(function(e,t){e||globalThis.__DEV__!==!1&&I.warn(typeof t==`string`?34:35,t)}),n},e.prototype.reFetchObservableQueries=function(e){var t=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?`all`:`active`).forEach(function(r,i){var a=r.options.fetchPolicy;r.resetLastResults(),(e||a!==`standby`&&a!==`cache-only`)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,a=i===void 0?`none`:i,o=e.variables,s=e.context,c=s===void 0?{}:s,l=e.extensions,u=l===void 0?{}:l;n=this.transform(n),o=this.getVariables(n,o);var d=function(e){return t.getObservableFromLink(n,c,e,u).map(function(i){r!==`no-cache`&&(Ch(i,a)&&t.cache.write({query:n,result:i.data,dataId:`ROOT_SUBSCRIPTION`,variables:e}),t.broadcastQueries());var o=sp(i),s=Mt(i);if(o||s){var c={};if(o&&(c.graphQLErrors=i.errors),s&&(c.protocolErrors=i.extensions[Ot]),a===`none`||s)throw new wt(c)}return a===`ignore`&&delete i.errors,i})};if(this.getDocumentInfo(n).hasClientExports){var f=this.localState.addExportedVariables(n,o,c).then(d);return new G(function(e){var t=null;return f.then(function(n){return t=n.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return d(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r,i){var a=this,o;i===void 0&&(i=(o=t==null?void 0:t.queryDeduplication)==null?this.queryDeduplication:o);var s,c=this.getDocumentInfo(e),l=c.serverQuery,u=c.clientQuery;if(l){var d=this,f=d.inFlightLinkObservables,p=d.link,m={query:l,variables:n,operationName:sd(l)||void 0,context:this.prepareContext(L(L({},t),{forceFetch:!i})),extensions:r};if(t=m.context,i){var h=uf(l),g=Pu(n),_=f.lookup(h,g);if(s=_.observable,!s){var v=new tp([bp(p,m)]);s=_.observable=v,v.beforeNext(function(){f.remove(h,g)})}}else s=new tp([bp(p,m)])}else s=new tp([G.of({data:{}})]),t=this.prepareContext(t);return u&&(s=Qf(s,function(e){return a.localState.runResolvers({document:u,remoteResult:e,context:t,variables:n})})),s},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(n.query);return Qf(this.getObservableFromLink(i,n.context,n.variables),function(a){var o=cp(a),s=o.length>0,c=n.errorPolicy;if(r>=e.lastRequestId){if(s&&c===`none`)throw e.markError(new wt({graphQLErrors:o}));e.markResult(a,i,n,t),e.markReady()}var l={data:a.data,loading:!1,networkStatus:P.ready};return s&&c===`none`&&(l.data=void 0),s&&c!==`ignore`&&(l.errors=o,l.networkStatus=P.error),l},function(t){var n=Bt(t)?t:new wt({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n})},e.prototype.fetchConcastWithInfo=function(e,t,n,r){var i=this;n===void 0&&(n=P.loading),r===void 0&&(r=t.query);var a=this.getVariables(r,t.variables),o=this.getQuery(e),s=this.defaultOptions.watchQuery,c=t.fetchPolicy,l=c===void 0?s&&s.fetchPolicy||`cache-first`:c,u=t.errorPolicy,d=u===void 0?s&&s.errorPolicy||`none`:u,f=t.returnPartialData,p=f!==void 0&&f,m=t.notifyOnNetworkStatusChange,h=m!==void 0&&m,g=t.context,_=Object.assign({},t,{query:r,variables:a,fetchPolicy:l,errorPolicy:d,returnPartialData:p,notifyOnNetworkStatusChange:h,context:g===void 0?{}:g}),v=function(e){_.variables=e;var r=i.fetchQueryByPolicy(o,_,n);return _.fetchPolicy!==`standby`&&r.sources.length>0&&o.observableQuery&&o.observableQuery.applyNextFetchPolicy(`after-fetch`,t),r},y=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(e){y(),setTimeout(function(){return b.cancel(e)})});var b,x;if(this.getDocumentInfo(_.query).hasClientExports)b=new tp(this.localState.addExportedVariables(_.query,_.variables,_.context).then(v).then(function(e){return e.sources})),x=!0;else{var S=v(_.variables);x=S.fromLink,b=new tp(S.sources)}return b.promise.then(y,y),{concast:b,fromLink:x}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,a=i!==void 0&&i,o=e.removeOptimistic,s=o===void 0?a?Dn(`refetchQueries`):void 0:o,c=e.onQueryUpdated,l=new Map;r&&this.getObservableQueries(r).forEach(function(e,n){l.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})});var u=new Map;return n&&this.cache.batch({update:n,optimistic:a&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof Sh&&e.watcher.observableQuery;if(r){if(c){l.delete(r.queryId);var i=c(r,t,n);return i===!0&&(i=r.refetch()),i!==!1&&u.set(r,i),i}c!==null&&l.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),l.size&&l.forEach(function(e,n){var r=e.oq,i=e.lastDiff,a=e.diff,o;if(c){if(!a){var s=r.queryInfo;s.reset(),a=s.getDiff()}o=c(r,a,i)}(!c||o===!0)&&(o=r.refetch()),o!==!1&&u.set(r,o),n.indexOf(`legacyOneTimeQuery`)>=0&&t.stopQueryNoBroadcast(n)}),s&&this.cache.removeOptimistic(s),u},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,a=t.variables,o=t.fetchPolicy,s=t.refetchWritePolicy,c=t.errorPolicy,l=t.returnPartialData,u=t.context,d=t.notifyOnNetworkStatusChange,f
42=e.networkStatus;e.init({document:i,variables:a,networkStatus:n});var p=function(){return e.getDiff()},m=function(t,n){n===void 0&&(n=e.networkStatus||P.loading);var o=t.result;globalThis.__DEV__!==!1&&!l&&!Lt(o,{})&&_h(t.missing);var s=function(e){return G.of(L({data:e,loading:Pt(n),networkStatus:n},t.complete?null:{partial:!0}))};return o&&r.getDocumentInfo(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:o},context:u,variables:a,onlyRunForcedResolvers:!0}).then(function(e){return s(e.data||void 0)}):c===`none`&&n===P.refetch&&Array.isArray(t.missing)?s(void 0):s(o)},h=o===`no-cache`?0:n===P.refetch&&s!==`merge`?1:2,g=function(){return r.getResultsFromLink(e,h,{query:i,variables:a,context:u,fetchPolicy:o,errorPolicy:c})},_=d&&typeof f==`number`&&f!==n&&Pt(n);switch(o){default:case`cache-first`:var v=p();return v.complete?{fromLink:!1,sources:[m(v,e.markReady())]}:l||_?{fromLink:!0,sources:[m(v),g()]}:{fromLink:!0,sources:[g()]};case`cache-and-network`:var v=p();return v.complete||l||_?{fromLink:!0,sources:[m(v),g()]}:{fromLink:!0,sources:[g()]};case`cache-only`:return{fromLink:!1,sources:[m(p(),e.markReady())]};case`network-only`:return _?{fromLink:!0,sources:[m(p()),g()]}:{fromLink:!0,sources:[g()]};case`no-cache`:return _?{fromLink:!0,sources:[m(e.getDiff()),g()]}:{fromLink:!0,sources:[g()]};case`standby`:return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Sh(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return L(L(L({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},e}(),Dh=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=xf(t.resolvers,e)}):this.resolvers=xf(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){return Vn(this,arguments,void 0,function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,a=e.onlyRunForcedResolvers,o=a!==void 0&&a;return zn(this,function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,o).then(function(e){return L(L({},n),{data:e.result})})]:[2,n]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return xu([`client`],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return yf(e)},e.prototype.prepareContext=function(e){var t=this.cache;return L(L({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e){return Vn(this,arguments,void 0,function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),zn(this,function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(e){return L(L({},t),e.exportedVariables)})]:[2,L({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return du(e,{Directive:{enter:function(e){if(e.name.value===`client`&&e.arguments&&(t=e.arguments.some(function(e){return e.name.value===`always`&&e.value.kind===`BooleanValue`&&e.value.value===!0}),t))return uu}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:vf(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t){return Vn(this,arguments,void 0,function(e,t,n,r,i,a){var o,s,c,l,u,d,f,p,m,h,g;return n===void 0&&(n={}),r===void 0&&(r={}),i===void 0&&(i=function(){return!0}),a===void 0&&(a=!1),zn(this,function(_){return o=dd(e),s=cd(e),c=Mu(s),l=this.collectSelectionsToResolve(o,c),u=o.operation,d=u?u.charAt(0).toUpperCase()+u.slice(1):`Query`,f=this,p=f.cache,m=f.client,h={fragmentMap:c,context:L(L({}
42,n),{cache:p,client:m}),variables:r,fragmentMatcher:i,defaultOperationType:d,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:a},g=!1,[2,this.resolveSelectionSet(o.selectionSet,g,t,h).then(function(e){return{result:e,exportedVariables:h.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,n,r){return Vn(this,void 0,void 0,function(){var i,a,o,s,c,l=this;return zn(this,function(u){return i=r.fragmentMap,a=r.context,o=r.variables,s=[n],c=function(e){return Vn(l,void 0,void 0,function(){var c,l;return zn(this,function(u){return!t&&!r.selectionsToResolve.has(e)||!bu(e,o)?[2]:rd(e)?[2,this.resolveField(e,t,n,r).then(function(t){var n;t!==void 0&&s.push((n={},n[td(e)]=t,n))})]:(id(e)?c=e:(c=i[e.name.value],I(c,18,e.name.value)),c&&c.typeCondition&&(l=c.typeCondition.name.value,r.fragmentMatcher(n,l,a))?[2,this.resolveSelectionSet(c.selectionSet,t,n,r).then(function(e){s.push(e)})]:[2])})})},[2,Promise.all(e.selections.map(c)).then(function(){return Sf(s)})]})})},e.prototype.resolveField=function(e,t,n,r){return Vn(this,void 0,void 0,function(){var i,a,o,s,c,l,u,d,f,p=this;return zn(this,function(m){return n?(i=r.variables,a=e.name.value,o=td(e),s=a!==o,c=n[o]||n[a],l=Promise.resolve(c),(!r.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(u=n.__typename||r.defaultOperationType,d=this.resolvers&&this.resolvers[u],d&&(f=d[s?a:o],f&&(l=Promise.resolve(jm.withValue(this.cache,f,[n,ed(e,i),r.context,{field:e,fragmentMap:r.fragmentMap}]))))),[2,l.then(function(n){var i,a;if(n===void 0&&(n=c),e.directives&&e.directives.forEach(function(e){e.name.value===`export`&&e.arguments&&e.arguments.forEach(function(e){e.name.value===`as`&&e.value.kind===`StringValue`&&(r.exportedVariables[e.value.value]=n)})}),!e.selectionSet||n==null)return n;var o=(a=(i=e.directives)==null?void 0:i.some(function(e){return e.name.value===`client`}))!=null&&a;if(Array.isArray(n))return p.resolveSubSelectedArray(e,t||o,n,r);if(e.selectionSet)return p.resolveSelectionSet(e.selectionSet,t||o,n,r)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map(function(n){if(n===null)return null;if(Array.isArray(n))return i.resolveSubSelectedArray(e,t,n,r);if(e.selectionSet)return i.resolveSelectionSet(e.selectionSet,t,n,r)}))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;function i(e){if(!r.has(e)){var a=new Set;r.set(e,a),du(e,{Directive:function(e,t,r,i,o){e.name.value===`client`&&o.forEach(function(e){n(e)&&yu(e)&&a.add(e)})},FragmentSpread:function(e,r,o,s,c){var l=t[e.name.value];I(l,19,e.name.value);var u=i(l);u.size>0&&(c.forEach(function(e){n(e)&&yu(e)&&a.add(e)}),a.add(e),u.forEach(function(e){a.add(e)}))}})}return r.get(e)}return i(e)},e}(),Oh=!1,kh=function(){function e(e){var t=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw rn(15);var n=e.uri,r=e.credentials,i=e.headers,a=e.cache,o=e.documentTransform,s=e.ssrMode,c=s!==void 0&&s,l=e.ssrForceFetchDelay,u=l===void 0?0:l,d=e.connectToDevTools,f=e.queryDeduplication,p=f===void 0||f,m=e.defaultOptions,h=e.defaultContext,g=e.assumeImmutableResults,_=g===void 0?a.assumeImmutableResults:g,v=e.resolvers,y=e.typeDefs,b=e.fragmentMatcher,x=e.name,S=e.version,C=e.devtools,w=e.link;w||(w=n?new Jp({uri:n,credentials:r,headers:i}):vp.empty()),this.link=w,this.cache=a,this.disableNetworkFetches=c||u>0,this.queryDeduplication=p,this.defaultOptions=m||Object.create(null),this.typeDefs=y,this.devtoolsConfig=L(L({},C),{enabled:(C==null?void 0:C.enabled)||d}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),u&&setTimeout(function(){return t.disableNetworkFetches=!1},u),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=cn,this.localState=new Dh({cache:a,client:this,resolvers:v,fragmentMatcher:b}),this.queryManager=new Eh({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:h,documentTransform:o,queryDeduplication:p,ssrMode:c,clientAwareness:{name:x,version:S},localState:this.localState,assumeImmutableResults:_,onBroadcast:this.devtoolsConfig.enabled?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if(!(typeof window>`u`)){var e=window,t=Symbol.for(`apollo.devtools`);(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,!Oh&&globalThis.__DEV__!==!1&&(Oh=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var e=window.navigator,t=e&&e.userAgent,n=void 0;typeof t==`string`&&(t.indexOf(`Chrome/`)>
42-1?n=`https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm`:t.indexOf(`Firefox/`)>-1&&(n=`https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/`)),n&&globalThis.__DEV__!==!1&&I.log(`Download the Apollo DevTools for a better development experience: %s`,n)}},1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Hn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy===`network-only`||e.fetchPolicy===`cache-and-network`)&&(e=L(L({},e),{fetchPolicy:`cache-first`})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Hn(this.defaultOptions.query,e)),I(e.fetchPolicy!==`cache-and-network`,16),this.disableNetworkFetches&&e.fetchPolicy===`network-only`&&(e=L(L({},e),{fetchPolicy:`cache-first`})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Hn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},e.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},e.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return bp(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach(function(e,t){n.push(t),r.push(e)});var i=Promise.all(r);return i.queries=n,i.results=r,i.catch(function(e){globalThis.__DEV__!==!1&&I.debug(17,e)}),i},e.prototype.getObservableQueries=function(e){return e===void 0&&(e=`active`),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();globalThis.__DEV__!==!1&&(kh.prototype.getMemoryInternals=Tt);var Ah=s(pn(),1),jh=function(e){var t=e.client,n=e.children,r=gt(),i=Ah.useContext(r),a=Ah.useMemo(function(){return L(L({},i),{client:t||i.client})},[i,t]);return I(a.client,47),Ah.createElement(r.Provider,{value:a},n)},Mh=s(Ft()),Nh=ee;function Ph({appId:e,userId:t,userIdHash:n,email:r,name:i,verticalPadding:a}
42){(0,Mh.Intercom)({app_id:e,api_base:`https://api-iam.intercom.io`,user_id:t,email:r,user_hash:n,vertical_padding:a,name:i}),(0,Mh.onShow)(()=>{Nh==null||Nh.capture(`intercom_event`,{eventName:`open`})}),(0,Mh.onHide)(()=>{Nh==null||Nh.capture(`intercom_event`,{eventName:`close`})}),(0,Mh.onUserEmailSupplied)(e=>{Nh==null||Nh.capture(`intercom_event`,{eventName:`user_email_supplied`,email:e})})}function Fh({children:e}){return(0,B.jsx)(te,{additionalProperties:{source:`app-error-boundary`},fallback:({error:e})=>(0,B.jsx)(Ke,{error:e instanceof Error?e:Error(`An unexpected error occurred`)}),children:e})}var Ih=()=>{let e=u();return z.useEffect(()=>{N==null||N.capture(`$pageview`,{$current_url:window.location.href})},[e]),null},K=function(e){return e.AddCredits=`AddCredits`,e.CreditLimitReached=`CreditLimitReached`,e.AddWebsite=`AddWebsite`,e.WebsiteLimitReached=`WebsiteLimitReached`,e.ChangePlan=`ChangePlan`,e.WorkspaceMembersLimitReached=`WorkspaceMembersLimitReached`,e.RobotsLimitReached=`RobotsLimitReached`,e.AiBudgetLimitReached=`AiBudgetLimitReached`,e}({}),Lh=(0,z.createContext)({isOpen:!1,modalType:void 0,modalInitContext:void 0}),Rh=(0,z.createContext)({openModal:()=>{},closeModal:()=>{},onComplete:()=>{}}),zh=({children:e})=>{let[t,n]=z.useState(!1),[r,i]=z.useState(void 0),[a,o]=z.useState(void 0),[s,c]=z.useState(void 0),[l,u]=z.useState(void 0),d=z.useCallback(()=>{n(!1),o(void 0),i(void 0),c(void 0),u(void 0),s==null||s()},[s]),f=z.useCallback(()=>{l==null||l()},[l]),p=z.useCallback((e,t)=>{i(e),o(t==null?void 0:t.context),c(()=>t==null?void 0:t.onClose),u(()=>t==null?void 0:t.onComplete),n(!0)},[]),m=z.useMemo(()=>({openModal:p,closeModal:d,onComplete:f}),[p,d,f]),h=z.useMemo(()=>({isOpen:t,modalType:r,modalInitContext:a}),[t,r,a]);return(0,B.jsx)(Rh.Provider,{value:m,children:(0,B.jsx)(Lh.Provider,{value:h,children:e})})},Bh=()=>{let e=z.useContext(Lh),t=z.useContext(Rh);return{...e,...t}};function Vh(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Hh=e=>{switch(e){case`success`:return Gh;case`info`:return qh;case`warning`:return Kh;case`error`:return Jh;default:return null}},Uh=Array(12).fill(0),Wh=({visible:e,className:t})=>z.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},z.createElement(`div`,{className:`sonner-spinner`},Uh.map((e,t)=>z.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Gh=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Kh=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),qh=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Jh=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Yh=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,
42width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),z.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Xh=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},Zh=1,Qh=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)==`number`||((t=e.id)==null?void 0:t.length)>0?e.id:Zh++,a=this.toasts.find(e=>e.id===i),o=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(t=>t.id===i?(this.publish({...t,...e,id:i,title:n}),{...t,...e,id:i,dismissible:o,title:n}):t):this.addToast({title:n,...r,dismissible:o,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>
42this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],z.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(eg(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Zh++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},$h=(e,t)=>{let n=(t==null?void 0:t.id)||Zh++;return Qh.addToast({title:e,...t,id:n}),n},eg=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,tg=Object.assign($h,{success:Qh.success,info:Qh.info,warning:Qh.warning,error:Qh.error,custom:Qh.custom,message:Qh.message,promise:Qh.promise,dismiss:Qh.dismiss,loading:Qh.loading},{getHistory:()=>Qh.toasts,getToasts:()=>Qh.getActiveToasts()});Vh(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;
42left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}
42[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);
42--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function ng(e){return e.label!==void 0}var rg=3,ig=`24px`,ag=`16px`,og=4e3,sg=356,cg=14,lg=45,ug=200;function dg(...e){return e.filter(Boolean).join(` `)}function fg(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var pg=e=>{var t,n,r,i,a,o,s,c,l;let{invert:u,toast:d,unstyled:f,interacting:p,setHeights:m,visibleToasts:h,heights:g,index:_,toasts:v,expanded:y,removeToast:b,defaultRichColors:x,closeButton:S,style:C,cancelButtonStyle:w,actionButtonStyle:T,className:E=``,descriptionClassName:D=``,duration:O,position:k,gap:ee,expandByDefault:A,classNames:j,icons:te,closeButtonAriaLabel:ne=`Close toast`}=e,[re,ie]=z.useState(null),[M,ae]=z.useState(null),[oe,se]=z.useState(!1),[ce,le]=z.useState(!1),[N,ue]=z.useState(!1),[de,fe]=z.useState(!1),[pe,me]=z.useState(!1),[he,ge]=z.useState(0),[_e,ve]=z.useState(0),ye=z.useRef(d.duration||O||og),be=z.useRef(null),xe=z.useRef(null),Se=_===0,Ce=_+1<=h,we=d.type,Te=d.dismissible!==!1,Ee=d.className||``,De=d.descriptionClassName||``,Oe=z.useMemo(()=>g.findIndex(e=>e.toastId===d.id)||0,[g,d.id]),ke=z.useMemo(()=>{var e;return(e=d.closeButton)==null?S:e},[d.closeButton,S]),Ae=z.useMemo(()=>d.duration||O||og,[d.duration,O]),je=z.useRef(0),Me=z.useRef(0),Ne=z.useRef(0),Pe=z.useRef(null),[Fe,Ie]=k.split(`-`),Le=z.useMemo(()=>
42g.reduce((e,t,n)=>n>=Oe?e:e+t.height,0),[g,Oe]),Re=Xh(),ze=d.invert||u,Be=we===`loading`;Me.current=z.useMemo(()=>Oe*ee+Le,[Oe,Le]),z.useEffect(()=>{ye.current=Ae},[Ae]),z.useEffect(()=>{se(!0)},[]),z.useEffect(()=>{let e=xe.current;if(e){let t=e.getBoundingClientRect().height;return ve(t),m(e=>[{toastId:d.id,height:t,position:d.position},...e]),()=>m(e=>e.filter(e=>e.toastId!==d.id))}},[m,d.id]),z.useLayoutEffect(()=>{if(!oe)return;let e=xe.current,t=e.style.height;e.style.height=`auto`;let n=e.getBoundingClientRect().height;e.style.height=t,ve(n),m(e=>e.find(e=>e.toastId===d.id)?e.map(e=>e.toastId===d.id?{...e,height:n}:e):[{toastId:d.id,height:n,position:d.position},...e])},[oe,d.title,d.description,m,d.id,d.jsx,d.action,d.cancel]);let Ve=z.useCallback(()=>{le(!0),ge(Me.current),m(e=>e.filter(e=>e.toastId!==d.id)),setTimeout(()=>{b(d)},ug)},[d,b,m,Me]);z.useEffect(()=>{if(d.promise&&we===`loading`||d.duration===1/0||d.type===`loading`)return;let e;return y||p||Re?(()=>{if(Ne.current<je.current){let e=new Date().getTime()-je.current;ye.current-=e}Ne.current=new Date().getTime()})():ye.current!==1/0&&(je.current=new Date().getTime(),e=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Ve()},ye.current)),()=>clearTimeout(e)},[y,p,d,we,Re,Ve]),z.useEffect(()=>{d.delete&&(Ve(),d.onDismiss==null||d.onDismiss.call(d,d))},[Ve,d.delete]);function He(){var e;if(te!=null&&te.loading){var t;return z.createElement(`div`,{className:dg(j==null?void 0:j.loader,d==null||(t=d.classNames)==null?void 0:t.loader,`sonner-loader`),"data-visible":we===`loading`},te.loading)}return z.createElement(Wh,{className:dg(j==null?void 0:j.loader,d==null||(e=d.classNames)==null?void 0:e.loader),visible:we===`loading`})}let Ue=d.icon||(te==null?void 0:te[we])||Hh(we);var We,Ge;return z.createElement(`li`,{tabIndex:0,ref:xe,className:dg(E,Ee,j==null?void 0:j.toast,d==null||(t=d.classNames)==null?void 0:t.toast,j==null?void 0:j.default,j==null?void 0:j[we],d==null||(n=d.classNames)==null?void 0:n[we]),"data-sonner-toast":``,"data-rich-colors":(We=d.richColors)==null?x:We,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":oe,"data-promise":!!d.promise,"data-swiped":pe,"data-removed":ce,"data-visible":Ce,"data-y-position":Fe,"data-x-position":Ie,"data-index":_,"data-front":Se,"data-swiping":N,"data-dismissible":Te,"data-type":we,"data-invert":ze,"data-swipe-out":de,"data-swipe-direction":M,"data-expanded":!!(y||A&&oe),"data-testid":d.testId,style:{"--index":_,"--toasts-before":_,"--z-index":v.length-_,"--offset":`${ce?he:Me.current}px`,"--initial-height":A?`auto`:`${_e}px`,...C,...d.style},onDragEnd:()=>{ue(!1),ie(null),Pe.current=null},onPointerDown:e=>{e.button!==2&&(Be||!Te||(be.current=new Date,ge(Me.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(ue(!0),Pe.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{var e,t,n;if(de||!Te)return;Pe.current=null;let r=Number(((e=xe.current)==null?void 0:e.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``))||0),i=Number(((t=xe.current)==null?void 0:t.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``))||0),a=new Date().getTime()-((n=be.current)==null?void 0:n.getTime()),o=re===`x`?r:i,s=Math.abs(o)/a;if(Math.abs(o)>=lg||s>.11){ge(Me.current),d.onDismiss==null||d.onDismiss.call(d,d),ae(re===`x`?r>0?`right`:`left`:i>0?`down`:`up`),Ve(),fe(!0);return}var c,l;(c=xe.current)==null||c.style.setProperty(`--swipe-amount-x`,`0px`),(l=xe.current)==null||l.style.setProperty(`--swipe-amount-y`,`0px`),me(!1),ue(!1),ie(null)},onPointerMove:t=>{var n,r,i;if(!Pe.current||!Te||((n=window.getSelection())==null?void 0:n.toString().length)>0)return;let a=t.clientY-Pe.current.y,o=t.clientX-Pe.current.x;var s;let c=(s=e.swipeDirections)==null?fg(k):s;!re&&(Math.abs(o)>1||Math.abs(a)>1)&&ie(Math.abs(o)>Math.abs(a)?`x`:`y`);let l={x:0,y:0},u=e=>1/(1.5+Math.abs(e)/20);if(re===`y`){if(c.includes(`top`)||c.includes(`bottom`)){if(c.includes(`top`)&&a<0||c.includes(`bottom`)&&a>0)l.y=a;else{let e=a*u(a);l.y=Math.abs(e)<Math.abs(a)?e:a}}}else if(re===`x`&&(c.includes(`left`)||c.includes(`right`))){if(c.includes(`left`)&&o<0||c.includes(`right`)&&o>0)l.x=o;else{let e=o*u(o);l.x=Math.abs(e)<Math.abs(o)?e:o}}(Math.abs(l.x)>
420||Math.abs(l.y)>0)&&me(!0),(r=xe.current)==null||r.style.setProperty(`--swipe-amount-x`,`${l.x}px`),(i=xe.current)==null||i.style.setProperty(`--swipe-amount-y`,`${l.y}px`)}},ke&&!d.jsx&&we!==`loading`?z.createElement(`button`,{"aria-label":ne,"data-disabled":Be,"data-close-button":!0,onClick:Be||!Te?()=>{}:()=>{Ve(),d.onDismiss==null||d.onDismiss.call(d,d)},className:dg(j==null?void 0:j.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Ge=te==null?void 0:te.close)==null?Yh:Ge):null,(we||d.icon||d.promise)&&d.icon!==null&&((te==null?void 0:te[we])!==null||d.icon)?z.createElement(`div`,{"data-icon":``,className:dg(j==null?void 0:j.icon,d==null||(i=d.classNames)==null?void 0:i.icon)},d.promise||d.type===`loading`&&!d.icon?d.icon||He():null,d.type===`loading`?null:Ue):null,z.createElement(`div`,{"data-content":``,className:dg(j==null?void 0:j.content,d==null||(a=d.classNames)==null?void 0:a.content)},z.createElement(`div`,{"data-title":``,className:dg(j==null?void 0:j.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title==`function`?d.title():d.title),d.description?z.createElement(`div`,{"data-description":``,className:dg(D,De,j==null?void 0:j.description,d==null||(s=d.classNames)==null?void 0:s.description)},typeof d.description==`function`?d.description():d.description):null),z.isValidElement(d.cancel)?d.cancel:d.cancel&&ng(d.cancel)?z.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||w,onClick:e=>{ng(d.cancel)&&Te&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,e),Ve())},className:dg(j==null?void 0:j.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,z.isValidElement(d.action)?d.action:d.action&&ng(d.action)?z.createElement(`button`,{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||T,onClick:e=>{ng(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,e),!e.defaultPrevented&&Ve())},className:dg(j==null?void 0:j.actionButton,d==null||(l=d.classNames)==null?void 0:l.actionButton)},d.action.label):null)};function mg(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function hg(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?ag:ig;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var gg=z.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=rg,toastOptions:g,dir:_=mg(),gap:v=cg,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=z.useState([]),C=z.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=z.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=z.useState([]),[D,O]=z.useState(!1),[k,ee]=z.useState(!1),[A,j]=z.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),te=z.useRef(null),ne=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),re=z.useRef(null),ie=z.useRef(!1),M=z.useCallback(e=>{S(t=>{var n;return(n=t.find(t=>t.id===e.id))!=null&&n.delete||Qh.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return z.useEffect(()=>Qh.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Br.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),z.useEffect(()=>{if(d!==`system`){j(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?j(`dark`):j(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{j(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{j(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),z.useEffect(()=>{x.length<=1&&O(!1)},[x]),z.useEffect(()=>{let e=e=>{var t;if(a.every(t=>e[t]||e.code===t)){var n;O(!0),(n=te.current)==null||n.focus()}e.code===`Escape`&&(document.activeElement===te.current||(t=te.current)!=null&&t.contains(document.activeElement))&&O(!1)};
42return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),z.useEffect(()=>{if(te.current)return()=>{re.current&&(re.current.focus({preventScroll:!0}),re.current=null,ie.current=!1)}},[te.current]),z.createElement(`section`,{ref:t,"aria-label":`${b} ${ne}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{var i;let[a,d]=t.split(`-`);return C.length?z.createElement(`ol`,{key:t,dir:_===`auto`?mg():_,tabIndex:-1,ref:te,className:c,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":a,"data-x-position":d,style:{"--front-toast-height":`${((i=T[0])==null?void 0:i.height)||0}px`,"--width":`${sg}px`,"--gap":`${v}px`,...m,...hg(l,u)},onBlur:e=>{ie.current&&!e.currentTarget.contains(e.relatedTarget)&&(ie.current=!1,re.current&&(re.current.focus({preventScroll:!0}),re.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ie.current||(ie.current=!0,re.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ee(!0)},onPointerUp:()=>ee(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>{var a,c;return z.createElement(pg,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:(a=g==null?void 0:g.duration)==null?p:a,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:h,closeButton:(c=g==null?void 0:g.closeButton)==null?s:c,interacting:k,position:t,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,closeButtonAriaLabel:g==null?void 0:g.closeButtonAriaLabel,removeToast:M,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections})})):null}))}),_g=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function vg(e){return typeof e==`string`&&_g.test(e)}var yg=`personal`,bg=e=>e===yg,xg=e=>vg(e)?yg:e,Sg=e=>e.graphQLErrors.some(e=>{var t;return(e==null||(t=e.extensions)==null?void 0:t.code)===`UNAUTHENTICATED`}),Cg=e=>`${e}-lastSelectedTeam`;function wg(e,t){localStorage.setItem(Cg(e),JSON.stringify(t))}function Tg(e){localStorage.removeItem(Cg(e))}function Eg(e){let t=localStorage.getItem(Cg(e)),n=t?JSON.parse(t):null;return typeof n==`string`?n:null}function Dg(){return d()}function Og(){return(0,B.jsx)(jn,{"aria-label":`Loading`,role:`status`,children:(0,B.jsxs)(`div`,{className:`mt-6 flex flex-col gap-4`,children:[(0,B.jsx)(Ci,{className:`h-8 w-48 max-w-full`}),(0,B.jsx)(Ci,{className:`h-4 w-full max-w-xl`}),(0,B.jsx)(Ci,{className:`h-4 w-2/3 max-w-md`})]})})}function kg(){let{pathname:e}=u();return z.useEffect(()=>{window.scrollTo(0,0)},[e]),null}var Ag=s(Tr(),1),jg=(0,z.createContext)({isPaymentInProgress:!1,paymentStatus:void 0}),Mg=(0,z.createContext)({setIsPaymentInProgress:()=>{throw Error(`Can't call setter outside of provider`)},setPaymentStatus:()=>{throw Error(`Can't call setter outside of provider`)}}),Ng=function(e){return e.FAILED=`FAILED`,e.SUCCESS=`SUCCESS`,e.FINALIZED_STRIPE_CHECKOUT=`FINALIZED_STRIPE_CHECKOUT`,e}({}),Pg=({children:e})=>{let{search:t}=u(),{checkoutSessionId:n,stripeStatus:r}=Ag.parse(t),i=r===`cancelled`?Ng.FAILED:n?Ng.FINALIZED_STRIPE_CHECKOUT:void 0,[a,o]=z.useState(i),[s,c]=z.useState(!1),l=z.useMemo(()=>({paymentStatus:a,isPaymentInProgress:s}),[a,s]),d=z.useMemo(()=>({setPaymentStatus:o,setIsPaymentInProgress:c}),[o,c]);return(0,B.jsx)(jg.Provider,{value:l,children:(0,B.jsx)(Mg.Provider,{value:d,children:e})})},Fg=({onClick:e,loading:t,...n})=>{let r=Je(),[i]=Ln(),[a,o]=z.useState(!1),s=async t=>{e&&e(t),o(!0);try{let{data:e}=await i(),t=e==null?void 0:e.createStripeCustomerPortalSessionUrl;t&&(window.location.href=t)}catch(e){r(e)}finally{o(!1)}};return(0,B.jsx)(T,{...n,loading:t||a,onClick:s})};function Ig(){return(0,B.jsxs)(me,{intent:`warning`,title:`There was an issue with your last payment`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:`Your recent payment couldn’t be processed. Please update your billing details to avoid service interruption. Until this is resolved, changes to your current plan can only be made by contacting support.`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(Fg,{variant:`secondary`,size:`small`,intent:`warning`,marginRight:4,marginTop:4,marginBottom:1,"data-test":`manage-payment-methods-past-due`,children:`Manage payment methods`}),(0,B.jsx)(x,{variant:`secondary`,size:`small`,marginTop:4,marginBottom:1,onClick:()=>{St.showNewMessage(`I'd like to update my plan with the following changes...`)},"data-test":`contact-support-past-due`,children:`Contact support`})]})]})}var Lg={[K.ChangePlan]:e=>
42(e==null?void 0:e.planChangePrerequisite)===It.ContactWorkspaceAdmin?{title:`Update the workspace plan`,description:`This action cannot be completed because you don't have permission to change the workspace plan.`,suggestion:`Contact your admin to change the workspace plan.`,iconName:`robot`}:{title:`Update my plan`,iconName:`robot`},[K.AddWebsite]:e=>(e==null?void 0:e.planChangePrerequisite)===It.ContactWorkspaceAdmin?{title:`Add more websites`,description:`This action cannot be completed because you don't have permission to add websites to the workspace.`,suggestion:`Contact your admin to add more websites to your current plan, or upgrade to a plan with higher limits.`,iconName:`globe`}:{title:`Add more websites`,description:`Add more websites to your current plan, or upgrade to a plan with higher limits. You can run unlimited robots for each website.`,iconName:`globe`},[K.AddCredits]:e=>(e==null?void 0:e.planChangePrerequisite)===It.ContactWorkspaceAdmin?{title:`Add more credits`,description:`This action cannot be completed because you don't have permission to add credits to the workspace.`,suggestion:`Contact your admin to add more credits to your current plan.`,iconName:`database`}:{title:`Add more credits`,description:`Upgrade to a plan with higher limits, or add more credits to your current plan.`,iconName:`database`},[K.WebsiteLimitReached]:e=>(e==null?void 0:e.planChangePrerequisite)===It.ContactWorkspaceAdmin?{title:`This workspace needs more websites`,description:`This robot cannot be created because your workspace has exceeded its website limit.`,suggestion:`Contact your admin to add more websites to your current plan, or upgrade to a plan with higher limits.`,iconName:`globe`}:(e==null?void 0:e.planChangePrerequisite)===It.ContactSupport?{title:`This workspace needs more websites`,description:`This robot cannot be created because your workspace has exceeded its website limit.`,suggestion:`Contact our support team to make adjustments to your plan.`,iconName:`globe`}:{title:`Need more websites`,description:`This robot cannot be created because your workspace has reached its website limit. Add more websites to your current plan or upgrade to a higher plan to continue.`,iconName:`globe`},[K.CreditLimitReached]:e=>(e==null?void 0:e.planChangePrerequisite)===It.ContactWorkspaceAdmin?{title:`This workspace needs more credits`,description:`This task cannot be completed because your workspace has run out of credits.`,suggestion:`Contact your admin to ${e!=null&&e.allowCreditTopUps?`add more credits to your current plan, or upgrade`:`upgrade`} to a plan with higher limits.`,iconName:`database`}:(e==null?void 0:e.planChangePrerequisite)===It.ContactSupport?{title:`This workspace needs more credits`,description:`This task cannot be completed because your workspace has run out of credits.`,suggestion:`Contact our support team to make adjustments to your plan.`,iconName:`database`}:{title:`Need more credits`,description:`This task cannot be completed because your workspace does not have enough credits. ${e!=null&&e.allowCreditTopUps?`Add more credits to your current plan, or upgrade`:`Upgrade`} to a plan with higher limits.`,iconName:`database`},[K.WorkspaceMembersLimitReached]:e=>(e==null?void 0:e.planChangePrerequisite)===It.ContactWorkspaceAdmin?{title:`This workspace needs more seats`,description:`This task cannot be completed because your workspace has exceeded its team members limit.`,suggestion:`Contact your admin to upgrade to a plan that supports more team members.`,iconName:`users`}:(e==null?void 0:e.planChangePrerequisite)===It.ContactSupport?{title:`This workspace needs more seats`,description:`This action cannot be completed because your workspace has exceeded its team members limit.`,suggestion:`Contact our support team to make adjustments to your plan.`,iconName:`users`}:{title:`Need more members`,description:`You've reached the team member limit for your workspace. Upgrade your plan to add more teammates.`,iconName:`users`},[K.RobotsLimitReached]:e=>
42(e==null?void 0:e.planChangePrerequisite)===It.ContactWorkspaceAdmin?{title:`This workspace needs more robots`,description:`This robot cannot be created because your workspace has exceeded its robots limit.`,suggestion:`Contact your admin to upgrade to a plan with higher limits.`,iconName:`robot`}:(e==null?void 0:e.planChangePrerequisite)===It.ContactSupport?{title:`This workspace needs more robots`,description:`This robot cannot be created because your workspace has exceeded its robots limit.`,suggestion:`Contact our support team to make adjustments to your plan.`,iconName:`robot`}:{title:`Need more robots`,description:`This robot cannot be created because your workspace has reached its robots limit.`,suggestion:`Upgrade to a higher plan to create more robots.`,iconName:`robot`},[K.AiBudgetLimitReached]:()=>({title:`AI budget limit reached`,description:`This action cannot be completed because your workspace has exceeded its AI budget for this billing cycle.`,suggestion:`Contact our support team for assistance.`,iconName:`sparkles`})},Rg=()=>{let e=z.useContext(jg),t=z.useContext(Mg);return{...e,...t}},zg=({setData:e,input:t})=>{let{isOpen:n}=Bh(),[r]=g(t.variables,300);return Nt({fetchPolicy:`network-only`,variables:r,skip:!n||t.skip||!r,onCompleted:e})},Bg=({setData:e,totalWebsitesAddOns:t,preferredPlanKey:n,currentWorkspace:r})=>{let{modalType:i}=Bh();return zg({setData:e,input:z.useMemo(()=>{if(!i||r.plan.planChangePrerequisite&&[It.ContactWorkspaceAdmin,It.ContactSupport].includes(r.plan.planChangePrerequisite)||r.plan.isLegacy&&[K.AddWebsite,K.WebsiteLimitReached].includes(i))return{variables:void 0,skip:!0};switch(i){case K.WorkspaceMembersLimitReached:return{variables:{maxUsers:!0},skip:!1};case K.ChangePlan:case K.AddWebsite:case K.WebsiteLimitReached:return t===void 0?{variables:void 0,skip:!0}:{variables:{totalWebsitesAddOns:t,preferredPlan:n},skip:!1}}return{variables:void 0,skip:!0}},[i,r.plan.planChangePrerequisite,r.plan.isLegacy,t,n])})},Vg=(e,t)=>{switch(t.type){case`SET_WEBSITE_ADDONS`:return{...e,websiteAddons:t.payload.addons,totalWebsitesAddOns:t.payload.totalAddons,totalWebsitesNeeded:t.payload.maxWebsites};case`SET_TOTAL_WEBSITES_NEEDED`:return{...e,totalWebsitesNeeded:t.payload};case`RESET`:return{websiteAddons:void 0,totalWebsitesAddOns:void 0,totalWebsitesNeeded:void 0};default:return e}},Hg=()=>{let[e,t]=ye(``,{queryStringKey:`websiteAddons`,pushToHistory:!1}),[n,r]=z.useReducer(Vg,{websiteAddons:void 0,totalWebsitesAddOns:void 0,totalWebsitesNeeded:void 0});return z.useEffect(()=>{if(n.websiteAddons===void 0)return;let r=n.websiteAddons===0?``:n.websiteAddons.toString();e!==r&&t(r)},[n.websiteAddons,e,t]),[n,r,e]},Ug=new WeakMap;function Wg(e){return Ug.has(e)||Ug.set(e,{transforms:[],values:new Map}),Ug.get(e)}function Gg(e,t){return e.has(t)||e.set(t,new xs),e.get(t)}var Kg=[``,`X`,`Y`,`Z`],qg=[`translate`,`scale`,`rotate`,`skew`],Jg={x:`translateX`,y:`translateY`,z:`translateZ`},Yg={syntax:`<angle>`,initialValue:`0deg`,toDefaultUnit:e=>e+`deg`},Xg={translate:{syntax:`<length-percentage>`,initialValue:`0px`,toDefaultUnit:e=>e+`px`},rotate:Yg,scale:{syntax:`<number>`,initialValue:1,toDefaultUnit:js},skew:Yg},Zg=new Map,Qg=e=>`--motion-${e}`,$g=[`x`,`y`,`z`];qg.forEach(e=>{Kg.forEach(t=>{$g.push(e+t),Zg.set(Qg(e+t),Xg[e])})});var e_=(e,t)=>$g.indexOf(e)-$g.indexOf(t),t_=new Set($g),n_=e=>t_.has(e),r_=(e,t)=>{Jg[t]&&(t=Jg[t]);let{transforms:n}=Wg(e);Ss(n,t),e.style.transform=i_(n)},i_=e=>e.sort(e_).reduce(a_,``).trim(),a_=(e,t)=>`${e} ${t}(var(${Qg(t)}))`,o_=e=>e.startsWith(`--`),s_=new Set;function c_(e){if(!s_.has(e)){s_.add(e);try{let{syntax:t,initialValue:n}=Zg.has(e)?Zg.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:n})}catch{}}}var l_=(e,t)=>document.createElement(`div`).animate(e,t),u_={cssRegisterProperty:()=>typeof CSS<`u`&&Object.hasOwnProperty.call(CSS,`registerProperty`),waapi:()=>Object.hasOwnProperty.call(Element.prototype,`animate`),partialKeyframes:()=>{try{l_({opacity:[1]})}catch{return!1}return!0},finished:()=>!!l_({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{l_({opacity:0}
42,{easing:`linear(0, 1)`})}catch{return!1}return!0}},d_={},f_={};for(let e in u_)f_[e]=()=>(d_[e]===void 0&&(d_[e]=u_[e]()),d_[e]);var p_=.015,m_=(e,t)=>{let n=``,r=Math.round(t/p_);for(let t=0;t<r;t++)n+=e(Ms(0,r-1,t))+`, `;return n.substring(0,n.length-2)},h_=(e,t)=>Rs(e)?f_.linearEasing()?`linear(${m_(e,t)})`:ws.easing:Is(e)?g_(e):e,g_=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`;function __(e,t){for(let n=0;n<e.length;n++)e[n]===null&&(e[n]=n?e[n-1]:t());return e}var v_=e=>Array.isArray(e)?e:[e];function y_(e){return Jg[e]&&(e=Jg[e]),n_(e)?Qg(e):e}var b_={get:(e,t)=>{t=y_(t);let n=o_(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!n&&n!==0){let e=Zg.get(t);e&&(n=e.initialValue)}return n},set:(e,t,n)=>{t=y_(t),o_(t)?e.style.setProperty(t,n):e.style[t]=n}};function x_(e,t=!0){if(!(!e||e.playState===`finished`))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function S_(e,t){var n;let r=(t==null?void 0:t.toDefaultUnit)||js,i=e[e.length-1];if(zs(i)){let e=((n=i.match(/(-?[\d.]+)([a-z%]*)/))==null?void 0:n[2])||``;e&&(r=t=>t+e)}return r}function C_(){return window.__MOTION_DEV_TOOLS_RECORD}function w_(e,t,n,r={},i){let a=C_(),o=r.record!==!1&&a,s,{duration:c=ws.duration,delay:l=ws.delay,endDelay:u=ws.endDelay,repeat:d=ws.repeat,easing:f=ws.easing,persist:p=!1,direction:m,offset:h,allowWebkitAcceleration:g=!1,autoplay:_=!0}=r,v=Wg(e),y=n_(t),b=f_.waapi();y&&r_(e,t);let x=y_(t),S=Gg(v.values,x),C=Zg.get(x);return x_(S.animation,!(Ls(f)&&S.generator)&&r.record!==!1),()=>{let v=()=>{var t,n;return(n=(t=b_.get(e,x))==null?C==null?void 0:C.initialValue:t)==null?0:n},w=__(v_(n),v),T=S_(w,C);if(Ls(f)){let e=f.createAnimation(w,t!==`opacity`,v,x,S);f=e.easing,w=e.keyframes||w,c=e.duration||c}if(o_(x)&&(f_.cssRegisterProperty()?c_(x):b=!1),y&&!f_.linearEasing()&&(Rs(f)||Es(f)&&f.some(Rs))&&(b=!1),b){C&&(w=w.map(e=>Ts(e)?C.toDefaultUnit(e):e)),w.length===1&&(!f_.partialKeyframes()||o)&&w.unshift(v());let t={delay:Bs.ms(l),duration:Bs.ms(c),endDelay:Bs.ms(u),easing:Es(f)?void 0:h_(f,c),direction:m,iterations:d+1,fill:`both`};s=e.animate({[x]:w,offset:h,easing:Es(f)?f.map(e=>h_(e,c)):void 0},t),s.finished||(s.finished=new Promise((e,t)=>{s.onfinish=e,s.oncancel=t}));let n=w[w.length-1];s.finished.then(()=>{p||(b_.set(e,x,n),s.cancel())}).catch(As),g||(s.playbackRate=1.000001)}else if(i&&y)w=w.map(e=>typeof e==`string`?parseFloat(e):e),w.length===1&&w.unshift(parseFloat(v())),s=new i(t=>{b_.set(e,x,T?T(t):t)},w,Object.assign(Object.assign({},r),{duration:c,easing:f}));else{let t=w[w.length-1];b_.set(e,x,C&&Ts(t)?C.toDefaultUnit(t):t)}return o&&a(e,t,w,{duration:c,delay:l,easing:f,repeat:d,offset:h},`motion-one`),S.setAnimation(s),s&&!_&&s.pause(),s}}var T_=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function E_(e,t){return typeof e==`string`?t?(t[e]!=null||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}var D_=e=>e(),O_=(e,t,n=ws.duration)=>new Proxy({animations:e.map(D_).filter(Boolean),duration:n,options:t},A_),k_=e=>e.animations[0],A_={get:(e,t)=>{let n=k_(e);switch(t){case`duration`:return e.duration;case`currentTime`:return Bs.s((n==null?void 0:n[t])||0);case`playbackRate`:case`playState`:return n==null?void 0:n[t];case`finished`:return e.finished||(e.finished=Promise.all(e.animations.map(j_)).catch(As)),e.finished;case`stop`:return()=>{e.animations.forEach(e=>x_(e))};case`forEachNative`:return t=>{e.animations.forEach(n=>t(n,e))};default:return(n==null?void 0:n[t])===void 0?void 0:()=>e.animations.forEach(e=>e[t]())}},set:(e,t,n)=>{switch(t){case`currentTime`:n=Bs.ms(n);case`playbackRate`:for(let r=0;r<e.animations.length;r++)e.animations[r][t]=n;return!0}return!1}},j_=e=>e.finished;function M_(e,t,n){return Rs(e)?e(t,n):e}function N_(e){return function(t,n,r={}){t=E_(t);let i=t.length,a=[];for(let o=0;o<i;o++){let s=t[o];for(let t in n){let c=T_(r,t);c.delay=M_(c.delay,o,i);let l=w_(s,t,n[t],c,e);a.push(l)}}return O_(a,r,r.duration)}}var P_=N_(Xs);function F_(e,t={}){return O_([()=>{let n=new Xs(e,[0,1],t);return n.finished.catch(()=>{}),n}],t,t.duration)}function I_(e,t,n){return(Rs(e)?F_:P_)(e,t,n)}var L_=({loading:e})=>{let t=z.useRef(null);return z.useEffect(()=>{if(!e||!t.current)return;let n=I_(t.current,{x:[`-100%`,`250%`]},{duration:1,repeat:1/0,easing:`ease-in-out`});return()=>{n.cancel()}},[e]),e?(0,B.jsx)(`div`,{className:`absolute left-0 top-0 h-1 w-full bg-gray-200`,children:(0,B.jsx)(`div`,{ref:t,className:`relative h-full w-[40%] bg-primary-500`})}):null},R_=({loading:e,error:t,children:n,hasData:r,refetch:i})=>e&&!r?(0,B.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,B.jsx)(Qn,{})}):t?(0,B.jsx)(`div`,{className:`mt-6`,children:(0,B.jsxs)(me,{icon:`circle-alert`,
42intent:`warning`,title:`Unexpected error`,children:[(0,B.jsx)(`p`,{children:`Something went wrong. Please try again in a few moments.`}),(0,B.jsx)(x,{variant:`secondary`,icon:`refresh-cw`,size:`small`,marginTop:2,marginBottom:1,onClick:()=>i(),"data-test":`retry-subscription-load`,children:`Try again`})]})}):(0,B.jsxs)(`div`,{className:`relative -mx-6 flex flex-1 flex-col lg:flex-row`,children:[(0,B.jsx)(L_,{loading:e}),n]}),z_=s(Er(),1);function B_(e){return`${e.title} ${e.options.credits.toLocaleString(`en-US`)}`}function V_(e){return W_(e),U_(e).replace(`.00`,``)}function H_(e,t=2){return W_(e),U_(e,t)}function U_(e,t){let n={style:`currency`,currency:`USD`};return t!==void 0&&(n.maximumFractionDigits=t,n.minimumFractionDigits=0),e.toLocaleString(`en-US`,n)}function W_(e){if(!Number.isFinite(e))throw Error(`Invalid amount: ${e}`)}var G_=(e,t)=>{let n=V_(e);return t?`${n}/${t===_n.Annually?`yr`:`mo`}`:n};function K_({purchaseMetadata:e,affiliation:t,workspaceId:n}){var r,i;return{eventName:`purchase`,parameters:{planSlug:(r=e.planSlug)==null?``:r,workspaceId:n,affiliation:t,transaction_id:e.transactionId,value:e.value,tax:e.tax,currency:e.currency,coupon:(i=e.coupon)==null?null:i,items:e.items.map(t=>{var n,r;return{item_id:t.itemId,item_name:t.itemName,planSlug:(n=t.planSlug)==null?``:n,price:t.price,discount:t.discount,item_category:q_(t.billingCycle),item_category2:((r=e.planTitle)==null?t.itemName:r).toLowerCase()}})}}}function q_(e){switch(e){case _n.Annually:return`annual`;case _n.Quarterly:return`quarterly`;case _n.Monthly:return`monthly`;case _n.Custom:return`custom`;case _n.OneTime:default:return`one-time`}}var J_=({title:e,children:t,className:n})=>(0,B.jsxs)(`div`,{className:`rounded-lg bg-white p-4 ${n}`,children:[e&&(0,B.jsx)(`p`,{className:`mb-4 text-base font-semibold text-gray-700`,children:e}),t]});function Y_(){let{workspaceName:e}=Dg(),t=F({to:`workspace-subscription`,workspaceName:e}),n=`${window.location.origin}${t}`;return(0,B.jsxs)(`p`,{className:`mt-4 flex items-start gap-2 text-sm font-normal text-gray-600`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)(pe,{name:`info`,size:4,"aria-label":`Information`})}),(0,B.jsxs)(`span`,{children:[`Your default payment method will be charged. You can update your payment method on the`,` `,(0,B.jsx)(T,{variant:`linkColored`,size:`small`,verticalAlign:`baseline`,link:n,"data-test":`manage-payment-methods`,children:(0,B.jsx)(`span`,{className:`-mt-1 block`,children:`Billing page`})}),`.`]})]})}var X_=({text:e,price:t,className:n,subPriceText:r,subPrice:i,subPriceTooltip:a})=>(0,B.jsxs)(`div`,{className:n,children:[i&&(0,B.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`p`,{className:`text-sm font-normal text-gray-600`,children:r}),a?(0,B.jsx)(ke,{placement:`right`,content:(0,B.jsx)(`div`,{className:`text-left text-sm font-normal [&>*]:text-sm [&>*]:font-normal`,children:a}),children:(0,B.jsx)(`span`,{className:`cursor-pointer`,children:(0,B.jsx)(pe,{name:`info`,size:5,className:`text-gray-400`})})}):null]}),(0,B.jsx)(`span`,{className:`text-sm font-semibold text-gray-700`,children:i})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`p`,{className:`text-sm font-medium text-gray-700`,children:e}),(0,B.jsx)(`span`,{className:`text-lg font-bold text-gray-900`,children:t})]})]}),Z_=({title:e,price:t,description:n,className:r,tooltip:i})=>{let a=i?(0,B.jsx)(ke,{placement:`right`,content:(0,B.jsx)(`div`,{className:`text-left text-sm font-normal [&>*]:text-sm [&>*]:font-normal`,children:i}),children:(0,B.jsx)(`span`,{className:`cursor-pointer`,children:(0,B.jsx)(pe,{name:`info`,size:5,className:`text-gray-400`})})}):null;return(0,B.jsxs)(`div`,{className:`flex items-center justify-between ${r}`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`p`,{className:`text-sm font-medium text-gray-700`,children:e}),a]}),n&&(0,B.jsx)(`p`,{className:`mt-1 text-sm font-normal text-gray-600`,children:n})]}),(0,B.jsx)(`span`,{className:`text-sm font-semibold text-gray-700`,children:t})]})},Q_=()=>{let e=new WeakSet;return(t,n)=>{if(typeof n==`object`&&n){if(e.has(n))return;e.add(n)}return n}},$_=e=>JSON.stringify(e,Q_()),ev=(e,{includeRawErrorObj:t}={includeRawErrorObj:!0})=>typeof e==`string`?{name:`StringError`,message:e}:e instanceof Error?{raw:t?$_(e):void 0,name:e.name,message:e.message,stack:e.stack}:{name:`unknownError`,message:`caught an unknown error`,raw:$_(e)};function tv(){return`https://calendly.com/d/cq8z-ccb-sxk/browse-ai-intro-call-premium?month=${nv()}`}function nv(){let e=new Date;return`${e.getFullYear()}
42-${String(e.getMonth()+1).padStart(2,`0`)}`}function rv(e){"@babel/helpers - typeof";return rv=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},rv(e)}var iv=`basil`,av=function(e){return e===3?`v3`:e},ov=`https://js.stripe.com`,sv=`${ov}/${iv}/stripe.js`,cv=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,lv=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,uv=`loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used`,dv=function(e){return cv.test(e)||lv.test(e)},fv=function(){for(var e=document.querySelectorAll(`script[src^="${ov}"]`),t=0;t<e.length;t++){var n=e[t];if(dv(n.src))return n}return null},pv=function(e){var t=e&&!e.advancedFraudSignals?`?advancedFraudSignals=false`:``,n=document.createElement(`script`);n.src=`${sv}${t}`;var r=document.head||document.body;if(!r)throw Error(`Expected document.body not to be null. Stripe.js requires a <body> element.`);return r.appendChild(n),n},mv=function(e,t){!e||!e._registerWrapper||e._registerWrapper({name:`stripe-js`,version:`7.3.1`,startTime:t})},hv=null,gv=null,_v=null,vv=function(e){return function(t){e(Error(`Failed to load Stripe.js`,{cause:t}))}},yv=function(e,t){return function(){window.Stripe?e(window.Stripe):t(Error(`Stripe.js not available`))}},bv=function(e){return hv===null?(hv=new Promise(function(t,n){if(typeof window>`u`||typeof document>`u`){t(null);return}if(window.Stripe&&e&&console.warn(uv),window.Stripe){t(window.Stripe);return}try{var r=fv();if(r&&e)console.warn(uv);else if(!r)r=pv(e);else if(r&&_v!==null&&gv!==null){var i;r.removeEventListener(`load`,_v),r.removeEventListener(`error`,gv),(i=r.parentNode)==null||i.removeChild(r),r=pv(e)}_v=yv(t,n),gv=vv(n),r.addEventListener(`load`,_v),r.addEventListener(`error`,gv)}catch(e){n(e);return}}),hv.catch(function(e){return hv=null,Promise.reject(e)})):hv},xv=function(e,t,n){if(e===null)return null;var r=t[0].match(/^pk_test/),i=av(e.version),a=iv;r&&i!==a&&console.warn(`Stripe.js@${i} was loaded on the page, but @stripe/[email protected] expected Stripe.js@${a}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);var o=e.apply(void 0,t);return mv(o,n),o},Sv=function(e){var t=`invalid load parameters; expected object of shape
43
44    {advancedFraudSignals: boolean}
45
46but received
47
48    ${JSON.stringify(e)}
49`;if(e===null||rv(e)!==`object`)throw Error(t);if(Object.keys(e).length===1&&typeof e.advancedFraudSignals==`boolean`)return e;throw Error(t)},Cv,wv=!1,Tv=function(){var e=[...arguments];wv=!0;var t=Date.now();return bv(Cv).then(function(n){return xv(n,e,t)})};Tv.setLoadParameters=function(e){if(wv&&Cv){var t=Sv(e);if(Object.keys(t).reduce(function(t,n){var r;return t&&e[n]===((r=Cv)==null?void 0:r[n])},!0))return}if(wv)throw Error(`You cannot change load parameters after calling loadStripe`);Cv=Sv(e)};var Ev=`pk_live_DzSjQ36HHCPCIjzCD35J54Hm002FzDGEvJ`,Dv=null,Ov=()=>(Dv||(Dv=Tv(Ev)),Dv),kv=k(`dashboard/src/components/SubscriptionModal/components/CostBreakdown/PayButton.tsx`),Av=({children:e,planChangePrerequisite:t,selectedPlanKey:n,totalWebsitesAddOns:r,disabled:i,ariaLabel:a,onClick:o,onModalClose:s})=>{let c=Je(),{setPaymentStatus:l,setIsPaymentInProgress:u}=Rg(),[d,f]=z.useState(!1),[p,{loading:m}]=gn(),h=async()=>{if(o==null||o(),t===It.ContactSupport){St.showNewMessage(`Hi, I’d like to adjust my plan. Can you help review my usage and suggest the best fit?`);return}if(!t){let e=window.Rewardful;try{u(!0);let{data:t}=await p({variables:{input:{planKey:n,totalWebsitesAddOns:r,referral:e==null?void 0:e.referral},returnUrl:`${window.location.pathname}${window.location.search}`}});if(u(!1),!t)return;switch(t.upgradePlan.__typename){case`UpgradePlanByCheckoutSession`:{let e=t.upgradePlan.checkoutSessionId;f(!0);try{let t=await Ov();if(!t)throw Error(`Could not load Stripe script.`);await t.redirectToCheckout({sessionId:e})}catch(t){kv(`error`,`Failed to redirect user to Stripe checkout page`,{error:ev(t),sessionId:e}),f(!1),c(t)}break}case`UpgradePlanSuccess`:l(Ng.SUCCESS);break;case`NeedInvoicePayment`:{let e=t.upgradePlan.invoiceUrl;window.location.href=e,s();break}}}catch(e){c(e)}}},g=t===It.ContactSales?tv():void 0,_=z.useMemo(()=>t?t===It.ContactSales?`Book a consultation call`:`Contact Support`:e,[t,e]),v=m||d;return(0,B.jsx)(x,{"aria-label":a==null?typeof _==`string`?_:void 0:a,fullWidth:!0,variant:`primary`,link:g,loading:v,disabled:v||i,onClick:h,"data-test":`pay-subscription-button`,children:_})},jv=({selectedPlan:e,totalWebsitesAddOns:t,setWillExceedPlanLimits:n,onInitPayment:r,onModalClose:i})=>{var a,o;let{isOpen:s}=Bh(),{workspaceName:c}=Dg(),l={slug:e.slug,billingCycleInMonths:e.billingCycle===_n.Annually?12:1},[u]=g({input:{planKey:l,totalWebsitesAddOns:t}},300),d=e.planChangePrerequisite!==null||!s||!u,{data:f,loading:p,error:m,refetch:h,networkStatus:_}=wn({fetchPolicy:`network-only`,variables:u,skip:d,notifyOnNetworkStatusChange:!0,onCompleted:e=>{e.calculateUpdatePlanCostBreakdown.__typename===`UpdatePlanCostBreakdown`&&(n==null||n(e.calculateUpdatePlanCostBreakdown.willExceedPlanLimits))}}),{data:v,loading:y,refetch:b,error:S,networkStatus:C}=Pn({variables:{workspaceName:c},skip:d||!c,notifyOnNetworkStatusChange:!0}),w=p||_===P.refetch||y||C===P.refetch,T=m||S,E=f&&v&&((a=v.team)==null?void 0:a.id),D=(0,B.jsx)(`p`,{className:`mb-4 text-lg font-bold text-gray-700`,children:`Cost breakdown`});if(e.planChangePrerequisite!==null&&v!=null&&(o=v.team)!=null&&o.id)return(0,B.jsxs)(`div`,{className:`flex-1 bg-gray-50 p-6`,children:[D,(0,B.jsxs)(J_,{children:[(0,B.jsx)(Z_,{title:e.title,price:`Starting at ${G_(e.amountPerMonth,_n.Monthly)}`,className:`mb-4`}),(0,B.jsx)(Av,{planChangePrerequisite:e.planChangePrerequisite,selectedPlanKey:l,totalWebsitesAddOns:0,onModalClose:i})]})]});if(w||!E||f.calculateUpdatePlanCostBreakdown.__typename!==`UpdatePlanCostBreakdown`)return(0,B.jsxs)(`div`,{className:`flex-1 bg-gray-50 p-6`,children:[D,(0,B.jsx)(`div`,{className:`flex h-48 items-center justify-center`,children:(0,B.jsx)(Qn,{largeMargin:!0})})]});if(T)return(0,B.jsxs)(`div`,{className:`flex-1 bg-gray-50 p-6 text-gray-700`,children:[D,(0,B.jsxs)(me,{icon:`circle-alert`,
49intent:`warning`,title:`Unexpected error`,children:[(0,B.jsx)(`p`,{children:`Something went wrong. Please try again in a few moments.`}),(0,B.jsx)(x,{variant:`secondary`,icon:`refresh-cw`,size:`small`,marginTop:2,marginBottom:1,onClick:()=>{h(),b()},"data-test":`retry-cost-breakdown-load`,children:`Try again`})]})]});let{state:k,currentInvoiceAmount:ee,totalWebsitesAddOnAmount:A,websiteAddOLineItems:j,nextInvoiceAmount:te,nextInvoiceAttemptAt:ne,nextInvoiceSubTotalTaxAmount:re,proratedAmount:ie,currentInvoiceSubTotalTaxAmount:M,rolloverCreditsFromCurrentCycle:ae,taxRate:oe,willExceedPlanLimits:se,plan:{websiteAddOnPricePerBillingCycle:ce,amountPerBillingCycle:le,billingCycle:N,planChangePrerequisite:ue,options:{maxWebsites:de}}}=f.calculateUpdatePlanCostBreakdown,fe=k===tn.NoChange||!!se,pe=v==null?void 0:v.team,he=`Tax subtotal (${oe}%)`,ge=`Calculated based on your region’s tax rate. In this case, ${oe}% applies to your plan cost.`,_e=typeof M==`number`&&M>0&&G_(M),ve=typeof re==`number`&&re>0&&G_(re),ye=A!==0||j.length>0;return(0,B.jsxs)(`div`,{className:`flex-1 bg-gray-50 p-6`,children:[D,(0,B.jsxs)(J_,{title:`Plan update`,className:`mb-6`,children:[(0,B.jsx)(Z_,{title:`Base plan`,description:`${B_(f.calculateUpdatePlanCostBreakdown.plan)} ${de?`(including ${de} websites)`:``}`,price:G_(le,N)}),ye&&(0,B.jsx)(Z_,{title:`Total add-on websites`,description:`${(0,z_.default)(`website`,f.calculateUpdatePlanCostBreakdown.totalWebsitesAddOns,!0)} x ${G_(ce||0,N)}`,price:G_(A,N),tooltip:(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{children:`Includes additional websites added on top of your base plan.`}),(0,B.jsx)(`p`,{children:`The following charges will appear on your next invoice:`}),(0,B.jsx)(`div`,{className:`space-y-2`,children:j.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-start justify-between text-sm`,children:[(0,B.jsx)(`div`,{className:`flex-1 lowercase first-letter:uppercase`,children:e.title}),(0,B.jsx)(`div`,{className:`ml-4 font-medium`,children:G_(e.amount,N)})]},t))})]}),className:`mt-3`}),typeof ae==`number`&&ae>0&&(0,B.jsx)(Z_,{title:`Rollover credits from previous plan`,description:`${ae.toLocaleString(`en-US`)} ${(0,z_.default)(`credit`,ae)} (carried forward)`,price:`$0`,tooltip:`These credits will remain available and carry over into your new plan. They are not charged again.`,className:`mt-3`}),(0,B.jsx)(`div`,{className:`my-4 border-t border-gray-200`}),(0,B.jsx)(X_,{text:`Next invoice on ${O(ne*1e3).format(`MMMM D, YYYY`)}`,subPrice:ve,subPriceText:he,subPriceTooltip:ge,price:G_(te)})]}),(0,B.jsxs)(J_,{title:`Amount due today`,children:[typeof ie==`number`&&ie>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Z_,{title:`Prorated plan cost`,price:G_(ie),tooltip:`This is the amount you will be charged for the remaining days of your current billing cycle.`}),(0,B.jsx)(`div`,{className:`my-4 border-t border-gray-200`})]}),(0,B.jsx)(X_,{text:`Total cost`,price:G_(ee),subPrice:_e,subPriceText:he,subPriceTooltip:ge,className:`mb-4`}),(0,B.jsxs)(Av,{onModalClose:i,onClick:r,ariaLabel:`Confirm and pay`,planChangePrerequisite:ue,selectedPlanKey:l,totalWebsitesAddOns:f.calculateUpdatePlanCostBreakdown.totalWebsitesAddOns,disabled:fe,children:[`Confirm and pay `,G_(ee)]}),(pe==null?void 0:pe.hasPaymentMethods)&&!fe&&(0,B.jsx)(Y_,{})]}),(0,B.jsx)(`p`,{className:`mt-2 text-xs font-normal text-gray-600`,children:`* The invoices are in USD and will be paid automatically. You will receive an email copy.`})]})},Mv=({plans:e,currentPlan:t})=>{let n=e.filter(e=>e.slug!==t).reduce((e,t)=>(e.includes(t.billingCycle)||e.push(t.billingCycle),e),[]);return n.length>1&&n.includes(_n.Annually)?(0,B.jsxs)(`div`,{className:`flex flex-row items-center gap-2`,children:[(0,B.jsx)(pe,{size:5,className:`text-gray-400`,name:`info`}),(0,B.jsx)(`p`,{className:`text-xs font-normal text-gray-600`,children:`By going annual, you’re saving 20% and getting all credits up front.`})]}):null},Nv=({workspaceName:e,onModalClose:t})=>{let n=f();return(0,B.jsxs)(me,{marginTop:3,icon:`circle-alert`,intent:`warning`,title:`Your new plan allows fewer team members than you currently have.`,children:[(0,B.jsx)(`p`,{children:`Remove team members or upgrade to a plan that supports more members.`}),(0,B.jsx)(x,{variant:`linkColored`,intent:`warning`,rightIcon:`arrow-right`,marginTop:3,onClick:()=>
49{t(),n(F({to:`workspace-settings`,workspaceName:e}))},"aria-label":`Manage team members`,"data-test":`manage-team-members`,children:`Manage team members`})]})},Pv=({workspaceName:e,currentWorkspaceTotalWebsites:t,totalWebsitesAllowed:n,onModalClose:r})=>{let i=f();return(0,B.jsxs)(me,{marginTop:3,icon:`circle-alert`,intent:`warning`,title:`You have robots set up for ${(0,z_.default)(`website`,t,!0)}.`,children:[(0,B.jsxs)(`p`,{children:[`To downgrade, reduce robots to`,` `,(0,z_.default)(`website`,n,!0),` or upgrade to plan that supports more websites.`]}),(0,B.jsx)(x,{variant:`linkColored`,intent:`warning`,rightIcon:`arrow-right`,marginTop:3,onClick:()=>{r(),i(F({to:`robots`,workspaceName:e}))},"aria-label":`Manage robots`,"data-test":`manage-robots`,children:`Manage robots`})]})},Fv=({onModalClose:e,workspaceName:t})=>(0,B.jsx)(me,{icon:`circle-alert`,intent:`warning`,title:`No plans were found.`,children:(0,B.jsx)(x,{variant:`secondary`,size:`small`,marginTop:2,marginBottom:1,onClick:e,link:F({to:`workspace-subscription`,workspaceName:t,scrollToPlans:!0}),"data-test":`view-all-plans`,children:`View all plans`})}),Iv={[Ct.MaxRobots]:e=>{let{maxRobots:t}=e;if(t===-1)return{text:`Unlimited robots`,tooltip:`Create unlimited robots to browse websites, extract structured data, take screenshots, and monitor changes automatically.`};let n=(0,z_.default)(`robot`,t);return{text:`${t} ${n}`,tooltip:`Create up to ${t} ${n} to browse websites, extract structured data, take screenshots, and monitor changes automatically.`}},[Ct.MaxWebsites]:e=>{let{maxWebsites:t,maxRobots:n}=e;if(t===-1)return{text:`Unlimited websites`,tooltip:`You can create ${n===-1?`unlimited`:n} ${(0,z_.default)(`robot`,n)} for unlimited websites.`};let r=(0,z_.default)(`website`,t);return{text:`${t} ${r}`,tooltip:`You can create ${n===-1?`unlimited`:n} ${(0,z_.default)(`robot`,n)} for up to ${t} ${r}. Website count is based on the root domain. You can add additional websites to any plan.`}},[Ct.MaxUsers]:e=>{let{maxUsers:t}=e;return t===-1?{text:`Unlimited users`,tooltip:`Add unlimited team members to collaborate.`}:{text:`${t} ${(0,z_.default)(`user`,t)}`,tooltip:`Add up to ${t} ${(0,z_.default)(`team member`,t)} to collaborate.`}},[Ct.FullPlatformAccess]:()=>({text:`Full platform access`,tooltip:`Access to all features on our platform including tables, workflows, monitoring, integrations, exports, and more.`}),[Ct.BasicEmailSupport]:()=>({text:`Basic email support`,tooltip:`Full access to our knowledge centre. Email support with estimated response time of 2 business days.`}),[Ct.CreditTopUps]:e=>{let{creditTopUpsEnabled:t,creditTopUpsPriceInCents:n,creditTopUpsCount:r}=e;return!t||!n||!r?null:{text:`Credit top-ups available`,tooltip:`Add credit top-ups to your plan starting at ${V_(n*r/100)} for ${r.toLocaleString(`en-US`)} credits. Credit top-ups are only available on annual plans.`}},[Ct.CustomizedLimitsOnUsersWebsitesAndCredits]:()=>({text:`Custom plan limits (websites and users)`,tooltip:`Customized limits and pricing for number of websites and users.`}),[Ct.DedicatedAccountManager]:()=>({text:`Dedicated Account Manager`,tooltip:`A dedicated account manager to be your single point of contact for success.`}),[Ct.DataPostProcessing]:()=>({text:`Data post-processing`,tooltip:`Customized data post-processing based on your needs.`}),[Ct.FullServiceOnboarding]:()=>({text:`Full service onboarding`,tooltip:`Our full service onboarding and implementation. We work with your team to get up and running with confidence.`}),[Ct.PriorityEmailSupport]:()=>({text:`Priority email support`,tooltip:`Full access to our knowledge centre. Priority email support with estimated response time of 1 business day.`}),[Ct.FullyManagedDataPipeline]:()=>({text:`Fully managed data pipeline`,tooltip:`Customized ongoing services including ongoing active management of your data pipelines based on your needs.`}),[Ct.ScaleCreditSavings]:()=>({text:`Save up to 44% per credit as you scale`,tooltip:`Added discounted cost per credit as you scale your usage.`}),[Ct.ExclusiveScaleDiscounts]:()=>({text:`Exclusive scale discounts`,tooltip:`Custom pricing based on your needs and scale.`})},Lv={[Ct.WebsitesAddOns]:e=>{let{websiteAddOnPricePerMonth:t}=e;return t?{text:`Additional websites ${V_(t)}/mo`,tooltip:`Add additional websites to your plan for ${V_(t)} a month.`}:null},[Ct.Credits]:e=>
49({text:`${e.credits.toLocaleString(`en-US`)} credits per month`,tooltip:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{children:`Credits determine how much data you can extract or monitor:`}),(0,B.jsxs)(`ul`,{className:`ml-8 mt-2 list-disc [&>li:not(:first-child):not(:last-child)]:my-2`,children:[(0,B.jsx)(`li`,{children:`Each task uses at least 1 credit (standard sites) or 2-10 credits (premium sites).`}),(0,B.jsx)(`li`,{children:`For standard sites every 10 rows of data or screenshot = 1 credit.`}),(0,B.jsxs)(`li`,{children:[`Credits reset each month.`,e.creditTopUpsEnabled?` You can purchase additional credits with any annual plan.`:``]})]})]})})},Rv={[Ct.WebsitesAddOns]:e=>{let{websiteAddOnPricePerYear:t,websiteAddOnPricePerMonth:n}=e;return!t||!n?null:{text:`Additional websites ${V_(n)}/mo paid annually`,tooltip:`
50      Add additional websites to your plan for ${V_(t)} a year.`}},[Ct.Credits]:e=>({text:`${e.credits.toLocaleString(`en-US`)} credits per year (all credits upfront)`,tooltip:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{children:`Credits determine how much data you can extract or monitor:`}),(0,B.jsxs)(`ul`,{className:`ml-8 mt-2 list-disc  [&>li:not(:first-child):not(:last-child)]:my-2`,children:[(0,B.jsx)(`li`,{children:`Each task uses at least 1 credit (standard sites) or 2-10 credits (premium sites).`}),(0,B.jsx)(`li`,{children:`For standard sites every 10 rows of data or screenshot = 1 credit.`}),(0,B.jsxs)(`li`,{children:[`Credits reset each year.`,e.creditTopUpsEnabled?` You can purchase additional credits with any annual plan.`:``]})]})]})}),[Ct.ScaledPricingDiscounts]:()=>({text:`20% savings vs. monthly plans`,tooltip:`Save 20% by going annual, plus get all credits up front.`})},zv=({children:e,tooltip:t,iconSize:n=5,textColor:r=`text-gray-600`,icon:i=`check`})=>{let a=(0,B.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,B.jsx)(`span`,{children:i===`circle`?(0,B.jsx)(pe,{name:`circle`,size:1,className:`ml-1 p-0.5 text-gray-500`}):(0,B.jsx)(pe,{name:`check`,size:n,className:`text-success-500`})}),(0,B.jsx)(`div`,{className:o(`text-sm`,{[r]:r}),children:e})]});return t?(0,B.jsx)(ke,{placement:`right`,content:(0,B.jsx)(`div`,{className:`text-left text-sm font-normal [&>*]:text-sm [&>*]:font-normal`,children:t}),children:a}):a},Bv=[Ct.Credits,Ct.MaxRobots,Ct.MaxWebsites,Ct.MaxUsers],Vv=({featureSlugs:e,options:t,planToCompare:n,showTooltip:r})=>{let i={...Iv,...t.billingCycle===_n.Annually?Rv:Lv},a=e.map(e=>{let a=i[e];if(!a)return null;let o=a(t);if(!(o!=null&&o.text))return null;let s=n&&Bv.includes(e)?Hv(n.options[e],t[e]):void 0;return(0,B.jsx)(zv,{tooltip:r?o.tooltip:void 0,icon:n?`circle`:`check`,children:(0,B.jsxs)(B.Fragment,{children:[o.text,typeof s==`number`&&s!==0&&(0,B.jsx)(`span`,{className:`ml-2 inline-flex`,children:(0,B.jsx)(ut,{intent:s>0?`success`:`danger`,size:`sm`,noMarginLeft:!0,children:s===1/0?`+∞`:s===-1/0?`-∞`:(s>0?`+`:``)+s.toLocaleString()})})]})},e)});return(0,B.jsx)(`ul`,{className:`flex flex-col items-start gap-2`,children:a})};function Hv(e,t){if(typeof e==`number`&&typeof t==`number`)return e===-1&&t===-1?0:t===-1?1/0:e===-1?-1/0:t-e}var Uv=({title:e,description:t,iconName:n,iconColor:r,fieldType:i,value:a,onChange:o,children:s})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 text-md`,children:[(0,B.jsx)(pe,{size:5,name:n,color:r}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:e})]}),(0,B.jsx)(`p`,{className:`w- mt-1 text-gray-700`,children:t})]}),(0,B.jsx)(`div`,{className:i===`website`?`w-20`:`w-[120px]`,children:(0,B.jsx)(_e,{type:`number`,"data-test":`plan-radio-card-${i}-input`,value:a,onChange:e=>{o(Number(e.target.value))}})})]}),s&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`my-3 border-t border-primary-300`,"aria-hidden":!0,role:`presentation`}),s]})]}),Wv=({title:e,subtitle:t,description:n,currentPlan:r=!1,costEfficient:i=!1,disabled:a=!1,value:s,children:c})=>{let{selectedValue:l}={selectedValue:void 0,...vi()},u=typeof l==`string`||typeof l==`number`?l===s:!1;return(0,B.jsxs)(`div`,{className:o(`focus:border-red mb-3 rounded-xl border border-gray-200 p-4 transition-colors duration-[360ms] ease-[cubic-bezier(0.25,0.1,0.25,1.0)] focus-within:shadow-focus hover:border-gray-300`,{"bg-gray-50":a,"bg-primary-50":u,"border-primary":u,"hover:border-primary-700":u,"border-2":u,"focus-within:shadow-primary-100":u}),children:[(0,B.jsx)(xi,{label:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`mb-1 flex flex-wrap items-center gap-1.5`,children:[(0,B.jsx)(`p`,{className:`text-lg font-bold text-gray-700`,children:e}),(0,B.jsx)(`p`,{className:o(`font-normal text-gray-600`,{"text-gray-900":u}),children:t}),r&&(0,B.jsx)(ut,{noMarginLeft:!0,size:`sm`,children:`Current plan`}),i&&(0,B.jsx)(ut,{noMarginLeft:!0,intent:`info`,size:`sm`,children:`Cost-efficient`})]}),(0,B.jsx)(`p`,{className:`font-normal text-gray-600`,children:n})]}),value:s,disabled:a}),u&&c&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`-mx-4 mb-3 mt-4 border border-primary`}),c]})]})};Wv.Extra=Uv;var Gv=({plan:e,currentPlan:t,websiteAddons:n,onChangeWebsiteAddons:r,costEfficientPlan:i,websiteAddonsInputTitle:a,totalWebsitesNeeded:o})=>{let s=e.planChangePrerequisite===It.ContactSales,{isPaymentInProgress:c}=Rg();
50return(0,B.jsx)(Wv,{title:e.title,description:(({websites:e,credits:t,billingCycle:n})=>{if(s)return`Customized plans with managed services.`;let r=e===-1?`custom`:e,i=t.toLocaleString(`en-US`),a=n===_n.Annually?`annually`:`monthly`;return`Includes ${r} ${(0,z_.default)(`website`,e)} and ${i} ${(0,z_.default)(`credit`,t)} ${a}.`})({billingCycle:e.billingCycle,websites:e.options.maxWebsites,credits:e.options.credits}),subtitle:(({amountPerMonth:e,discountedAmountPerMonth:t,billingCycle:n})=>{let r=n===_n.Annually?`annually`:`monthly`,i=s?`Starts at `:``;return t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`mr-1 line-through`,children:[i,G_(e),`/mo`]}),`${G_(t)}/mo billed ${r}`]}):`${i}${G_(e)}/mo billed ${r}`})({discountedAmountPerMonth:e.discountedAmountPerMonth,amountPerMonth:e.amountPerMonth,billingCycle:e.billingCycle}),value:e.slug,currentPlan:t,costEfficient:i,children:e.websiteAddOnEnabled?(0,B.jsx)(Wv.Extra,{iconName:`globe`,iconColor:`info`,title:a,description:`In total, your plan will have ${Math.max(o,e.options.maxWebsites)} websites.`,value:n,fieldType:`website`,onChange:t=>{if(!c){if(t<0){r(0,e);return}r(t,e)}},children:(0,B.jsx)(Vv,{featureSlugs:e.features,options:{...e.options,billingCycle:e.billingCycle,creditTopUpsEnabled:!1,creditTopUpsCount:1e3,creditTopUpsPriceInCents:e.creditTopUpPriceInCents}})}):(0,B.jsxs)(B.Fragment,{children:[s&&(0,B.jsx)(`p`,{className:`mb-2 text-sm font-medium text-gray-800`,children:`We work with you to create a customized solution based on your needs including:`}),(0,B.jsx)(Vv,{featureSlugs:e.features,options:{...e.options,billingCycle:e.billingCycle,creditTopUpsEnabled:!1,creditTopUpsCount:1e3,creditTopUpsPriceInCents:e.creditTopUpPriceInCents}})]})},e.slug)},Kv=({children:e,workspaceName:t,onModalClose:n})=>{let r=f();return(0,B.jsxs)(`div`,{className:`mb-4 flex items-center justify-between pt-2`,children:[(0,B.jsx)(`p`,{className:`text-lg font-medium text-gray-700`,children:e}),(0,B.jsx)(x,{variant:`linkColored`,size:`small`,onClick:()=>{r(F({to:`workspace-subscription`,workspaceName:t,scrollToPlans:!0})),n()},"data-test":`view-all-plans`,children:`All plans`})]})},qv=({selectedPlanSlug:e,setSelectedPlanSlug:t,websiteAddons:n=0,onChangeWebsiteAddons:r,data:i,totalWebsitesNeeded:a,websiteAddonsInputTitle:o,currentWorkspaceTotalWebsites:s,willExceedPlanLimits:c,onModalClose:l})=>{let{modalType:u}=Bh(),{workspaceName:d}=Dg(),{isPaymentInProgress:f}=Rg(),p=z.useCallback(n=>{f||n===e||t(n)},[f,e,t]),m=i.recommendPlans.plans.find(e=>e.slug===i.recommendPlans.currentPlanKey.slug&&e.billingCycleInMonths===i.recommendPlans.currentPlanKey.billingCycleInMonths),h=m?i.recommendPlans.plans.filter(e=>e.slug!==m.slug||e.billingCycleInMonths!==m.billingCycleInMonths):i.recommendPlans.plans,g=(!m||i.recommendPlans.plans.length===1&&i.recommendPlans.plans[0].planChangePrerequisite===It.ContactSales)&&u!==K.ChangePlan,_=i.recommendPlans.plans.find(t=>t.slug===e);return(0,B.jsxs)(`div`,{className:`flex-1 p-6`,children:[(0,B.jsxs)(_i,{name:`plan`,isDotCenter:!1,selectedValue:e,onValueChanged:p,children:[(i==null?void 0:i.recommendPlans.plans.length)===0&&(0,B.jsx)(Fv,{onModalClose:l,workspaceName:d}),m&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Gv,{plan:m,websiteAddons:n,onChangeWebsiteAddons:r,websiteAddonsInputTitle:o,currentPlan:!0,totalWebsitesNeeded:a}),h.length>0&&(0,B.jsx)(Kv,{onModalClose:l,workspaceName:d,children:`or upgrade to higher plan`})]}),h.map(e=>{var t;return(0,B.jsx)(Gv,{plan:e,websiteAddons:n,onChangeWebsiteAddons:r,websiteAddonsInputTitle:o,costEfficientPlan:((t=i.recommendPlans.costEfficientPlan)==null?void 0:t.slug)===e.slug,totalWebsitesNeeded:a},e.slug)}),g&&(0,B.jsx)(Kv,{onModalClose:l,workspaceName:d,children:`or view other plans`}),(0,B.jsx)(Mv,{plans:i.recommendPlans.plans,currentPlan:i.recommendPlans.currentPlanKey.slug})]}),_&&(c==null?void 0:c.includes(Dt.WebsitesLimit))&&(0,B.jsx)(Pv,{workspaceName:d,onModalClose:l,currentWorkspaceTotalWebsites:s,totalWebsitesAllowed:Math.max(a,_.options.maxWebsites)}),(c==null?void 0:c.includes(Dt.UsersLimit))&&(0,B.jsx)(Nv,{workspaceName:d,onModalClose:l})]})},Jv=({isOpen:e,onClose:t,config:n,currentWorkspace:r,modalType:i,onInitPayment:a,modalInitContext:o})=>{var s;let{preferredPlan:c}=o||{},[l,u]=z.useState(void 0),[d,f]=z.useState(void 0),[p,m,h]=Hg(),[g,_]=z.useState(void 0);z.useEffect(()=>{var t;if(!e||!i||p.websiteAddons!==void 0||(m({type:`SET_TOTAL_WEBSITES_NEEDED`,payload:Math.max(r.maxSites,r.websitesCount)}),(o==null||(t=o.preferredPlan)==null?void 0:t.maxWebsites)===void 0))return;let n=Math.max(r.maxSites,r.websitesCount),a=Math.max(n-o.preferredPlan.maxWebsites,parseInt(h,10)||0,0);m({type:`SET_WEBSITE_ADDONS`,payload:{addons:a,totalAddons:a,maxWebsites:a+o.preferredPlan.maxWebsites}})},[e,i,r.maxSites,r.websitesCount,r.plan.options.maxWebsites,o==null||(s=o.preferredPlan)==null?void 0:s.maxWebsites,m,h,p.websiteAddons]);let v=z.useCallback((e,t)=>{m({type:`SET_WEBSITE_ADDONS`,payload:{addons:e,totalAddons:e,maxWebsites:e+t.options.maxWebsites}})},[m]),y=z.useCallback(e=>{if(f(e),p.totalWebsitesNeeded===void 0)throw Error(`websiteState is not set`);let t=Math.max(p.totalWebsitesNeeded-e.options.maxWebsites,0);v(t,e)},[v,p.totalWebsitesNeeded]);z.useEffect(()=>{d===void 0&&l!==void 0&&(l==null?void 0:l.recommendPlans.plans.length)!==0&&y(l.recommendPlans.plans[0])}
50,[l,y,d]);let b=z.useCallback(e=>{let t=l==null?void 0:l.recommendPlans.plans.find(t=>t.slug===e);t&&y(t)},[l==null?void 0:l.recommendPlans.plans,y]),x=z.useCallback(()=>{t(),u(void 0),f(void 0),_(void 0),m({type:`RESET`})},[m,t]),{loading:S,error:C,refetch:w}=Bg({setData:u,totalWebsitesAddOns:p.totalWebsitesAddOns,preferredPlanKey:c==null?void 0:c.planKey,currentWorkspace:r});return(0,B.jsx)(je,{name:`SubscriptionModal_${i}`,height:`full`,width:`four-fifths`,align:`horizontalLeft`,isOpen:e,onClose:x,icon:{name:n.iconName,theme:`modern`},title:n==null?void 0:n.title,description:n==null?void 0:n.description,hasDivider:!0,children:(0,B.jsx)(R_,{loading:S,error:C,hasData:!!l,refetch:w,children:l&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(qv,{selectedPlanSlug:d==null?void 0:d.slug,setSelectedPlanSlug:b,websiteAddons:p.websiteAddons,onChangeWebsiteAddons:v,data:l,totalWebsitesNeeded:p.totalWebsitesNeeded||0,currentWorkspaceTotalWebsites:r.websitesCount,willExceedPlanLimits:g,websiteAddonsInputTitle:`Total add-on websites`,onModalClose:x}),d?(0,B.jsx)(jv,{selectedPlan:d,totalWebsitesAddOns:p.totalWebsitesAddOns,setWillExceedPlanLimits:_,onModalClose:x,onInitPayment:a}):(0,B.jsx)(`div`,{className:`flex-1 bg-gray-50 p-6`})]})})})},Yv=({children:e,stripeQuoteId:t,ariaLabel:n,onModalClose:r})=>{let{setPaymentStatus:i,setIsPaymentInProgress:a}=Rg(),o=Je(),[s,{loading:c}]=At({variables:{stripeQuoteId:t}});return(0,B.jsx)(x,{fullWidth:!0,variant:`primary`,onClick:async()=>{try{a(!0);let{data:e}=await s({variables:{stripeQuoteId:t}});a(!1),(e==null?void 0:e.finalizeCreditTopUpQuote.__typename)===`CreditTopUpAddedSuccessfully`?i(Ng.SUCCESS):(e==null?void 0:e.finalizeCreditTopUpQuote.__typename)===`NeedInvoicePayment`&&(window.location.href=e.finalizeCreditTopUpQuote.invoiceUrl,r())}catch(e){o(e)}},loading:c,"aria-label":n,"data-test":`pay-credit-top-up-button`,children:e})};function Xv({creditsNeeded:e,onModalClose:t}){var n,r;let[i,{loading:a,error:o,data:s}]=hn(),{workspaceName:c}=Dg(),{data:l,loading:u,refetch:d,error:f,networkStatus:p}=Vt({variables:{workspaceName:c},notifyOnNetworkStatusChange:!0,skip:!c||!e});z.useEffect(()=>{e&&i({variables:{quantity:e}})},[e,i]);let m=a||u||p===P.refetch,h=o||f,g=s&&l&&((n=l.team)==null?void 0:n.id),_=(0,B.jsx)(`p`,{className:`mb-4 text-lg font-bold text-gray-700`,children:`Cost breakdown`});if(m||!g)return(0,B.jsxs)(`div`,{className:`flex-1 bg-gray-50 p-6`,children:[_,(0,B.jsx)(`div`,{className:`flex h-48 items-center justify-center`,children:(0,B.jsx)(Qn,{largeMargin:!0})})]});if(h)return(0,B.jsxs)(`div`,{className:`flex-1 bg-gray-50 p-6 text-gray-700`,children:[_,(0,B.jsxs)(me,{icon:`circle-alert`,intent:`warning`,title:`Unexpected error`,children:[(0,B.jsx)(`p`,{children:`Something went wrong. Please try again in a few moments.`}),(0,B.jsx)(x,{variant:`secondary`,icon:`refresh-cw`,size:`small`,marginTop:2,marginBottom:1,onClick:()=>{i({variables:{quantity:v}}),d()},"data-test":`retry-credit-top-up-load`,children:`Try again`})]})]});let{quantity:v,stripeQuoteId:y,currentInvoiceAmount:b,currentInvoiceSubTotalTaxAmount:S,taxRate:C}=s.createCreditsTopUpQuote,w=typeof S==`number`&&S>0&&G_(S);return(0,B.jsxs)(`div`,{className:`flex-1 bg-gray-50 p-6`,children:[_,(0,B.jsxs)(J_,{title:`Amount due today`,className:`mb-2`,children:[(0,B.jsx)(Z_,{title:`One-time credit purchase`,description:`${v.toLocaleString(`en-US`)} ${(0,z_.default)(`credit`,v)}`,price:G_(b)}),(0,B.jsx)(`div`,{className:`my-4 border-t border-gray-200`}),(0,B.jsx)(X_,{text:`Total cost`,price:G_(b),subPrice:w,subPriceText:`Tax subtotal (${C}%)`,subPriceTooltip:`Calculated based on your region’s tax rate. In this case, ${C}% applies to your plan cost.`,className:`mb-4`}),(0,B.jsxs)(Yv,{ariaLabel:`Confirm and pay`,stripeQuoteId:y,onModalClose:t,children:[`Confirm and pay `,G_(b)]}),(l==null||(r=l.team)==null?void 0:r.hasPaymentMethods)&&(0,B.jsx)(Y_,{})]}),(0,B.jsx)(`p`,{className:`mt-2 text-xs font-normal text-gray-600`,children:`* The invoices are in USD and will be paid automatically. You will receive an email copy.`})]})}E();var Zv=({nextQuotaResetAt:e})=>{let{modalInitContext:t}=Bh(),{remainingCredits:n,lockedCredits:r}=t||{};return n==null&&r==null&&e==null?null:(0,B.jsxs)(`div`,{className:`mt-1 flex flex-row justify-between gap-2 text-sm leading-5 text-gray-600 lg:max-w-[80%]`,children:[n!==void 0&&(0,B.jsxs)(`div`,{children:[`Available credits: `,n]}),r!==void 0&&(0,B.jsxs)(`div`,{className:`flex flex-row items-center`,children:[(0,B.jsxs)(`span`,{className:`mr-1`,children:[`Locked credits: `,r]}),` `,(0,B.jsx)(ke,{content:`Credits which are locked until other pending tasks finish.`,children:(0,B.jsx)(`span`,{children:(0,B.jsx)(pe,{size:4,className:`-mt-0.5 text-gray-400`,name:`info`})})})]}),typeof e==`number`&&e>0&&(0,B.jsxs)(`div`,{children:[`Next Refill: `,O(e*1e3).format(`MMMM D, YYYY`)]})]})},Qv=({setData:e,creditTopUps:t,currentWorkspace:n})=>{let r=ne(`allowCreditTopUp`);return zg({setData:e,input:z.useMemo(()=>
50n.plan.planChangePrerequisite&&[It.ContactWorkspaceAdmin,It.ContactSupport].includes(n.plan.planChangePrerequisite)?{variables:void 0,skip:!0}:{variables:{creditsNeeded:t,creditTopUpStrategy:r?vn.PrioritizeUpgrade:vn.UpgradeOnly},skip:!t},[n.plan.planChangePrerequisite,t,r])})},$v=({plan:e,currentPlan:t,creditTopUps:n,onChangeCreditTopUps:r,costEfficientPlan:i})=>{let a=e.planChangePrerequisite===It.ContactSales,{isPaymentInProgress:o}=Rg();return(0,B.jsx)(Wv,{title:e.title,description:(({websites:e,credits:t,billingCycle:n})=>{if(a)return`Customized plans with managed services.`;let r=e===-1?`custom`:e,i=t.toLocaleString(`en-US`),o=n===_n.Annually?`annually`:`monthly`;return`Includes ${r} ${(0,z_.default)(`website`,e)} and ${i} ${(0,z_.default)(`credit`,t)} ${o}.`})({billingCycle:e.billingCycle,websites:e.options.maxWebsites,credits:e.options.credits}),subtitle:(({amountPerMonth:e,discountedAmountPerMonth:t,billingCycle:n})=>{let r=n===_n.Annually?`annually`:`monthly`,i=a?`Starts at `:``;return t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`mr-1 line-through`,children:[i,G_(e),`/mo`]}),`${G_(t)}/mo billed ${r}`]}):`${i}${G_(e)}/mo billed ${r}`})({discountedAmountPerMonth:e.discountedAmountPerMonth,amountPerMonth:e.amountPerMonth,billingCycle:e.billingCycle}),value:e.slug,currentPlan:t,costEfficient:i,children:e.creditTopUpEnabled?(0,B.jsx)(oe,{flag:`allowCreditTopUp`,match:!0,trackView:!0,children:(0,B.jsx)(Wv.Extra,{iconName:`database`,iconColor:`warning`,title:`Credit purchase`,description:`Minimum 1,000 credits`,fieldType:`credit`,value:n,onChange:e=>{if(!o){if(e<0){r(1e3);return}r(e)}},children:(0,B.jsx)(Vv,{featureSlugs:e.features,options:{...e.options,billingCycle:e.billingCycle,creditTopUpsEnabled:!1,creditTopUpsCount:1e3,creditTopUpsPriceInCents:e.creditTopUpPriceInCents}})})}):(0,B.jsxs)(B.Fragment,{children:[a&&(0,B.jsx)(`p`,{className:`mb-2 text-sm font-medium text-gray-800`,children:`We work with you to create a customized solution based on your needs including:`}),(0,B.jsx)(Vv,{featureSlugs:e.features,options:{...e.options,billingCycle:e.billingCycle,creditTopUpsEnabled:!1,creditTopUpsCount:1e3,creditTopUpsPriceInCents:e.creditTopUpPriceInCents}})]})},e.slug)},ey=({selectedPlanSlug:e,setSelectedPlanSlug:t,creditTopUps:n=0,onChangeCreditTopUps:r,onModalClose:i,data:a})=>{let{workspaceName:o}=Dg(),{isPaymentInProgress:s}=Rg(),c=z.useCallback(n=>{s||n===e||t(n)},[s,e,t]),l=a.recommendPlans.plans.find(e=>e.slug===a.recommendPlans.currentPlanKey.slug&&e.billingCycleInMonths===a.recommendPlans.currentPlanKey.billingCycleInMonths),u=l?a.recommendPlans.plans.filter(e=>e.slug!==l.slug||e.billingCycleInMonths!==l.billingCycleInMonths):a.recommendPlans.plans,d=!l||a.recommendPlans.plans.length===1&&a.recommendPlans.plans[0].planChangePrerequisite===It.ContactSales;return(0,B.jsx)(`div`,{className:`flex-1 p-6`,children:(0,B.jsxs)(_i,{name:`plan`,isDotCenter:!1,selectedValue:e,onValueChanged:c,children:[(a==null?void 0:a.recommendPlans.plans.length)===0&&(0,B.jsx)(Fv,{onModalClose:i,workspaceName:o}),u.map(e=>{var t;return(0,B.jsx)($v,{plan:e,creditTopUps:n,onChangeCreditTopUps:r,costEfficientPlan:((t=a.recommendPlans.costEfficientPlan)==null?void 0:t.slug)===e.slug},e.slug)}),l&&(0,B.jsxs)(B.Fragment,{children:[u.length>0&&(0,B.jsx)(Kv,{onModalClose:i,workspaceName:o,children:`or purchase one-time credits`}),(0,B.jsx)($v,{plan:l,creditTopUps:n,onChangeCreditTopUps:r,currentPlan:!0})]}),d&&(0,B.jsx)(Kv,{onModalClose:i,workspaceName:o,children:`or view other plans`}),(0,B.jsx)(Mv,{plans:a.recommendPlans.plans,currentPlan:a.recommendPlans.currentPlanKey.slug})]})})},ty=1e3;function ny({isOpen:e,onClose:t,config:n,currentWorkspace:r,modalType:i,modalInitContext:a,onInitPayment:o}){let{iconName:s,title:c,description:l}=n,[u,d]=z.useState(void 0),[f,p]=z.useState(void 0),[m,h]=ye(``,{queryStringKey:`creditTopUps`,pushToHistory:!1}),[_,v]=z.useState(void 0),y=z.useMemo(()=>typeof f==`number`?ry(iy(f)):f,[f]),[b]=g(y,300),{loading:x,error:S,refetch:C}=Qv({setData:d,creditTopUps:y,currentWorkspace:r});z.useEffect(()=>{h(f?f.toString():``)},[f,h]),z.useEffect(()=>{!e||f!==void 0||p(Math.max((a==null?void 0:a.creditsNeeded)||0,parseInt(m,10)||0,ty))},[e,a==null?void 0:a.creditsNeeded,m,f]),z.useEffect(()=>{_===void 0&&u!==void 0&&(u==null?void 0:u.recommendPlans.plans.length)!==0&&v(u.recommendPlans.plans[0])},[u,_]);let w=z.useCallback(e=>{let t=u==null?void 0:u.recommendPlans.plans.find(t=>t.slug===e);t&&v(t)},[u==null?void 0:u.recommendPlans.plans]),T=z.useCallback(()=>{t(),v(void 0),d(void 0),p(void 0)},[t]),E=z.useMemo(()=>
50{if(!_)return(0,B.jsx)(`div`,{className:`flex-1 bg-gray-50 p-6`});if(_.creditTopUpEnabled)return(0,B.jsx)(Xv,{creditsNeeded:b,onModalClose:T});let e=Math.max(r.maxSites,r.websitesCount),t=Math.max(e-_.options.maxWebsites,0);return(0,B.jsx)(jv,{selectedPlan:_,totalWebsitesAddOns:t,onModalClose:T,onInitPayment:o})},[r,b,T,o,_]);return(0,B.jsx)(je,{name:`SubscriptionModal_${i}`,height:`full`,width:`four-fifths`,align:`horizontalLeft`,isOpen:e,onClose:T,icon:{name:s,theme:`modern`},title:c,description:l,headerChildren:(0,B.jsx)(Zv,{nextQuotaResetAt:r.nextQuotaResetAt}),hasDivider:!0,children:(0,B.jsx)(R_,{loading:x,error:S,hasData:!!u,refetch:C,children:u&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ey,{selectedPlanSlug:_==null?void 0:_.slug,setSelectedPlanSlug:w,creditTopUps:f,onChangeCreditTopUps:p,data:u,onModalClose:T}),E]})})})}function ry(e){return e<ty?ty:e}function iy(e){return e+(10-e%10)%10}var ay={};(function e(t,n,r,i){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D==`function`&&typeof DOMMatrix==`function`,s=(function(){if(!t.OffscreenCanvas)return!1;var e=new OffscreenCanvas(1,1),n=e.getContext(`2d`);n.fillRect(0,0,1,1);var r=e.transferToImageBitmap();try{n.createPattern(r,`no-repeat`)}catch{return!1}return!0})();function c(){}function l(e){var r=n.exports.Promise,i=r===void 0?t.Promise:r;return typeof i==`function`?new i(e):(e(c,c),null)}var u=(function(e,t){return{transform:function(n){if(e)return n;if(t.has(n))return t.get(n);var r=new OffscreenCanvas(n.width,n.height);return r.getContext(`2d`).drawImage(n,0,0),t.set(n,r),r},clear:function(){t.clear()}}})(s,new Map),d=function(){var e,t,n={},r=0;return typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?(e=function(e){var t=Math.random();return n[t]=requestAnimationFrame(function i(a){r===a||r+16-1<a?(r=a,delete n[t],e()):n[t]=requestAnimationFrame(i)}),t},t=function(e){n[e]&&cancelAnimationFrame(n[e])}):(e=function(e){return setTimeout(e,16)},t=function(e){return clearTimeout(e)}),{frame:e,cancel:t}}(),f=(function(){var t,n,i={};function o(e){function t(t,n){e.postMessage({options:t||{},callback:n})}e.init=function(t){var n=t.transferControlToOffscreen();e.postMessage({canvas:n},[n])},e.fire=function(r,a,o){if(n)return t(r,null),n;var s=Math.random().toString(36).slice(2);return n=l(function(a){function c(t){t.data.callback===s&&(delete i[s],e.removeEventListener(`message`,c),n=null,u.clear(),o(),a())}e.addEventListener(`message`,c),t(r,s),i[s]=c.bind(null,{data:{callback:s}})}),n},e.reset=function(){for(var t in e.postMessage({reset:!0}),i)i[t](),delete i[t]}}return function(){if(t)return t;if(!r&&a){var n=[`var CONFETTI, SIZE = {}, module = {};`,`(`+e.toString()+`)(this, module, true, SIZE);`,`onmessage = function(msg) {`,`  if (msg.data.options) {`,`    CONFETTI(msg.data.options).then(function () {`,`      if (msg.data.callback) {`,`        postMessage({ callback: msg.data.callback });`,`      }`,`    });`,`  } else if (msg.data.reset) {`,`    CONFETTI && CONFETTI.reset();`,`  } else if (msg.data.resize) {`,`    SIZE.width = msg.data.resize.width;`,`    SIZE.height = msg.data.resize.height;`,`  } else if (msg.data.canvas) {`,`    SIZE.width = msg.data.canvas.width;`,`    SIZE.height = msg.data.canvas.height;`,`    CONFETTI = module.exports.create(msg.data.canvas);`,`  }`,`}`].join(`
51`);try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console.warn==`function`&&console.warn(`🎊 Could not load worker`,e),null}o(t)}return t}})(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:[`square`,`circle`],zIndex:100,colors:[`#26ccff`,`#a25afd`,`#ff5e7e`,`#88ff5a`,`#fcff42`,`#ffa62d`,`#ff36ff`],disableForReducedMotion:!1,scalar:1};function m(e,t){return t?t(e):e}function h(e){return e!=null}function g(e,t,n){return m(e&&h(e[t])?e[t]:p[t],n)}function _(e){return e<0?0:Math.floor(e)}function v(e,t){return Math.floor(Math.random()*(t-e))+e}function y(e){return parseInt(e,16)}function b(e){return e.map(x)}function x(e){var t=String(e).replace(/[^0-9a-f]/gi,``);return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:y(t.substring(0,2)),g:y(t.substring(2,4)),b:y(t.substring(4,6))}}function S(e){var t=g(e,`origin`,Object);return t.x=g(t,`x`,Number),t.y=g(t,`y`,Number),t}function C(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function w(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function T(e){var t=document.createElement(`canvas`);return t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.pointerEvents=`none`,t.style.zIndex=e,t}function E(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),e.arc(0,0,1,o,s,c),e.restore(
51)}function D(e){var t=e.angle*(Math.PI/180),n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:(Math.random()*.5+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function O(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var n=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,a=t.wobbleX+t.random*t.tiltCos,s=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle=`rgba(`+t.color.r+`, `+t.color.g+`, `+t.color.b+`, `+(1-n)+`)`,e.beginPath(),o&&t.shape.type===`path`&&typeof t.shape.path==`string`&&Array.isArray(t.shape.matrix))e.fill(te(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(a-r)*.1,Math.abs(s-i)*.1,Math.PI/10*t.wobble));else if(t.shape.type===`bitmap`){var c=Math.PI/10*t.wobble,l=Math.abs(a-r)*.1,d=Math.abs(s-i)*.1,f=t.shape.bitmap.width*t.scalar,p=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(c)*l,Math.sin(c)*l,-Math.sin(c)*d,Math.cos(c)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var h=e.createPattern(u.transform(t.shape.bitmap),`no-repeat`);h.setTransform(m),e.globalAlpha=1-n,e.fillStyle=h,e.fillRect(t.x-f/2,t.y-p/2,f,p),e.globalAlpha=1}else if(t.shape===`circle`)e.ellipse?e.ellipse(t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):E(e,t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if(t.shape===`star`)for(var g=Math.PI/2*3,_=4*t.scalar,v=8*t.scalar,y=t.x,b=t.y,x=5,S=Math.PI/x;x--;)y=t.x+Math.cos(g)*v,b=t.y+Math.sin(g)*v,e.lineTo(y,b),g+=S,y=t.x+Math.cos(g)*_,b=t.y+Math.sin(g)*_,e.lineTo(y,b),g+=S;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(i)),e.lineTo(Math.floor(a),Math.floor(s)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function k(e,t,n,a,o){var s=t.slice(),c=e.getContext(`2d`),f,p,m=l(function(t){function l(){f=p=null,c.clearRect(0,0,a.width,a.height),u.clear(),o(),t()}function m(){r&&(a.width!==i.width||a.height!==i.height)&&(a.width=e.width=i.width,a.height=e.height=i.height),!a.width&&!a.height&&(n(e),a.width=e.width,a.height=e.height),c.clearRect(0,0,a.width,a.height),s=s.filter(function(e){return O(c,e)}),s.length?f=d.frame(m):l()}f=d.frame(m),p=l});return{addFettis:function(e){return s=s.concat(e),m},canvas:e,promise:m,reset:function(){f&&d.cancel(f),p&&p()}}}function ee(e,n){var r=!e,i=!!g(n||{},`resize`),o=!1,s=g(n,`disableForReducedMotion`,Boolean),c=a&&g(n||{},`useWorker`)?f():null,u=r?C:w,d=e&&c?!!e.__confetti_initialized:!1,p=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion)`).matches,m;function h(t,n,r){for(var i=g(t,`particleCount`,_),a=g(t,`angle`,Number),o=g(t,`spread`,Number),s=g(t,`startVelocity`,Number),c=g(t,`decay`,Number),l=g(t,`gravity`,Number),d=g(t,`drift`,Number),f=g(t,`colors`,b),p=g(t,`ticks`,Number),h=g(t,`shapes`),y=g(t,`scalar`),x=!!g(t,`flat`),C=S(t),w=i,T=[],E=e.width*C.x,O=e.height*C.y;w--;)T.push(D({x:E,y:O,angle:a,spread:o,startVelocity:s,color:f[w%f.length],shape:h[v(0,h.length)],ticks:p,decay:c,gravity:l,drift:d,scalar:y,flat:x}));return m?m.addFettis(T):(m=k(e,T,u,n,r),m.promise)}function y(n){var a=s||g(n,`disableForReducedMotion`,Boolean),f=g(n,`zIndex`,Number);if(a&&p)return l(function(e){e()});r&&m?e=m.canvas:r&&!e&&(e=T(f),document.body.appendChild(e)),i&&!d&&u(e);var _={width:e.width,height:e.height};c&&!d&&c.init(e),d=!0,c&&(e.__confetti_initialized=!0);function v(){if(c){var t={getBoundingClientRect:function(){if(!r)return e.getBoundingClientRect()}};u(t),c.postMessage({resize:{width:t.width,height:t.height}});return}_.width=_.height=null}function y(){m=null,i&&(o=!1,t.removeEventListener(`resize`,v)),r&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,d=!1)}return i&&!o&&(o=!0,t.addEventListener(`resize`,v,!1)),c?c.fire(n,_,y):h(n,_,y)}return y.reset=function(){c&&c.reset(),m&&m.reset()},y}var A;function j(){return A||(A=ee(null,{useWorker:!0,resize:!0})),A}function te(e,t,n,r,i,a,o){var s=new Path2D(e),c=new Path2D;c.addPath(s,new DOMMatrix(t));var l=new Path2D;
51return l.addPath(c,new DOMMatrix([Math.cos(o)*i,Math.sin(o)*i,-Math.sin(o)*a,Math.cos(o)*a,n,r])),l}function ne(e){if(!o)throw Error(`path confetti are not supported in this browser`);var t,n;typeof e==`string`?t=e:(t=e.path,n=e.matrix);var r=new Path2D(t),i=document.createElement(`canvas`).getContext(`2d`);if(!n){for(var a=1e3,s=a,c=a,l=0,u=0,d,f,p=0;p<a;p+=2)for(var m=0;m<a;m+=2)i.isPointInPath(r,p,m,`nonzero`)&&(s=Math.min(s,p),c=Math.min(c,m),l=Math.max(l,p),u=Math.max(u,m));d=l-s,f=u-c;var h=10,g=Math.min(h/d,h/f);n=[g,0,0,g,-Math.round(d/2+s)*g,-Math.round(f/2+c)*g]}return{type:`path`,path:t,matrix:n}}function re(e){var t,n=1,r=`#000000`,i=`"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif`;typeof e==`string`?t=e:(t=e.text,n=`scalar`in e?e.scalar:n,i=`fontFamily`in e?e.fontFamily:i,r=`color`in e?e.color:r);var a=10*n,o=``+a+`px `+i,s=new OffscreenCanvas(a,a),c=s.getContext(`2d`);c.font=o;var l=c.measureText(t),u=Math.ceil(l.actualBoundingBoxRight+l.actualBoundingBoxLeft),d=Math.ceil(l.actualBoundingBoxAscent+l.actualBoundingBoxDescent),f=2,p=l.actualBoundingBoxLeft+f,m=l.actualBoundingBoxAscent+f;u+=f+f,d+=f+f,s=new OffscreenCanvas(u,d),c=s.getContext(`2d`),c.font=o,c.fillStyle=r,c.fillText(t,p,m);var h=1/n;return{type:`bitmap`,bitmap:s.transferToImageBitmap(),matrix:[h,0,0,h,-u*h/2,-d*h/2]}}n.exports=function(){return j().apply(this,arguments)},n.exports.reset=function(){j().reset()},n.exports.create=ee,n.exports.shapeFromPath=ne,n.exports.shapeFromText=re})((function(){return typeof window<`u`?window:typeof self<`u`?self:this||{}})(),ay,!1);var oy=ay.exports;ay.exports.create;var sy={particleCount:150,spread:90,gravity:1.5},cy=window.innerWidth,ly=window.innerHeight,uy=({timeout:e=200})=>{let t=z.useRef(null);return z.useLayoutEffect(()=>{let n=window.setTimeout(()=>{if(t.current){let e=oy.create(t.current);e({...sy,origin:{x:0},angle:45}),e({...sy,origin:{x:1},angle:135})}},e);return()=>{n&&clearTimeout(n)}},[]),(0,B.jsx)(`canvas`,{ref:t,className:`pointer-events-none fixed inset-0 z-[100] h-full w-full`,width:cy,height:ly})},dy=`/assets/creditCardIllustrationError-BM8lUyhl.png`,fy=({checkoutSessionId:e,onModalClose:t,retry:n})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`img`,{className:`mt-5 w-[220px]`,src:dy,alt:`payment upgrade failed`}),(0,B.jsx)(`p`,{className:`mt-5 text-xl font-bold text-gray-700`,children:`There was an error upgrading your account.`}),e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`mt-2 text-sm text-gray-600`,children:`Please give the account upgrade another shot.`}),(0,B.jsx)(x,{marginTop:8,marginBottom:6,variant:`secondary`,icon:`refresh-cw`,onClick:n,"data-test":`retry-payment`,children:`Retry`})]}):(0,B.jsx)(x,{marginTop:8,marginBottom:6,variant:`secondary`,icon:`thumbs-up`,onClick:t,"data-test":`acknowledge-payment-failure`,children:`Got it`})]}),py=`/assets/creditCardIllustrationSuccess-D8KENVln.png`,my=({onPaymentComplete:e})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`img`,{className:`mt-5 w-[220px]`,src:py,alt:`payment updated successfully`}),(0,B.jsx)(`p`,{className:`mt-5 text-xl font-bold text-gray-700`,children:`Your plan has been updated.`}),(0,B.jsx)(x,{marginTop:8,marginBottom:6,variant:`secondary`,icon:`thumbs-up`,onClick:e,"data-test":`acknowledge-payment-success`,children:`Got it`})]}),hy=({onClose:e,onPaymentComplete:t,workspaceId:n})=>{let{search:r}=u(),{paymentStatus:i,setPaymentStatus:a}=Rg(),{checkoutSessionId:o,freeToPaid:s}=Ag.parse(r),[c,{loading:l}]=fn({onCompleted:e=>{if(a(Ng.SUCCESS),s){var t,r;Zt({event:`customEventGA4`,customEvent:K_({workspaceId:n,purchaseMetadata:e.finalizeStripeCheckout.purchaseMetadata,affiliation:(t=(r=window.Rewardful)==null?void 0:r.referral)==null?null:t})})}},onError:()=>{a(Ng.FAILED)}});z.useEffect(()=>{o&&c({variables:{checkoutSessionId:o}})},[o,c]);let d=z.useMemo(()=>i===Ng.SUCCESS?(0,B.jsx)(my,{onPaymentComplete:t}):i===Ng.FAILED?(0,B.jsx)(fy,{checkoutSessionId:o,onModalClose:e,retry:()=>{a(Ng.FINALIZED_STRIPE_CHECKOUT),c()}}):i===Ng.FINALIZED_STRIPE_CHECKOUT&&l?(0,B.jsx)(Qn,{}
51):null,[i,l,o,e,t,a,c]);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(je,{name:`PaymentStatusModal_${i}`,width:`half`,isOpen:!!i,onClose:e,children:(0,B.jsx)(`div`,{className:`flex flex-col items-center justify-center`,children:d})}),i===Ng.SUCCESS&&(0,B.jsx)(uy,{})]})},gy=1,_y=({isOpen:e,onClose:t,config:n,currentWorkspace:r,modalType:i,onInitPayment:a,modalInitContext:o})=>{var s,c,l;let{preferredPlan:u}=o||{},[d,f]=z.useState(void 0),[p,m]=z.useState(void 0),[h,g,_]=Hg(),[v,y]=z.useState(void 0);z.useEffect(()=>{if(!e||!i||h.websiteAddons!==void 0)return;g({type:`SET_TOTAL_WEBSITES_NEEDED`,payload:Math.max(r.maxSites,r.websitesCount)});let t=Math.max(r.maxSites,r.websitesCount),n=Math.max(t-r.plan.options.maxWebsites,0),a=Math.max(parseInt(_,10)||0,gy);g({type:`SET_WEBSITE_ADDONS`,payload:{addons:a,totalAddons:a+n,maxWebsites:a+t}})},[e,i,r.maxSites,r.websitesCount,r.plan.options.maxWebsites,o==null||(s=o.preferredPlan)==null?void 0:s.maxWebsites,g,_,h.websiteAddons]);let b=z.useCallback((e,t)=>{if(h.totalWebsitesNeeded===void 0||h.totalWebsitesAddOns===void 0||h.websiteAddons===void 0)throw Error(`Total websites needed is not set`);let n=h.websiteAddons,r=h.totalWebsitesAddOns,i=Math.max(h.totalWebsitesNeeded,t.options.maxWebsites),a=e-n,o=Math.max(r+a,0),s=Math.max(i+a,0);g({type:`SET_WEBSITE_ADDONS`,payload:{addons:e,totalAddons:o,maxWebsites:s}})},[g,h.totalWebsitesAddOns,h.totalWebsitesNeeded,h.websiteAddons]),x=z.useCallback((e,t)=>{if(m(e),t){var n,i;if((d==null||(n=d.recommendPlans.currentPlanKey)==null?void 0:n.slug)!==e.slug||(d==null||(i=d.recommendPlans.currentPlanKey)==null?void 0:i.billingCycleInMonths)!==e.billingCycleInMonths){let e=Math.max(r.maxSites,r.websitesCount),t=Math.max(e-r.plan.options.maxWebsites,0);g({type:`SET_WEBSITE_ADDONS`,payload:{addons:0,totalAddons:t,maxWebsites:e}})}return}if(h.totalWebsitesNeeded===void 0||h.totalWebsitesAddOns===void 0||h.websiteAddons===void 0)throw Error(`websiteState is not set`);let a=Math.max(h.totalWebsitesNeeded-e.options.maxWebsites,0),o=e.slug===r.plan.slug?a-Math.max(Math.max(r.maxSites,r.websitesCount)-r.plan.options.maxWebsites,0):a;g({type:`SET_WEBSITE_ADDONS`,payload:{addons:o,totalAddons:a,maxWebsites:h.totalWebsitesNeeded}})},[h.totalWebsitesNeeded,h.totalWebsitesAddOns,h.websiteAddons,r.plan.slug,r.plan.options.maxWebsites,r.maxSites,r.websitesCount,g,d==null||(c=d.recommendPlans.currentPlanKey)==null?void 0:c.slug,d==null||(l=d.recommendPlans.currentPlanKey)==null?void 0:l.billingCycleInMonths]);z.useEffect(()=>{p===void 0&&d!==void 0&&(d==null?void 0:d.recommendPlans.plans.length)!==0&&x(d.recommendPlans.plans[0],!0)},[d,x,i,p]);let S=z.useCallback(e=>{let t=d==null?void 0:d.recommendPlans.plans.find(t=>t.slug===e);t&&x(t)},[d==null?void 0:d.recommendPlans.plans,x]),C=z.useCallback(()=>{t(),f(void 0),m(void 0),y(void 0),g({type:`RESET`})},[g,t]),{loading:w,error:T,refetch:E}=Bg({setData:f,totalWebsitesAddOns:h.totalWebsitesAddOns,preferredPlanKey:u==null?void 0:u.planKey,currentWorkspace:r});return(0,B.jsx)(je,{name:`SubscriptionModal_${i}`,height:`full`,width:`four-fifths`,align:`horizontalLeft`,isOpen:e,onClose:C,icon:{name:n.iconName,theme:`modern`},title:n==null?void 0:n.title,description:n==null?void 0:n.description,hasDivider:!0,children:(0,B.jsx)(R_,{loading:w,error:T,hasData:!!d,refetch:E,children:d&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(qv,{selectedPlanSlug:p==null?void 0:p.slug,setSelectedPlanSlug:S,websiteAddons:h.websiteAddons,onChangeWebsiteAddons:b,data:d,totalWebsitesNeeded:h.totalWebsitesNeeded||0,currentWorkspaceTotalWebsites:r.websitesCount,willExceedPlanLimits:v,websiteAddonsInputTitle:`Add-on websites`,onModalClose:C}),p?(0,B.jsx)(jv,{selectedPlan:p,totalWebsitesAddOns:h.totalWebsitesAddOns,setWillExceedPlanLimits:y,onModalClose:C,onInitPayment:a}):(0,B.jsx)(`div`,{className:`flex-1 bg-gray-50 p-6`})]})})})};function vy({config:e,button:t,isOpen:n,onClose:r,children:i,modalType:a}){let{iconName:s,title:c,description:l,suggestion:u}=e;return(0,B.jsxs)(je,{name:`WorkspaceActionRestrictedModal_${a}`,width:`third`,align:`left`,icon:{name:s,theme:`modern`},isOpen:n,onClose:r,title:c,description:l,CTA:t?(0,B.jsx)(`div`,{className:`p-6`,children:t}):void 0,children:[i?(0,B.jsx)(`div`,{className:o({"mb-6":!t}),children:i}):void 0,u&&(0,B.jsx)(me,{hasIcon:!1,title:`What you can do:`,intent:`info`,marginTop:i?4:2,children:(0,B.jsx)(`ul`,{className:`ml-4 mt-2 list-disc pl-4`,children:(0,B.jsx)(`li`,{children:u})})})]})}var yy=({currentWorkspace:e})=>{let{planChangePrerequisite:t,creditTopUpEnabled:n,isLegacy:r,planChangePrerequisite:i,isFreePlan:a}=e.plan,o=f(),{pathname:s,search:c}=u(),{workspaceName:l}=Dg(),{paymentStatus:d,setPaymentStatus:p,isPaymentInProgress:m,setIsPaymentInProgress:h}=Rg(),{isOpen:g,modalType:_,closeModal:v,onComplete:y,modalInitContext:b}=Bh(),x=!!(ne(`allowCreditTopUp`)&&n),S=_?Lg[_]({planChangePrerequisite:t,allowCreditTopUps:x}):void 0,C=z.useCallback(()=>{m||(v(),p(void 0),h(!1),o({pathname:s,search:Ag.stringify({...Ag.parse(c),checkoutSessionId:void 0,stripeStatus:void 0,plan:void 0,freeToPaid:void 0,addOns:void 0,creditTopUps:void 0,websiteAddons:void 0,...d!==void 0&&{changePlan:void 0}})},{replace:!0}))},[v,o,s,c,p,d,m,h]),w=z.useCallback(()=>{a&&!i&&o({pathname:s,search:Ag.stringify({...Ag.parse(window.location.search),freeToPaid:`1`})},{replace:!0})},[a,o,s,i]),E=z.useCallback(()=>{y==null||y(),C()},[y,C]);if(d)return(0,B.jsx)(hy,{workspaceId:e.id,onClose:C,onPaymentComplete:E});if(!S||!_)return null;if(_===K.AiBudgetLimitReached)return(0,B.jsx)(vy,{modalType:_,config:S,button:(0,B.jsx)(T,{intent:`normal`,variant:`primary`,fullWidth:!0,onClick:()=>{St.showNewMessage(`My workspace has reached its AI budget limit. I need assistance with increasing my AI budget or understanding my usage.`)},"data-test":`contact-support-ai-budget`,children:`Contact support`}),isOpen:g,onClose:C});
51if(t===It.ContactWorkspaceAdmin)return(0,B.jsx)(vy,{modalType:_,config:S,button:(0,B.jsx)(T,{variant:`primary`,fullWidth:!0,onClick:C,link:F({to:`workspace-settings`,workspaceName:l}),"data-test":`view-workspace-admins`,children:`View my workspace admins`}),isOpen:g,onClose:C});if(t===It.ContactSupport)return(0,B.jsx)(vy,{modalType:_,config:S,button:(0,B.jsx)(T,{intent:`normal`,variant:`primary`,fullWidth:!0,onClick:()=>{St.showNewMessage(`I need help to make adjustments to my plan...`)},"data-test":`contact-support`,children:`Contact support`}),isOpen:g,onClose:C});if(r&&_===K.RobotsLimitReached)return(0,B.jsx)(vy,{modalType:_,config:S,button:(0,B.jsx)(T,{variant:`primary`,fullWidth:!0,onClick:C,link:F({to:`workspace-subscription`,workspaceName:l,scrollToPlans:!0}),"data-test":`view-all-plans-legacy`,children:`View all plans`}),isOpen:g,onClose:C});if(e.status===Ut.SubscriptionOverdue)return(0,B.jsx)(vy,{modalType:_,config:S,isOpen:g,onClose:C,children:(0,B.jsx)(Ig,{})});if(_===K.AddCredits||_===K.CreditLimitReached)return(0,B.jsx)(ny,{modalType:_,config:S,isOpen:g,currentWorkspace:e,modalInitContext:b,onClose:C,onInitPayment:w});if(_===K.AddWebsite||_===K.WebsiteLimitReached)return(0,B.jsx)(_y,{modalType:_,config:S,isOpen:g,currentWorkspace:e,modalInitContext:b,onClose:C,onInitPayment:w});if(_===K.ChangePlan||_===K.WorkspaceMembersLimitReached)return(0,B.jsx)(Jv,{modalType:_,config:S,isOpen:g,currentWorkspace:e,modalInitContext:b,onClose:C,onInitPayment:w});throw Error(`Unknown modal type: ${_}`)},by=({currentWorkspace:e})=>(0,B.jsx)(Pg,{children:(0,B.jsx)(yy,{currentWorkspace:e})}),xy=e(((e,t)=>{function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=n})),Sy=e(((e,t)=>{var n=xy();function r(e,t,r){var i=e.length;return r=r===void 0?i:r,!t&&r>=i?e:n(e,t,r)}t.exports=r})),Cy=e(((e,t)=>{var n=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function r(e){return n.test(e)}t.exports=r})),wy=e(((e,t)=>{function n(e){return e.split(``)}t.exports=n})),Ty=e(((e,t)=>{var n=`\\ud800-\\udfff`,r=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,i=`\\ufe0e\\ufe0f`,a=`[`+n+`]`,o=`[`+r+`]`,s=`\\ud83c[\\udffb-\\udfff]`,c=`(?:`+o+`|`+s+`)`,l=`[^`+n+`]`,u=`(?:\\ud83c[\\udde6-\\uddff]){2}`,d=`[\\ud800-\\udbff][\\udc00-\\udfff]`,f=`\\u200d`,p=c+`?`,m=`[`+i+`]?`,h=`(?:`+f+`(?:`+[l,u,d].join(`|`)+`)`+m+p+`)*`,g=m+p+h,_=`(?:`+[l+o+`?`,o,u,d,a].join(`|`)+`)`,v=RegExp(s+`(?=`+s+`)|`+_+g,`g`);function y(e){return e.match(v)||[]}t.exports=y})),Ey=e(((e,t)=>{var n=wy(),r=Cy(),i=Ty();function a(e){return r(e)?i(e):n(e)}t.exports=a})),Dy=e(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Oy=e(((e,t)=>{var n=Ve(),r=Dy(),i=Ne(),a=$n(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),ky=e(((e,t)=>{var n=Oy();function r(e){return e==null?``:n(e)}t.exports=r})),Ay=e(((e,t)=>{var n=Sy(),r=Cy(),i=Ey(),a=ky();function o(e){return function(t){t=a(t);var o=r(t)?i(t):void 0,s=o?o[0]:t.charAt(0),c=o?n(o,1).join(``):t.slice(1);return s[e]()+c}}t.exports=o})),jy=e(((e,t)=>{t.exports=Ay()(`toUpperCase`)})),My=s(jy(),1),Ny=e=>(0,My.default)(e),Py=z.forwardRef((e,t)=>(0,B.jsx)(Zs,{linkComponent:_,...e,ref:t}));function Fy({isLoading:e=!1,teamNameFromPath:t,currentUser:n,currentTeam:r,selectedTeamId:i}){var a,o;let{myUserRole:s}=un();if(e)return(0,B.jsx)(Ci,{className:`h-8 w-36`});if(!n)return null;let{userTeams:c,canCreateTeam:l}=n,u=(c==null?void 0:c.items)||[],d=u.find(({team:e})=>e.id===i),f=u.find(({teamId:e})=>e===i),p=(s===Bn.SuperAdmin||s===Bn.Support)&&!f?xg(t)===`personal`?`${r!=null&&(a=r.createdBy)!=null&&a.email?r==null||(o=r.createdBy)==null?void 0:o.email:t.split(`-`)[0]}`:t:(d==null?void 0:d.team.name)||t;return(0,B.jsxs)(`div`,{className:`relative flex items-center overflow-hidden whitespace-nowrap`,children:[(0,B.jsx)(Be,{content:(0,B.jsxs)(`div`,{className:`flex min-w-[250px] flex-col gap-1`,children:[(0,B.jsx)(`div`,{className:`pl-3 pt-1 text-xs font-medium text-gray-600`,children:`Workspaces`}),u.map(({teamRole:e,team:t},n)=>(0,B.jsx)(Py,{isSelected:t.name===(d==null?void 0:d.team.name),link:F({to:`robots`,workspaceName:t.name||``}),badge:{label:Ny(e),intent:`secondary`},"data-test":`view-workspace`,children:t.name},n)),l&&(0,B.jsx)(`div`,{className:`border-t border-gray-200 pt-1`,children:(0,B.jsx)(Py,{icon:`plus`,isSelected:!1,link:F({to:`workspace-new`,workspaceName:t}),"data-test":`create-new-workspace`,children:`Create New Workspace`})})]}),children:(0,B.jsxs)(T,{variant:`tertiary`,size:`small`,title:`Switch workspace`,"data-test":`switch-workspace`,children:[(0,B.jsx)(`span`,{className:`inline-block max-w-[120px] overflow-hidden text-ellipsis align-middle`,children:p}),(0,B.jsx)(pe,{className:`ml-[5px]`,name:`chevrons-up-down`,size:4})]})}),(0,B.jsx)(er,{authorizedRoles:[Bn.SuperAdmin,Bn.Support],className:`m-0.5`,children:(0,B.jsx)(T,{variant:`tertiary`,icon:`house`,title:`Admin workspace settings`,link:F({to:`admin-workspaces`,search:r==null?void 0:r.id}
51),"data-test":`admin-workspace-settings`})})]})}var Iy=Fy,Ly=`free`,Ry=`free-zero`,zy=`starter-ltd`,By=`starter-appsumo`,Vy=`starter`,Hy=`professional`,Uy=`team`,Wy=`custom`,Gy=`company`,Ky=`premium`,qy=`premium-managed`,Jy=`flex size-9 shrink-0 items-center justify-center rounded-full`,Yy=function(e,t){return Yy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Yy(e,t)};function Xy(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Yy(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var q=function(){return q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},q.apply(this,arguments)};function Zy(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Qy(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function $y(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function eb(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var tb=`production`,nb=function(e){return{isEnabled:function(t){return e.some(function(e){return!!t[e]})}}},rb={measureLayout:nb([`layout`,`layoutId`,`drag`]),animation:nb([`animate`,`exit`,`variants`,`whileHover`,`whileTap`,`whileFocus`,`whileDrag`,`whileInView`]),exit:nb([`exit`]),drag:nb([`drag`,`dragControls`]),focus:nb([`whileFocus`]),hover:nb([`whileHover`,`onHoverStart`,`onHoverEnd`]),tap:nb([`whileTap`,`onTap`,`onTapStart`,`onTapCancel`]),pan:nb([`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`]),inView:nb([`whileInView`,`onViewportEnter`,`onViewportLeave`])};function ib(e){for(var t in e)e[t]!==null&&(t===`projectionNodeConstructor`?rb.projectionNodeConstructor=e[t]:rb[t].Component=e[t])}var ab=(0,z.createContext)({strict:!1}),ob=Object.keys(rb),sb=ob.length;function cb(e,t,n){var r=[],i=(0,z.useContext)(ab);if(!t)return null;tb!==`production`&&n&&i.strict;for(var a=0;a<sb;a++){var o=ob[a],s=rb[o],c=s.isEnabled,l=s.Component;c(e)&&l&&r.push(z.createElement(l,q({key:o},e,{visualElement:t})))}return r}var lb=(0,z.createContext)({transformPagePoint:function(e){return e},isStatic:!1,reducedMotion:`never`}),ub=(0,z.createContext)({});function db(){return(0,z.useContext)(ub).visualElement}var fb=(0,z.createContext)(null),pb=typeof document<`u`,mb=pb?z.useLayoutEffect:z.useEffect,hb={current:null},gb=!1;function _b(){if(gb=!0,pb){if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion)`),t=function(){return hb.current=e.matches};e.addListener(t),t()}else hb.current=!1}}function vb(){return!gb&&_b(),$y((0,z.useState)(hb.current),1)[0]}function yb(){var e=vb(),t=(0,z.useContext)(lb).reducedMotion;return t===`never`?!1:t===`always`||e}function bb(e,t,n,r){var i=(0,z.useContext)(ab),a=db(),o=(0,z.useContext)(fb),s=yb(),c=(0,z.useRef)(void 0);r||(r=i.renderer),!c.current&&r&&(c.current=r(e,{visualState:t,parent:a,props:n,presenceId:o==null?void 0:o.id,blockInitialAnimation:(o==null?void 0:o.initial)===!1,shouldReduceMotion:s}));var l=c.current;return mb(function(){l==null||l.syncRender()}),(0,z.useEffect)(function(){var e;(e=l==null?void 0:l.animationState)==null||e.animateChanges()}),mb(function(){return function(){return l==null?void 0:l.notifyUnmount()}},[]),l}function xb(e){return typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Sb(e,t,n){return(0,z.useCallback)(function(r){var i;r&&((i=e.mount)==null||i.call(e,r)),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):xb(n)&&(n.current=r))},[t])}function Cb(e){return Array.isArray(e)}function wb(e){return typeof e==`string`||Cb(e)}function Tb(e){var t={};return e.forEachValue(function(e,n){return t[n]=e.get()}),t}function Eb(e){var t={};return e.forEachValue(function(e,n){return t[n]=e.getVelocity()}),t}function Db(e,t,n,r,i){var a;return r===void 0&&(r={}),i===void 0&&(i={}),typeof t==`function`&&(t=t(n==null?e.custom:n,r,i)),typeof t==`string`&&(t=(a=e.variants)==null?void 0:a[t]),typeof t==`function`&&(t=t(n==null?e.custom:n,r,i)),t}function Ob(e,t,n){var r=e.getProps();return Db(r,t,n==null?r.custom:n,Tb(e),Eb(e))}function kb(e){var t;return typeof((t=e.animate)==null?void 0:t.start)==`function`||wb(e.initial)||wb(e.animate)||wb(e.whileHover)||wb(e.whileDrag)||wb(e.whileTap)||wb(e.whileFocus)||wb(e.exit)}function Ab(e){return!!(kb(e)||e.variants)}function jb(e,t){if(kb(e)){var n=e.initial,r=e.animate;return{initial:n===!1||wb(n)?n:void 0,animate:wb(r)?r:void 0}}return e.inherit===!1?{}:t}function Mb(e){var t=jb(e,(0,z.useContext)(ub)),n=t.initial,r=t.animate;return(0,z.useMemo)(function(){return{initial:n,animate:r}},[Nb(n),Nb(r)])}function Nb(e){return Array.isArray(e)?e.join(` `):e}function Pb(e){var t=(0,z.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Fb={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ib=1;
51function Lb(){return Pb(function(){if(Fb.hasEverUpdated)return Ib++})}var Rb=(0,z.createContext)({}),zb=(0,z.createContext)({});function Bb(e,t,n,r){var i,a=t.layoutId,o=t.layout,s=t.drag,c=t.dragConstraints,l=t.layoutScroll,u=(0,z.useContext)(zb);!r||!n||n!=null&&n.projection||(n.projection=new r(e,n.getLatestValues(),(i=n.parent)==null?void 0:i.projection),n.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!s||c&&xb(c),visualElement:n,scheduleRender:function(){return n.scheduleRender()},animationType:typeof o==`string`?o:`both`,initialPromotionConfig:u,layoutScroll:l}))}var Vb=function(e){Xy(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getSnapshotBeforeUpdate=function(){return this.updateProps(),null},t.prototype.componentDidUpdate=function(){},t.prototype.updateProps=function(){var e=this.props,t=e.visualElement,n=e.props;t&&t.setProps(n)},t.prototype.render=function(){return this.props.children},t}(z.Component);function Hb(e){var t=e.preloadedFeatures,n=e.createVisualElement,r=e.projectionNodeConstructor,i=e.useRender,a=e.useVisualState,o=e.Component;t&&ib(t);function s(e,s){var c=Ub(e);e=q(q({},e),{layoutId:c});var l=(0,z.useContext)(lb),u=null,d=Mb(e),f=l.isStatic?void 0:Lb(),p=a(e,l.isStatic);return!l.isStatic&&pb&&(d.visualElement=bb(o,p,q(q({},l),e),n),Bb(f,e,d.visualElement,r||rb.projectionNodeConstructor),u=cb(e,d.visualElement,t)),z.createElement(Vb,{visualElement:d.visualElement,props:q(q({},l),e)},u,z.createElement(ub.Provider,{value:d},i(o,e,f,Sb(p,d.visualElement,s),p,l.isStatic,d.visualElement)))}return(0,z.forwardRef)(s)}function Ub(e){var t,n=e.layoutId,r=(t=(0,z.useContext)(Rb))==null?void 0:t.id;return r&&n!==void 0?r+`-`+n:n}function Wb(e){function t(t,n){return n===void 0&&(n={}),Hb(e(t,n))}if(typeof Proxy>`u`)return t;var n=new Map;return new Proxy(t,{get:function(e,r){return n.has(r)||n.set(r,t(r)),n.get(r)}})}var Gb=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`svg`,`switch`,`symbol`,`text`,`tspan`,`use`,`view`];function Kb(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Gb.indexOf(e)>-1||/[A-Z]/.test(e))}var qb={};function Jb(e){Object.assign(qb,e)}var Yb=[``,`X`,`Y`,`Z`],Xb=[`translate`,`scale`,`rotate`,`skew`],Zb=[`transformPerspective`,`x`,`y`,`z`];Xb.forEach(function(e){return Yb.forEach(function(t){return Zb.push(e+t)})});function Qb(e,t){return Zb.indexOf(e)-Zb.indexOf(t)}var $b=new Set(Zb);function ex(e){return $b.has(e)}var tx=new Set([`originX`,`originY`,`originZ`]);function nx(e){return tx.has(e)}function rx(e,t){var n=t.layout,r=t.layoutId;return ex(e)||nx(e)||(n||r!==void 0)&&(!!qb[e]||e===`opacity`)}var ix=function(e){return!!(typeof e==`object`&&e&&e.getVelocity)},ax={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`};function ox(e,t,n,r){var i=e.transform,a=e.transformKeys,o=t.enableHardwareAcceleration,s=o===void 0||o,c=t.allowTransformNone,l=c===void 0||c,u=``;a.sort(Qb);for(var d=!1,f=a.length,p=0;p<f;p++){var m=a[p];u+=`${ax[m]||m}(${i[m]}) `,m===`z`&&(d=!0)}return!d&&s?u+=`translateZ(0)`:u=u.trim(),r?u=r(i,n?``:u):l&&n&&(u=`none`),u}function sx(e){var t=e.originX,n=t===void 0?`50%`:t,r=e.originY,i=r===void 0?`50%`:r,a=e.originZ;return`${n} ${i} ${a===void 0?0:a}`}function cx(e){return e.startsWith(`--`)}var lx=function(e,t){return t&&typeof e==`number`?t.transform(e):e},ux=q(q({},Mi),{transform:Math.round}),dx={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,size:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,rotate:Ii,rotateX:Ii,rotateY:Ii,rotateZ:Ii,scale:Pi,scaleX:Pi,scaleY:Pi,scaleZ:Pi,skew:Ii,skewX:Ii,skewY:Ii,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:Ni,originX:Bi,originY:Bi,originZ:V,zIndex:ux,fillOpacity:Ni,strokeOpacity:Ni,numOctaves:ux};function fx(e,t,n,r){var i,a=e.style,o=e.vars,s=e.transform,c=e.transformKeys,l=e.transformOrigin;c.length=0;var u=!1,d=!1,f=!0;for(var p in t){var m=t[p];if(cx(p)){o[p]=m;continue}var h=dx[p],g=lx(m,h);if(ex(p)){if(u=!0,s[p]=g,c.push(p),!f)continue;m!==((i=h.default)==null?0:i)&&(f=!1)}else nx(p)?(l[p]=g,d=!0):a[p]=g}u?a.transform=ox(e,n,f,r):r?a.transform=r({},``):!t.transform&&a.transform&&(a.transform=`none`),d&&(a.transformOrigin=sx(l))}var px=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function mx(e,t,n){for(var r in t)!ix(t[r])&&!rx(r,n)&&(e[r]=t[r])}
51function hx(e,t,n){var r=e.transformTemplate;return(0,z.useMemo)(function(){var e=px();fx(e,t,{enableHardwareAcceleration:!n},r);var i=e.vars,a=e.style;return q(q({},i),a)},[t])}function gx(e,t,n){var r=e.style||{},i={};return mx(i,r,e),Object.assign(i,hx(e,t,n)),e.transformValues&&(i=e.transformValues(i)),i}function _x(e,t,n){var r={},i=gx(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout=`none`,i.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),r.style=i,r}var vx=new Set(`initial.animate.exit.style.variants.transition.transformTemplate.transformValues.custom.inherit.layout.layoutId.layoutDependency.onLayoutAnimationStart.onLayoutAnimationComplete.onLayoutMeasure.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd.drag.dragControls.dragListener.dragConstraints.dragDirectionLock.dragSnapToOrigin._dragX._dragY.dragElastic.dragMomentum.dragPropagation.dragTransition.whileDrag.onPan.onPanStart.onPanEnd.onPanSessionStart.onTap.onTapStart.onTapCancel.onHoverStart.onHoverEnd.whileFocus.whileTap.whileHover.whileInView.onViewportEnter.onViewportLeave.viewport.layoutScroll`.split(`.`));function yx(e){return vx.has(e)}var bx=function(e){return!yx(e)};function xx(e){e&&(bx=function(t){return t.startsWith(`on`)?!yx(t):e(t)})}try{xx((ma(),t(da)).default)}catch{}function Sx(e,t,n){var r={};for(var i in e)(bx(i)||n===!0&&yx(i)||!t&&!yx(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}function Cx(e,t,n){return typeof e==`string`?e:V.transform(t+n*e)}function wx(e,t,n){return`${Cx(t,e.x,e.width)} ${Cx(n,e.y,e.height)}`}var Tx={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Ex={offset:`strokeDashoffset`,array:`strokeDasharray`};function Dx(e,t,n,r,i){n===void 0&&(n=1),r===void 0&&(r=0),i===void 0&&(i=!0),e.pathLength=1;var a=i?Tx:Ex;e[a.offset]=V.transform(-r);var o=V.transform(t),s=V.transform(n);e[a.array]=`${o} ${s}`}function Ox(e,t,n,r){var i=t.attrX,a=t.attrY,o=t.originX,s=t.originY,c=t.pathLength,l=t.pathSpacing,u=l===void 0?1:l,d=t.pathOffset,f=d===void 0?0:d;fx(e,Zy(t,[`attrX`,`attrY`,`originX`,`originY`,`pathLength`,`pathSpacing`,`pathOffset`]),n,r),e.attrs=e.style,e.style={};var p=e.attrs,m=e.style,h=e.dimensions;p.transform&&(h&&(m.transform=p.transform),delete p.transform),h&&(o!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=wx(h,o===void 0?.5:o,s===void 0?.5:s)),i!==void 0&&(p.x=i),a!==void 0&&(p.y=a),c!==void 0&&Dx(p,c,u,f,!1)}var kx=function(){return q(q({},px()),{attrs:{}})};function Ax(e,t){var n=(0,z.useMemo)(function(){var n=kx();return Ox(n,t,{enableHardwareAcceleration:!1},e.transformTemplate),q(q({},n.attrs),{style:q({},n.style)})},[t]);if(e.style){var r={};mx(r,e.style,e),n.style=q(q({},r),n.style)}return n}function jx(e){return e===void 0&&(e=!1),function(t,n,r,i,a,o){var s=a.latestValues,c=(Kb(t)?Ax:_x)(n,s,o),l=Sx(n,typeof t==`string`,e),u=q(q(q({},l),c),{ref:i});return r&&(u[`data-projection-id`]=r),(0,z.createElement)(t,u)}}var Mx=/([a-z])([A-Z])/g,Nx=`$1-$2`,Px=function(e){return e.replace(Mx,Nx).toLowerCase()};function Fx(e,t,n,r){var i=t.style,a=t.vars;for(var o in Object.assign(e.style,i,r&&r.getProjectionStyles(n)),a)e.style.setProperty(o,a[o])}var Ix=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`]);function Lx(e,t,n,r){for(var i in Fx(e,t,void 0,r),t.attrs)e.setAttribute(Ix.has(i)?i:Px(i),t.attrs[i])}function Rx(e){var t=e.style,n={};for(var r in t)(ix(t[r])||rx(r,e))&&(n[r]=t[r]);return n}function zx(e){var t=Rx(e);for(var n in e)if(ix(e[n])){var r=n===`x`||n===`y`?`attr`+n.toUpperCase():n;t[r]=e[n]}return t}function Bx(e){return typeof e==`object`&&typeof e.start==`function`}var Vx=function(e){return Array.isArray(e)},Hx=function(e){return!!(e&&typeof e==`object`&&e.mix&&e.toValue)},Ux=function(e){return Vx(e)?e[e.length-1]||0:e};function Wx(e){var t=ix(e)?e.get():e;return Hx(t)?t.toValue():t}function Gx(e,t,n,r){var i=e.scrapeMotionValuesFromProps,a=e.createRenderState,o=e.onMount,s={latestValues:qx(t,n,r,i),renderState:a()};return o&&(s.mount=function(e){return o(t,e,s)}),s}var Kx=function(e){return function(t,n){var r=(0,z.useContext)(ub),i=(0,z.useContext)(fb);return n?Gx(e,t,r,i):Pb(function(){return Gx(e,t,r,i)})}};function qx(e,t,n,r){var i={},a=(n==null?void 0:n.initial)===!1,o=r(e);for(var s in o)i[s]=Wx(o[s]);var c=e.initial,l=e.animate,u=kb(e),d=Ab(e);t&&d&&!u&&e.inherit!==!1&&(c!=null||(c=t.initial),l!=null||(l=t.animate));var f=a||c===!1,p=f?l:c;return p&&typeof p!=`boolean`&&!Bx(p)&&(Array.isArray(p)?p:[p]).forEac
51h(function(t){var n=Db(e,t);if(n){var r=n.transitionEnd;n.transition;var a=Zy(n,[`transitionEnd`,`transition`]);for(var o in a){var s=a[o];if(Array.isArray(s)){var c=f?s.length-1:0;s=s[c]}s!==null&&(i[o]=s)}for(var o in r)i[o]=r[o]}}),i}var Jx={useVisualState:Kx({scrapeMotionValuesFromProps:zx,createRenderState:kx,onMount:function(e,t,n){var r=n.renderState,i=n.latestValues;try{r.dimensions=typeof t.getBBox==`function`?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}Ox(r,i,{enableHardwareAcceleration:!1},e.transformTemplate),Lx(t,r)}})},Yx={useVisualState:Kx({scrapeMotionValuesFromProps:Rx,createRenderState:px})};function Xx(e,t,n,r,i){var a=t.forwardMotionProps,o=a!==void 0&&a,s=Kb(e)?Jx:Yx;return q(q({},s),{preloadedFeatures:n,useRender:jx(o),createVisualElement:r,projectionNodeConstructor:i,Component:e})}var Zx;(function(e){e.Animate=`animate`,e.Hover=`whileHover`,e.Tap=`whileTap`,e.Drag=`whileDrag`,e.Focus=`whileFocus`,e.InView=`whileInView`,e.Exit=`exit`})(Zx||(Zx={}));function Qx(e,t,n,r){return r===void 0&&(r={passive:!0}),e.addEventListener(t,n,r),function(){return e.removeEventListener(t,n)}}function $x(e,t,n,r){(0,z.useEffect)(function(){var i=e.current;if(n&&i)return Qx(i,t,n,r)},[e,t,n,r])}function eS(e){var t=e.whileFocus,n=e.visualElement;$x(n,`focus`,t?function(){var e;(e=n.animationState)==null||e.setActive(Zx.Focus,!0)}:void 0),$x(n,`blur`,t?function(){var e;(e=n.animationState)==null||e.setActive(Zx.Focus,!1)}:void 0)}function tS(e){return typeof PointerEvent<`u`&&e instanceof PointerEvent?e.pointerType===`mouse`:e instanceof MouseEvent}function nS(e){return!!e.touches}function rS(e){return function(t){var n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}var iS={pageX:0,pageY:0};function aS(e,t){t===void 0&&(t=`page`);var n=e.touches[0]||e.changedTouches[0]||iS;return{x:n[t+`X`],y:n[t+`Y`]}}function oS(e,t){return t===void 0&&(t=`page`),{x:e[t+`X`],y:e[t+`Y`]}}function sS(e,t){return t===void 0&&(t=`page`),{point:nS(e)?aS(e,t):oS(e,t)}}var cS=function(e,t){t===void 0&&(t=!1);var n=function(t){return e(t,sS(t))};return t?rS(n):n},lS=function(){return pb&&window.onpointerdown===null},uS=function(){return pb&&window.ontouchstart===null},dS=function(){return pb&&window.onmousedown===null},fS={pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointercancel:`mousecancel`,pointerover:`mouseover`,pointerout:`mouseout`,pointerenter:`mouseenter`,pointerleave:`mouseleave`},pS={pointerdown:`touchstart`,pointermove:`touchmove`,pointerup:`touchend`,pointercancel:`touchcancel`};function mS(e){return lS()?e:uS()?pS[e]:dS()?fS[e]:e}function hS(e,t,n,r){return Qx(e,mS(t),cS(n,t===`pointerdown`),r)}function gS(e,t,n,r){return $x(e,mS(t),n&&cS(n,t===`pointerdown`),r)}function _S(e){var t=null;return function(){return t===null&&(t=e,function(){t=null})}}var vS=_S(`dragHorizontal`),yS=_S(`dragVertical`);function bS(e){var t=!1;if(e===`y`)t=yS();else if(e===`x`)t=vS();else{var n=vS(),r=yS();n&&r?t=function(){n(),r()}:(n&&n(),r&&r())}return t}function xS(){var e=bS(!0);return!e||(e(),!1)}function SS(e,t,n){return function(r,i){var a;!tS(r)||xS()||((a=e.animationState)==null||a.setActive(Zx.Hover,t),n==null||n(r,i))}}function CS(e){var t=e.onHoverStart,n=e.onHoverEnd,r=e.whileHover,i=e.visualElement;gS(i,`pointerenter`,t||r?SS(i,!0,t):void 0,{passive:!t}),gS(i,`pointerleave`,n||r?SS(i,!1,n):void 0,{passive:!n})}var wS=function(e,t){return t?e===t||wS(e,t.parentElement):!1};function TS(e){return(0,z.useEffect)(function(){return function(){return e()}},[])}function ES(e){var t=e.onTap,n=e.onTapStart,r=e.onTapCancel,i=e.whileTap,a=e.visualElement,o=t||n||r||i,s=(0,z.useRef)(!1),c=(0,z.useRef)(null),l={passive:!(n||t||r||m)};function u(){var e;(e=c.current)==null||e.call(c),c.current=null}function d(){var e;return u(),s.current=!1,(e=a.animationState)==null||e.setActive(Zx.Tap,!1),!xS()}function f(e,n){d()&&(wS(a.getInstance(),e.target)?t==null||t(e,n):r==null||r(e,n))}function p(e,t){d()&&(r==null||r(e,t))}function m(e,t){var r;u(),!s.current&&(s.current=!0,c.current=Ba(hS(window,`pointerup`,f,l),hS(window,`pointercancel`,p,l)),(r=a.animationState)==null||r.setActive(Zx.Tap,!0),n==null||n(e,t))}gS(a,`pointerdown`,o?m:void 0,l),TS(u)}var DS=new Set;function OS(e,t,n){e||DS.has(t)||(console.warn(t),n&&console.warn(n),DS.add(t))}var kS=new WeakMap,AS=new WeakMap,jS=function(e){var t;(t=kS.get(e.target))==null||t(e)},MS=function(e){e.forEach(jS)};function NS(e){var t=e.root,n=Zy(e,[`root`]),r=t||document;AS.has(r)||AS.set(r,{});var i=AS.get(r),a=JSON.stringify(n);
51return i[a]||(i[a]=new IntersectionObserver(MS,q({root:t},n))),i[a]}function PS(e,t,n){var r=NS(t);return kS.set(e,n),r.observe(e),function(){kS.delete(e),r.unobserve(e)}}function FS(e){var t=e.visualElement,n=e.whileInView,r=e.onViewportEnter,i=e.onViewportLeave,a=e.viewport,o=a===void 0?{}:a,s=(0,z.useRef)({hasEnteredView:!1,isInView:!1}),c=!!(n||r||i);o.once&&s.current.hasEnteredView&&(c=!1),(typeof IntersectionObserver>`u`?RS:LS)(c,s.current,t,o)}var IS={some:0,all:1};function LS(e,t,n,r){var i=r.root,a=r.margin,o=r.amount,s=o===void 0?`some`:o,c=r.once;(0,z.useEffect)(function(){if(e){var r={root:i==null?void 0:i.current,rootMargin:a,threshold:typeof s==`number`?s:IS[s]};return PS(n.getInstance(),r,function(e){var r,i=e.isIntersecting;if(t.isInView!==i&&(t.isInView=i,!(c&&!i&&t.hasEnteredView))){i&&(t.hasEnteredView=!0),(r=n.animationState)==null||r.setActive(Zx.InView,i);var a=n.getProps(),o=i?a.onViewportEnter:a.onViewportLeave;o==null||o(e)}})}},[e,i,a,s])}function RS(e,t,n,r){var i=r.fallback,a=i===void 0||i;(0,z.useEffect)(function(){!e||!a||(tb!==`production`&&OS(!1,`IntersectionObserver not available on this device. whileInView animations will trigger on mount.`),requestAnimationFrame(function(){var e;t.hasEnteredView=!0;var r=n.getProps().onViewportEnter;r==null||r(null),(e=n.animationState)==null||e.setActive(Zx.InView,!0)}))},[e])}var zS=function(e){return function(t){return e(t),null}},BS={inView:zS(FS),tap:zS(ES),focus:zS(eS),hover:zS(CS)},VS=0,HS=function(){return VS++},US=function(){return Pb(HS)};function WS(){var e=(0,z.useContext)(fb);if(e===null)return[!0,null];var t=e.isPresent,n=e.onExitComplete,r=e.register,i=US();return(0,z.useEffect)(function(){return r(i)},[]),!t&&n?[!1,function(){return n==null?void 0:n(i)}]:[!0]}function GS(){return KS((0,z.useContext)(fb))}function KS(e){return e===null||e.isPresent}function qS(e,t){if(!Array.isArray(t))return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var JS=function(e){return e*1e3},YS={linear:so,easeIn:co,easeInOut:uo,easeOut:lo,circIn:fo,circInOut:mo,circOut:po,backIn:ho,backInOut:_o,backOut:go,anticipate:vo,bounceIn:Co,bounceInOut:wo,bounceOut:So},XS=function(e){if(Array.isArray(e)){e.length;var t=$y(e,4),n=t[0],r=t[1],i=t[2],a=t[3];return bs(n,r,i,a)}return typeof e==`string`?(YS[e],`${e}`,YS[e]):e},ZS=function(e){return Array.isArray(e)&&typeof e[0]!=`number`},QS=function(e,t){return e!==`zIndex`&&!!(typeof t==`number`||Array.isArray(t)||typeof t==`string`&&ia.test(t)&&!t.startsWith(`url(`))},$S=function(){return{type:`spring`,stiffness:500,damping:25,restSpeed:10}},eC=function(e){return{type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}},tC=function(){return{type:`keyframes`,ease:`linear`,duration:.3}},nC=function(e){return{type:`keyframes`,duration:.8,values:e}},rC={x:$S,y:$S,z:$S,rotate:$S,rotateX:$S,rotateY:$S,rotateZ:$S,scaleX:eC,scaleY:eC,scale:eC,opacity:tC,backgroundColor:tC,color:tC,default:eC},iC=function(e,t){var n=Vx(t)?nC:rC[e]||rC.default;return q({to:t},n(t))},aC=q(q({},dx),{color:Yi,backgroundColor:Yi,outlineColor:Yi,fill:Yi,stroke:Yi,borderColor:Yi,borderTopColor:Yi,borderRightColor:Yi,borderBottomColor:Yi,borderLeftColor:Yi,filter:ca,WebkitFilter:ca}),oC=function(e){return aC[e]};function sC(e,t){var n,r=oC(e);return r!==ca&&(r=ia),(n=r.getAnimatableNone)==null?void 0:n.call(r,t)}var cC={current:!1};function lC(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=Zy(e,[`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`]);return!!Object.keys(t).length}function uC(e){var t=e.ease,n=e.times,r=e.yoyo,i=e.flip,a=e.loop,o=Zy(e,[`ease`,`times`,`yoyo`,`flip`,`loop`]),s=q({},o);return n&&(s.offset=n),o.duration&&(s.duration=JS(o.duration)),o.repeatDelay&&(s.repeatDelay=JS(o.repeatDelay)),t&&(s.ease=ZS(t)?t.map(XS):XS(t)),o.type===`tween`&&(s.type=`keyframes`),(r||a||i)&&(r?s.repeatType=`reverse`:a?s.repeatType=`loop`:i&&(s.repeatType=`mirror`),s.repeat=a||r||i||o.repeat),o.type!==`spring`&&(s.type=`keyframes`),s}function dC(e,t){var n,r;return(r=(n=(_C(e,t)||{}).delay)==null?e.delay:n)==null?0:r}function fC(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=eb([],$y(e.to),!1),e.to[0]=e.from),e}function pC(e,t,n){return Array.isArray(t.to)&&(e.duration!=null||(e.duration=.8)),fC(t),lC(e)||(e=q(q({},e),iC(n,t.to))),q(q({},t),uC(e))}function mC(e,t,n,r,i){var a,o=_C(r,e),s=(a=o.from)==null?t.get():a,c=QS(e,n);s===`none`&&c&&typeof n==`string`?s=sC(e,n):hC(s)&&typeof n==`string`?s=gC(n):!Array.isArray(n)&&hC(n)&&typeof s==`string`&&(n=gC(s));var l=QS(e,s);`${e}${s}${n}${s}${s}${n}`;function u(){var r={from:s,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:function(e){return t.set(e)}};return o.type===`inertia`||o.type===`decay`?ns(q(q({},r),o)):es(q(q({},pC(o,r,e)),{onUpdate:function(e){var t;r.onUpdate(e),(t=o.onUpdate)==null||t.call(o,e)},onComplete:function(){var e;r.onComplete(),(e=o.onComplete)==null||e.call(o)}}))}function d(){var e,r,a=Ux(n);
51return t.set(a),i(),(e=o==null?void 0:o.onUpdate)==null||e.call(o,a),(r=o==null?void 0:o.onComplete)==null||r.call(o),{stop:function(){}}}return!l||!c||o.type===!1?d:u}function hC(e){return e===0||typeof e==`string`&&parseFloat(e)===0&&e.indexOf(` `)===-1}function gC(e){return typeof e==`number`?0:sC(``,e)}function _C(e,t){return e[t]||e.default||e}function vC(e,t,n,r){return r===void 0&&(r={}),cC.current&&(r={type:!1}),t.start(function(i){var a,o,s=mC(e,t,n,r,i),c=dC(r,e),l=function(){return o=s()};return c?a=window.setTimeout(l,JS(c)):l(),function(){clearTimeout(a),o==null||o.stop()}})}var yC=function(e){return/^\-?\d*\.?\d+$/.test(e)},bC=function(e){return/^0[^.\s]+$/.test(e)};function xC(e,t){e.indexOf(t)===-1&&e.push(t)}function SC(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var CC=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return xC(this.subscriptions,e),function(){return SC(t.subscriptions,e)}},e.prototype.notify=function(e,t,n){var r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(var i=0;i<r;i++){var a=this.subscriptions[i];a&&a(e,t,n)}}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),wC=function(e){return!isNaN(parseFloat(e))},TC=function(){function e(e){var t=this;this.version=`6.5.1`,this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new CC,this.velocityUpdateSubscribers=new CC,this.renderSubscribers=new CC,this.canTrackVelocity=!1,this.updateAndNotify=function(e,n){
51n===void 0&&(n=!0),t.prev=t.current,t.current=e;var r=Yo(),i=r.delta,a=r.timestamp;t.lastUpdated!==a&&(t.timeDelta=i,t.lastUpdated=a,Uo.postRender(t.scheduleVelocityCheck)),t.prev!==t.current&&t.updateSubscribers.notify(t.current),t.velocityUpdateSubscribers.getSize()&&t.velocityUpdateSubscribers.notify(t.getVelocity()),n&&t.renderSubscribers.notify(t.current)},this.scheduleVelocityCheck=function(){return Uo.postRender(t.velocityCheck)},this.velocityCheck=function(e){e.timestamp!==t.lastUpdated&&(t.prev=t.current,t.velocityUpdateSubscribers.notify(t.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=wC(this.current)}return e.prototype.onChange=function(e){return this.updateSubscribers.add(e)},e.prototype.clearListeners=function(){this.updateSubscribers.clear()},e.prototype.onRenderRequest=function(e){return e(this.get()),this.renderSubscribers.add(e)},e.prototype.attach=function(e){this.passiveEffect=e},e.prototype.set=function(e,t){t===void 0&&(t=!0),!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)},e.prototype.get=function(){return this.current},e.prototype.getPrevious=function(){return this.prev},e.prototype.getVelocity=function(){return this.canTrackVelocity?ts(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(e){var t=this;return this.stop(),new Promise(function(n){t.hasAnimated=!0,t.stopAnimation=e(n)}).then(function(){return t.clearAnimation()})},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},e}();function EC(e){return new TC(e)}var DC=function(e){return function(t){return t.test(e)}},OC=[Mi,V,Li,Ii,zi,Ri,{test:function(e){return e===`auto`},parse:function(e){return e}}],kC=function(e){return OC.find(DC(e))},AC=eb(eb([],$y(OC),!1),[Yi,ia],!1),jC=function(e){return AC.find(DC(e))};function MC(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,EC(n))}function NC(e,t){var n=Ob(e,t),r=n?e.makeTargetAnimatable(n,!1):{},i=r.transitionEnd,a=i===void 0?{}:i;r.transition;var o=Zy(r,[`transitionEnd`,`transition`]);for(var s in o=q(q({},o),a),o)MC(e,s,Ux(o[s]))}function PC(e,t){eb([],$y(t),!1).reverse().forEach(function(n){var r,i=e.getVariant(n);i&&NC(e,i),(r=e.variantChildren)==null||r.forEach(function(e){PC(e,t)})})}function FC(e,t){if(Array.isArray(t))return PC(e,t);if(typeof t==`string`)return PC(e,[t]);NC(e,t)}function IC(e,t,n){var r,i,a,o=Object.keys(t).filter(function(t){return!e.hasValue(t)}),s=o.length;if(s)for(var c=0;c<s;c++){var l=o[c],u=t[l],d=null;Array.isArray(u)&&(d=u[0]),d===null&&(d=(i=(r=n[l])==null?e.readValue(l):r)==null?t[l]:i),d!=null&&(typeof d==`string`&&(yC(d)||bC(d))?d=parseFloat(d):!jC(d)&&ia.test(u)&&(d=sC(l,u)),e.addValue(l,EC(d)),(a=n)[l]!=null||(a[l]=d),e.setBaseTarget(l,d))}}function LC(e,t){if(t)return(t[e]||t.default||t).from}function RC(e,t,n){var r,i,a={};for(var o in e)a[o]=(r=LC(o,t))==null?(i=n.getValue(o))==null?void 0:i.get():r;return a}function zC(e,t,n){n===void 0&&(n={}),e.notifyAnimationStart(t);var r;if(Array.isArray(t)){var i=t.map(function(t){return BC(e,t,n)});r=Promise.all(i)}else r=typeof t==`string`?BC(e,t,n):VC(e,typeof t==`function`?Ob(e,t,n.custom):t,n);return r.then(function(){return e.notifyAnimationComplete(t)})}function BC(e,t,n){var r;n===void 0&&(n={});var i=Ob(e,t,n.custom),a=(i||{}).transition,o=a===void 0?e.getDefaultTransition()||{}:a;n.transitionOverride&&(o=n.transitionOverride);var s=i?function(){return VC(e,i,n)}:function(){return Promise.resolve()},c=(r=e.variantChildren)!=null&&r.size?function(r){r===void 0&&(r=0);var i=o.delayChildren,a=i===void 0?0:i,s=o.staggerChildren,c=o.staggerDirection;return HC(e,t,a+r,s,c,n)}:function(){return Promise.resolve()},l=o.when;if(l){var u=$y(l===`beforeChildren`?[s,c]:[c,s],2),d=u[0],f=u[1];return d().then(f)}return Promise.all([s(),c(n.delay)])}function VC(e,t,n){var r,i=n===void 0?{}:n,a=i.delay,o=a===void 0?0:a,s=i.transitionOverride,c=i.type,l=e.makeTargetAnimatable(t),u=l.transition,d=u===void 0?e.getDefaultTransition():u,f=l.transitionEnd,p=Zy(l,[`transition`,`transitionEnd`]);s&&(d=s);var m=[],h=c&&((r=e.animationState)==null?void 0:r.getState()[c]);for(var g in p){var _=e.getValue(g),v=p[g];if(!(!_||v===void 0||h&&GC(h,g))){var y=q({delay:o},d);e.shouldReduceMotion&&ex(g)&&(y=q(q({},y),{type:!1,delay:0}));var b=vC(g,_,v,y);m.push(b)}}return Promise.all(m).then(function(){f&&NC(e,f)})}function HC(e,t,n,r,i,a){n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=1);var o=[],s=(e.variantChildren.size-1)*r,c=i===1?function(e){return e===void 0&&(e=0),e*r}:function(e){return e===void 0&&(e=0),s-e*r};
51return Array.from(e.variantChildren).sort(WC).forEach(function(e,r){o.push(BC(e,t,q(q({},a),{delay:n+c(r)})).then(function(){return e.notifyAnimationComplete(t)}))}),Promise.all(o)}function UC(e){e.forEachValue(function(e){return e.stop()})}function WC(e,t){return e.sortNodePosition(t)}function GC(e,t){var n=e.protectedKeys,r=e.needsAnimating,i=n.hasOwnProperty(t)&&r[t]!==!0;return r[t]=!1,i}var KC=[Zx.Animate,Zx.InView,Zx.Focus,Zx.Hover,Zx.Tap,Zx.Drag,Zx.Exit],qC=eb([],$y(KC),!1).reverse(),JC=KC.length;function YC(e){return function(t){return Promise.all(t.map(function(t){var n=t.animation,r=t.options;return zC(e,n,r)}))}}function XC(e){var t=YC(e),n=$C(),r={},i=!0,a=function(t,n){var r=Ob(e,n);if(r){r.transition;var i=r.transitionEnd,a=Zy(r,[`transition`,`transitionEnd`]);t=q(q(q({},t),a),i)}return t};function o(e){return r[e]!==void 0}function s(n){t=n(e)}function c(o,s){for(var c,l=e.getProps(),u=e.getVariantContext(!0)||{},d=[],f=new Set,p={},m=1/0,h=function(t){var r=qC[t],h=n[r],g=(c=l[r])==null?u[r]:c,_=wb(g),v=r===s?h.isActive:null;v===!1&&(m=t);var y=g===u[r]&&g!==l[r]&&_;if(y&&i&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys=q({},p),!h.isActive&&v===null||!g&&!h.prevProp||Bx(g)||typeof g==`boolean`)return`continue`;var b=ZC(h.prevProp,g),x=b||r===s&&h.isActive&&!y&&_||t>m&&_,S=Array.isArray(g)?g:[g],C=S.reduce(a,{});v===!1&&(C={});var w=h.prevResolvedValues,T=w===void 0?{}:w,E=q(q({},T),C),D=function(e){x=!0,f.delete(e),h.needsAnimating[e]=!0};for(var O in E){var k=C[O],ee=T[O];p.hasOwnProperty(O)||(k===ee?k!==void 0&&f.has(O)?D(O):h.protectedKeys[O]=!0:Vx(k)&&Vx(ee)?!qS(k,ee)||b?D(O):h.protectedKeys[O]=!0:k===void 0?f.add(O):D(O))}h.prevProp=g,h.prevResolvedValues=C,h.isActive&&(p=q(q({},p),C)),i&&e.blockInitialAnimation&&(x=!1),x&&!y&&d.push.apply(d,eb([],$y(S.map(function(e){return{animation:e,options:q({type:r},o)}})),!1))},g=0;g<JC;g++)h(g);if(r=q({},p),f.size){var _={};f.forEach(function(t){var n=e.getBaseTarget(t);n!==void 0&&(_[t]=n)}),d.push({animation:_})}var v=!!d.length;return i&&l.initial===!1&&!e.manuallyAnimateOnMount&&(v=!1),i=!1,v?t(d):Promise.resolve()}function l(t,r,i){var a;if(n[t].isActive===r)return Promise.resolve();(a=e.variantChildren)==null||a.forEach(function(e){var n;return(n=e.animationState)==null?void 0:n.setActive(t,r)}),n[t].isActive=r;var o=c(i,t);for(var s in n)n[s].protectedKeys={};return o}return{isAnimated:o,animateChanges:c,setActive:l,setAnimateFunction:s,getState:function(){return n}}}function ZC(e,t){return typeof t==`string`?t!==e:Cb(t)?!qS(t,e):!1}function QC(e){return e===void 0&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $C(){var e;return e={},e[Zx.Animate]=QC(!0),e[Zx.InView]=QC(),e[Zx.Hover]=QC(),e[Zx.Tap]=QC(),e[Zx.Drag]=QC(),e[Zx.Focus]=QC(),e[Zx.Exit]=QC(),e}var ew={animation:zS(function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=XC(t)),Bx(n)&&(0,z.useEffect)(function(){return n.subscribe(t)},[n])}),exit:zS(function(e){var t=e.custom,n=e.visualElement,r=$y(WS(),2),i=r[0],a=r[1],o=(0,z.useContext)(fb);(0,z.useEffect)(function(){var e,r;n.isPresent=i;var s=(e=n.animationState)==null?void 0:e.setActive(Zx.Exit,!i,{custom:(r=o==null?void 0:o.custom)==null?t:r});!i&&(s==null||s.then(a))},[i])})},tw=function(){function e(e,t,n){var r=this,i=(n===void 0?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(r.lastMoveEvent&&r.lastMoveEventInfo){var e=iw(r.lastMoveEventInfo,r.history),t=r.startEvent!==null,n=os(e.offset,{x:0,y:0})>=3;if(!(!t&&!n)){var i=e.point,a=Yo().timestamp;r.history.push(q(q({},i),{timestamp:a}));var o=r.handlers,s=o.onStart,c=o.onMove;t||(s&&s(r.lastMoveEvent,e),r.startEvent=r.lastMoveEvent),c&&c(r.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){if(r.lastMoveEvent=e,r.lastMoveEventInfo=nw(t,r.transformPagePoint),tS(e)&&e.buttons===0){r.handlePointerUp(e,t);return}Uo.update(r.updatePoint,!0)},this.handlePointerUp=function(e,t){r.end();var n=r.handlers,i=n.onEnd,a=n.onSessionEnd,o=iw(nw(t,r.transformPagePoint),r.history);r.startEvent&&i&&i(e,o),a&&a(e,o)},!(nS(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=i;var a=nw(sS(e),this.transformPagePoint),o=a.point,s=Yo().timestamp;this.history=[q(q({},o),{timestamp:s})];var c=t.onSessionStart;c&&c(e,iw(a,this.history)),this.removeListeners=Ba(hS(window,`pointermove`,this.handlePointerMove),hS(window,`pointerup`,this.handlePointerUp),hS(window,`pointercancel`,this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),Wo.update(this.updatePoint)},e}();function nw(e,t){return t?{point:t(e.point)}:e}function rw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function iw(e,t){var n=e.point;return{point:n,delta:rw(n,ow(t)),offset:rw(n,aw(t)),velocity:sw(t,.1)}}function aw(e){return e[0]}function ow(e){return e[e.length-1]}function sw(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,r=null,i=ow(e);n>=0&&(r=e[n],!(i.timestamp-r.timestamp>JS(t)));)n--;if(!r)return{x:0,y:0};var a=(i.timestamp-r.timestamp)/1e3;if(a===0)return{x:0,y:0};var o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function cw(e){return e.max-e.min}
51function lw(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=.01),os(e,t)<n}function uw(e,t,n,r){r===void 0&&(r=.5),e.origin=r,e.originPoint=Aa(t.min,t.max,e.origin),e.scale=cw(n)/cw(t),(lw(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Aa(n.min,n.max,e.origin)-e.originPoint,(lw(e.translate)||isNaN(e.translate))&&(e.translate=0)}function dw(e,t,n,r){uw(e.x,t.x,n.x,r==null?void 0:r.originX),uw(e.y,t.y,n.y,r==null?void 0:r.originY)}function fw(e,t,n){e.min=n.min+t.min,e.max=e.min+cw(t)}function pw(e,t,n){fw(e.x,t.x,n.x),fw(e.y,t.y,n.y)}function mw(e,t,n){e.min=t.min-n.min,e.max=e.min+cw(t)}function hw(e,t,n){mw(e.x,t.x,n.x),mw(e.y,t.y,n.y)}function gw(e,t,n){var r=t.min,i=t.max;return r!==void 0&&e<r?e=n?Aa(r,e,n.min):Math.max(e,r):i!==void 0&&e>i&&(e=n?Aa(i,e,n.max):Math.min(e,i)),e}function _w(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function vw(e,t){var n=t.top,r=t.left,i=t.bottom,a=t.right;return{x:_w(e.x,r,a),y:_w(e.y,n,i)}}function yw(e,t){var n,r=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&(n=$y([i,r],2),r=n[0],i=n[1]),{min:r,max:i}}function bw(e,t){return{x:yw(e.x,t.x),y:yw(e.y,t.y)}}function xw(e,t){var n=.5,r=cw(e),i=cw(t);return i>r?n=ka(t.min,t.max-r,e.min):r>i&&(n=ka(e.min,e.max-i,t.min)),ha(0,1,n)}function Sw(e,t){var n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Cw=.35;function ww(e){return e===void 0&&(e=Cw),e===!1?e=0:e===!0&&(e=Cw),{x:Tw(e,`left`,`right`),y:Tw(e,`top`,`bottom`)}}function Tw(e,t,n){return{min:Ew(e,t),max:Ew(e,n)}}function Ew(e,t){var n;return typeof e==`number`?e:(n=e[t])==null?0:n}var Dw=function(){return{translate:0,scale:1,origin:0,originPoint:0}},Ow=function(){return{x:Dw(),y:Dw()}},kw=function(){return{min:0,max:0}},Aw=function(){return{x:kw(),y:kw()}};function jw(e){return[e(`x`),e(`y`)]}function Mw(e){var t=e.top,n=e.left,r=e.right,i=e.bottom;return{x:{min:n,max:r},y:{min:t,max:i}}}function Nw(e){var t=e.x,n=e.y;return{top:n.min,right:t.max,bottom:n.max,left:t.min}}function Pw(e,t){if(!t)return e;var n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Fw(e){return e===void 0||e===1}function Iw(e){var t=e.scale,n=e.scaleX,r=e.scaleY;return!Fw(t)||!Fw(n)||!Fw(r)}function Lw(e){return Iw(e)||Rw(e.x)||Rw(e.y)||e.z||e.rotate||e.rotateX||e.rotateY}function Rw(e){return e&&e!==`0%`}function zw(e,t,n){return n+t*(e-n)}function Bw(e,t,n,r,i){return i!==void 0&&(e=zw(e,i,r)),zw(e,n,r)+t}function Vw(e,t,n,r,i){t===void 0&&(t=0),n===void 0&&(n=1),e.min=Bw(e.min,t,n,r,i),e.max=Bw(e.max,t,n,r,i)}function Hw(e,t){var n=t.x,r=t.y;Vw(e.x,n.translate,n.scale,n.originPoint),Vw(e.y,r.translate,r.scale,r.originPoint)}function Uw(e,t,n,r){var i,a;r===void 0&&(r=!1);var o=n.length;if(o){t.x=t.y=1;for(var s,c,l=0;l<o;l++)s=n[l],c=s.projectionDelta,((a=(i=s.instance)==null?void 0:i.style)==null?void 0:a.display)!==`contents`&&(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Jw(e,{x:-s.scroll.x,y:-s.scroll.y}),c&&(t.x*=c.x.scale,t.y*=c.y.scale,Hw(e,c)),r&&Lw(s.latestValues)&&Jw(e,s.latestValues))}}function Ww(e,t){e.min+=t,e.max+=t}function Gw(e,t,n){var r=$y(n,3),i=r[0],a=r[1],o=r[2],s=t[o]===void 0?.5:t[o],c=Aa(e.min,e.max,s);Vw(e,t[i],t[a],c,t.scale)}var Kw=[`x`,`scaleX`,`originX`],qw=[`y`,`scaleY`,`originY`];function Jw(e,t){Gw(e.x,t,Kw),Gw(e.y,t,qw)}function Yw(e,t){return Mw(Pw(e.getBoundingClientRect(),t))}function Xw(e,t,n){var r=Yw(e,n),i=t.scroll;return i&&(Ww(r.x,i.x),Ww(r.y,i.y)),r}var Zw=new WeakMap,Qw=function(){function e(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Aw(),this.visualElement=e}return e.prototype.start=function(e,t){var n=this,r=(t===void 0?{}:t).snapToCursor,i=r!==void 0&&r;if(this.visualElement.isPresent!==!1){var a=function(e){n.stopAnimation(),i&&n.snapToCursor(sS(e,`page`).point)},o=function(e,t){var r,i=n.getProps(),a=i.drag,o=i.dragPropagation,s=i.onDragStart;a&&!o&&(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=bS(a),!n.openGlobalLock)||(n.isDragging=!0,n.currentDirection=null,n.resolveConstraints(),n.visualElement.projection&&(n.visualElement.projection.isAnimationBlocked=!0,n.visualElement.projection.target=void 0),jw(function(e){var t,r,i=n.getAxisMotionValue(e).get()||0;if(Li.test(i)){var a=(r=(t=n.visualElement.projection)==null?void 0:t.layout)==null?void 0:r.actual[e];a&&(i=cw(a)*(parseFloat(i)/100))}n.originPoint[e]=i}),s==null||s(e,t),(r=n.visualElement.animationState)==null||r.setActive(Zx.Drag,!0))},s=function(e,t){var r=n.getProps(),i=r.dragPropagation,a=r.dragDirectionLock,o=r.onDirectionLock,s=r.onDrag;if(!(!i&&!n.openGlobalLock)){var c=t.offset;if(a&&n.currentDirection===null){n.currentDirection=eT(c),n.currentDirection!==null&&(o==null||o(n.currentDirection));return}n.updateAxis(`x`,t.point,c),n.updateAxis(`y`,t.point,c),n.visualElement.syncRender(),s==null||s(e,t)}},c=function(e,t){return n.stop(e,t)};
51this.panSession=new tw(e,{onSessionStart:a,onStart:o,onMove:s,onSessionEnd:c},{transformPagePoint:this.visualElement.getTransformPagePoint()})}},e.prototype.stop=function(e,t){var n=this.isDragging;if(this.cancel(),n){var r=t.velocity;this.startAnimation(r);var i=this.getProps().onDragEnd;i==null||i(e,t)}},e.prototype.cancel=function(){var e,t;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)==null||e.end(),this.panSession=void 0,!this.getProps().dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(t=this.visualElement.animationState)==null||t.setActive(Zx.Drag,!1)},e.prototype.updateAxis=function(e,t,n){var r=this.getProps().drag;if(!(!n||!$w(e,r,this.currentDirection))){var i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=gw(a,this.constraints[e],this.elastic[e])),i.set(a)}},e.prototype.resolveConstraints=function(){var e=this,t=this.getProps(),n=t.dragConstraints,r=t.dragElastic,i=(this.visualElement.projection||{}).layout,a=this.constraints;n&&xb(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=n&&i?vw(i.actual,n):!1,this.elastic=ww(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&jw(function(t){e.getAxisMotionValue(t)&&(e.constraints[t]=Sw(i.actual[t],e.constraints[t]))})},e.prototype.resolveRefConstraints=function(){var e=this.getProps(),t=e.dragConstraints,n=e.onMeasureDragConstraints;if(!t||!xb(t))return!1;var r=t.current,i=this.visualElement.projection;if(!i||!i.layout)return!1;var a=Xw(r,i.root,this.visualElement.getTransformPagePoint()),o=bw(i.layout.actual,a);if(n){var s=n(Nw(o));this.hasMutatedConstraints=!!s,s&&(o=Mw(s))}return o},e.prototype.startAnimation=function(e){var t=this,n=this.getProps(),r=n.drag,i=n.dragMomentum,a=n.dragElastic,o=n.dragTransition,s=n.dragSnapToOrigin,c=n.onDragTransitionEnd,l=this.constraints||{},u=jw(function(n){var c;if($w(n,r,t.currentDirection)){var u=(c=l==null?void 0:l[n])==null?{}:c;s&&(u={min:0,max:0});var d=a?200:1e6,f=a?40:1e7,p=q(q({type:`inertia`,velocity:i?e[n]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10},o),u);return t.startAxisValueAnimation(n,p)}});return Promise.all(u).then(c)},e.prototype.startAxisValueAnimation=function(e,t){return vC(e,this.getAxisMotionValue(e),0,t)},e.prototype.stopAnimation=function(){var e=this;jw(function(t){return e.getAxisMotionValue(t).stop()})},e.prototype.getAxisMotionValue=function(e){var t,n,r=`_drag`+e.toUpperCase();return this.visualElement.getProps()[r]||this.visualElement.getValue(e,(n=(t=this.visualElement.getProps().initial)==null?void 0:t[e])==null?0:n)},e.prototype.snapToCursor=function(e){var t=this;jw(function(n){var r=t.getProps().drag;if($w(n,r,t.currentDirection)){var i=t.visualElement.projection,a=t.getAxisMotionValue(n);if(i&&i.layout){var o=i.layout.actual[n],s=o.min,c=o.max;a.set(e[n]-Aa(s,c,.5))}}})},e.prototype.scalePositionWithinConstraints=function(){var e=this,t,n=this.getProps(),r=n.drag,i=n.dragConstraints,a=this.visualElement.projection;if(!(!xb(i)||!a||!this.constraints)){this.stopAnimation();var o={x:0,y:0};jw(function(t){var n=e.getAxisMotionValue(t);if(n){var r=n.get();o[t]=xw({min:r,max:r},e.constraints[t])}});var s=this.visualElement.getProps().transformTemplate;this.visualElement.getInstance().style.transform=s?s({},``):`none`,(t=a.root)==null||t.updateScroll(),a.updateLayout(),this.resolveConstraints(),jw(function(t){if($w(t,r,null)){var n=e.getAxisMotionValue(t),i=e.constraints[t],a=i.min,s=i.max;n.set(Aa(a,s,o[t]))}})}},e.prototype.addListeners=function(){var e=this,t;Zw.set(this.visualElement,this);var n=hS(this.visualElement.getInstance(),`pointerdown`,function(t){var n=e.getProps(),r=n.drag,i=n.dragListener;r&&(i===void 0||i)&&e.start(t)}),r=function(){var t=e.getProps().dragConstraints;xb(t)&&(e.constraints=e.resolveRefConstraints())},i=this.visualElement.projection,a=i.addEventListener(`measure`,r);i&&!i.layout&&((t=i.root)==null||t.updateScroll(),i.updateLayout()),r();var o=Qx(window,`resize`,function(){return e.scalePositionWithinConstraints()});return i.addEventListener(`didUpdate`,(function(t){var n=t.delta,r=t.hasLayoutChanged;e.isDragging&&r&&(jw(function(t){var r=e.getAxisMotionValue(t);r&&(e.originPoint[t]+=n[t].translate,r.set(r.get()+n[t].translate))}),e.visualElement.syncRender())})),function(){o(),n(),a()}},e.prototype.getProps=function(){var e=this.visualElement.getProps(),t=e.drag,n=t!==void 0&&t,r=e.dragDirectionLock,i=r!==void 0&&r,a=e.dragPropagation,o=a!==void 0&&a,s=e.dragConstraints,c=s!==void 0&&s,l=e.dragElastic,u=l===void 0?Cw:l,d=e.dragMomentum,f=d===void 0||d;return q(q({},e),{drag:n,dragDirectionLock:i,dragPropagation:o,dragConstraints:c,dragElastic:u,dragMomentum:f})},e}();function $w(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function eT(e,t){t===void 0&&(t=10);var n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function tT(e){var t=e.dragControls,n=e.visualElement,r=Pb(function(){return new Qw(n)});(0,z.useEffect)(function(){return t&&t.subscribe(r)},[r,t]),(0,z.useEffect)(function(){return r.addListeners()},[r])}function nT(e){var t=e.onPan,n=e.onPanStart,r=e.onPanEnd,i=e.onPanSessionStart,a=e.visualElement,o=t||n||r||i,s=(0,z.useRef)(null),c=(0,z.useContext)(lb).transformPagePoint,l={onSessionStart:i,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,r&&r(e,t)}};(0,z.useEffect)(function(){s.current!==null&&s.current.updateHandlers(l)});
51function u(e){s.current=new tw(e,l,{transformPagePoint:c})}gS(a,`pointerdown`,o&&u),TS(function(){return s.current&&s.current.end()})}var rT={pan:zS(nT),drag:zS(tT)},iT=[`LayoutMeasure`,`BeforeLayoutMeasure`,`LayoutUpdate`,`ViewportBoxUpdate`,`Update`,`Render`,`AnimationComplete`,`LayoutAnimationComplete`,`AnimationStart`,`LayoutAnimationStart`,`SetAxisTarget`,`Unmount`];function aT(){var e=iT.map(function(){return new CC}),t={},n={clearAllListeners:function(){return e.forEach(function(e){return e.clear()})},updatePropListeners:function(e){iT.forEach(function(r){var i,a=`on`+r,o=e[a];(i=t[r])==null||i.call(t),o&&(t[r]=n[a](o))})}};return e.forEach(function(e,t){n[`on`+iT[t]]=function(t){return e.add(t)},n[`notify`+iT[t]]=function(){var t=[...arguments];return e.notify.apply(e,eb([],$y(t),!1))}}),n}function oT(e,t,n){var r;for(var i in t){var a=t[i],o=n[i];if(ix(a))e.addValue(i,a);else if(ix(o))e.addValue(i,EC(a));else if(o!==a){if(e.hasValue(i)){var s=e.getValue(i);!s.hasAnimated&&s.set(a)}else e.addValue(i,EC((r=e.getStaticValue(i))==null?a:r))}}for(var i in n)t[i]===void 0&&e.removeValue(i);return t}var sT=function(e){var t=e.treeType,n=t===void 0?``:t,r=e.build,i=e.getBaseTarget,a=e.makeTargetAnimatable,o=e.measureViewportBox,s=e.render,c=e.readValueFromInstance,l=e.removeValueFromRenderState,u=e.sortNodePosition,d=e.scrapeMotionValuesFromProps;return function(e,t){var f=e.parent,p=e.props,m=e.presenceId,h=e.blockInitialAnimation,g=e.visualState,_=e.shouldReduceMotion;t===void 0&&(t={});var v=!1,y=g.latestValues,b=g.renderState,x,S=aT(),C=new Map,w=new Map,T={},E=q({},y),D;function O(){!x||!v||(k(),s(x,b,p.style,M.projection))}function k(){r(M,b,y,t,p)}function ee(){S.notifyUpdate(y)}function A(e,t){var n=t.onChange(function(t){y[e]=t,p.onUpdate&&Uo.update(ee,!1,!0)}),r=t.onRenderRequest(M.scheduleRender);w.set(e,function(){n(),r()})}var j=d(p);for(var te in j){var ne=j[te];y[te]!==void 0&&ix(ne)&&ne.set(y[te],!1)}var re=kb(p),ie=Ab(p),M=q(q({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,presenceId:m,shouldReduceMotion:_,variantChildren:ie?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:!!(f!=null&&f.isMounted()),blockInitialAnimation:h,isMounted:function(){return!!x},mount:function(e){v=!0,x=M.current=e,M.projection&&M.projection.mount(e),ie&&f&&!re&&(D=f==null?void 0:f.addVariantChild(M)),C.forEach(function(e,t){return A(t,e)}),f==null||f.children.add(M),M.setProps(p)},unmount:function(){var e;(e=M.projection)==null||e.unmount(),Wo.update(ee),Wo.render(O),w.forEach(function(e){return e()}),D==null||D(),f==null||f.children.delete(M),S.clearAllListeners(),x=void 0,v=!1},addVariantChild:function(e){var t,n=M.getClosestVariantNode();if(n)return(t=n.variantChildren)==null||t.add(e),function(){return n.variantChildren.delete(e)}},sortNodePosition:function(e){return!u||n!==e.treeType?0:u(M.getInstance(),e.getInstance())},getClosestVariantNode:function(){return ie?M:f==null?void 0:f.getClosestVariantNode()},getLayoutId:function(){return p.layoutId},getInstance:function(){return x},getStaticValue:function(e){return y[e]},setStaticValue:function(e,t){return y[e]=t},getLatestValues:function(){return y},setVisibility:function(e){M.isVisible!==e&&(M.isVisible=e,M.scheduleRender())},makeTargetAnimatable:function(e,t){return t===void 0&&(t=!0),a(M,e,p,t)},measureViewportBox:function(){return o(x,p)},addValue:function(e,t){M.hasValue(e)&&M.removeValue(e),C.set(e,t),y[e]=t.get(),A(e,t)},removeValue:function(e){var t;C.delete(e),(t=w.get(e))==null||t(),w.delete(e),delete y[e],l(e,b)},hasValue:function(e){return C.has(e)},getValue:function(e,t){var n=C.get(e);return n===void 0&&t!==void 0&&(n=EC(t),M.addValue(e,n)),n}
51,forEachValue:function(e){return C.forEach(e)},readValue:function(e){var n;return(n=y[e])==null?c(x,e,t):n},setBaseTarget:function(e,t){E[e]=t},getBaseTarget:function(e){if(i){var t=i(p,e);if(t!==void 0&&!ix(t))return t}return E[e]}},S),{build:function(){return k(),b},scheduleRender:function(){Uo.render(O,!1,!0)},syncRender:O,setProps:function(e){(e.transformTemplate||p.transformTemplate)&&M.scheduleRender(),p=e,S.updatePropListeners(e),T=oT(M,d(p),T)},getProps:function(){return p},getVariant:function(e){var t;return(t=p.variants)==null?void 0:t[e]},getDefaultTransition:function(){return p.transition},getTransformPagePoint:function(){return p.transformPagePoint},getVariantContext:function(e){if(e===void 0&&(e=!1),e)return f==null?void 0:f.getVariantContext();if(!re){var t=(f==null?void 0:f.getVariantContext())||{};return p.initial!==void 0&&(t.initial=p.initial),t}for(var n={},r=0;r<lT;r++){var i=cT[r],a=p[i];(wb(a)||a===!1)&&(n[i]=a)}return n}});return M}},cT=eb([`initial`],$y(KC),!1),lT=cT.length;function uT(e){return typeof e==`string`&&e.startsWith(`var(--`)}var dT=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function fT(e){var t=dT.exec(e);if(!t)return[,];var n=$y(t,3);return[n[1],n[2]]}function pT(e,t,n){n===void 0&&(n=1),`${e}`;var r=$y(fT(e),2),i=r[0],a=r[1];if(i){var o=window.getComputedStyle(t).getPropertyValue(i);return o?o.trim():uT(a)?pT(a,t,n+1):a}}function mT(e,t,n){var r=Zy(t,[]),i=e.getInstance();if(!(i instanceof Element))return{target:r,transitionEnd:n};for(var a in n&&(n=q({},n)),e.forEachValue(function(e){var t=e.get();if(uT(t)){var n=pT(t,i);n&&e.set(n)}}),r){var o=r[a];if(uT(o)){var s=pT(o,i);s&&(r[a]=s,n&&(n[a]!=null||(n[a]=o)))}}return{target:r,transitionEnd:n}}var hT=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,`x`,`y`]),gT=function(e){return hT.has(e)},_T=function(e){return Object.keys(e).some(gT)},vT=function(e,t){e.set(t,!1),e.set(t)},yT=function(e){return e===Mi||e===V},bT;(function(e){e.width=`width`,e.height=`height`,e.left=`left`,e.right=`right`,e.top=`top`,e.bottom=`bottom`})(bT||(bT={}));var xT=function(e,t){return parseFloat(e.split(`, `)[t])},ST=function(e,t){return function(n,r){var i=r.transform;if(i===`none`||!i)return 0;var a=i.match(/^matrix3d\((.+)\)$/);if(a)return xT(a[1],t);var o=i.match(/^matrix\((.+)\)$/);return o?xT(o[1],e):0}},CT=new Set([`x`,`y`,`z`]),wT=Zb.filter(function(e){return!CT.has(e)});function TT(e){var t=[];return wT.forEach(function(n){var r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t.length&&e.syncRender(),t}var ET={width:function(e,t){var n=e.x,r=t.paddingLeft,i=r===void 0?`0`:r,a=t.paddingRight,o=a===void 0?`0`:a;return n.max-n.min-parseFloat(i)-parseFloat(o)},height:function(e,t){var n=e.y,r=t.paddingTop,i=r===void 0?`0`:r,a=t.paddingBottom,o=a===void 0?`0`:a;return n.max-n.min-parseFloat(i)-parseFloat(o)},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,r=t.top;return parseFloat(r)+(n.max-n.min)},right:function(e,t){var n=e.x,r=t.left;return parseFloat(r)+(n.max-n.min)},x:ST(4,13),y:ST(5,14)},DT=function(e,t,n){var r=t.measureViewportBox(),i=t.getInstance(),a=getComputedStyle(i),o=a.display,s={};
51o===`none`&&t.setStaticValue(`display`,e.display||`block`),n.forEach(function(e){s[e]=ET[e](r,a)}),t.syncRender();var c=t.measureViewportBox();return n.forEach(function(n){vT(t.getValue(n),s[n]),e[n]=ET[n](c,a)}),e},OT=function(e,t,n,r){n===void 0&&(n={}),r===void 0&&(r={}),t=q({},t),r=q({},r);var i=Object.keys(t).filter(gT),a=[],o=!1,s=[];if(i.forEach(function(i){var c=e.getValue(i);if(e.hasValue(i)){var l=n[i],u=kC(l),d=t[i],f;if(Vx(d)){var p=d.length,m=+(d[0]===null);l=d[m],u=kC(l);for(var h=m;h<p;h++)f?kC(d[h]):f=kC(d[h])}else f=kC(d);if(u!==f){if(yT(u)&&yT(f)){var g=c.get();typeof g==`string`&&c.set(parseFloat(g)),typeof d==`string`?t[i]=parseFloat(d):Array.isArray(d)&&f===V&&(t[i]=d.map(parseFloat))}else u!=null&&u.transform&&f!=null&&f.transform&&(l===0||d===0)?l===0?c.set(f.transform(l)):t[i]=u.transform(d):(o||(a=TT(e),o=!0),s.push(i),r[i]=r[i]===void 0?t[i]:r[i],vT(c,d))}}}),s.length){var c=s.indexOf(`height`)>=0?window.pageYOffset:null,l=DT(t,e,s);return a.length&&a.forEach(function(t){var n=$y(t,2),r=n[0],i=n[1];e.getValue(r).set(i)}),e.syncRender(),c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:r}}return{target:t,transitionEnd:r}};function kT(e,t,n,r){return _T(t)?OT(e,t,n,r):{target:t,transitionEnd:r}}var AT=function(e,t,n,r){var i=mT(e,t,r);return t=i.target,r=i.transitionEnd,kT(e,t,n,r)};function jT(e){return window.getComputedStyle(e)}var MT={treeType:`dom`,readValueFromInstance:function(e,t){if(ex(t)){var n=oC(t);return n&&n.default||0}var r=jT(e);return(cx(t)?r.getPropertyValue(t):r[t])||0},sortNodePosition:function(e,t){return e.compareDocumentPosition(t)&2?1:-1},getBaseTarget:function(e,t){var n;return(n=e.style)==null?void 0:n[t]},measureViewportBox:function(e,t){var n=t.transformPagePoint;return Yw(e,n)},resetTransform:function(e,t,n){var r=n.transformTemplate;t.style.transform=r?r({},``):`none`,e.scheduleRender()},restoreTransform:function(e,t){e.style.transform=t.style.transform},removeValueFromRenderState:function(e,t){var n=t.vars,r=t.style;delete n[e],delete r[e]},makeTargetAnimatable:function(e,t,n,r){var i=n.transformValues;r===void 0&&(r=!0);var a=t.transition,o=t.transitionEnd,s=Zy(t,[`transition`,`transitionEnd`]),c=RC(s,a||{},e);if(i&&(o&&(o=i(o)),s&&(s=i(s)),c&&(c=i(c))),r){IC(e,s,c);var l=AT(e,s,c,o);o=l.transitionEnd,s=l.target}return q({transition:a,transitionEnd:o},s)},scrapeMotionValuesFromProps:Rx,build:function(e,t,n,r,i){e.isVisible!==void 0&&(t.style.visibility=e.isVisible?`visible`:`hidden`),fx(t,n,r,i.transformTemplate)},render:Fx},NT=sT(MT),PT=sT(q(q({},MT),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var n;return ex(t)?((n=oC(t))==null?void 0:n.default)||0:(t=Ix.has(t)?t:Px(t),e.getAttribute(t))},scrapeMotionValuesFromProps:zx,build:function(e,t,n,r,i){Ox(t,n,r,i.transformTemplate)},render:Lx})),FT=function(e,t){return Kb(e)?PT(t,{enableHardwareAcceleration:!1}):NT(t,{enableHardwareAcceleration:!0})};function IT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var LT={correct:function(e,t){if(!t.target)return e;if(typeof e==`string`){if(V.test(e))e=parseFloat(e);else return e}return`${IT(e,t.target.x)}% ${IT(e,t.target.y)}%`}},RT=`_$css`,zT={correct:function(e,t){var n=t.treeScale,r=t.projectionDelta,i=e,a=e.includes(`var(`),o=[];a&&(e=e.replace(dT,function(e){return o.push(e),RT}));var s=ia.parse(e);if(s.length>5)return i;var c=ia.createTransformer(e),l=typeof s[0]==`number`?0:1,u=r.x.scale*n.x,d=r.y.scale*n.y;s[0+l]/=u,s[1+l]/=d;var f=Aa(u,d,.5);typeof s[2+l]==`number`&&(s[2+l]/=f),typeof s[3+l]==`number`&&(s[3+l]/=f);var p=c(s);if(a){var m=0;p=p.replace(RT,function(){var e=o[m];return m++,e})}return p}},BT=function(e){Xy(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.visualElement,r=t.layoutGroup,i=t.switchLayoutGroup,a=t.layoutId,o=n.projection;Jb(HT),o&&(r!=null&&r.group&&r.group.add(o),i!=null&&i.register&&a&&i.register(o),o.root.didUpdate(),o.addEventListener(`animationComplete`,function(){e.safeToRemove()}),o.setOptions(q(q({},o.options),{onExitComplete:function(){return e.safeToRemove()}}))),Fb.hasEverUpdated=!0},t.prototype.getSnapshotBeforeUpdate=function(e){var t=this,n=this.props,r=n.layoutDependency,i=n.visualElement,a=n.drag,o=n.isPresent,s=i.projection;
51return s?(s.isPresent=o,a||e.layoutDependency!==r||r===void 0?s.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?s.promote():s.relegate()||Uo.postRender(function(){var e;(e=s.getStack())!=null&&e.members.length||t.safeToRemove()})),null):null},t.prototype.componentDidUpdate=function(){var e=this.props.visualElement.projection;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.visualElement,n=e.layoutGroup,r=e.switchLayoutGroup,i=t.projection;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))},t.prototype.safeToRemove=function(){var e=this.props.safeToRemove;e==null||e()},t.prototype.render=function(){return null},t}(z.Component);function VT(e){var t=$y(WS(),2),n=t[0],r=t[1],i=(0,z.useContext)(Rb);return z.createElement(BT,q({},e,{layoutGroup:i,switchLayoutGroup:(0,z.useContext)(zb),isPresent:n,safeToRemove:r}))}var HT={borderRadius:q(q({},LT),{applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]}),borderTopLeftRadius:LT,borderTopRightRadius:LT,borderBottomLeftRadius:LT,borderBottomRightRadius:LT,boxShadow:zT},UT={measureLayout:VT};function WT(e,t,n){n===void 0&&(n={});var r=ix(e)?e:EC(e);return vC(``,r,t,n),{stop:function(){return r.stop()},isAnimating:function(){return r.isAnimating()}}}var GT=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],KT=GT.length,qT=function(e){return typeof e==`string`?parseFloat(e):e},JT=function(e){return typeof e==`number`||V.test(e)};function YT(e,t,n,r,i,a){var o,s,c,l;i?(e.opacity=Aa(0,(o=n.opacity)==null?1:o,ZT(r)),e.opacityExit=Aa((s=t.opacity)==null?1:s,0,QT(r))):a&&(e.opacity=Aa((c=t.opacity)==null?1:c,(l=n.opacity)==null?1:l,r));for(var u=0;u<KT;u++){var d=`border${GT[u]}Radius`,f=XT(t,d),p=XT(n,d);(f!==void 0||p!==void 0)&&(f||(f=0),p||(p=0),f===0||p===0||JT(f)===JT(p)?(e[d]=Math.max(Aa(qT(f),qT(p),r),0),(Li.test(p)||Li.test(f))&&(e[d]+=`%`)):e[d]=p)}(t.rotate||n.rotate)&&(e.rotate=Aa(t.rotate||0,n.rotate||0,r))}function XT(e,t){var n;return(n=e[t])==null?e.borderRadius:n}var ZT=$T(0,.5,po),QT=$T(.5,.95,so);function $T(e,t,n){return function(r){return r<e?0:r>t?1:n(ka(e,t,r))}}function eE(e,t){e.min=t.min,e.max=t.max}function tE(e,t){eE(e.x,t.x),eE(e.y,t.y)}function nE(e,t,n,r,i){return e-=t,e=zw(e,1/n,r),i!==void 0&&(e=zw(e,1/i,r)),e}function rE(e,t,n,r,i,a,o){if(t===void 0&&(t=0),n===void 0&&(n=1),r===void 0&&(r=.5),a===void 0&&(a=e),o===void 0&&(o=e),Li.test(t)&&(t=parseFloat(t),t=Aa(o.min,o.max,t/100)-o.min),typeof t==`number`){var s=Aa(a.min,a.max,r);e===a&&(s-=t),e.min=nE(e.min,t,n,s,i),e.max=nE(e.max,t,n,s,i)}}function iE(e,t,n,r,i){var a=$y(n,3),o=a[0],s=a[1],c=a[2];rE(e,t[o],t[s],t[c],t.scale,r,i)}var aE=[`x`,`scaleX`,`originX`],oE=[`y`,`scaleY`,`originY`];function sE(e,t,n,r){iE(e.x,t,aE,n==null?void 0:n.x,r==null?void 0:r.x),iE(e.y,t,oE,n==null?void 0:n.y,r==null?void 0:r.y)}function cE(e){return e.translate===0&&e.scale===1}function lE(e){return cE(e.x)&&cE(e.y)}function uE(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}var dE=function(){function e(){this.members=[]}return e.prototype.add=function(e){xC(this.members,e),e.scheduleRender()},e.prototype.remove=function(e){if(SC(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){var t=this.members[this.members.length-1];t&&this.promote(t)}},e.prototype.relegate=function(e){var t=this.members.findIndex(function(t){return e===t});if(t===0)return!1;for(var n,r=t;r>=0;r--){var i=this.members[r];if(i.isPresent!==!1){n=i;break}}return n?(this.promote(n),!0):!1},e.prototype.promote=function(e,t){var n,r=this.lead;e!==r&&(this.prevLead=r,this.lead=e,e.show(),r&&(r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues,e.snapshot.isShared=!0),(n=e.root)!=null&&n.isUpdating&&(e.isLayoutDirty=!0),e.options.crossfade===!1&&r.hide()))},e.prototype.exitAnimationComplete=function(){this.members.forEac
51h(function(e){var t,n,r,i,a;(n=(t=e.options).onExitComplete)==null||n.call(t),(a=(r=e.resumingFrom)==null?void 0:(i=r.options).onExitComplete)==null||a.call(i)})},e.prototype.scheduleRender=function(){this.members.forEach(function(e){e.instance&&e.scheduleRender(!1)})},e.prototype.removeLeadSnapshot=function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)},e}();function fE(e,t,n){var r=`translate3d(${e.x.translate/t.x}px, ${e.y.translate/t.y}px, 0) `;if(r+=`scale(${1/t.x}, ${1/t.y}) `,n){var i=n.rotate,a=n.rotateX,o=n.rotateY;i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `)}var s=e.x.scale*t.x,c=e.y.scale*t.y;return r+=`scale(${s}, ${c})`,r===`translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)`?`none`:r}var pE=function(e,t){return e.depth-t.depth},mE=function(){function e(){this.children=[],this.isDirty=!1}return e.prototype.add=function(e){xC(this.children,e),this.isDirty=!0},e.prototype.remove=function(e){SC(this.children,e),this.isDirty=!0},e.prototype.forEach=function(e){this.isDirty&&this.children.sort(pE),this.isDirty=!1,this.children.forEach(e)},e}(),hE=1e3;function gE(e){var t=e.attachResizeListener,n=e.defaultParent,r=e.measureScroll,i=e.checkIsScrollRoot,a=e.resetTransform;return function(){function e(e,t,r){var i=this;t===void 0&&(t={}),r===void 0&&(r=n==null?void 0:n()),this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){i.isUpdating&&(i.isUpdating=!1,i.clearAllSnapshots())},this.updateProjection=function(){i.nodes.forEach(CE),i.nodes.forEach(wE)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=e,this.latestValues=t,this.root=r?r.root||r:this,this.path=r?eb(eb([],$y(r.path),!1),[r],!1):[],this.parent=r,this.depth=r?r.depth+1:0,e&&this.root.registerPotentialNode(e,this);for(var a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new mE)}return e.prototype.addEventListener=function(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new CC),this.eventHandlers.get(e).add(t)},e.prototype.notifyListeners=function(e){var t=[...arguments].slice(1),n=this.eventHandlers.get(e);n==null||n.notify.apply(n,eb([],$y(t),!1))},e.prototype.hasListeners=function(e){return this.eventHandlers.has(e)},e.prototype.registerPotentialNode=function(e,t){this.potentialNodes.set(e,t)},e.prototype.mount=function(e,n){var r=this,i;if(n===void 0&&(n=!1),!this.instance){this.isSVG=e instanceof SVGElement&&e.tagName!==`svg`,this.instance=e;var a=this.options,o=a.layoutId,s=a.layout,c=a.visualElement;if(c&&!c.getInstance()&&c.mount(e),this.root.nodes.add(this),(i=this.parent)==null||i.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(s||o)&&(this.isLayoutDirty=!0),t){var l,u=function(){return r.root.updateBlockedByResize=!1};t(e,function(){r.root.updateBlockedByResize=!0,clearTimeout(l),l=window.setTimeout(u,250),Fb.hasAnimatedSinceResize&&(Fb.hasAnimatedSinceResize=!1,r.nodes.forEach(SE))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&c&&(o||s)&&this.addEventListener(`didUpdate`,function(e){var t,n,i,a,o,s=e.delta,l=e.hasLayoutChanged,u=e.hasRelativeTargetChanged,d=e.layout;if(r.isTreeAnimationBlocked()){r.target=void 0,r.relativeTarget=void 0;return}var f=(n=(t=r.options.transition)==null?c.getDefaultTransition():t)==null?jE:n,p=c.getProps(),m=p.onLayoutAnimationStart,h=p.onLayoutAnimationComplete,g=!r.targetLayout||!uE(r.targetLayout,d)||u,_=!l&&u;if((i=r.resumeFrom)!=null&&i.instance||_||l&&(g||!r.currentAnimation)){r.resumeFrom&&(r.resumingFrom=r.resumeFrom,r.resumingFrom.resumingFrom=void 0),r.setAnimationOrigin(s,_);var v=q(q({},_C(f,`layout`)),{onPlay:m,onComplete:h});c.shouldReduceMotion&&(v.delay=0,v.type=!1),r.startAnimation(v)}else!l&&r.animationProgress===0&&r.finishAnimation(),r.isLead()&&((o=(a=r.options).onExitComplete)==null||o.call(a));r.targetLayout=d})}},e.prototype.unmount=function(){var e,t;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(e=this.getStack())==null||e.remove(this),(t=this.parent)==null||t.children.delete(this),this.instance=void 0,Wo.preRender(this.updateProjection)},e.prototype.blockUpdate=function(){this.updateManuallyBlocked=!0},e.prototype.unblockUpdate=function(){this.updateManuallyBlocked=!1},e.prototype.isUpdateBlocked=function(){return this.updateManuallyBlocked||this.updateBlockedByResize},e.prototype.isTreeAnimationBlocked=function(){var e;return this.isAnimationBlocked||((e=this.parent)==null?void 0:e.isTreeAnimationBlocked())||!1}
51,e.prototype.startUpdate=function(){var e;this.isUpdateBlocked()||(this.isUpdating=!0,(e=this.nodes)==null||e.forEach(TE))},e.prototype.willUpdate=function(e){var t,n,r;if(e===void 0&&(e=!0),this.root.isUpdateBlocked()){(n=(t=this.options).onExitComplete)==null||n.call(t);return}if(!this.root.isUpdating&&this.root.startUpdate(),!this.isLayoutDirty){this.isLayoutDirty=!0;for(var i=0;i<this.path.length;i++){var a=this.path[i];a.shouldResetTransform=!0,a.updateScroll()}var o=this.options,s=o.layoutId,c=o.layout;if(!(s===void 0&&!c)){var l=(r=this.options.visualElement)==null?void 0:r.getProps().transformTemplate;this.prevTransformTemplateValue=l==null?void 0:l(this.latestValues,``),this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}}},e.prototype.didUpdate=function(){if(this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(bE);return}this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(ME),this.potentialNodes.clear()),this.nodes.forEach(xE),this.nodes.forEach(_E),this.nodes.forEach(vE),this.clearAllSnapshots(),Go.update(),Go.preRender(),Go.render())},e.prototype.clearAllSnapshots=function(){this.nodes.forEach(yE),this.sharedNodes.forEach(EE)},e.prototype.scheduleUpdateProjection=function(){Uo.preRender(this.updateProjection,!1,!0)},e.prototype.scheduleCheckAfterUnmount=function(){var e=this;Uo.postRender(function(){e.isLayoutDirty?e.root.didUpdate():e.root.checkUpdateFailed()})},e.prototype.updateSnapshot=function(){if(!(this.snapshot||!this.instance)){var e=this.measure(),t=this.removeTransform(this.removeElementScroll(e));PE(t),this.snapshot={measured:e,layout:t,latestValues:{}}}},e.prototype.updateLayout=function(){var e;if(this.instance&&(this.updateScroll(),!(!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))){if(this.resumeFrom&&!this.resumeFrom.instance)for(var t=0;t<this.path.length;t++)this.path[t].updateScroll();var n=this.measure();PE(n);var r=this.layout;this.layout={measured:n,actual:this.removeElementScroll(n)},this.layoutCorrected=Aw(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.actual),(e=this.options.visualElement)==null||e.notifyLayoutMeasure(this.layout.actual,r==null?void 0:r.actual)}},e.prototype.updateScroll=function(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=i(this.instance),this.scroll=r(this.instance))},e.prototype.resetTransform=function(){var e;if(a){var t=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!lE(this.projectionDelta),r=(e=this.options.visualElement)==null?void 0:e.getProps().transformTemplate,i=r==null?void 0:r(this.latestValues,``),o=i!==this.prevTransformTemplateValue;t&&(n||Lw(this.latestValues)||o)&&(a(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}},e.prototype.measure=function(){var e=this.options.visualElement;if(!e)return Aw();var t=e.measureViewportBox(),n=this.root.scroll;return n&&(Ww(t.x,n.x),Ww(t.y,n.y)),t},e.prototype.removeElementScroll=function(e){var t=Aw();tE(t,e);for(var n=0;n<this.path.length;n++){var r=this.path[n],i=r.scroll,a=r.options,o=r.isScrollRoot;if(r!==this.root&&i&&a.layoutScroll){if(o){tE(t,e);var s=this.root.scroll;s&&(Ww(t.x,-s.x),Ww(t.y,-s.y))}Ww(t.x,i.x),Ww(t.y,i.y)}}return t},e.prototype.applyTransform=function(e,t){t===void 0&&(t=!1);var n=Aw();tE(n,e);for(var r=0;r<this.path.length;r++){var i=this.path[r];!t&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Jw(n,{x:-i.scroll.x,y:-i.scroll.y}),Lw(i.latestValues)&&Jw(n,i.latestValues)}return Lw(this.latestValues)&&Jw(n,this.latestValues),n},e.prototype.removeTransform=function(e){var t,n=Aw();tE(n,e);for(var r=0;r<this.path.length;r++){var i=this.path[r];if(i.instance&&Lw(i.latestValues)){Iw(i.latestValues)&&i.updateSnapshot();var a=Aw();tE(a,i.measure()),sE(n,i.latestValues,(t=i.snapshot)==null?void 0:t.layout,a)}}return Lw(this.latestValues)&&sE(n,this.latestValues),n},e.prototype.setTargetDelta=function(e){this.targetDelta=e,this.root.scheduleUpdateProjection()},e.prototype.setOptions=function(e){var t;this.options=q(q(q({},this.options),e),{crossfade:(t=e.crossfade)==null||t})},e.prototype.clearMeasurements=function(){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},e.prototype.resolveTargetDelta=function(){var e,t=this.options,n=t.layout,r=t.layoutId;!this.layout||!(n||r)||(!this.targetDelta&&!this.relativeTarget&&(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget=Aw(),this.relativeTargetOrigin=Aw(),hw(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),tE(this.relativeTarget,this.relativeTargetOrigin))),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Aw(),this.targetWithTransforms=Aw()),this.relativeTarget&&this.relativeTargetOrigin&&(e=this.relativeParent)!=null&&e.target?pw(this.target,this.relativeTarget,this.relativeParent.target):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.actual):tE(this.target,this.layout.actual),Hw(this.target,this.targetDelta)):tE(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&!!this.relativeParent.resumingFrom==!!this.resumingFrom&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget=Aw(),this.relativeTargetOrigin=Aw(),hw(this.relativeTargetOrigin,this.target,this.relativeParent.target),tE(this.relativeTarget,this.relativeTargetOrigin)))))},e.prototype.getClosestProjectingParent=function(){if(!(!this.parent||Lw(this.parent.latestValues)))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()},e.prototype.calcProjection=function(){var e,t=this.options,n=t.layout,r=t.layoutId;if(this.isTreeAnimating=!!((e=this.parent)!=null&&e.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!(!this.layout||!(n||r))){var i=this.getLead();tE(this.layoutCorrected,this.layout.actual),Uw(this.layoutCorrected,this.treeScale,this.path,!!this.resumingFrom||this!==i);var a=i.target;if(a){this.projectionDelta||(this.projectionDelta=Ow(),this.projectionDeltaWithTransform=Ow());var o=this.treeScale.x,s=this.treeScale.y,c=this.projectionTransform;dw(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.projectionTransform=fE(this.projectionDelta,this.treeScale),(this.projectionTransform!==c||this.treeScale.x!==o||this.treeScale.y!==s)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,a))}}},e.prototype.hide=function(){this.isVisible=!1},e.prototype.show=function(){this.isVisible=!0},e.prototype.scheduleRender=function(e){var t,n,r;e===void 0&&(e=!0),(n=(t=this.options).scheduleRender)==null||n.call(t),e&&((r=this.getStack())==null||r.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)},e.prototype.setAnimationOrigin=function(e,t){var n=this,r;t===void 0&&(t=!1);var i=this.snapshot,a=(i==null?void 0:i.latestValues)||{},o=q({},this.latestValues),s=Ow();this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!t;
51var c=Aw(),l=i==null?void 0:i.isShared,u=(((r=this.getStack())==null?void 0:r.members.length)||0)<=1,d=!!(l&&!u&&this.options.crossfade===!0&&!this.path.some(AE));this.animationProgress=0,this.mixTargetDelta=function(t){var r,i=t/1e3;DE(s.x,e.x,i),DE(s.y,e.y,i),n.setTargetDelta(s),n.relativeTarget&&n.relativeTargetOrigin&&n.layout&&(r=n.relativeParent)!=null&&r.layout&&(hw(c,n.layout.actual,n.relativeParent.layout.actual),kE(n.relativeTarget,n.relativeTargetOrigin,c,i)),l&&(n.animationValues=o,YT(o,a,n.latestValues,i,d,u)),n.root.scheduleUpdateProjection(),n.scheduleRender(),n.animationProgress=i},this.mixTargetDelta(0)},e.prototype.startAnimation=function(e){var t=this,n,r;this.notifyListeners(`animationStart`),(n=this.currentAnimation)==null||n.stop(),this.resumingFrom&&((r=this.resumingFrom.currentAnimation)==null||r.stop()),this.pendingAnimation&&(Wo.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Uo.update(function(){Fb.hasAnimatedSinceResize=!0,t.currentAnimation=WT(0,hE,q(q({},e),{onUpdate:function(n){var r;t.mixTargetDelta(n),(r=e.onUpdate)==null||r.call(e,n)},onComplete:function(){var n;(n=e.onComplete)==null||n.call(e),t.completeAnimation()}})),t.resumingFrom&&(t.resumingFrom.currentAnimation=t.currentAnimation),t.pendingAnimation=void 0})},e.prototype.completeAnimation=function(){var e;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(e=this.getStack())==null||e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)},e.prototype.finishAnimation=function(){var e;this.currentAnimation&&((e=this.mixTargetDelta)==null||e.call(this,hE),this.currentAnimation.stop()),this.completeAnimation()},e.prototype.applyTransformsToTarget=function(){var e=this.getLead(),t=e.targetWithTransforms,n=e.target,r=e.layout,i=e.latestValues;!t||!n||!r||(tE(t,n),Jw(t,i),dw(this.projectionDeltaWithTransform,this.layoutCorrected,t,i))},e.prototype.registerSharedNode=function(e,t){var n,r,i;this.sharedNodes.has(e)||this.sharedNodes.set(e,new dE),this.sharedNodes.get(e).add(t),t.promote({transition:(n=t.options.initialPromotionConfig)==null?void 0:n.transition,preserveFollowOpacity:(i=(r=t.options.initialPromotionConfig)==null?void 0:r.shouldPreserveFollowOpacity)==null?void 0:i.call(r,t)})},e.prototype.isLead=function(){var e=this.getStack();return!e||e.lead===this},e.prototype.getLead=function(){var e;return this.options.layoutId&&((e=this.getStack())==null?void 0:e.lead)||this},e.prototype.getPrevLead=function(){var e;return this.options.layoutId?(e=this.getStack())==null?void 0:e.prevLead:void 0},e.prototype.getStack=function(){var e=this.options.layoutId;if(e)return this.root.sharedNodes.get(e)},e.prototype.promote=function(e){var t=e===void 0?{}:e,n=t.needsReset,r=t.transition,i=t.preserveFollowOpacity,a=this.getStack();a&&a.promote(this,i),n&&(this.projectionDelta=void 0,this.needsReset=!0),r&&this.setOptions({transition:r})},e.prototype.relegate=function(){var e=this.getStack();return e?e.relegate(this):!1},e.prototype.resetRotation=function(){var e=this.options.visualElement;if(e){for(var t=!1,n={},r=0;r<Yb.length;r++){var i=`rotate`+Yb[r];e.getStaticValue(i)&&(t=!0,n[i]=e.getStaticValue(i),e.setStaticValue(i,0))}if(t){for(var i in e==null||e.syncRender(),n)e.setStaticValue(i,n[i]);e.scheduleRender()}}},e.prototype.getProjectionStyles=function(e){var t,n,r,i,a,o;e===void 0&&(e={});var s={};if(!this.instance||this.isSVG)return s;if(this.isVisible)s.visibility=``;else return{visibility:`hidden`};var c=(t=this.options.visualElement)==null?void 0:t.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,s.opacity=``,s.pointerEvents=Wx(e.pointerEvents)||``,s.transform=c?c(this.latestValues,``):`none`,s;var l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){var u={};return this.options.layoutId&&(u.opacity=(n=this.latestValues.opacity)==null?1:n,u.pointerEvents=Wx(e.pointerEvents)||``),this.hasProjected&&!Lw(this.latestValues)&&(u.transform=c?c({},``):`none`,this.hasProjected=!1),u}var d=l.animationValues||l.latestValues;this.applyTransformsToTarget(),s.transform=fE(this.projectionDeltaWithTransform,this.treeScale,d),c&&(s.transform=c(d,s.transform));var f=this.projectionDelta,p=f.x,m=f.y;for(var h in s.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,s.opacity=l.animationValues?l===this?(i=(r=d.opacity)==null?this.latestValues.opacity:r)==null?1:i:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:l===this?(a=d.opacity)==null?``:a:(o=d.opacityExit)==null?0:o,qb)if(d[h]!==void 0){var g=qb[h],_=g.correct,v=g.applyTo,y=_(d[h],l);if(v)for(var b=v.length,x=0;x<b;x++)s[v[x]]=y;else s[h]=y}return this.options.layoutId&&(s.pointerEvents=l===this?Wx(e.pointerEvents)||``:`none`),s},e.prototype.clearSnapshot=function(){this.resumeFrom=this.snapshot=void 0}
51,e.prototype.resetTree=function(){this.root.nodes.forEach(function(e){var t;return(t=e.currentAnimation)==null?void 0:t.stop()}),this.root.nodes.forEach(bE),this.root.sharedNodes.clear()},e}()}function _E(e){e.updateLayout()}function vE(e){var t,n,r,i,a=(n=(t=e.resumeFrom)==null?void 0:t.snapshot)==null?e.snapshot:n;if(e.isLead()&&e.layout&&a&&e.hasListeners(`didUpdate`)){var o=e.layout,s=o.actual,c=o.measured;e.options.animationType===`size`?jw(function(e){var t=a.isShared?a.measured[e]:a.layout[e],n=cw(t);t.min=s[e].min,t.max=t.min+n}):e.options.animationType===`position`&&jw(function(e){var t=a.isShared?a.measured[e]:a.layout[e],n=cw(s[e]);t.max=t.min+n});var l=Ow();dw(l,s,a.layout);var u=Ow();a.isShared?dw(u,e.applyTransform(c,!0),a.measured):dw(u,s,a.layout);var d=!lE(l),f=!1;if(!e.resumeFrom&&(e.relativeParent=e.getClosestProjectingParent(),e.relativeParent&&!e.relativeParent.resumeFrom)){var p=e.relativeParent,m=p.snapshot,h=p.layout;if(m&&h){var g=Aw();hw(g,a.layout,m.layout);var _=Aw();hw(_,s,h.actual),uE(g,_)||(f=!0)}}e.notifyListeners(`didUpdate`,{layout:s,snapshot:a,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeTargetChanged:f})}else e.isLead()&&((i=(r=e.options).onExitComplete)==null||i.call(r));e.options.transition=void 0}function yE(e){e.clearSnapshot()}function bE(e){e.clearMeasurements()}function xE(e){var t=e.options.visualElement;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notifyBeforeLayoutMeasure(),e.resetTransform()}function SE(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function CE(e){e.resolveTargetDelta()}function wE(e){e.calcProjection()}function TE(e){e.resetRotation()}function EE(e){e.removeLeadSnapshot()}function DE(e,t,n){e.translate=Aa(t.translate,0,n),e.scale=Aa(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function OE(e,t,n,r){e.min=Aa(t.min,n.min,r),e.max=Aa(t.max,n.max,r)}function kE(e,t,n,r){OE(e.x,t.x,n.x,r),OE(e.y,t.y,n.y,r)}function AE(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var jE={duration:.45,ease:[.4,0,.1,1]};function ME(e,t){for(var n=e.root,r=e.path.length-1;r>=0;r--)if(e.path[r].instance){n=e.path[r];break}
51var i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function NE(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function PE(e){NE(e.x),NE(e.y)}var FE=gE({attachResizeListener:function(e,t){return Qx(e,`resize`,t)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}},checkIsScrollRoot:function(){return!0}}),IE={current:void 0},LE=gE({measureScroll:function(e){return{x:e.scrollLeft,y:e.scrollTop}},defaultParent:function(){if(!IE.current){var e=new FE(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),IE.current=e}return IE.current},resetTransform:function(e,t){e.style.transform=t==null?`none`:t},checkIsScrollRoot:function(e){return window.getComputedStyle(e).position===`fixed`}}),RE=q(q(q(q({},ew),BS),rT),UT),zE=Wb(function(e,t){return Xx(e,t,RE,FT,LE)});function BE({availableCredits:e,lockedCredits:t,totalCredits:n}){if(n<=0)return{availableRatio:0,lockedRatio:0};let r=Math.max(0,e/n),i=Math.max(0,t/n),a=r+i;return a<=1?{availableRatio:r,lockedRatio:i}:{availableRatio:r/a,lockedRatio:i/a}}function VE(e,t){let n=t>0?e/t:0;return n<=.3?`danger`:n<=.6?`warning`:`success`}var HE=11,UE=2*Math.PI*HE,WE={duration:.4,ease:`easeOut`};function GE({availableCredits:e,lockedCredits:t,totalCredits:n}){let r=vb(),{availableRatio:i,lockedRatio:a}=BE({availableCredits:e,lockedCredits:t,totalCredits:n}),s=UE*(1-i),c=UE*(1-a),l=VE(e,n);return(0,B.jsxs)(`svg`,{className:`size-6 -rotate-90`,viewBox:`-14 -14 28 28`,children:[(0,B.jsx)(`circle`,{stroke:`currentColor`,className:`text-gray-300`,cx:`0`,cy:`0`,r:HE,fill:`none`,strokeWidth:`2`}),(0,B.jsx)(zE.circle,{stroke:`currentColor`,className:o({"text-danger-500":l===`danger`,"text-warning-500":l===`warning`,"text-gray-600":l===`success`}),cx:`0`,cy:`0`,r:HE,fill:`none`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:UE,initial:!r&&{strokeDashoffset:UE},animate:{strokeDashoffset:s},transition:r?{duration:0}:WE}),a>0&&(0,B.jsx)(`g`,{transform:`rotate(${i*360})`,children:(0,B.jsx)(zE.circle,{stroke:`currentColor`,className:`text-blue-500`,cx:`0`,cy:`0`,r:HE,fill:`none`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:UE,initial:!r&&{strokeDashoffset:UE},animate:{strokeDashoffset:c},transition:r?{duration:0}:{...WE,delay:WE.duration}})})]})}function KE(e){return new Intl.NumberFormat(`en-US`,{minimumFractionDigits:e%1?2:0,maximumFractionDigits:3}).format(e)}function qE(e){return`${KE(e)} ${(0,z_.default)(`credit`,e)}`}var JE=10,YE=.5;function XE({remainedQuotaIntent:e,lockedCredits:t,totalCredits:n,availableCredits:r}){let i=vb(),{availableRatio:a,lockedRatio:s}=BE({availableCredits:r,lockedCredits:t,totalCredits:n}),c=i?{duration:0}:{duration:YE,ease:`easeOut`};return(0,B.jsxs)(`svg`,{className:`size-10 shrink-0 -rotate-90`,viewBox:`-12 -12 24 24`,children:[(0,B.jsx)(`circle`,{cx:`0`,cy:`0`,fill:`none`,strokeWidth:`2`,r:JE,className:`stroke-gray-100`}),(0,B.jsx)(zE.circle,{cx:`0`,cy:`0`,fill:`none`,strokeWidth:`2`,r:JE,className:o({"stroke-danger-500":e===`danger`,"stroke-warning-500":e===`warning`,"stroke-success-500":e===`success`}),strokeLinecap:`round`,initial:!i&&{pathLength:0},animate:{pathLength:a},transition:c}),s>0&&(0,B.jsx)(`g`,{transform:`rotate(${a*360})`,children:(0,B.jsx)(zE.circle,{cx:`0`,cy:`0`,fill:`none`,strokeWidth:`2`,r:JE,className:`stroke-blue-500`,strokeLinecap:`round`,initial:!i&&{pathLength:0},animate:{pathLength:s},transition:{...c,delay:i?0:YE}})})]})}function ZE({isWorkspaceOnLegacyPlan:e,unlimitedWebsites:t,maxWebsites:n,maxRobots:r}){let i=e?`robot`:`website`;return e?r>-1?{amount:r.toLocaleString(`en-US`),noun:(0,z_.default)(i,r)}:{amount:`Unlimited`,noun:(0,z_.default)(i)}:t||n===-1?{amount:`Unlimited`,noun:(0,z_.default)(i)}:{amount:n.toLocaleString(`en-US`),noun:(0,z_.default)(i,n)}}function QE(e){return e===12?`Yearly`:e===1?`Monthly`:`Every ${e} months`}E();
51function $E({maxRobots:e,maxWebsites:t,unlimitedWebsites:n,lockedCredits:r,nextQuotaResetAt:i,billingCycleInMonths:a,availableCredits:o,workspaceName:s,isWorkspaceOnLegacyPlan:c,totalCredits:l,CTA:u,planName:d,badge:f,subscriptionCanceled:m=!1}){let h=F({to:`workspace-subscription`,workspaceName:s}),g=p({path:h,end:!1}),_=VE(o,l),v=i&&!m?O(i*1e3).format(`MMM D, YYYY`):``,y=ZE({isWorkspaceOnLegacyPlan:c,unlimitedWebsites:n,maxWebsites:t,maxRobots:e}),b=QE(a);return(0,B.jsxs)(`div`,{className:`flex flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 p-4`,children:[(0,B.jsx)(XE,{remainedQuotaIntent:_,totalCredits:l,availableCredits:o,lockedCredits:r}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:d}),f]}),(0,B.jsxs)(`p`,{className:`whitespace-nowrap text-xs text-gray-500`,children:[KE(o),` of`,` `,qE(l)]}),r>0&&(0,B.jsxs)(`p`,{className:`flex items-center gap-1 whitespace-nowrap text-xs text-gray-500`,children:[qE(r),` reserved`,(0,B.jsx)(ke,{content:`Reserved credits will be spent or become available again once your in-progress tasks finish.`})]}),v&&(0,B.jsxs)(`p`,{className:`whitespace-nowrap text-xs text-gray-500`,children:[`Resets `,v]})]})]}),(0,B.jsxs)(`div`,{className:`font-sm mx-4 grid grid-cols-2 border-t border-gray-200 text-xs`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-3 pr-4 text-gray-600`,children:[(0,B.jsx)(`span`,{className:`font-medium text-gray-900`,children:y.amount}),` `,String(y.noun).charAt(0).toUpperCase()+String(y.noun).slice(1)]}),(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-3 pl-4 text-gray-600`,children:[(0,B.jsx)(`span`,{className:`whitespace-nowrap font-medium text-gray-900`,children:qE(l)}),` `,b]})]}),u?(0,B.jsx)(`div`,{className:`px-4 pb-4 pt-2`,children:u}):null,!g&&(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-b-lg border-t border-primary-200 bg-primary-50 px-4 py-3`,children:[(0,B.jsx)(`span`,{className:`text-xs font-medium text-primary-800`,children:`Need more credits?`}),(0,B.jsx)(T,{"data-test":`credits-overview-upgrade`,variant:`primary`,size:`xs`,hasMinWidth:!1,link:h,children:`Upgrade workspace`})]})]})}function eD({isLoading:e=!1,currentTeam:t,workspaceName:n}){var r;let[i,{loading:a}]=xt({variables:{teamName:n}}),[s,c]=z.useState(!1),l=F({to:`workspace-subscription`,workspaceName:n}),u=p({path:l,end:!1});if(z.useEffect(()=>{s&&i()},[s]),e)return(0,B.jsx)(`div`,{className:o(Jy,`relative self-center text-left`),children:(0,B.jsx)(Ci,{"aria-hidden":`true`,className:`size-6 rounded-full`})});if(!t)return null;let d=t.subscriptionPlan.title.toLocaleLowerCase()===Ly,f=t.subscriptionPlan.slug===Ry,m=t.credits-t.remainingCredits,h=t.credits?m/t.credits:0,g=t.credits&&t.remainingCredits?Math.max(0,t.remainingCredits-t.lockedCredits):0,_={isWorkspaceOnLegacyPlan:t.subscriptionPlan.isLegacy,unlimitedWebsites:t.unlimitedSites,maxWebsites:t.maxSites,maxRobots:t.maxRobots,billingCycleInMonths:t.plan.billingCycleInMonths,totalCredits:t.credits};return(0,B.jsxs)(`div`,{className:`relative flex items-center self-center text-left`,children:[(h>=.5||f||d&&m>0)&&!u&&(0,B.jsx)(`div`,{className:`mr-2 hidden sm:inline-flex`,children:(0,B.jsx)(ke,{content:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`mb-1 font-semibold`,children:`Upgrade your workspace`}),(0,B.jsx)(`div`,{className:`font-medium`,children:h>=.8?`More than ${Math.floor(h*100)}% of
52                      your credits have been spent. If you run out of credits,
53                      all tasks and monitors will stop. Upgrade your workspace
54                      to avoid interruptions.`:(0,B.jsxs)(B.Fragment,{children:[`As part of upgrading your workspace,`,` `,(0,B.jsx)(`span`,{className:`whitespace-nowrap`,children:`Browse AI`}),` `,`support team will assist you with creating new robots.`]})})]}),children:(0,B.jsx)(T,{"data-test":`upgrade-workspace`,onMouseOver:()=>{c(!1)},variant:h>=.8||f?`primary`:`tertiary`,icon:`zap`,size:`small`,link:l,children:`Upgrade Workspace`})})}),(0,B.jsx)(Be,{onOpenChange:c,isOpen:s,hasWidthLimitation:!1,hasPadding:!1,content:(0,B.jsx)(`div`,{className:`w-80 overflow-hidden`,children:a?(0,B.jsx)(`div`,{className:`flex items-center justify-center p-8`,children:(0,B.jsx)(Qn,{})}):(0,B.jsx)($E,{..._,subscriptionCanceled:!!t.subscriptionWillCancelAt,planName:t.
54subscriptionPlan.title,availableCredits:g,lockedCredits:t.lockedCredits,nextQuotaResetAt:(r=t.nextQuotaResetAt)==null?void 0:r,workspaceName:n,CTA:(0,B.jsx)(T,{"data-test":`usage-analytics`,variant:`secondary`,icon:`chart-column`,fullWidth:!0,size:`xs`,link:F({to:`usage-analytics`,workspaceName:n}),children:`View usage`})})}),children:(0,B.jsx)(`button`,{type:`button`,className:o(Jy,`cursor-pointer transition-colors duration-200 hover:duration-0 focus:outline-none focus-visible:duration-0 active:duration-0`,s?`bg-gray-100`:`hover:bg-gray-100 focus-visible:bg-gray-100`),title:`My plan & usage`,"data-test":`credits-spinner`,children:(0,B.jsx)(GE,{availableCredits:g,lockedCredits:t.lockedCredits,totalCredits:t.credits})})})]})}var tD=eD;function nD(){let[e,t]=z.useState(!1);return(0,B.jsx)(`div`,{className:`self-center`,children:(0,B.jsx)(Be,{isOpen:e,onOpenChange:t,content:(0,B.jsx)(Be.Description,{children:(0,B.jsx)(`div`,{className:`w-max rounded-lg`,children:(0,B.jsx)(`div`,{className:`relative grid gap-8 bg-white lg:grid-cols-1`,children:(0,B.jsx)(`div`,{className:`whitespace-nowrap`,children:(0,B.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-2`,children:[(0,B.jsx)(Py,{"data-test":`documentation-nav`,isSelected:!1,icon:`book-open`,link:rr(),children:`Documentation`}),(0,B.jsx)(Py,{"data-test":`get-support-nav`,isSelected:!1,icon:`messages-square`,onClick:()=>{St.showNewMessage(``),t(!1)},children:`Get support`}),(0,B.jsx)(Py,{"data-test":`contact-sales-nav`,isSelected:!1,icon:`circle-user`,link:tv(),children:`Contact sales`})]})})})})}),hasPadding:!1,children:(0,B.jsx)(`button`,{type:`button`,className:o(Jy,`cursor-pointer text-gray-600 transition-colors duration-200 hover:duration-0 focus:outline-none focus-visible:duration-0 active:duration-0`,e?`bg-gray-100`:`hover:bg-gray-100 focus-visible:bg-gray-100`),title:`Find documentation or get support`,"aria-label":`Help center menu`,"data-test":`help-center-menu`,children:(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-6 w-6 items-center justify-center text-xl font-normal leading-none text-gray-600 antialiased`,children:`?`})})})})}var rD=()=>(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(hi,{children:({open:e})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(hi.Button,{as:T,"data-test":`admin-menu`,fullWidth:!0,rightIcon:e?`chevron-up`:`chevron-down`,variant:`tertiary`,leftAlignText:!0,icon:`settings`,children:`Admin`}),(0,B.jsxs)(hi.Items,{as:`ul`,className:`m-0 block list-none p-0`,children:[(0,B.jsxs)(er,{authorizedRoles:[Bn.SuperAdmin],children:[(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,"data-test":`admin-users`,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/users`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Users`})})]}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/workspaces`,"data-test":`admin-workspaces`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Workspaces`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/robots`,"data-test":`admin-robots`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Robots`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/recording-sessions`,"data-test":`admin-recording-sessions`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Recording Sessions`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/training-sessions`,"data-test":`admin-training-sessions`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Training Sessions`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/shared-robots`,"data-test":`admin-shared-robots`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Shared Robots`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/proxies`,"data-test":`admin-proxies`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Proxies`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/page-templates`,"data-test":`admin-page-templates`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Page Templates`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/subscription-plans`,"data-test":`admin-subscription-plans`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Subscription Plans`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/credits-logs`,"data-test":`admin-credits-logs`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Credits Quota Edit Logs`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/domain-rules`,"data-test":`admin-domain-rules`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Domain Rules`})}),(0,B.jsx)(`div`,{className:`border-t`}),(0,B.jsx)(hi.Item,{as:T,fullWidth:!0,variant:`tertiary`,leftAlignText:!0,link:`/admin/email-campaigns`,"data-test":`admin-email-campaigns`,children:(0,B.jsx)(`span`,{className:`inline-block pl-8`,children:`Email Campaigns`})})]})]})})});function iD({currentUser:e,isOnboarding:t,pathname:n,isLoading:r=!1}){let[i,a]=z.useState(!1),{userIsLoggedIn:s}=le(),{demoMode:c,setDemoMode:l}=un();if(!s)return null;if(!e||r)return(0,B.jsx)(`div`,{className:`self-center`,children:(0,B.jsx)(`button`,{type:`button`,disabled:!0,className:o(Jy,`relative -mr-1 cursor-not-allowed text-gray-600 focus:outline-none sm:-mr-1.5`),title:`My personal settings`,"data-test":`profile-menu`,children:(0,B.jsx)(kr,{size:`sm`,imageSrc:void 0,alt:`Your profile picture`,hasTransparentBackgroun
54d:!0})})});let u=Math.min(+!e.emailVerified,100),d=[e==null?void 0:e.firstName,e==null?void 0:e.lastName].filter(Boolean).join(` `);return(0,B.jsx)(`div`,{className:`self-center`,children:(0,B.jsx)(Be,{isOpen:i,onOpenChange:a,content:(0,B.jsx)(Be.Description,{children:(0,B.jsx)(`div`,{className:`min-w-0 max-w-xs`,children:(0,B.jsx)(`div`,{className:`relative grid gap-8 bg-white lg:grid-cols-1`,children:(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 border-b border-gray-200 px-4 py-3 text-left`,children:[(0,B.jsx)(kr,{size:`md`,as:`div`,imageSrc:e.imageSrc,alt:`Your profile picture`}),(0,B.jsx)(`div`,{className:`min-w-0 flex-1`,children:d?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`truncate text-xs font-medium leading-tight text-gray-700`,children:d}),(0,B.jsx)(`div`,{className:`mt-0.5 truncate text-xs font-normal leading-tight text-slate-500`,children:e.email})]}):(0,B.jsx)(`div`,{className:`truncate text-xs font-normal leading-tight text-slate-500`,children:e.email})})]}),(0,B.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-2`,children:[!t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(er,{authorizedRoles:[Bn.SuperAdmin,Bn.Support],authorizedTeamRoles:[sn.Technician],showInDemoMode:!0,children:(0,B.jsx)(`li`,{className:`m-0 block p-0`,children:(0,B.jsx)(`div`,{className:`px-5 py-3`,children:(0,B.jsx)(Ze,{label:`Demo Mode`,onChange:e=>{l(e.target.checked)},checked:c,"data-test":`app-header-demo-mode`})})})}),(0,B.jsx)(Py,{"data-test":`profile-nav`,isSelected:n.startsWith(F({to:`account-profile`})),link:F({to:`account-profile`}),icon:`circle-user`,badge:e.emailVerified?void 0:{label:`Not verified`,intent:e.enforceEmailVerification?`danger`:`warning`},children:`Profile`}),(0,B.jsx)(Py,{"data-test":`experimental-features-nav`,isSelected:n.startsWith(F({to:`experimental-features`})),link:F({to:`experimental-features`}),icon:`flask-conical`,children:`Experimental features`}),(0,B.jsx)(er,{authorizedRoles:[Bn.SuperAdmin,Bn.Support],children:(0,B.jsx)(`li`,{className:`m-0 block p-0`,children:(0,B.jsx)(rD,{})})})]}),(0,B.jsx)(Py,{"data-test":`logout-nav`,isSelected:!1,icon:`log-out`,link:F({to:`logout`}),children:`Sign out`})]})]})})})}),hasPadding:!1,children:(0,B.jsxs)(`button`,{type:`button`,className:o(Jy,`relative -mr-1 cursor-pointer transition-colors duration-200 hover:duration-0 focus:outline-none focus-visible:duration-0 active:duration-0 sm:-mr-1.5`,i?`bg-gray-100`:`hover:bg-gray-100 focus-visible:bg-gray-100`),title:`My personal settings`,"data-test":`profile-menu`,children:[(0,B.jsx)(kr,{size:`sm`,imageSrc:e.imageSrc,alt:`Your profile picture`,hasTransparentBackground:!0}),u>0&&(0,B.jsx)(`span`,{className:`border-background absolute right-[1px] top-[1px] box-content h-1.5 w-1.5 rounded-full border-2 bg-red-500 text-red-500`})]})})})}function aD({isOnboarding:e,currentUser:t,currentTeam:n,isLoadingUser:r=!1}){let i=p({path:`/workspaces/:workspaceName`,end:!1}),{pathname:a}=u(),[o]=ye(``,{queryStringKey:`workspaceName`}),s=i==null?void 0:i.params.workspaceName,c=s===void 0?yg:s===`new`?o:s,l=z.useMemo(()=>t!=null&&t.email?{id:t.id,email:t.email,firstName:t.firstName||null,lastName:t.lastName||null,role:t.role||`user`,referrer:t.referrer||``,newsEmailsPerYear:t.newsEmailsPerYear||0,reasonToExtractData:t.reasonToExtractData||``,intendedUsageFrequency:t.intendedUsageFrequency||``,serviceTypePreference:t.serviceTypePreference||``}:null,[t]);z.useEffect(()=>{l&&Zt({event:`userSet`,user:{...l,firstName:l.firstName||``,lastName:l.lastName||void 0,hasFinishedOnboarding:void 0}})},[l]);let d=F({to:`dashboard`,workspaceName:c}),f=r&&!t;return(0,B.jsx)(`header`,{className:`relative z-10 h-[52px] border-b border-gray-200 text-center`,children:(0,B.jsx)(`nav`,{children:(0,B.jsx)(jn,{children:(0,B.jsxs)(Si,{children:[(0,B.jsxs)(Ir,{xs:10,md:8,lg:6,className:`h-[52px]`,verticalAlign:`center`,children:[(0,B.jsx)(v,{to:d,className:`-ml-1 rounded-full p-1 ring-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2`,children:(0,B.jsxs)(`picture`,{children:[(0,B.jsx)(`source`,{media:`(max-width: 640px)`,srcSet:`/assets/header-logo-1x.png 1x, /assets/header-logo-2x.png 2x, /assets/header-logo-3x.png 3x`,width:32,height:32}),(0,B.jsx)(`img`,{alt:`Browse AI`,className:`h-[34px] w-auto`,title:`Browse AI`,src:`/assets/header-logo-type-1x.png`,srcSet:`/assets/header-logo-type-1x.png 1x, /assets/header-logo-type-2x.png 2x, /assets/header-logo-type-3x.png 3x`,width:140,height:34})]})}),!e&&(0,B.jsx)(Iy,{isLoading:f,teamNameFromPath:c,currentUser:t,currentTeam:n,selectedTeamId:n==null?void 0:n.id})]}),(0,B.jsxs)(Ir,{xs:2,md:4,lg:6,verticalAlign:`center`,align:`right`,className:`h-[52px]`,children:[!e&&(0,B.jsx)(tD,{isLoading:f,currentTeam:n,workspaceName:c}
54),(0,B.jsx)(nD,{}),(0,B.jsx)(iD,{currentUser:t,isOnboarding:e,pathname:a,isLoading:f})]})]})})})})}var oD=aD,sD=F({to:`welcome`}),cD=F({to:`link-accounts`}),lD=`bcyfauog`,uD=({children:e})=>{let t=f(),n=Je(),{userIsLoggedIn:r,userProfile:i}=le(),{setMyUserId:a,setMyUserRole:o,setMyUserTeamRole:s}=un(),{pathname:c}=u(),{workspaceName:l}=Dg(),d=Eg((i==null?void 0:i.email)||``),m=l||d||`personal`,h=p({path:`/workspaces/:workspaceName/robots/:robotId/tables`,end:!1}),g=c===cD,_=c===sD,v=c.startsWith(F({to:`verify-email`})),y=c.startsWith(F({to:`account-profile`})),b=c.startsWith(F({to:`create-new-shared-robot`,workspaceName:m,sharedRobotSlug:``})),[x,{loading:S}]=Yt({onCompleted:e=>{var n;((n=e.createProfileIfNotExists)==null?void 0:n.__typename)===`LinkingAuth0AccountsIsPossible`?t(F({to:`link-accounts`}),{replace:!0}):T()}}),{loading:C,data:w,refetch:T}=Rt({variables:{teamName:m},skip:g||!r,onCompleted:e=>{D({user:{id:e.myUser.id,role:e.myUser.role||null}}),a(e.myUser.id),o(e.myUser.role),N==null||N.identify(e.myUser.id,{email:e.myUser.email,role:e.myUser.role,emailVerified:e.myUser.emailVerified,createdAt:new Date(e.myUser.createdAt*1e3).toISOString(),referrer:e.myUser.referrer,companyName:e.myUser.companyName,newsEmailsPerYear:e.myUser.newsEmailsPerYear,reasonToExtractData:e.myUser.reasonToExtractData,numberOfWebsitesToExtract:e.myUser.numberOfWebsitesToExtract,intendedUsageFrequency:e.myUser.intendedUsageFrequency,serviceTypePreference:e.myUser.serviceTypePreference,hasFinishedOnboarding:e.myUser.hasFinishedOnboarding}),bt({appId:lD,userId:e.myUser.id,userIdHash:e.myUser.intercomHash,email:e.myUser.email,name:e.myUser.firstName&&e.myUser.lastName?`${e.myUser.firstName} ${e.myUser.lastName}`:e.myUser.firstName||void 0}),nu.setUser({id:e.myUser.id})},onError:e=>{Sg(e)?x({variables:{firstName:(i==null?void 0:i.given_name)||null,lastName:(i==null?void 0:i.family_name)||null}}):n(e)}}),E=r&&w!=null&&w.myUser?w.myUser:null,O=w==null?void 0:w.team,k=C&&!w;return z.useEffect(()=>{var e;if(!E||!m){re();return}let t=(e=E.userTeams)==null?void 0:e.items.find(({team:e})=>m===`personal`?e.isPersonal:e.name===m);if(t&&(s(t.teamRole),wg((i==null?void 0:i.email)||``,xg(t.team.name)),O)){let e=O.subscriptionPlan.slug;ae(O.id,{workspaceCreatedAt:new Date(O.createdAt*1e3),lastQuotaResetAt:new Date(O.lastQuotaResetAt*1e3)}),N==null||N.register({subscriptionPlanSlug:e});let t={workspaceId:O.id,name:O.name,subscriptionPlanSlug:e,createdAt:new Date(O.createdAt*1e3).toISOString()};N==null||N.group(`workspace`,O.id,t),nu.setUserProperty(`workspaceId`,O.id),nu.setUserProperty(`role`,E.role),nu.setUserProperty(`subscriptionPlanSlug`,e),D({team:{planSlug:e}})}},[E,m,s,O,i==null?void 0:i.email]),z.useEffect(()=>{E&&!E.emailVerified&&E.enforceEmailVerification&&!v&&!y&&!b&&!_&&t(F({to:`verify-email`}),{replace:!0})},[E,v,y,t,b,_]),(0,B.jsxs)(`div`,{className:`relative flex min-h-full flex-col font-[Inter,sans-serif] text-[length:1rem] antialiased`,children:[(0,B.jsx)(gg,{position:`bottom-right`,offset:{bottom:`86px`}}),(0,B.jsx)(kg,{}),(()=>{let t=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(oD,{isOnboarding:_,currentUser:E,currentTeam:r&&O?O:null,isLoadingUser:k}),k||S?(0,B.jsx)(Og,{}):e,(0,B.jsx)(`div`,{className:`m-4`})]});return h?(0,B.jsx)(`div`,{className:`flex h-screen flex-col`,children:t}):t})(),(w==null?void 0:w.team)&&(0,B.jsx)(by,{currentWorkspace:w.team})]})};function dD(){return(0,B.jsxs)(`div`,{className:`relative flex min-h-full flex-col font-[Inter,sans-serif] text-[length:1rem] antialiased`,children:[(0,B.jsx)(oD,{isOnboarding:!1,currentUser:null,currentTeam:null,isLoadingUser:!0}),(0,B.jsx)(Og,{})]})}var fD=[`MO`,`TU`,`WE`,`TH`,`FR`,`SA`,`SU`],pD=function(){function e(e,t){if(t===0)throw Error(`Can't create weekday with n == 0`);this.weekday=e,this.n=t}return e.fromStr=function(t){return new e(fD.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},e.prototype.toString=function(){var e=fD[this.weekday];return this.n&&(e=(this.n>0?`+`:``)+String(this.n)+e),e},e.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},e}(),mD=function(e){return e!=null},hD=function(e){return typeof e==`number`},gD=function(e){return typeof e==`string`&&fD.includes(e)},_D=Array.isArray,vD=function(e,t){t===void 0&&(t=e),arguments.length===1&&(t=e,e=0);for(var n=[],r=e;r<t;r++)n.push(r);return n},J=function(e,t){var n=0,r=[];if(_D(e))for(;n<t;n++)r[n]=[].concat(e);else for(;n<t;n++)r[n]=e;return r},yD=function(e){return _D(e)?e:[e]};function bD(e,t,n){n===void 0&&(n=` `);var r=String(e);return t>>=0,r.length>t?String(r):(t-=r.length,t>n.length&&(n+=J(n,t/n.length)),n.slice(0,t)+String(r))}var xD=function(e,t,n){var r=e.split(t);return n?r.slice(0,n).concat([r.slice(n).join(t)]):r},SD=function(e,t){var n=e%t;return n*t<0?n+t:n},CD=function(e,t){return{div:Math.floor(e/t),mod:SD(e,t)}},wD=function(e){return!mD(e)||e.length===0},TD=function(e){return!wD(e)},ED=function(e,t){return TD(e)&&e.indexOf(t)!==-1},DD=function(e,t,n,r,i,a){return r===void 0&&(r=0),i===void 0&&(i=0),a===void 0&&(a=0),new Date(Date.UTC(e,t-1,n,r,i,a))},OD=[31,28,31,30,31,30,31,31,30,31,30,31],kD=864e5,AD=DD(1970,1,1),jD=[6,0,1,2,3,4,5],MD=function(e){return e%4==0&&e%100!=0||e%400==0},ND=function(e){return e instanceof Date},PD=function(e){return ND(e)&&!isNaN(e.getTime())},FD=function(e,t){var n=e.getTime()-t.getTime();return Math.round(n/kD)},ID=function(e){return FD(e,AD)},LD=function(e){return new Date(AD.getTime()+e*kD)},RD=function(e){var t=e.getUTCMonth();return t===1&&MD(e.getUTCFullYear())?29:OD[t]},zD=function(e){return jD[e.getUTCDay()]},BD=function(e,t){var n=DD(e,t+1,1);return[zD(n),RD(n)]},VD=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},HD=function(e){return new Date(e.getTime())},UD=function(e){for(var t=[],n=0;n<e.length;n++)t.push(HD(e[n]));return t},WD=function(e){e.sort(function(e,t){return e.getTime()-t.getTime()})},GD=function(e,t){t===void 0&&(t=!0);var n=new Date(e);return[bD(n.getUTCFullYear().toString(),4,`0`),bD(n.getUTCMonth()+1,2,`0`),bD(n.getUTCDate(),2,`0`),`T`,bD(n.getUTCHours(),2,`0`),bD(n.getUTCMinutes(),2,`0`),bD(n.getUTCSeconds(),2,`0`),t?`Z`:``].join(``)},KD=function(e){var t=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(e);if(!t)throw Error(`Invalid UNTIL value: ${e}`);return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))}
54,qD=function(e,t){return e.toLocaleString(`sv-SE`,{timeZone:t}).replace(` `,`T`)+`Z`},JD=function(e,t){var n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=new Date(qD(e,n)),i=new Date(qD(e,t==null?`UTC`:t)).getTime()-r.getTime();return new Date(e.getTime()-i)},YD=function(){function e(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,e===`between`?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):e===`before`?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):e===`after`&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return e.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if(this.method===`between`){if(t)return!0;if(n)return!1}else if(this.method===`before`){if(n)return!1}else if(this.method===`after`)return t?!0:(this.add(e),!1);return this.add(e)},e.prototype.add=function(e){return this._result.push(e),!0},e.prototype.getValue=function(){var e=this._result;switch(this.method){case`all`:case`between`:return e;default:return e.length?e[e.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),XD=function(e){en(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.iterator=r,i}return t.prototype.add=function(e){return this.iterator(e,this._result.length)?(this._result.push(e),!0):!1},t}(YD),ZD={dayNames:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},QD=function(e,t){return e.indexOf(t)!==-1},$D=function(e){return e.toString()},eO=function(e,t,n){return`${t} ${n}, ${e}`},tO=function(){function e(e,t,n,r){if(t===void 0&&(t=$D),n===void 0&&(n=ZD),r===void 0&&(r=eO),this.text=[],this.language=n||ZD,this.gettext=t,this.dateFormatter=r,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);i.sort(function(e,t){return e-t}),a.sort(function(e,t){return t-e}),this.bymonthday=i.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(mD(this.origOptions.byweekday)){var o=_D(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],s=String(o);this.byweekday={allWeeks:o.filter(function(e){return!e.n}),someWeeks:o.filter(function(e){return!!e.n}),isWeekdays:s.indexOf(`MO`)!==-1&&s.indexOf(`TU`)!==-1&&s.indexOf(`WE`)!==-1&&s.indexOf(`TH`)!==-1&&s.indexOf(`FR`)!==-1&&s.indexOf(`SA`)===-1&&s.indexOf(`SU`)===-1,isEveryDay:s.indexOf(`MO`)!==-1&&s.indexOf(`TU`)!==-1&&s.indexOf(`WE`)!==-1&&s.indexOf(`TH`)!==-1&&s.indexOf(`FR`)!==-1&&s.indexOf(`SA`)!==-1&&s.indexOf(`SU`)!==-1};var c=function(e,t){return e.weekday-t.weekday};this.byweekday.allWeeks.sort(c),this.byweekday.someWeeks.sort(c),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return e.isFullyConvertible=function(t){var n=!0;
54if(!(t.options.freq in e.IMPLEMENTED)||t.origOptions.until&&t.origOptions.count)return!1;for(var r in t.origOptions){if(QD([`dtstart`,`tzid`,`wkst`,`freq`],r))return!0;if(!QD(e.IMPLEMENTED[t.options.freq],r))return!1}return n},e.prototype.isFullyConvertible=function(){return e.isFullyConvertible(this.rrule)},e.prototype.toString=function(){var t=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return t(`RRule error: Unable to fully convert this rrule to text`);if(this.text=[t(`every`)],this[X.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t(`until`));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(t(`for`)).add(this.options.count.toString()).add(this.plural(this.options.count)?t(`times`):t(`time`));return this.isFullyConvertible()||this.add(t(`(~ approximate)`)),this.text.join(``)},e.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e(`hours`):e(`hour`))},e.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e(`minutes`):e(`minute`))},e.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e(`weekdays`):e(`weekday`)):this.add(this.plural(this.options.interval)?e(`days`):e(`day`)),this.origOptions.bymonth&&(this.add(e(`in`)),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},e.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e(`weeks`):e(`week`)),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e(`weekdays`):e(`weekday`)):this.add(e(`on`)).add(e(`weekdays`)):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e(`days`):e(`day`)):(this.options.interval===1&&this.add(e(`week`)),this.origOptions.bymonth&&(this.add(e(`in`)),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},e.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e(`months`)),this.plural(this.options.interval)&&this.add(e(`in`))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e(`months`):e(`month`))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e(`on`)).add(e(`weekdays`)):this.byweekday&&this._byweekday()},e.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e(`years`))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e(`years`):e(`year`))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e(`on the`)).add(this.list(this.options.byyearday,this.nth,e(`and`))).add(e(`day`)),this.options.byweekno&&this.add(e(`in`)).add(this.plural(this.options.byweekno.length)?e(`weeks`):e(`week`)).add(this.list(this.options.byweekno,void 0,e(`and`)))},e.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e(`on`)).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e(`or`))).add(e(`the`)).add(this.list(this.bymonthday,this.nth,e(`or`))):this.add(e(`on the`)).add(this.list(this.bymonthday,this.nth,e(`and`)))},e.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e(`on`)).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e(`and`)),this.add(e(`on the`)).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e(`and`))))},e.prototype._byhour=function(){var e=this.gettext;this.add(e(`at`)).add(this.list(this.origOptions.byhour,void 0,e(`and`)))},e.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext(`and`)))},e.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n(`last`);var r=Math.abs(e);switch(r){case 1:case 21:case 31:t=r+n(`st`);break;
54case 2:case 22:t=r+n(`nd`);break;case 3:case 23:t=r+n(`rd`);break;default:t=r+n(`th`)}return e<0?t+` `+n(`last`):t},e.prototype.monthtext=function(e){return this.language.monthNames[e-1]},e.prototype.weekdaytext=function(e){var t=hD(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+` `:``)+this.language.dayNames[t]},e.prototype.plural=function(e){return e%100!=1},e.prototype.add=function(e){return this.text.push(` `),this.text.push(e),this},e.prototype.list=function(e,t,n,r){var i=this;r===void 0&&(r=`,`),_D(e)||(e=[e]);var a=function(e,t,n){for(var r=``,i=0;i<e.length;i++)i!==0&&(i===e.length-1?r+=` `+n+` `:r+=t+` `),r+=e[i];return r};t=t||function(e){return e.toString()};var o=function(e){return t&&t.call(i,e)};return n?a(e.map(o),r,n):e.map(o).join(r+` `)},e}(),nO=function(){function e(e){this.done=!0,this.rules=e}return e.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},e.prototype.isDone=function(){return this.done&&this.symbol===null},e.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;var n=void 0;for(var r in e=null,this.rules){n=this.rules[r];var i=n.exec(this.text);i&&(e===null||i[0].length>e[0].length)&&(e=i,t=r)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===``&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t===`SKIP`);return this.symbol=t,this.value=e,!0},e.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept(`number`)},e.prototype.expect=function(e){if(this.accept(e))return!0;throw Error(`expected `+e+` but found `+this.symbol)},e}();function rO(e,t){t===void 0&&(t=ZD);var n={},r=new nO(t.tokens);if(!r.start(e))return null;return i(),n;function i(){r.expect(`every`);var e=r.acceptNumber();if(e&&(n.interval=parseInt(e[0],10)),r.isDone())throw Error(`Unexpected end`);switch(r.symbol){case`day(s)`:n.freq=X.DAILY,r.nextSymbol()&&(o(),d());break;case`weekday(s)`:n.freq=X.WEEKLY,n.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR],r.nextSymbol(),o(),d();break;case`week(s)`:n.freq=X.WEEKLY,r.nextSymbol()&&(a(),o(),d());break;case`hour(s)`:n.freq=X.HOURLY,r.nextSymbol()&&(a(),d());break;case`minute(s)`:n.freq=X.MINUTELY,r.nextSymbol()&&(a(),d());break;case`month(s)`:n.freq=X.MONTHLY,r.nextSymbol()&&(a(),d());break;case`year(s)`:n.freq=X.YEARLY,r.nextSymbol()&&(a(),d());break;case`monday`:case`tuesday`:case`wednesday`:case`thursday`:case`friday`:case`saturday`:case`sunday`:if(n.freq=X.WEEKLY,n.byweekday=[X[r.symbol.substr(0,2).toUpperCase()]],!r.nextSymbol())return;for(;r.accept(`comma`);){if(r.isDone())throw Error(`Unexpected end`);var t=c();if(!t)throw Error(`Unexpected symbol `+r.symbol+`, expected weekday`);n.byweekday.push(X[t]),r.nextSymbol()}o(),u(),d();break;case`january`:case`february`:case`march`:case`april`:case`may`:case`june`:case`july`:case`august`:case`september`:case`october`:case`november`:case`december`:if(n.freq=X.YEARLY,n.bymonth=[s()],!r.nextSymbol())return;for(;r.accept(`comma`);){if(r.isDone())throw Error(`Unexpected end`);var i=s();if(!i)throw Error(`Unexpected symbol `+r.symbol+`, expected month`);n.bymonth.push(i),r.nextSymbol()}a(),d();break;default:throw Error(`Unknown symbol`)}}function a(){var e=r.accept(`on`),t=r.accept(`the`);if(e||t)do{var i=l(),a=c(),o=s();if(i)a?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(X[a].nth(i))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(i),r.accept(`day(s)`));else if(a)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(X[a]);else if(r.symbol===`weekday(s)`)r.nextSymbol(),n.byweekday||(n.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR]);else if(r.symbol===`week(s)`){r.nextSymbol();var u=r.acceptNumber();if(!u)throw Error(`Unexpected symbol `+r.symbol+`, expected week number`);for(n.byweekno=[parseInt(u[0],10)];r.accept(`comma`);){if(u=r.acceptNumber(),!u)throw Error(`Unexpected symbol `+r.symbol+`; expected monthday`);n.byweekno.push(parseInt(u[0],10))}}else if(o)r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(o);else return}while(r.accept(`comma`)||r.accept(`the`)||r.accept(`on`))}function o(){if(r.accept(`at`))do{var e=r.acceptNumber();if(!e)throw Error(`Unexpected symbol `+r.symbol+`, expected hour`);for(n.byhour=[parseInt(e[0],10)];r.accept(`comma`);){if(e=r.acceptNumber(),!e)throw Error(`Unexpected symbol `+r.symbol+`; expected hour`);n.byhour.push(parseInt(e[0],10))}}while(r.accept(`comma`)||r.accept(`at`))}function s(){switch(r.symbol){case`january`:return 1;case`february`:return 2;case`march`:return 3;case`april`:return 4;case`may`:return 5;case`june`:return 6;case`july`:return 7;case`august`:return 8;case`september`:return 9;
54case`october`:return 10;case`november`:return 11;case`december`:return 12;default:return!1}}function c(){switch(r.symbol){case`monday`:case`tuesday`:case`wednesday`:case`thursday`:case`friday`:case`saturday`:case`sunday`:return r.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(r.symbol){case`last`:return r.nextSymbol(),-1;case`first`:return r.nextSymbol(),1;case`second`:return r.nextSymbol(),r.accept(`last`)?-2:2;case`third`:return r.nextSymbol(),r.accept(`last`)?-3:3;case`nth`:var e=parseInt(r.value[1],10);if(e<-366||e>366)throw Error(`Nth out of range: `+e);return r.nextSymbol(),r.accept(`last`)?-e:e;default:return!1}}function u(){r.accept(`on`),r.accept(`the`);var e=l();if(e)for(n.bymonthday=[e],r.nextSymbol();r.accept(`comma`);){if(e=l(),!e)throw Error(`Unexpected symbol `+r.symbol+`; expected monthday`);n.bymonthday.push(e),r.nextSymbol()}}function d(){if(r.symbol===`until`){var e=Date.parse(r.text);if(!e)throw Error(`Cannot parse until date:`+r.text);n.until=new Date(e)}else r.accept(`for`)&&(n.count=parseInt(r.value[0],10),r.expect(`number`))}}var Y;(function(e){e[e.YEARLY=0]=`YEARLY`,e[e.MONTHLY=1]=`MONTHLY`,e[e.WEEKLY=2]=`WEEKLY`,e[e.DAILY=3]=`DAILY`,e[e.HOURLY=4]=`HOURLY`,e[e.MINUTELY=5]=`MINUTELY`,e[e.SECONDLY=6]=`SECONDLY`})(Y||(Y={}));function iO(e){return e<Y.HOURLY}var aO=function(e,t){return t===void 0&&(t=ZD),new X(rO(e,t)||void 0)},oO=[`count`,`until`,`interval`,`byweekday`,`bymonthday`,`bymonth`];
54tO.IMPLEMENTED=[],tO.IMPLEMENTED[Y.HOURLY]=oO,tO.IMPLEMENTED[Y.MINUTELY]=oO,tO.IMPLEMENTED[Y.DAILY]=[`byhour`].concat(oO),tO.IMPLEMENTED[Y.WEEKLY]=oO,tO.IMPLEMENTED[Y.MONTHLY]=oO,tO.IMPLEMENTED[Y.YEARLY]=[`byweekno`,`byyearday`].concat(oO);var sO=function(e,t,n,r){return new tO(e,t,n,r).toString()},cO=tO.isFullyConvertible,lO=function(){function e(e,t,n,r){this.hour=e,this.minute=t,this.second=n,this.millisecond=r||0}return e.prototype.getHours=function(){return this.hour},e.prototype.getMinutes=function(){return this.minute},e.prototype.getSeconds=function(){return this.second},e.prototype.getMilliseconds=function(){return this.millisecond},e.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},e}(),uO=function(e){en(t,e);function t(t,n,r,i,a,o,s){var c=e.call(this,i,a,o,s)||this;return c.year=t,c.month=n,c.day=r,c}return t.fromDate=function(e){return new this(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.valueOf()%1e3)},t.prototype.getWeekday=function(){return zD(new Date(this.getTime()))},t.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},t.prototype.getDay=function(){return this.day},t.prototype.getMonth=function(){return this.month},t.prototype.getYear=function(){return this.year},t.prototype.addYears=function(e){this.year+=e},t.prototype.addMonths=function(e){if(this.month+=e,this.month>12){var t=Math.floor(this.month/12),n=SD(this.month,12);this.month=n,this.year+=t,this.month===0&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(e,t){t>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-t))+e*7:this.day+=-(this.getWeekday()-t)+e*7,this.fixDay()},t.prototype.addDaily=function(e){this.day+=e,this.fixDay()},t.prototype.addHours=function(e,t,n){for(t&&(this.hour+=Math.floor((23-this.hour)/e)*e);;){this.hour+=e;var r=CD(this.hour,24),i=r.div,a=r.mod;if(i&&(this.hour=a,this.addDaily(i)),wD(n)||ED(n,this.hour))break}},t.prototype.addMinutes=function(e,t,n,r){for(t&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/e)*e);;){this.minute+=e;var i=CD(this.minute,60),a=i.div,o=i.mod;if(a&&(this.minute=o,this.addHours(a,!1,n)),(wD(n)||ED(n,this.hour))&&(wD(r)||ED(r,this.minute)))break}},t.prototype.addSeconds=function(e,t,n,r,i){for(t&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/e)*e);;){this.second+=e;var a=CD(this.second,60),o=a.div,s=a.mod;if(o&&(this.second=s,this.addMinutes(o,!1,n,r)),(wD(n)||ED(n,this.hour))&&(wD(r)||ED(r,this.minute))&&(wD(i)||ED(i,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var e=BD(this.year,this.month-1)[1];if(!(this.day<=e))for(;this.day>e;){if(this.day-=e,++this.month,this.month===13&&(this.month=1,++this.year,this.year>9999))return;e=BD(this.year,this.month-1)[1]}}},t.prototype.add=function(e,t){var n=e.freq,r=e.interval,i=e.wkst,a=e.byhour,o=e.byminute,s=e.bysecond;switch(n){case Y.YEARLY:return this.addYears(r);case Y.MONTHLY:return this.addMonths(r);case Y.WEEKLY:return this.addWeekly(r,i);case Y.DAILY:return this.addDaily(r);case Y.HOURLY:return this.addHours(r,t,a);case Y.MINUTELY:return this.addMinutes(r,t,a,o);case Y.SECONDLY:return this.addSeconds(r,t,a,o,s)}},t}(lO);function dO(e){for(var t=[],n=Object.keys(e),r=0,i=n;r<i.length;r++){var a=i[r];ED(rk,a)||t.push(a),ND(e[a])&&!PD(e[a])&&t.push(a)}if(t.length)throw Error(`Invalid options: `+t.join(`, `));return L({},e)}function fO(e){var t=L(L({},nk),dO(e));if(mD(t.byeaster)&&(t.freq=X.YEARLY),!(mD(t.freq)&&X.FREQUENCIES[t.freq]))throw Error(`Invalid frequency: ${t.freq} ${e.freq}`);if(t.dtstart||(t.dtstart=new Date(new Date().setMilliseconds(0))),mD(t.wkst)?hD(t.wkst)||(t.wkst=t.wkst.weekday):t.wkst=X.MO.weekday,mD(t.bysetpos)){hD(t.bysetpos)&&(t.bysetpos=[t.bysetpos]);for(var n=0;n<t.bysetpos.length;n++){var r=t.bysetpos[n];if(r===0||!(r>=-366&&r<=366))throw Error(`bysetpos must be between 1 and 366, or between -366 and -1`)}}if(!(t.byweekno||TD(t.byweekno)||TD(t.byyearday)||t.bymonthday||TD(t.bymonthday)||mD(t.byweekday)||mD(t.byeaster)))switch(t.freq){case X.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case X.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case X.WEEKLY:t.byweekday=[zD(t.dtstart)]}if(mD(t.bymonth)&&!_D(t.bymonth)&&(t.bymonth=[t.bymonth]),mD(t.byyearday)&&!_D(t.byyearday)&&hD(t.byyearday)&&(t.byyearday=[t.byyearday]),!mD(t.bymonthday))t.bymonthday=[],t.bynmonthday=[];else if(_D(t.bymonthday)){for(var i=[],a=[],n=0;n<t.bymonthday.length;n++){var r=t.bymonthday[n];r>0?i.push(r):r<0&&a.push(r)}t.bymonthday=i,t.bynmonthday=a}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);if(mD(t.byweekno)&&!_D(t.byweekno)&&(t.byweekno=[t.byweekno]),!mD(t.byweekday))t.bynweekday=null;else if(hD(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(gD(t.byweekday))t.byweekday=[pD.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof pD)!t.byweekday.n||t.freq>X.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var o=[],s=[],n=0;n<t.byweekday.length;n++){var c=t.byweekday[n];if(hD(c)){o.push(c);continue}if(gD(c)){o.push(pD.fromStr(c).weekday);continue}!c.n||t.freq>X.MONTHLY?o.push(c.weekday):s.push([c.weekday,c.n])}t.byweekday=TD(o)?o:null,t.bynweekday=TD(s)?s:null}return mD(t.byhour)?hD(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq<X.HOURLY?[t.dtstart.getUTCHours()]:null,mD(t.byminute)?hD(t.byminute)&&(t.byminute=[t.byminute]):t.byminute=t.freq<X.MINUTELY?[t.dtstart.getUTCMinutes()]:null,mD(t.bysecond)?hD(t.bysecond)&&(t.bysecond=[t.bysecond]):t.bysecond=t.freq<X.SECONDLY?[t.dtstart.getUTCSeconds()]:null,{parsedOptions:t}}function pO(e){var t=e.dtstart.getTime()%1e3;if(!iO(e.freq))return[];var n=[];return e.byhour.forEach(function(r){e.byminute.forEach(function(i){e.bysecond.forEac
54h(function(e){n.push(new lO(r,i,e,t))})})}),n}function mO(e){var t=e.split(`
55`).map(gO).filter(function(e){return e!==null});return L(L({},t[0]),t[1])}function hO(e){var t={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(e);if(!n)return t;var r=n[1],i=n[2];return r&&(t.tzid=r),t.dtstart=KD(i),t}function gO(e){if(e=e.replace(/^\s+|\s+$/,``),!e.length)return null;var t=/^([A-Z]+?)[:;]/.exec(e.toUpperCase());if(!t)return _O(e);var n=t[1];switch(n.toUpperCase()){case`RRULE`:case`EXRULE`:return _O(e);case`DTSTART`:return hO(e);default:throw Error(`Unsupported RFC prop ${n} in ${e}`)}}function _O(e){var t=hO(e.replace(/^RRULE:/i,``));return e.replace(/^(?:RRULE|EXRULE):/i,``).split(`;`).forEach(function(n){var r=n.split(`=`),i=r[0],a=r[1];switch(i.toUpperCase()){case`FREQ`:t.freq=Y[a.toUpperCase()];break;case`WKST`:t.wkst=tk[a.toUpperCase()];break;case`COUNT`:case`INTERVAL`:case`BYSETPOS`:case`BYMONTH`:case`BYMONTHDAY`:case`BYYEARDAY`:case`BYWEEKNO`:case`BYHOUR`:case`BYMINUTE`:case`BYSECOND`:var o=vO(a),s=i.toLowerCase();t[s]=o;break;case`BYWEEKDAY`:case`BYDAY`:t.byweekday=bO(a);break;case`DTSTART`:case`TZID`:var c=hO(e);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case`UNTIL`:t.until=KD(a);break;case`BYEASTER`:t.byeaster=Number(a);break;default:throw Error(`Unknown RRULE property '`+i+`'`)}}),t}function vO(e){return e.indexOf(`,`)===-1?yO(e):e.split(`,`).map(yO)}function yO(e){return/^[+-]?\d+$/.test(e)?Number(e):e}function bO(e){return e.split(`,`).map(function(e){if(e.length===2)return tk[e];var t=e.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!t||t.length<3)throw SyntaxError(`Invalid weekday string: ${e}`);var n=Number(t[1]),r=tk[t[2]].weekday;return new pD(r,n)})}var xO=function(){function e(e,t){if(isNaN(e.getTime()))throw RangeError(`Invalid date passed to DateWithZone`);this.date=e,this.tzid=t}return Object.defineProperty(e.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()===`UTC`},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var e=GD(this.date.getTime(),this.isUTC);return this.isUTC?`:${e}`:`;TZID=${this.tzid}:${e}`},e.prototype.getTime=function(){return this.date.getTime()},e.prototype.rezonedDate=function(){return this.isUTC?this.date:JD(this.date,this.tzid)},e}();function SO(e){for(var t=[],n=``,r=Object.keys(e),i=Object.keys(nk),a=0;a<r.length;a++)if(r[a]!==`tzid`&&ED(i,r[a])){var o=r[a].toUpperCase(),s=e[r[a]],c=``;if(!(!mD(s)||_D(s)&&!s.length)){switch(o){case`FREQ`:c=X.FREQUENCIES[e.freq];break;case`WKST`:c=hD(s)?new pD(s).toString():s.toString();break;case`BYWEEKDAY`:o=`BYDAY`,c=yD(s).map(function(e){return e instanceof pD?e:_D(e)?new pD(e[0],e[1]):new pD(e)}).toString();break;case`DTSTART`:n=CO(s,e.tzid);break;case`UNTIL`:c=GD(s,!e.tzid);break;default:if(_D(s)){for(var l=[],u=0;u<s.length;u++)l[u]=String(s[u]);c=l.toString()}else c=String(s)}c&&t.push([o,c])}}var d=t.map(function(e){return`${e[0]}=${e[1].toString()}`}).join(`;`),f=``;return d!==``&&(f=`RRULE:${d}`),[n,f].filter(function(e){return!!e}).join(`
56`)}function CO(e,t){return e?`DTSTART`+new xO(new Date(e),t).toString():``}function wO(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every(function(e,n){return e.getTime()===t[n].getTime()}):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():e===t}var TO=function(){function e(){this.all=!1,this.before=[],this.after=[],this.between=[]}return e.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?HD(t):UD(t)),e===`all`?this.all=t:(n._value=t,this[e].push(n))},e.prototype._cacheGet=function(e,t){var n=!1,r=t?Object.keys(t):[],i=function(e){for(var n=0;n<r.length;n++){var i=r[n];if(!wO(t[i],e[i]))return!0}return!1},a=this[e];if(e===`all`)n=this.all;else if(_D(a))for(var o=0;o<a.length;o++){var s=a[o];if(!(r.length&&i(s))){n=s._value;break}}if(!n&&this.all){for(var c=new YD(e,t),o=0;o<this.all.length&&c.accept(this.all[o]);o++);n=c.getValue(),this._cacheAdd(e,n,t)}return _D(n)?UD(n):n instanceof Date?HD(n):n},e}(),EO=R(R(R(R(R(R(R(R(R(R(R(R(R([],J(1,31),!0),J(2,28),!0),J(3,31),!0),J(4,30),!0),J(5,31),!0),J(6,30),!0),J(7,31),!0),J(8,31),!0),J(9,30),!0),J(10,31),!0),J(11,30),!0),J(12,31),!0),J(1,7),!0),DO=R(R(R(R(R(R(R(R(R(R(R(R(R([],J(1,31),!0),J(2,29),!0),J(3,31),!0),J(4,30),!0),J(5,31),!0),J(6,30),!0),J(7,31),!0),J(8,31),!0),J(9,30),!0),J(10,31),!0),J(11,30),!0),J(12,31),!0),J(1,7),!0),OO=vD(1,29),kO=vD(1,30),AO=vD(1,31),jO=vD(1,32),MO=R(R(R(R(R(R(R(R(R(R(R(R(R([],jO,!0),kO,!0),jO,!0),AO,!0),jO,!0),AO,!0),jO,!0),jO,!0),AO,!0),jO,!0),AO,!0),jO,!0),jO.slice(0,7),!0),NO=R(R(R(R(R(R(R(R(R(R(R(R(R([],jO,!0),OO,!0),jO,!0),AO,!0),jO,!0),AO,!0),jO,!0),jO,!0),AO,!0),jO,!0),AO,!0),jO,!0),jO.slice(0,7),!0),PO=vD(-28,0),FO=vD(-29,0),IO=vD(-30,0),LO=vD(-31,0
56),RO=R(R(R(R(R(R(R(R(R(R(R(R(R([],LO,!0),FO,!0),LO,!0),IO,!0),LO,!0),IO,!0),LO,!0),LO,!0),IO,!0),LO,!0),IO,!0),LO,!0),LO.slice(0,7),!0),zO=R(R(R(R(R(R(R(R(R(R(R(R(R([],LO,!0),PO,!0),LO,!0),IO,!0),LO,!0),IO,!0),LO,!0),LO,!0),IO,!0),LO,!0),IO,!0),LO,!0),LO.slice(0,7),!0),BO=[0,31,60,91,121,152,182,213,244,274,305,335,366],VO=[0,31,59,90,120,151,181,212,243,273,304,334,365],HO=(function(){for(var e=[],t=0;t<55;t++)e=e.concat(vD(7));return e})();function UO(e,t){var n=DD(e,1,1),r=MD(e)?366:365,i=MD(e+1)?366:365,a=ID(n),o=zD(n),s=L(L({yearlen:r,nextyearlen:i,yearordinal:a,yearweekday:o},WO(e)),{wnomask:null});if(wD(t.byweekno))return s;s.wnomask=J(0,r+7);var c,l,u=c=SD(7-o+t.wkst,7);u>=4?(u=0,l=s.yearlen+SD(o-t.wkst,7)):l=r-u;for(var d=Math.floor(l/7),f=SD(l,7),p=Math.floor(d+f/4),m=0;m<t.byweekno.length;m++){var h=t.byweekno[m];if(h<0&&(h+=p+1),h>0&&h<=p){var g=void 0;h>1?(g=u+(h-1)*7,u!==c&&(g-=7-c)):g=u;for(var _=0;_<7&&(s.wnomask[g]=1,g++,s.wdaymask[g]!==t.wkst);_++);}}if(ED(t.byweekno,1)){var g=u+p*7;if(u!==c&&(g-=7-c),g<r)for(var m=0;m<7&&(s.wnomask[g]=1,g+=1,s.wdaymask[g]!==t.wkst);m++);}if(u){var v=void 0;if(ED(t.byweekno,-1))v=-1;else{var y=zD(DD(e-1,1,1)),b=SD(7-y.valueOf()+t.wkst,7),x=MD(e-1)?366:365,S=void 0;b>=4?(b=0,S=x+SD(y-t.wkst,7)):S=r-u,v=Math.floor(52+SD(S,7)/4)}if(ED(t.byweekno,v))for(var g=0;g<u;g++)s.wnomask[g]=1}return s}function WO(e){var t=MD(e)?366:365,n=zD(DD(e,1,1));return t===365?{mmask:EO,mdaymask:NO,nmdaymask:zO,wdaymask:HO.slice(n),mrange:VO}:{mmask:DO,mdaymask:MO,nmdaymask:RO,wdaymask:HO.slice(n),mrange:BO}}function GO(e,t,n,r,i,a){var o={lastyear:e,lastmonth:t,nwdaymask:[]},s=[];if(a.freq===X.YEARLY){if(wD(a.bymonth))s=[[0,n]];else for(var c=0;c<a.bymonth.length;c++)t=a.bymonth[c],s.push(r.slice(t-1,t+1))}else a.freq===X.MONTHLY&&(s=[r.slice(t-1,t+1)]);if(wD(s))return o;o.nwdaymask=J(0,n);for(var c=0;c<s.length;c++)for(var l=s[c],u=l[0],d=l[1]-1,f=0;f<a.bynweekday.length;f++){var p=void 0,m=a.bynweekday[f],h=m[0],g=m[1];g<0?(p=d+(g+1)*7,p-=SD(i[p]-h,7)):(p=u+(g-1)*7,p+=SD(7-i[p]+h,7)),u<=p&&p<=d&&(o.nwdaymask[p]=1)}return o}function KO(e,t){t===void 0&&(t=0);var n=e%19,r=Math.floor(e/100),i=e%100,a=Math.floor(r/4),o=r%4,s=Math.floor((r+8)/25),c=Math.floor((r-s+1)/3),l=Math.floor(19*n+r-a-c+15)%30,u=Math.floor(i/4),d=i%4,f=Math.floor(32+2*o+2*u-l-d)%7,p=Math.floor((n+11*l+22*f)/451),m=Math.floor((l+f-7*p+114)/31),h=(l+f-7*p+114)%31+1,g=Date.UTC(e,m-1,h+t);return[Math.ceil((g-Date.UTC(e,0,1))/864e5)]}var qO=function(){function e(e){this.options=e}return e.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=UO(e,n)),TD(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var r=this.yearinfo,i=r.yearlen,a=r.mrange,o=r.wdaymask;this.monthinfo=GO(e,t,i,a,o,n)}mD(n.byeaster)&&(this.eastermask=KO(e,n.byeaster))},Object.defineProperty(e.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen}
56,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),e.prototype.ydayset=function(){return[vD(this.yearlen),0,this.yearlen]},e.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],r=this.mrange[t],i=J(null,this.yearlen),a=n;a<r;a++)i[a]=a;return[i,n,r]},e.prototype.wdayset=function(e,t,n){for(var r=J(null,this.yearlen+7),i=ID(DD(e,t,n))-this.yearordinal,a=i,o=0;o<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);o++);return[r,a,i]},e.prototype.ddayset=function(e,t,n){var r=J(null,this.yearlen),i=ID(DD(e,t,n))-this.yearordinal;return r[i]=i,[r,i,i+1]},e.prototype.htimeset=function(e,t,n,r){var i=this,a=[];return this.options.byminute.forEach(function(t){a=a.concat(i.mtimeset(e,t,n,r))}),WD(a),a},e.prototype.mtimeset=function(e,t,n,r){var i=this.options.bysecond.map(function(n){return new lO(e,t,n,r)});return WD(i),i},e.prototype.stimeset=function(e,t,n,r){return[new lO(e,t,n,r)]},e.prototype.getdayset=function(e){switch(e){case Y.YEARLY:return this.ydayset.bind(this);case Y.MONTHLY:return this.mdayset.bind(this);case Y.WEEKLY:return this.wdayset.bind(this);case Y.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},e.prototype.gettimeset=function(e){switch(e){case Y.HOURLY:return this.htimeset.bind(this);case Y.MINUTELY:return this.mtimeset.bind(this);case Y.SECONDLY:return this.stimeset.bind(this)}},e}();function JO(e,t,n,r,i,a){for(var o=[],s=0;s<e.length;s++){var c=void 0,l=void 0,u=e[s];u<0?(c=Math.floor(u/t.length),l=SD(u,t.length)):(c=Math.floor((u-1)/t.length),l=SD(u-1,t.length));for(var d=[],f=n;f<r;f++){var p=a[f];mD(p)&&d.push(p)}var m=void 0;m=c<0?d.slice(c)[0]:d[c];var h=t[l],g=VD(LD(i.yearordinal+m),h);ED(o,g)||o.push(g)}return WD(o),o}function YO(e,t){var n=t.dtstart,r=t.freq,i=t.interval,a=t.until,o=t.bysetpos,s=t.count;if(s===0||i===0)return QO(e);var c=uO.fromDate(n),l=new qO(t);l.rebuild(c.year,c.month);for(var u=ek(l,c,t);;){var d=l.getdayset(r)(c.year,c.month,c.day),f=d[0],p=d[1],m=d[2],h=$O(f,p,m,l,t);if(TD(o))for(var g=JO(o,u,p,m,l,f),_=0;_<g.length;_++){var v=g[_];if(a&&v>a)return QO(e);if(v>=n){var y=ZO(v,t);if(!e.accept(y)||s&&(--s,!s))return QO(e)}}else for(var _=p;_<m;_++){var b=f[_];if(mD(b))for(var x=LD(l.yearordinal+b),S=0;S<u.length;S++){var C=u[S],v=VD(x,C);if(a&&v>a)return QO(e);if(v>=n){var y=ZO(v,t);if(!e.accept(y)||s&&(--s,!s))return QO(e)}}}if(t.interval===0||(c.add(t,h),c.year>9999))return QO(e);iO(r)||(u=l.gettimeset(r)(c.hour,c.minute,c.second,0)),l.rebuild(c.year,c.month)}}function XO(e,t,n){var r=n.bymonth,i=n.byweekno,a=n.byweekday,o=n.byeaster,s=n.bymonthday,c=n.bynmonthday,l=n.byyearday;return TD(r)&&!ED(r,e.mmask[t])||TD(i)&&!e.wnomask[t]||TD(a)&&!ED(a,e.wdaymask[t])||TD(e.nwdaymask)&&!e.nwdaymask[t]||o!==null&&!ED(e.eastermask,t)||(TD(s)||TD(c))&&!ED(s,e.mdaymask[t])&&!ED(c,e.nmdaymask[t])||TD(l)&&(t<e.yearlen&&!ED(l,t+1)&&!ED(l,-e.yearlen+t)||t>=e.yearlen&&!ED(l,t+1-e.yearlen)&&!ED(l,-e.nextyearlen+t-e.yearlen))}function ZO(e,t){return new xO(e,t.tzid).rezonedDate()}function QO(e){return e.getValue()}function $O(e,t,n,r,i){for(var a=!1,o=t;o<n;o++){var s=e[o];a=XO(r,s,i),a&&(e[s]=null)}return a}function ek(e,t,n){var r=n.freq,i=n.byhour,a=n.byminute,o=n.bysecond;return iO(r)?pO(n):r>=X.HOURLY&&TD(i)&&!ED(i,t.hour)||r>=X.MINUTELY&&TD(a)&&!ED(a,t.minute)||r>=X.SECONDLY&&TD(o)&&!ED(o,t.second)?[]:e.gettimeset(r)(t.hour,t.minute,t.second,t.millisecond)}var tk={MO:new pD(0),TU:new pD(1),WE:new pD(2),TH:new pD(3),FR:new pD(4),SA:new pD(5),SU:new pD(6)},nk={freq:Y.YEARLY,dtstart:null,interval:1,wkst:tk.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},rk=Object.keys(nk),X=function(){function e(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new TO,this.origOptions=dO(e);var n=fO(e).parsedOptions;this.options=n}return e.parseText=function(e,t){return rO(e,t)},e.fromText=function(e,t){return aO(e,t)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(e){return YO(e,this.options)},e.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},e.prototype._cacheAdd=function(e,t,n){if(this._cache)return this._cache._cacheAdd(e,t,n
56)},e.prototype.all=function(e){if(e)return this._iter(new XD(`all`,{},e));var t=this._cacheGet(`all`);return t===!1&&(t=this._iter(new YD(`all`,{})),this._cacheAdd(`all`,t)),t},e.prototype.between=function(e,t,n,r){if(n===void 0&&(n=!1),!PD(e)||!PD(t))throw Error(`Invalid date passed in to RRule.between`);var i={before:t,after:e,inc:n};if(r)return this._iter(new XD(`between`,i,r));var a=this._cacheGet(`between`,i);return a===!1&&(a=this._iter(new YD(`between`,i)),this._cacheAdd(`between`,a,i)),a},e.prototype.before=function(e,t){if(t===void 0&&(t=!1),!PD(e))throw Error(`Invalid date passed in to RRule.before`);var n={dt:e,inc:t},r=this._cacheGet(`before`,n);return r===!1&&(r=this._iter(new YD(`before`,n)),this._cacheAdd(`before`,r,n)),r},e.prototype.after=function(e,t){if(t===void 0&&(t=!1),!PD(e))throw Error(`Invalid date passed in to RRule.after`);var n={dt:e,inc:t},r=this._cacheGet(`after`,n);return r===!1&&(r=this._iter(new YD(`after`,n)),this._cacheAdd(`after`,r,n)),r},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return SO(this.origOptions)},e.prototype.toText=function(e,t,n){return sO(this,e,t,n)},e.prototype.isFullyConvertibleToText=function(){return cO(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=[`YEARLY`,`MONTHLY`,`WEEKLY`,`DAILY`,`HOURLY`,`MINUTELY`,`SECONDLY`],e.YEARLY=Y.YEARLY,e.MONTHLY=Y.MONTHLY,e.WEEKLY=Y.WEEKLY,e.DAILY=Y.DAILY,e.HOURLY=Y.HOURLY,e.MINUTELY=Y.MINUTELY,e.SECONDLY=Y.SECONDLY,e.MO=tk.MO,e.TU=tk.TU,e.WE=tk.WE,e.TH=tk.TH,e.FR=tk.FR,e.SA=tk.SA,e.SU=tk.SU,e.parseString=mO,e.optionsToString=SO,e}();function ik(e,t,n,r,i,a){var o={},s=e.accept;
56function c(e,t){n.forEach(function(n){n.between(e,t,!0).forEach(function(e){o[Number(e)]=!0})})}i.forEach(function(e){var t=new xO(e,a).rezonedDate();o[Number(t)]=!0}),e.accept=function(e){var t=Number(e);return isNaN(t)?s.call(this,e):!o[t]&&(c(new Date(t-1),new Date(t+1)),!o[t])?(o[t]=!0,s.call(this,e)):!0},e.method===`between`&&(c(e.args.after,e.args.before),e.accept=function(e){var t=Number(e);return o[t]?!0:(o[t]=!0,s.call(this,e))});for(var l=0;l<r.length;l++){var u=new xO(r[l],a).rezonedDate();if(!e.accept(new Date(u.getTime())))break}t.forEach(function(t){YO(e,t.options)});var d=e._result;switch(WD(d),e.method){case`all`:case`between`:return d;case`before`:return d.length&&d[d.length-1]||null;default:return d.length&&d[0]||null}}var ak={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function ok(e,t){var n=[],r=[],i=[],a=[],o=hO(e),s=o.dtstart,c=o.tzid;return pk(e,t.unfold).forEach(function(e){var t;if(e){var o=fk(e),s=o.name,l=o.parms,u=o.value;switch(s.toUpperCase()){case`RRULE`:if(l.length)throw Error(`unsupported RRULE parm: ${l.join(`,`)}`);n.push(mO(e));break;case`RDATE`:var d=((t=/RDATE(?:;TZID=([^:=]+))?/i.exec(e))==null?[]:t)[1];d&&!c&&(c=d),r=r.concat(hk(u,l));break;case`EXRULE`:if(l.length)throw Error(`unsupported EXRULE parm: ${l.join(`,`)}`);i.push(mO(u));break;case`EXDATE`:a=a.concat(hk(u,l));break;case`DTSTART`:break;default:throw Error(`unsupported property: `+s)}}}),{dtstart:s,tzid:c,rrulevals:n,rdatevals:r,exrulevals:i,exdatevals:a}}function sk(e,t){var n=ok(e,t),r=n.rrulevals,i=n.rdatevals,a=n.exrulevals,o=n.exdatevals,s=n.dtstart,c=n.tzid,l=t.cache===!1;if(t.compatible&&(t.forceset=!0,t.unfold=!0),t.forceset||r.length>1||i.length||a.length||o.length){var u=new _k(l);return u.dtstart(s),u.tzid(c||void 0),r.forEach(function(e){u.rrule(new X(lk(e,s,c),l))}
56),i.forEach(function(e){u.rdate(e)}),a.forEach(function(e){u.exrule(new X(lk(e,s,c),l))}),o.forEach(function(e){u.exdate(e)}),t.compatible&&t.dtstart&&u.rdate(s),u}var d=r[0]||{};return new X(lk(d,d.dtstart||t.dtstart||s,d.tzid||t.tzid||c),l)}function ck(e,t){return t===void 0&&(t={}),sk(e,uk(t))}function lk(e,t,n){return L(L({},e),{dtstart:t,tzid:n})}function uk(e){var t=[],n=Object.keys(e),r=Object.keys(ak);if(n.forEach(function(e){ED(r,e)||t.push(e)}),t.length)throw Error(`Invalid options: `+t.join(`, `));return L(L({},ak),e)}function dk(e){if(e.indexOf(`:`)===-1)return{name:`RRULE`,value:e};var t=xD(e,`:`,1);return{name:t[0],value:t[1]}}function fk(e){var t=dk(e),n=t.name,r=t.value,i=n.split(`;`);if(!i)throw Error(`empty property name`);return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}function pk(e,t){if(t===void 0&&(t=!1),e=e&&e.trim(),!e)throw Error(`Invalid empty string`);if(!t)return e.split(/\s/);for(var n=e.split(`
57`),r=0;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,``);i?r>0&&i[0]===` `?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}function mk(e){e.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw Error(`unsupported RDATE/EXDATE parm: `+e)})}function hk(e,t){return mk(t),e.split(`,`).map(function(e){return KD(e)})}function gk(e){var t=this;return function(n){if(n!==void 0&&(t[`_${e}`]=n),t[`_${e}`]!==void 0)return t[`_${e}`];for(var r=0;r<t._rrule.length;r++){var i=t._rrule[r].origOptions[e];if(i)return i}}}var _k=function(e){en(t,e);function t(t){t===void 0&&(t=!1);var n=e.call(this,{},t)||this;return n.dtstart=gk.apply(n,[`dtstart`]),n.tzid=gk.apply(n,[`tzid`]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return t.prototype._iter=function(e){return ik(e,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},t.prototype.rrule=function(e){vk(e,this._rrule)},t.prototype.exrule=function(e){vk(e,this._exrule)},t.prototype.rdate=function(e){yk(e,this._rdate)},t.prototype.exdate=function(e){yk(e,this._exdate)},t.prototype.rrules=function(){return this._rrule.map(function(e){return ck(e.toString())})},t.prototype.exrules=function(){return this._exrule.map(function(e){return ck(e.toString())})},t.prototype.rdates=function(){return this._rdate.map(function(e){return new Date(e.getTime())})},t.prototype.exdates=function(){return this._exdate.map(function(e){return new Date(e.getTime())})},t.prototype.valueOf=function(){var e=[];return!this._rrule.length&&this._dtstart&&(e=e.concat(SO({dtstart:this._dtstart}))),this._rrule.forEach(function(t){e=e.concat(t.toString().split(`
58`))}),this._exrule.forEach(function(t){e=e.concat(t.toString().split(`
59`).map(function(e){return e.replace(/^RRULE:/,`EXRULE:`)}).filter(function(e){return!/^DTSTART/.test(e)}))}),this._rdate.length&&e.push(bk(`RDATE`,this._rdate,this.tzid())),this._exdate.length&&e.push(bk(`EXDATE`,this._exdate,this.tzid())),e},t.prototype.toString=function(){return this.valueOf().join(`
60`)},t.prototype.clone=function(){var e=new t(!!this._cache);return this._rrule.forEach(function(t){return e.rrule(t.clone())}),this._exrule.forEach(function(t){return e.exrule(t.clone())}),this._rdate.forEach(function(t){return e.rdate(new Date(t.getTime()))}),this._exdate.forEach(function(t){return e.exdate(new Date(t.getTime()))}),e},t}(X);function vk(e,t){if(!(e instanceof X))throw TypeError(String(e)+` is not RRule instance`);ED(t.map(String),String(e))||t.push(e)}function yk(e,t){if(!(e instanceof Date))throw TypeError(String(e)+` is not Date instance`);ED(t.map(Number),Number(e))||(t.push(e),WD(t))}function bk(e,t,n){var r=!n||n.toUpperCase()===`UTC`;return`${r?`${e}:`:`${e};TZID=${n}:`}${t.map(function(e){return GD(e.valueOf(),r)}).join(`,`)}`}var xk=60,Sk=1440,Ck=7*Sk,wk=30*Sk,Tk=31*Sk,Ek=365*Sk,Dk=e=>e%1==0,Ok=(e,t=30)=>{let n=e/Ek,r=e/wk,i=e/Tk,a=e/Ck,o=e/Sk,s=e/xk,c=e,l=e*60;return Dk(n)?n>1?`${n} years`:`year`:Dk(i)&&t===31?i>1?`${i} months`:`month`:Dk(r)?r>1?`${r} months`:`month`:Dk(a)?a>1?`${a} weeks`:`week`:Dk(o)?o>1?`${o} days`:`day`:Dk(s)?s>1?`${s} hours`:`hour`:Dk(c)?c>1?`${c} minutes`:`minute`:l>1?`${l} seconds`:`second`},kk=e=>{switch(e.to){case`home`:return`/`;case`terms-of-service`:return`/legal/terms`;case`privacy-policy`:return`/legal/privacy`;case`support`:return`/support`;case`service`:return`/service${e.email?`?email=${e.email}`:``}`;case`pricing`:return`/pricing`;
60case`1-click-automations`:return`/prebuilt-robots`;case`1-click-automation`:return`/t/${e.slug}`;case`blog-tag`:return`/blog/tags/${Ur(e.tag)}`;case`blog-post`:return`/b/${Ur(e.postSlug)}`;case`use-cases`:return`/use-cases`;case`startups`:return`/startups`;default:throw Error("Invalid `to` parameter in `getMarketingSiteUrlPath`")}},Ak,jk=(Ak=`https://browse.ai/`)==null?void 0:Ak.replace(/\/$/,``);if(!jk)throw Error(`REACT_APP_MARKETING_SITE_URL is not set.`);var Mk=e=>`${jk}${kk(e)}`,Nk=(e,t)=>e.includes(`/workspaces/`)?e.replace(/\/workspaces\/[^/]+/,`/workspaces/${t}`):`/workspaces/${t}${e}`,Pk=[`/workspaces`,`/workspaces/`,`/`];function Fk(e,t){let n=/^(https?:|\/\/)/.test(e);return e&&!n&&!Pk.includes(e)?e:t}var Ik=()=>{let{pathname:e,search:t,hash:n}=u(),r=t?Ag.parse(t,{}):{},i=`p`in r&&r.p?r.p.toString():`/`;if(`s`in r&&r.s){if(Array.isArray(r.s))throw Error(`UNHANDLED CASE: s is an array`);let e=Ag.stringify(Ag.parse(r.s));i+=`?${e}`}`h`in r&&r.h&&(i+=`${r.h.toString()}`),i&&i.match(/^(https?|\/\/)/)&&(i=`/`);let a=[`p=${encodeURIComponent(e)}`];return t&&a.push(`s=${encodeURIComponent(t)}`),n&&a.push(`h=${encodeURIComponent(n)}`),{redirectTo:i,querystringParams:a}},Lk=()=>typeof document<`u`&&document.hasFocus(),Rk=()=>{let[e,t]=z.useState(Lk);return z.useEffect(()=>{t(Lk());let e=()=>t(!0),n=()=>t(!1);return window.addEventListener(`focus`,e),window.addEventListener(`blur`,n),()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`blur`,n)}},[]),e},zk=({fullWidth:e,value:t,...n})=>{let r=z.useRef(null),i=z.useRef(null);z.useEffect(()=>{let e=r.current,t=i.current;if(t&&e){let n=Math.max(e.offsetWidth,e.clientWidth);t.style.width=`${Math.max(n+10,100)}px`}},[t]);let a=o(`transition hover:border-gray-300 focus:border-blue-500 border border-transparent bg-transparent py-2 text-inherit indent-0.5 text-ellipsis [font-weight:inherit]`,e?`w-full`:`max-w-full`);return(0,B.jsxs)(B.Fragment,{children:[!e&&(0,B.jsx)(`div`,{ref:r,"aria-hidden":!0,className:o(a,`invisible bottom-full right-full`,`pointer-events-none absolute mt-10 inline whitespace-nowrap`),children:(t==null?void 0:t.toString().replace(/ /g,`\xA0`))||n.placeholder}),(0,B.jsx)(`input`,{...n,value:t,ref:i,className:o(a)})]})},Bk=e=>{let t=null;return e.endsWith(`@gmail.com`)&&(t=`https://mail.google.com/mail/u/0/#search/from%3A%40browse.ai+in%3Aanywhere`),t},Vk=({user:e})=>{let t=Bk(e.email),n=Je(),[r,i]=z.useState(!1),[a,{loading:o}]=Cn({onCompleted:()=>i(!0),onError:n}),s=e.enforceEmailVerification?`danger`:`warning`;return e.emailVerified?null:(0,B.jsx)(me,{title:`You haven’t verified your email address.`,intent:s,actions:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(T,{"data-test":`resend-verification-email`,variant:`secondary`,intent:s,loading:o,onClick:()=>a(),disabled:r,children:`Resend Verification Email`}),t&&(0,B.jsx)(T,{"data-test":`verify-email`,intent:s,variant:`secondary`,rightIcon:`arrow-right`,link:t,children:`Take me to the email`})]}),children:(0,B.jsx)(`div`,{children:r?`Verification email is re-sent. Please check your email.`:`Please click on the link we emailed you to verify your email.`})})},Hk=Vk,Uk=({defaultInputParameters:e,values:t})=>(0,B.jsx)(`div`,{className:`my-3 flex list-none flex-wrap gap-2 p-0 text-base text-gray-800`,children:e.map(({name:e,label:n,defaultValue:r})=>(0,B.jsx)(`div`,{children:(0,B.jsxs)(ut,{intent:`secondary`,noMarginLeft:!0,size:`sm`,children:[(0,B.jsxs)(`span`,{className:`font-medium`,children:[n,`:`]}),` `,(0,B.jsx)(`span`,{className:`break-words`,children:e in t?t[e]:r})]})},e))}),Wk=({children:e,icon:t,title:n,description:r=``})=>(0,B.jsx)(`div`,{className:`[&_svg]:!text-gray-500/60`,children:(0,B.jsxs)(`div`,{className:`text-center`,children:[t&&(0,B.jsx)(`div`,{className:`mb-2`,children:(0,B.jsx)(pe,{color:`light`,name:t,size:13})}),(0,B.jsx)(`p`,{className:`p-4 text-lg font-bold`,children:n}),(0,B.jsx)(`p`,{className:`text-md`,children:r}),e&&(0,B.jsx)(`div`,{className:`mt-6`,children:e})]})}),Gk=k(`dashboard/src/components/QueryError/QueryError.tsx`),Kk=({error:e})=>{let{logout:t}=le(),{myUserRole:n}=un(),{workspaceName:r}=Dg();z.useEffect(()=>{Gk(`error`,`Query Error`,{error:e})},[e]);let i=Rn(e),a=`If the problem persists, please contact us.`,o=`triangle-alert`,s=`An error occurred`,c=`Try reloading the page. ${a}`,l=e.message.replace(`GraphQL error: `,``),u=!0,d=!1;return i?(o=`sparkles`,s=`Please refresh to continue`,c=`A new version of Browse AI is ready. Refresh the page to keep going.`):l===`It is forbidden to access this resource.`?(o=`search`,s=`Robot not found`,c=(0,B.jsxs)(B.Fragment,{children:[`Try finding the robot on`,` `,(0,B.jsx)(Fn,{to:F({to:`robots`,workspaceName:r||`personal`}),children:`My Robots`}),`.`,(0,B.jsx)(`br`,{}),(0,B.jsx)(`br`,{}),`If you cannot find it there, the possibilities are:`,(0,B.jsx)(`br`,{}),(0,B.jsxs)(`ol`,{className:`mx-auto mt-4 max-w-xs list-decimal text-left`,children:[n===Bn.Support&&(0,B.jsx)(`li`,{className:`mb-2`,children:`As a supp
60ort user you may not be able to access workspace resources, but you can request access.`}),(0,B.jsx)(`li`,{className:`mb-2`,children:`The robot is deleted.`}),(0,B.jsx)(`li`,{className:`mb-2`,children:`You moved it to a different account and this account does not have access to it anymore.`}),(0,B.jsxs)(`li`,{className:`mb-2`,children:[`Your Chrome extension is activated using a different Browse AI account and the robot you built was saved to that account.`,(0,B.jsx)(`br`,{}),(0,B.jsx)(`br`,{}),`If you'd like to switch the account that the extension uses, click on the Chrome extension, press the Settings (gear) icon, and click on "Sign out".`]})]})]}),u=!1):l===`Network error: Failed to fetch`?(o=`wifi-off`,s=`Cannot connect to API`,c=`It may be your internet connection or maybe our API is experiencing an issue. ${a}`):l.includes(`sorry, too many clients already`)?(o=`wifi-off`,s=`API error occurred`,c=`There are too many database connections. This can be caused by a large amount of traffic on the dashboard. ${a}`):l.includes(`Not authorized`)||l.includes(`Not authenticated`)?(o=`wifi-off`,s=`You don't seem to be logged in.`,c=`Please try signing in again. Make sure you use the same login method you used when you signed up. ${a}`,d=!0):l.includes(`User not found`)?(o=`wifi-off`,s=`Account not found.`,c=`Please try signing in again. Make sure you use the same login method you used when you signed up. ${a}`,d=!0):Gk(`error`,`API error occurred`,{error:e}),(0,B.jsx)(jn,{children:(0,B.jsx)(`div`,{className:`my-10`,children:(0,B.jsx)(Wk,{icon:o,title:s,description:c?(0,B.jsxs)(B.Fragment,{children:[c,u&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(xn,{}),(0,B.jsxs)(`div`,{children:[d?(0,B.jsx)(T,{variant:`primary`,onClick:()=>{t(`${F({to:`logout`})}?done=1`)},"data-test":`sign-in-again`,children:`Sign in again`}):(0,B.jsx)(T,{variant:`primary`,onClick:()=>window.location&&window.location.reload(),"data-test":`reload-page`,children:i?`Refresh the page`:`Reload the page`}),(0,B.jsx)(xn,{inlineInSm:!0}),(0,B.jsx)(T,{variant:`secondary`,onClick:()=>{St.showNewMessage(`Hi BrowseAI Support!
61I've encountered an error on the dashboard page: ${window.location.href}
62
63Error message: "${l}"
64
65Additional details:
66${JSON.stringify(e,null,2)}
67
68Could you please look into this? Thanks in advance!`)},"data-test":`contact-support`,children:`Contact Support`})]})]})]}):void 0})})})},qk=e(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),Jk=e(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Yk=e(((e,t)=>{var n=xe(),r=qk(),i=Jk();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),Xk=e(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),Zk=e(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),Qk=e(((e,t)=>{var n=Yk(),r=Xk(),i=Zk(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),$k=e(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),eA=e(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),tA=e(((e,t)=>{var n=Ve(),r=We(),i=it(),a=Qk(),o=$k(),s=eA(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;
68if(E||(E=s),e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),nA=e(((e,t)=>{var n=tt(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||(_=p==`constructor`)}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),rA=e(((e,t)=>{var n=Ce(),r=Qk(),i=tA(),a=nA(),o=ct(),s=Ne(),c=pt(),l=ot(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||(v=new n),y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||(v=new n),_(O,k,h,g,v)}}return T?(v||(v=new n),a(e,t,h,g,_,v)):!1}t.exports=h})),iA=e(((e,t)=>{var n=rA(),r=Te();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),aA=e(((e,t)=>{var n=iA();function r(e,t){return n(e,t)}t.exports=r}));Object.freeze({status:`aborted`});function Z(e,t,n){var r;function i(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=s.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let a=(r=n==null?void 0:n.Parent)==null?Object:r;class o extends a{}Object.defineProperty(o,"name",{value:e});function s(e){var t;let r=n!=null&&n.Parent?new o:this;i(r,e),(t=r._zod).deferred!=null||(t.deferred=[]);for(let e of r._zod.deferred)e();return r}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>{var r;return n!=null&&n.Parent&&t instanceof n.Parent?!0:t==null||(r=t._zod)==null||(r=r.traits)==null?void 0:r.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var oA=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},sA=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},cA={};function lA(e){return e&&Object.assign(cA,e),cA}function uA(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function dA(e,t){return typeof t==`bigint`?t.toString():t}function fA(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function pA(e){return e==null}function mA(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function hA(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e!=null&&e[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var gA=Symbol(`evaluating`);function Q(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==gA)return r===void 0&&(r=gA,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function _A(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function vA(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function yA(e){return JSON.stringify(e)}function bA(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var xA=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function SA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var CA=fA(()=>{var e;if(typeof navigator<`u`&&(e=navigator)!=null&&(e=e.userAgent)!=null&&e.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function wA(e){if(SA(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return SA(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function TA(e){return wA(e)?{...e}:Array.isArray(e)?[...e]:e}var EA=new Set([`string`,`number`,`symbol`]);function DA(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function OA(e,t,n){let r=new e._zod.constr(t==null?e._zod.def:t);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function $(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function kA(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var AA={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function jA(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return OA(e,vA(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return _A(this,`shape`,e),e},checks:[]}))}function MA(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return OA(e,vA(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return _A(this,`shape`,r),r},checks:[]}))}function NA(e,t){if(!wA(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot over
68write keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return OA(e,vA(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return _A(this,`shape`,n),n}}))}function PA(e,t){if(!wA(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return OA(e,vA(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return _A(this,`shape`,n),n}}))}function FA(e,t){return OA(e,vA(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return _A(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function IA(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return OA(t,vA(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return _A(this,`shape`,i),i},checks:[]}))}function LA(e,t,n){return OA(t,vA(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return _A(this,`shape`,i),i}}))}function RA(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++){var n;if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0}return!1}function zA(e,t){return t.map(t=>{var n;return(n=t).path!=null||(n.path=[]),t.path.unshift(e),t})}function BA(e){return typeof e==`string`?e:e==null?void 0:e.message}function VA(e,t,n){var r;let i={...e,path:(r=e.path)==null?[]:r};if(!e.message){var a,o,s,c,l,u,d,f,p;i.message=(a=(o=(s=(c=BA((l=e.inst)==null||(l=l._zod.def)==null||(u=l.error)==null?void 0:u.call(l,e)))==null?BA(t==null||(d=t.error)==null?void 0:d.call(t,e)):c)==null?BA((f=n.customError)==null?void 0:f.call(n,e)):s)==null?BA((p=n.localeError)==null?void 0:p.call(n,e)):o)==null?`Invalid input`:a}return delete i.inst,delete i.continue,t!=null&&t.reportInput||delete i.input,i}function HA(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function UA(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var WA=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,dA,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},GA=Z(`$ZodError`,WA),KA=Z(`$ZodError`,WA,{Parent:Error});function qA(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function JA(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var YA=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new oA;if(o.issues.length){var s;let t=new((s=i==null?void 0:i.Err)==null?e:s)(o.issues.map(e=>VA(e,a,lA())));throw xA(t,i==null?void 0:i.callee),t}return o.value},XA=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){var s;let t=new((s=i==null?void 0:i.Err)==null?e:s)(o.issues.map(e=>VA(e,a,lA())));throw xA(t,i==null?void 0:i.callee),t}return o.value},ZA=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new oA;
vendor: 13,598 bytes, lines 68-70
68return a.issues.length?{success:!1,error:new(e==null?GA:e)(a.issues.map(e=>VA(e,i,lA())))}:{success:!0,data:a.value}},QA=ZA(KA),$A=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>VA(e,i,lA())))}:{success:!0,data:a.value}},ej=$A(KA),tj=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return YA(e)(t,n,i)},nj=e=>(t,n,r)=>YA(e)(t,n,r),rj=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return XA(e)(t,n,i)},ij=e=>async(t,n,r)=>XA(e)(t,n,r),aj=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ZA(e)(t,n,i)},oj=e=>(t,n,r)=>ZA(e)(t,n,r),sj=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return $A(e)(t,n,i)},cj=e=>async(t,n,r)=>$A(e)(t,n,r),lj=/^[cC][^\s-]{8,}$/,uj=/^[0-9a-z]+$/,dj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fj=/^[0-9a-vA-V]{20}$/,pj=/^[A-Za-z0-9]{27}$/,mj=/^[a-zA-Z0-9_-]{21}$/,hj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gj=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_j=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,vj=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yj=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function bj(){return new RegExp(yj,`u`)}var xj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sj=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Cj=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,wj=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Tj=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ej=/^[A-Za-z0-9_-]*$/,Dj=/^\+[1-9]\d{6,14}$/,Oj=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,kj=RegExp(`^${Oj}$`);function Aj(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function jj(e){return RegExp(`^${Aj(e)}$`)}function Mj(e){let t=Aj({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Oj}T(?:${r})$`)}var Nj=e=>{var t,n;let r=e?`[\\s\\S]{${(t=e==null?void 0:e.minimum)==null?0:t},${(n=e==null?void 0:e.maximum)==null?``:n}}`:`[\\s\\S]*`;return RegExp(`^${r}$`)},Pj=/^-?\d+$/,Fj=/^-?\d+(?:\.\d+)?$/,Ij=/^[^A-Z]*$/,Lj=/^[^a-z]*$/,Rj=Z(`$ZodCheck`,(e,t)=>{var n;e._zod!=null||(e._zod={}),e._zod.def=t,(n=e._zod).onattach!=null||(n.onattach=[])}),zj={number:`number`,bigint:`bigint`,object:`date`},Bj=Z(`$ZodCheckLessThan`,(e,t)=>{Rj.init(e,t);let n=zj[typeof t.value];e._zod.onattach.push(e=>{var n;let r=e._zod.bag,i=(n=t.inclusive?r.maximum:r.exclusiveMaximum)==null?1/0:n;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vj=Z(`$ZodCheckGreaterThan`,(e,t)=>{Rj.init(e,t);let n=zj[typeof t.value];e._zod.onattach.push(e=>{var n;let r=e._zod.bag,i=(n=t.inclusive?r.minimum:r.exclusiveMinimum)==null?-1/0:n;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hj=Z(`$ZodCheckMultipleOf`,(e,t)=>{Rj.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf!=null||(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):hA(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Uj=Z(`$ZodCheckNumberFormat`,(e,t)=>{var n;Rj.init(e,t),t.format=t.format||`float64`;let r=(n=t.format)==null?void 0:n.includes(`int`),i=r?`int`:`number`,[a,o]=AA[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=a,n.maximum=o,r&&(n.pattern=Pj)}),e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s)){n.issues.push({expected:i,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?n.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:i,inclusive:!0,continue:!t.abort}):n.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<a&&n.issues.push({origin:`number`,input:s,code:`too_small`,minimum:a,inclusive:!0,inst:e,continue:!t.abort}),s>o&&n.issues.push({origin:`number`,input:s,code:`too_big`,maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Wj=Z(`$ZodCheckMaxLength`,(e,t)=>{var n;Rj.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!pA(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{var n;let r=(n=e._zod.bag.maximum)==null?1/0:n;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=HA(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Gj=Z(`$ZodCheckMinLength`,(e,t)=>{var n;Rj.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!pA(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{var n;let r=(n=e._zod.bag.minimum)==null?-1/0:n;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=HA(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Kj=Z(`$ZodCheckLengthEquals`,(e,t)=>{var n;Rj.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!pA(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=HA(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),qj=Z(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Rj.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns!=null||(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check!=null||(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check!=null||(r.check=()=>{})}),Jj=Z(`$ZodCheckRegex`,(e,t)=>{qj.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Yj=Z(`$ZodCheckLowerCase`,(e,t)=>{t.pattern!=null||(t.pattern=Ij),qj.init(e,t)}),Xj=Z(`$ZodCheckUpperCase`,(e,t)=>{t.pattern!=null||(t.pattern=Lj),qj.init(e,t)}),Zj=Z(`$ZodCheckIncludes`,(e,t)=>{Rj.init(e,t);let n=DA(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns!=null||(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Qj=Z(`$ZodCheckStartsWith`,(e,t)=>{Rj.init(e,t);let n=RegExp(`^${DA(t.prefix)}.*`);t.pattern!=null||(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns!=null||(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),$j=Z(`$ZodCheckEndsWith`,(e,t)=>{Rj.init(e,t);let n=RegExp(`.*${DA(t.suffix)}$`);t.pattern!=null||(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns!=null||(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),eM=Z(`$ZodCheckOverwrite`,(e,t)=>{Rj.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),tM=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
69`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){var e,t,n;let r=Function,i=(e=this)==null?void 0:e.args,a=[...((t=(n=this)==null?void 0:n.content)==null?[``]:t).map(e=>`  ${e}`)];return new r(...i,a.join(`
70`))}},nM={major:4,minor:3,patch:5},rM=Z(`$ZodType`,(e,t)=>{var n,r;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nM;let i=[...(n=e._zod.def.checks)==null?[]:n];e._zod.traits.has(`$ZodCheck`)&&i.unshift(e);for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0){var a;(r=e._zod).deferred!=null||(r.deferred=[]),(a=e._zod.deferred)==null||a.push(()=>{e._zod.run=e._zod.parse})}else{let t=(e,t,n)=>{let r=RA(e),i;for(let o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&(n==null?void 0:n.async)===!1)throw new oA;if(i||s instanceof Promise){var a;i=((a=i)==null?Promise.resolve():a).then(async()=>{await s,e.issues.length!==t&&(r||(r=RA(e,t)))})}else{if(e.issues.length===t)continue;r||(r=RA(e,t))}}return i?i.then(()=>e):e},n=(n,r,a)=>{if(RA(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new oA;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new oA;return o.then(e=>t(e,i,a))}return t(o,i,a)}}Q(e,`~standard`,()=>({validate:t=>{try{var n;let r=QA(e,t);return r.success?{value:r.data}:{issues:(n=r.error)==null?void 0:n.issues}}catch{return ej(e,t).then(e=>{var t;return e.success?{value:e.data}:{issues:(t=e.error)==null?void 0:t.issues}})}},vendor:`zod`,version:1}))}),iM=Z(`$ZodString`,(e,t)=>{var n,r,i;rM.init(e,t),e._zod.pattern=(n=[...(r=e==null||(i=e._zod.bag)==null?void 0:i.patterns)==null?[]:r].pop())==null?Nj(e._zod.bag):n,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),aM=Z(`$ZodStringFormat`,(e,t)=>{qj.init(e,t),iM.init(e,t)}),oM=Z(`$ZodGUID`,(e,t)=>{t.pattern!=null||(t.pattern=gj),aM.init(e,t)}),sM=Z(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern!=null||(t.pattern=_j(e))}else t.pattern!=null||(t.pattern=_j());aM.init(e,t)}),cM=Z(`$ZodEmail`,(e,t)=>{t.pattern!=null||(t.pattern=vj),aM.init(e,t)}),lM=Z(`$ZodURL`,(e,t)=>{aM.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),uM=Z(`$ZodEmoji`,(e,t)=>{t.pattern!=null||(t.pattern=bj()),aM.init(e,t)}),dM=Z(`$ZodNanoID`,(e,t)=>
70{t.pattern!=null||(t.pattern=mj),aM.init(e,t)}),fM=Z(`$ZodCUID`,(e,t)=>{t.pattern!=null||(t.pattern=lj),aM.init(e,t)}),pM=Z(`$ZodCUID2`,(e,t)=>{t.pattern!=null||(t.pattern=uj),aM.init(e,t)}),mM=Z(`$ZodULID`,(e,t)=>{t.pattern!=null||(t.pattern=dj),aM.init(e,t)}),hM=Z(`$ZodXID`,(e,t)=>{t.pattern!=null||(t.pattern=fj),aM.init(e,t)}),gM=Z(`$ZodKSUID`,(e,t)=>{t.pattern!=null||(t.pattern=pj),aM.init(e,t)}),_M=Z(`$ZodISODateTime`,(e,t)=>{t.pattern!=null||(t.pattern=Mj(t)),aM.init(e,t)}),vM=Z(`$ZodISODate`,(e,t)=>{t.pattern!=null||(t.pattern=kj),aM.init(e,t)}),yM=Z(`$ZodISOTime`,(e,t)=>{t.pattern!=null||(t.pattern=jj(t)),aM.init(e,t)}),bM=Z(`$ZodISODuration`,(e,t)=>{t.pattern!=null||(t.pattern=hj),aM.init(e,t)}),xM=Z(`$ZodIPv4`,(e,t)=>{t.pattern!=null||(t.pattern=xj),aM.init(e,t),e._zod.bag.format=`ipv4`}),SM=Z(`$ZodIPv6`,(e,t)=>{t.pattern!=null||(t.pattern=Sj),aM.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),CM=Z(`$ZodCIDRv4`,(e,t)=>{t.pattern!=null||(t.pattern=Cj),aM.init(e,t)}),wM=Z(`$ZodCIDRv6`,(e,t)=>{t.pattern!=null||(t.pattern=wj),aM.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function TM(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var EM=Z(`$ZodBase64`,(e,t)=>{t.pattern!=null||(t.pattern=Tj),aM.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{TM(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function DM(e){if(!Ej.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return TM(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var OM=Z(`$ZodBase64URL`,(e,t)=>{t.pattern!=null||(t.pattern=Ej),aM.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{DM(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),kM=Z(`$ZodE164`,(e,t)=>{t.pattern!=null||(t.pattern=Dj),aM.init(e,t)});function AM(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&(i==null?void 0:i.typ)!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var jM=Z(`$ZodJWT`,(e,t)=>{aM.init(e,t),e._zod.check=n=>{AM(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),MM=Z(`$ZodNumber`,(e,t)=>{var n;rM.init(e,t),e._zod.pattern=(n=e._zod.bag.pattern)==null?Fj:n,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),NM=Z(`$ZodNumberFormat`,(e,t)=>{Uj.init(e,t),MM.init(e,t)}),PM=Z(`$ZodUnknown`,(e,t)=>{rM.init(e,t),e._zod.parse=e=>e}),FM=Z(`$ZodNever`,(e,t)=>{rM.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function IM(e,t,n){e.issues.length&&t.issues.push(...zA(n,e.issues)),t.value[n]=e.value}var LM=Z(`$ZodArray`,(e,t)=>{rM.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>IM(t,n,e))):IM(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function RM(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...zA(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function zM(e){let t=Object.keys(e.shape);for(let r of t){var n;if(!((n=e.shape)!=null&&(n=n[r])!=null&&(n=n._zod)!=null&&(n=n.traits)!=null&&n.has(`$ZodType`)))throw Error(`Invalid element at key "${r}": expected a Zod schema`)}let r=kA(e.shape);
vendor: 12,845 bytes, lines 70-104
70return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function BM(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>RM(e,n,i,t,u))):RM(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var VM=Z(`$ZodObject`,(e,t)=>{rM.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`);if(!(n!=null&&n.get)){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let r=fA(()=>zM(t));Q(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]!=null||(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let i=SA,a=t.catchall,o;e._zod.parse=(t,n)=>{o!=null||(o=r.value);let s=t.value;if(!i(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=o.shape;for(let e of o.keys){let r=l[e],i=r._zod.optout===`optional`,a=r._zod.run({value:s[e],issues:[]},n);a instanceof Promise?c.push(a.then(n=>RM(n,t,e,s,i))):RM(a,t,e,s,i)}return a?BM(c,s,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),HM=Z(`$ZodObjectJIT`,(e,t)=>{VM.init(e,t);let n=e._zod.parse,r=fA(()=>zM(t)),i=e=>{let t=new tM([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=yA(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){var s;let n=a[r],o=yA(r),c=e[r],l=(c==null||(s=c._zod)==null?void 0:s.optout)===`optional`;t.write(`const ${n} = ${i(r)};`),l?t.write(`
71        if (${n}.issues.length) {
72          if (${o} in input) {
73            payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
74              ...iss,
75              path: iss.path ? [${o}, ...iss.path] : [${o}]
76            })));
77          }
78        }
79        
80        if (${n}.value === undefined) {
81          if (${o} in input) {
82            newResult[${o}] = undefined;
83          }
84        } else {
85          newResult[${o}] = ${n}.value;
86        }
87        
88      `):t.write(`
89        if (${n}.issues.length) {
90          payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
91            ...iss,
92            path: iss.path ? [${o}, ...iss.path] : [${o}]
93          })));
94        }
95        
96        if (${n}.value === undefined) {
97          if (${o} in input) {
98            newResult[${o}] = undefined;
99          }
100        } else {
101          newResult[${o}] = ${n}.value;
102        }
103        
104      `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let c=t.compile();return(t,n)=>c(e,t,n)},a,o=SA,s=!cA.jitless,c=s&&CA.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u!=null||(u=r.value);let p=d.value;return o(p)?s&&c&&(f==null?void 0:f.async)===!1&&f.jitless!==!0?(a||(a=i(t.shape)),d=a(d,f),l?BM([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function UM(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!RA(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>VA(e,r,lA())))}),t)}var WM=Z(`$ZodUnion`,(e,t)=>{rM.init(e,t),Q(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Q(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Q(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Q(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>mA(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>UM(t,i,e,a)):UM(s,i,e,a)}}),GM=Z(`$ZodIntersection`,(e,t)=>{rM.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>qM(e,t,n)):qM(e,i,a)}});function KM(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(wA(e)&&wA(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=KM(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=KM(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qM(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i!=null||(i=n);for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),RA(e))return e;let o=KM(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var JM=Z(`$ZodEnum`,(e,t)=>{rM.init(e,t);let n=uA(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>EA.has(typeof e)).map(e=>typeof e==`string`?DA(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),YM=Z(`$ZodTransform`,(e,t)=>{rM.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new sA(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new oA;return n.value=i,n}});function XM(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var ZM=Z(`$ZodOptional`,(e,t)=>{rM.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Q(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Q(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${mA(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>XM(t,e.value)):XM(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),QM=Z(`$ZodExactOptional`,(e,t)=>{ZM.init(e,t),Q(e._zod,`values`,()=>t.innerType._zod.values),Q(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),$M=Z(`$ZodNullable`,(e,t)=>{rM.init(e,t),Q(e._zod,`optin`,()=>t.innerType._zod.optin),Q(e._zod,`optout`,()=>t.innerType._zod.optout),Q(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${mA(e.source)}|null)$`):void 0}),Q(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),eN=Z(`$ZodDefault`,(e,t)=>{rM.init(e,t),e._zod.optin=`optional`,Q(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>tN(e,t)):tN(r,t)}});function tN(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var nN=Z(`$ZodPrefault`,(e,t)=>{rM.init(e,t),e._zod.optin=`optional`,Q(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),rN=Z(`$ZodNonOptional`,(e,t)=>{rM.init(e,t),Q(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>iN(t,e)):iN(i,e)}});function iN(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var aN=Z(`$ZodCatch`,(e,t)=>{rM.init(e,t),Q(e._zod,`optin`,()=>t.innerType._zod.optin),Q(e._zod,`optout`,()=>t.innerType._zod.optout),Q(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>VA(e,n,lA()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>VA(e,n,lA()))},input:e.value}),e.issues=[]),e)}}),oN=Z(`$ZodPipe`,(e,t)=>{rM.init(e,t),Q(e._zod,`values`,()=>t.in._zod.values),Q(e._zod,`optin`,()=>t.in._zod.optin),Q(e._zod,`optout`,()=>t.out._zod.optout),Q(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>sN(e,t.in,n)):sN(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>sN(e,t.out,n)):sN(r,t.out,n)}});function sN(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var cN=Z(`$ZodReadonly`,(e,t)=>{rM.init(e,t),Q(e._zod,`propValues`,()=>t.innerType._zod.propValues),Q(e._zod,`values`,()=>t.innerType._zod.values),Q(e._zod,`optin`,()=>{var e;return(e=t.innerType)==null||(e=e._zod)==null?void 0:e.optin}),Q(e._zod,`optout`,()=>{var e;return(e=t.innerType)==null||(e=e._zod)==null?void 0:e.optout}),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(lN):lN(r)}});function lN(e){return e.value=Object.freeze(e.value),e}var uN=Z(`$ZodCustom`,(e,t)=>{Rj.init(e,t),rM.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>dN(t,n,r,e));dN(i,n,r,e)}});function dN(e,t,n,r){if(!e){var i;let e={code:`custom`,input:n,inst:r,path:[...(i=r._zod.def.path)==null?[]:i],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(UA(e))}}var fN,pN=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){var n;let r={...(n=this.get(t))==null?{}:n};delete r.id;let i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function mN(){return new pN}(fN=globalThis).__zod_globalRegistry!=null||(fN.__zod_globalRegistry=mN());var hN=globalThis.__zod_globalRegistry;function gN(e,t){return new e({type:`string`,...$(t)})}function _N(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...$(t)})}function vN(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...$(t)})}function yN(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...$(t)})}function bN(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...$(t)})}function xN(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...$(t)})}function SN(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...$(t)})}function CN(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...$(t)})}function wN(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...$(t)})}function TN(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...$(t)})}function EN(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...$(t)})}function DN(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...$(t)})}function ON(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...$(t)})}function kN(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...$(t)})}
104function AN(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...$(t)})}function jN(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...$(t)})}function MN(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...$(t)})}function NN(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...$(t)})}function PN(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...$(t)})}function FN(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...$(t)})}function IN(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...$(t)})}function LN(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...$(t)})}function RN(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...$(t)})}function zN(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...$(t)})}function BN(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...$(t)})}function VN(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...$(t)})}function HN(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...$(t)})}function UN(e,t){return new e({type:`number`,checks:[],...$(t)})}function WN(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...$(t)})}function GN(e){return new e({type:`unknown`})}function KN(e,t){return new e({type:`never`,...$(t)})}function qN(e,t){return new Bj({check:`less_than`,...$(t),value:e,inclusive:!1})}function JN(e,t){return new Bj({check:`less_than`,...$(t),value:e,inclusive:!0})}function YN(e,t){return new Vj({check:`greater_than`,...$(t),value:e,inclusive:!1})}function XN(e,t){return new Vj({check:`greater_than`,...$(t),value:e,inclusive:!0})}function ZN(e,t){return new Hj({check:`multiple_of`,...$(t),value:e})}function QN(e,t){return new Wj({check:`max_length`,...$(t),maximum:e})}function $N(e,t){return new Gj({check:`min_length`,...$(t),minimum:e})}function eP(e,t){return new Kj({check:`length_equals`,...$(t),length:e})}function tP(e,t){return new Jj({check:`string_format`,format:`regex`,...$(t),pattern:e})}function nP(e){return new Yj({check:`string_format`,format:`lowercase`,...$(e)})}function rP(e){return new Xj({check:`string_format`,format:`uppercase`,...$(e)})}function iP(e,t){return new Zj({check:`string_format`,format:`includes`,...$(t),includes:e})}function aP(e,t){return new Qj({check:`string_format`,format:`starts_with`,...$(t),prefix:e})}function oP(e,t){return new $j({check:`string_format`,format:`ends_with`,...$(t),suffix:e})}function sP(e){return new eM({check:`overwrite`,tx:e})}function cP(e){return sP(t=>t.normalize(e))}function lP(){return sP(e=>e.trim())}function uP(){return sP(e=>e.toLowerCase())}function dP(){return sP(e=>e.toUpperCase())}function fP(){return sP(e=>bA(e))}function pP(e,t,n){return new e({type:`array`,element:t,...$(n)})}function mP(e,t,n){let r=$(n);return r.abort!=null||(r.abort=!0),new e({type:`custom`,check:`custom`,fn:t,...r})}function hP(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...$(n)})}function gP(e){let t=_P(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(UA(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code!=null||(r.code=`custom`),r.input!=null||(r.input=n.value),r.inst!=null||(r.inst=t),r.continue!=null||(r.continue=!t._zod.def.abort),n.issues.push(UA(r))}},e(n.value,n)));return t}function _P(e,t){let n=new Rj({check:`custom`,...$(t)});return n._zod.check=e,n}function vP(e){var t,n,r,i,a,o,s,c,l;let u=(t=e==null?void 0:e.target)==null?`draft-2020-12`:t;return u===`draft-4`&&(u=`draft-04`),u===`draft-7`&&(u=`draft-07`),{processors:(n=e.processors)==null?{}:n,metadataRegistry:(r=e==null?void 0:e.metadata)==null?hN:r,target:u,unrepresentable:(i=e==null?void 0:e.unrepresentable)==null?`throw`:i,override:(a=e==null?void 0:e.override)==null?(()=>{}):a,io:(o=e==null?void 0:e.io)==null?`output`:o,counter:0,seen:new Map,cycles:(s=e==null?void 0:e.cycles)==null?`ref`:s,reused:(c=e==null?void 0:e.reused)==null?`inline`:c,external:(l=e==null?void 0:e.external)==null?void 0:l}}function yP(e,t,n={path:[],schemaPath:[]}){var r,i,a;let o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;let c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);let l=(r=(i=e._zod).toJSONSchema)==null?void 0:r.call(i);if(l)c.schema=l;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,r);else{let n=c.schema,i=t.processors[o.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}let i=e._zod.parent;i&&(c.ref||(c.ref=i),yP(i,t,r),t.seen.get(i).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(c.schema,u),t.io===`input`&&SP(e)&&(delete c.schema.examples,delete c.schema.default),t.io===`input`&&c.schema._prefault&&((a=c.schema).default!=null||(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function bP(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){var i;let n=(i=e.metadataRegistry.get(t[0]))==null?void 0:i.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let a=t=>{var r;
vendor: 4,769 bytes, lines 104-106
104let i=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){var a,o,s,c;let n=(a=e.external.registry.get(t[0]))==null?void 0:a.id,r=(o=e.external.uri)==null?(e=>e):o;if(n)return{ref:r(n)};let l=(s=(c=t[1].defId)==null?t[1].schema.id:c)==null?`schema${e.counter++}`:s;return t[1].defId=l,{defId:l,ref:`${r(`__shared`)}#/${i}/${l}`}}if(t[1]===n)return{ref:`#`};let l=`#/${i}/`,u=(r=t[1].schema.id)==null?`__schema${e.counter++}`:r;return{defId:u,ref:l+u}},o=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=a(e);t.def={...t.schema},r&&(t.defId=r);let i=t.schema;for(let e in i)delete i[e];i.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle){var s;throw Error(`Cycle detected: #/${(s=e.cycle)==null?void 0:s.join(`/`)}/<root>
105
106Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}}for(let n of e.seen.entries()){var c;let r=n[1];if(t===n[0]){o(n);continue}if(e.external){var l;let r=(l=e.external.registry.get(n[0]))==null?void 0:l.id;if(t!==n[0]&&r){o(n);continue}}if((c=e.metadataRegistry.get(n[0]))!=null&&c.id){o(n);continue}if(r.cycle){o(n);continue}if(r.count>1&&e.reused===`ref`){o(n);continue}}}function xP(e,t){var n,r,i,a;let o=e.seen.get(t);if(!o)throw Error(`Unprocessed schema. This is a bug in Zod.`);let s=t=>{var n,r;let i=e.seen.get(t);if(i.ref===null)return;let a=(n=i.def)==null?i.schema:n,o={...a},c=i.ref;if(i.ref=null,c){s(c);let n=e.seen.get(c),r=n.schema;if(r.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)){var l;a.allOf=(l=a.allOf)==null?[]:l,a.allOf.push(r)}else Object.assign(a,r);if(Object.assign(a,o),t._zod.parent===c)for(let e in a)e!==`$ref`&&e!==`allOf`&&(e in o||delete a[e]);if(r.$ref)for(let e in a)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(a[e])===JSON.stringify(n.def[e])&&delete a[e]}let u=t._zod.parent;if(u&&u!==c){s(u);let t=e.seen.get(u);if(t!=null&&t.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(let e in a)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:(r=i.path)==null?[]:r})};for(let t of[...e.seen.entries()].reverse())s(t[0]);let c={};if(e.target===`draft-2020-12`?c.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?c.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?c.$schema=`http://json-schema.org/draft-04/schema#`:e.target,(n=e.external)!=null&&n.uri){var l;let n=(l=e.external.registry.get(t))==null?void 0:l.id;if(!n)throw Error("Schema is missing an `id` property");c.$id=e.external.uri(n)}Object.assign(c,(r=o.def)==null?o.schema:r);let u=(i=(a=e.external)==null?void 0:a.defs)==null?{}:i;for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(u[e.defId]=e.def)}e.external||Object.keys(u).length>0&&(e.target===`draft-2020-12`?c.$defs=u:c.definitions=u);try{let n=JSON.parse(JSON.stringify(c));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:wP(t,`input`,e.processors),output:wP(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function SP(e,t){let n=t==null?{seen:new Set}:t;if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return SP(r.element,n);if(r.type===`set`)return SP(r.valueType,n);if(r.type===`lazy`)return SP(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return SP(r.innerType,n);if(r.type===`intersection`)return SP(r.left,n)||SP(r.right,n);if(r.type===`record`||r.type===`map`)return SP(r.keyType,n)||SP(r.valueType,n);if(r.type===`pipe`)return SP(r.in,n)||SP(r.out,n);if(r.type===`object`){for(let e in r.shape)if(SP(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(SP(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(SP(e,n))return!0;return!!(r.rest&&SP(r.rest,n))}return!1}var CP=(e,t={})=>n=>{let r=vP({...n,processors:t});return yP(e,r),bP(r,e),xP(r,e)},wP=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r==null?{}:r,o=vP({...i==null?{}:i,target:a,io:t,processors:n});return yP(e,o),bP(o,e),xP(o,e)},TP={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},EP=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s){var u;i.format=(u=TP[s])==null?s:u,i.format===``&&delete i.format,s===`time`&&delete i.format}if(l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>
106({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},DP=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},OP=(e,t,n,r)=>{n.not={}},kP=(e,t,n,r)=>{let i=e._zod.def,a=uA(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},AP=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},jP=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},MP=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=yP(a.element,t,{...r,path:[...r.path,`items`]})},NP=(e,t,n,r)=>{var i;let a=n,o=e._zod.def;a.type=`object`,a.properties={};let s=o.shape;for(let e in s)a.properties[e]=yP(s[e],t,{...r,path:[...r.path,`properties`,e]});let c=new Set(Object.keys(s)),l=new Set([...c].filter(e=>{let n=o.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));l.size>0&&(a.required=Array.from(l)),((i=o.catchall)==null?void 0:i._zod.def.type)===`never`?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=yP(o.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(a.additionalProperties=!1)},PP=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>yP(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},FP=(e,t,n,r)=>{let i=e._zod.def,a=yP(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=yP(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},IP=(e,t,n,r)=>{let i=e._zod.def,a=yP(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},LP=(e,t,n,r)=>{let i=e._zod.def;yP(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},RP=(e,t,n,r)=>{let i=e._zod.def;yP(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},zP=(e,t,n,r)=>{let i=e._zod.def;yP(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},BP=(e,t,n,r)=>{let i=e._zod.def;yP(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},VP=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;yP(a,t,r);let o=t.seen.get(e);o.ref=a},HP=(e,t,n,r)=>{let i=e._zod.def;yP(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},UP=(e,t,n,r)=>{let i=e._zod.def;yP(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},WP=Z(`ZodISODateTime`,(e,t)=>{_M.init(e,t),gF.init(e,t)});function GP(e){return zN(WP,e)}var KP=Z(`ZodISODate`,(e,t)=>{vM.init(e,t),gF.init(e,t)});function qP(e){return BN(KP,e)}var JP=Z(`ZodISOTime`,(e,t)=>{yM.init(e,t),gF.init(e,t)});function YP(e){return VN(JP,e)}var XP=Z(`ZodISODuration`,(e,t)=>{bM.init(e,t),gF.init(e,t)});function ZP(e){return HN(XP,e)}var QP=(e,t)=>{GA.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>JA(e,t)},flatten:{value:t=>qA(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,dA,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,dA,2)}},isEmpty:{get(){return e.issues.length===0}}})};Z(`ZodError`,QP);var $P=Z(`ZodError`,QP,{Parent:Error}),eF=YA($P),tF=XA($P),nF=ZA($P),rF=$A($P),iF=tj($P),aF=nj($P),oF=rj($P),sF=ij($P),cF=aj($P),lF=oj($P),uF=sj($P),dF=cj($P),fF=Z(`ZodType`,(e,t)=>(rM.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:wP(e,`input`),output:wP(e,`output`)}}),e.toJSONSchema=CP(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>{var r;return e.clone(vA(t,{checks:[...(r=t.checks)==null?[]:r,...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},e.with=e.check,e.clone=(t,n)=>OA(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>eF(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>nF(e,t,n),e.parseAsync=async(t,n)=>tF(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>rF(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>
106iF(e,t,n),e.decode=(t,n)=>aF(e,t,n),e.encodeAsync=async(t,n)=>oF(e,t,n),e.decodeAsync=async(t,n)=>sF(e,t,n),e.safeEncode=(t,n)=>cF(e,t,n),e.safeDecode=(t,n)=>lF(e,t,n),e.safeEncodeAsync=async(t,n)=>uF(e,t,n),e.safeDecodeAsync=async(t,n)=>dF(e,t,n),e.refine=(t,n)=>e.check(CI(t,n)),e.superRefine=t=>e.check(wI(t)),e.overwrite=t=>e.check(sP(t)),e.optional=()=>iI(e),e.exactOptional=()=>oI(e),e.nullable=()=>cI(e),e.nullish=()=>iI(cI(e)),e.nonoptional=t=>mI(e,t),e.array=()=>GF(e),e.or=t=>XF([e,t]),e.and=t=>QF(e,t),e.transform=t=>vI(e,nI(t)),e.default=t=>uI(e,t),e.prefault=t=>fI(e,t),e.catch=t=>gI(e,t),e.pipe=t=>vI(e,t),e.readonly=()=>bI(e),e.describe=t=>{let n=e.clone();return hN.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){var t;return(t=hN.get(e))==null?void 0:t.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return hN.get(e);let n=e.clone();return hN.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),pF=Z(`_ZodString`,(e,t)=>{var n,r,i;iM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EP(e,t,n,r);let a=e._zod.bag;e.format=(n=a.format)==null?null:n,e.minLength=(r=a.minimum)==null?null:r,e.maxLength=(i=a.maximum)==null?null:i,e.regex=(...t)=>e.check(tP(...t)),e.includes=(...t)=>e.check(iP(...t)),e.startsWith=(...t)=>e.check(aP(...t)),e.endsWith=(...t)=>e.check(oP(...t)),e.min=(...t)=>e.check($N(...t)),e.max=(...t)=>e.check(QN(...t)),e.length=(...t)=>e.check(eP(...t)),e.nonempty=(...t)=>e.check($N(1,...t)),e.lowercase=t=>e.check(nP(t)),e.uppercase=t=>e.check(rP(t)),e.trim=()=>e.check(lP()),e.normalize=(...t)=>e.check(cP(...t)),e.toLowerCase=()=>e.check(uP()),e.toUpperCase=()=>e.check(dP()),e.slugify=()=>e.check(fP())}),mF=Z(`ZodString`,(e,t)=>{iM.init(e,t),pF.init(e,t),e.email=t=>e.check(_N(_F,t)),e.url=t=>e.check(CN(bF,t)),e.jwt=t=>e.check(RN(FF,t)),e.emoji=t=>e.check(wN(xF,t)),e.guid=t=>e.check(vN(vF,t)),e.uuid=t=>e.check(yN(yF,t)),e.uuidv4=t=>e.check(bN(yF,t)),e.uuidv6=t=>e.check(xN(yF,t)),e.uuidv7=t=>e.check(SN(yF,t)),e.nanoid=t=>e.check(TN(SF,t)),e.guid=t=>e.check(vN(vF,t)),e.cuid=t=>e.check(EN(CF,t)),e.cuid2=t=>e.check(DN(wF,t)),e.ulid=t=>e.check(ON(TF,t)),e.base64=t=>e.check(FN(MF,t)),e.base64url=t=>e.check(IN(NF,t)),e.xid=t=>e.check(kN(EF,t)),e.ksuid=t=>e.check(AN(DF,t)),e.ipv4=t=>e.check(jN(OF,t)),e.ipv6=t=>e.check(MN(kF,t)),e.cidrv4=t=>e.check(NN(AF,t)),e.cidrv6=t=>e.check(PN(jF,t)),e.e164=t=>e.check(LN(PF,t)),e.datetime=t=>e.check(GP(t)),e.date=t=>e.check(qP(t)),e.time=t=>e.check(YP(t)),e.duration=t=>e.check(ZP(t))});function hF(e){return gN(mF,e)}var gF=Z(`ZodStringFormat`,(e,t)=>{aM.init(e,t),pF.init(e,t)}),_F=Z(`ZodEmail`,(e,t)=>{cM.init(e,t),gF.init(e,t)}),vF=Z(`ZodGUID`,(e,t)=>{oM.init(e,t),gF.init(e,t)}),yF=Z(`ZodUUID`,(e,t)=>{sM.init(e,t),gF.init(e,t)}),bF=Z(`ZodURL`,(e,t)=>{lM.init(e,t),gF.init(e,t)}),xF=Z(`ZodEmoji`,(e,t)=>{uM.init(e,t),gF.init(e,t)}),SF=Z(`ZodNanoID`,(e,t)=>{dM.init(e,t),gF.init(e,t)}),CF=Z(`ZodCUID`,(e,t)=>{fM.init(e,t),gF.init(e,t)}),wF=Z(`ZodCUID2`,(e,t)=>{pM.init(e,t),gF.init(e,t)}),TF=Z(`ZodULID`,(e,t)=>{mM.init(e,t),gF.init(e,t)}),EF=Z(`ZodXID`,(e,t)=>{hM.init(e,t),gF.init(e,t)}),DF=Z(`ZodKSUID`,(e,t)=>{gM.init(e,t),gF.init(e,t)}),OF=Z(`ZodIPv4`,(e,t)=>{xM.init(e,t),gF.init(e,t)}),kF=Z(`ZodIPv6`,(e,t)=>{SM.init(e,t),gF.init(e,t)}),AF=Z(`ZodCIDRv4`,(e,t)=>{CM.init(e,t),gF.init(e,t)}),jF=Z(`ZodCIDRv6`,(e,t)=>{wM.init(e,t),gF.init(e,t)}),MF=Z(`ZodBase64`,(e,t)=>{EM.init(e,t),gF.init(e,t)}),NF=Z(`ZodBase64URL`,(e,t)=>{OM.init(e,t),gF.init(e,t)}),PF=Z(`ZodE164`,(e,t)=>{kM.init(e,t),gF.init(e,t)}),FF=Z(`ZodJWT`,(e,t)=>{jM.init(e,t),gF.init(e,t)}),IF=Z(`ZodNumber`,(e,t)=>{var n,r,i,a,o,s,c,l,u;MM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DP(e,t,n,r),e.gt=(t,n)=>e.check(YN(t,n)),e.gte=(t,n)=>e.check(XN(t,n)),e.min=(t,n)=>e.check(XN(t,n)),e.lt=(t,n)=>e.check(qN(t,n)),e.lte=(t,n)=>e.check(JN(t,n)),e.max=(t,n)=>e.check(JN(t,n)),e.int=t=>e.check(zF(t)),e.safe=t=>e.check(zF(t)),e.positive=t=>e.check(YN(0,t)),e.nonnegative=t=>e.check(XN(0,t)),e.negative=t=>e.check(qN(0,t)),e.nonpositive=t=>e.check(JN(0,t)),e.multipleOf=(t,n)=>e.check(ZN(t,n)),e.step=(t,n)=>e.check(ZN(t,n)),e.finite=()=>e;let d=e._zod.bag;e.minValue=(n=Math.max((r=d.minimum)==null?-1/0:r,(i=d.exclusiveMinimum)==null?-1/0:i))==null?null:n,e.maxValue=(a=Math.min((o=d.maximum)==null?1/0:o,(s=d.exclusiveMaximum)==null?1/0:s))==null?null:a,e.isInt=((c=d.format)==null?``:c).includes(`int`)||Number.isSafeInteger((l=d.multipleOf)==null?.5:l),e.isFinite=!0,e.format=(u=d.format)==null?null:u});function LF(e){return UN(IF,e)}var RF=Z(`ZodNumberFormat`,(e,t)=>{NM.init(e,t),IF.init(e,t)});function zF(e){return WN(RF,e)}var BF=Z(`ZodUnknown`,(e,t)=>{PM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function VF(){return GN(BF)}var HF=Z(`ZodNever`,(e,t)=>{FM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>OP(e,t,n,r)});function UF(e){return KN(HF,e)}var WF=Z(`ZodArray`,(e,t)=>{LM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MP(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check($N(t,n)),e.nonempty=t=>e.check($N(1,t)),e.max=(t,n)=>e.check(QN(t,n)),e.length=(t,n)=>e.check(eP(t,n)),e.unwrap=()=>e.element});function GF(e,t){return pP(WF,e,t)}var KF=Z(`ZodObject`,(e,t)=>{HM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NP(e,t,n,r),Q(e,`shape`,()=>t.shape),e.keyof=()=>eI(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:VF()}),e.loose=()=>e.clone({...e._zod.def,catchall:VF()}),e.strict=()=>e.clone({...e._zod.def,catchall:UF()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>NA(e,t),e.safeExtend=t=>PA(e,t),e.merge=t=>FA(e,t),e.pick=t=>jA(e,t),e.omit=t=>MA(e,t),e.partial=(...t)=>IA(rI,e,t[0]),e.required=(...t)=>LA(pI,e,t[0])});function qF(e,t){return new KF({type:`object`,shape:e==null?{}:e,...$(t)})}function JF(e,t){return new KF({type:`object`,shape:e,catchall:UF(),...$(t)})}var YF=Z(`ZodUnion`,(e,t)=>{WM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PP(e,t,n,r),e.options=t.options});function XF(e,t){return new YF({type:`union`,options:e,...$(t)})}var ZF=Z(`ZodIntersection`,(e,t)=>{GM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FP(e,t,n,r)});function QF(e,t){return new ZF({type:`intersection`,left:e,right:t})}var $F=Z(`ZodEnum`,(e,t)=>{JM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kP(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new $F({...t,checks:[],...$(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new $F({...t,checks:[],...$(r),entries:i})}});function eI(e,t){return new $F({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...$(t)})}var tI=Z(`ZodTransform`,(e,t)=>{YM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jP(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new sA(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(UA(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code!=null||(t.code=`custom`),t.input!=null||(t.input=n.value),t.inst!=null||(t.inst=e),n.issues.push(UA(t))}};
106let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function nI(e){return new tI({type:`transform`,transform:e})}var rI=Z(`ZodOptional`,(e,t)=>{ZM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UP(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function iI(e){return new rI({type:`optional`,innerType:e})}var aI=Z(`ZodExactOptional`,(e,t)=>{QM.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UP(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oI(e){return new aI({type:`optional`,innerType:e})}var sI=Z(`ZodNullable`,(e,t)=>{$M.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IP(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cI(e){return new sI({type:`nullable`,innerType:e})}var lI=Z(`ZodDefault`,(e,t)=>{eN.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RP(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function uI(e,t){return new lI({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():TA(t)}})}var dI=Z(`ZodPrefault`,(e,t)=>{nN.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zP(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fI(e,t){return new dI({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():TA(t)}})}var pI=Z(`ZodNonOptional`,(e,t)=>{rN.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LP(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mI(e,t){return new pI({type:`nonoptional`,innerType:e,...$(t)})}var hI=Z(`ZodCatch`,(e,t)=>{aN.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BP(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gI(e,t){return new hI({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var _I=Z(`ZodPipe`,(e,t)=>{oN.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VP(e,t,n,r),e.in=t.in,e.out=t.out});function vI(e,t){return new _I({type:`pipe`,in:e,out:t})}var yI=Z(`ZodReadonly`,(e,t)=>{cN.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HP(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bI(e){return new yI({type:`readonly`,innerType:e})}var xI=Z(`ZodCustom`,(e,t)=>{uN.init(e,t),fF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AP(e,t,n,r)});function SI(e,t){return mP(xI,e==null?(()=>!0):e,t)}function CI(e,t={}){return hP(xI,e,t)}function wI(e){return gP(e)}function TI(e,t){return vI(nI(e),t)}var EI=s(aA(),1),DI=s(Kn()),OI=(e,t)=>{let n={};for(let t of e)switch(t.type){case`number`:{let e=LF({error:e=>e.input===void 0?`${t.label} is required`:`${t.label} is not a valid number`});t.min&&(e=e.min(t.min,{error:`${t.label} must be ${t.min} or more`})),t.max&&(e=e.max(t.max,{error:`${t.label} must be ${t.max} or less`}));let r=e;t.required||(r=r.nullable(),r=r.optional()),t.defaultValue&&(r=r.default(t.defaultValue)),n[t.name]=TI(e=>typeof e==`string`||typeof e==`number`?parseInt(e,10):t.defaultValue,r);break}case`text`:case void 0:{let e=+!!t.required,r=hF({error:e=>e.input===void 0?`${t.label} is required`:`${t.label} is not a valid string`}).min(e,{error:`${t.label} can't be empty`}).regex(new RegExp(t.pattern||`.*`),{error:`${t.label} is not in the correct format`});t.required||(r=r.nullable(),r=r.optional()),t.defaultValue&&(r=r.default(typeof t.defaultValue==`number`?String(t.defaultValue):t.defaultValue)),n[t.name]=TI(e=>typeof e==`number`?String(e):e,r);break}case`url`:{let e=hF({error:e=>e.input===void 0?`${t.label} is required`:`${t.label} is not a valid string`}).regex(new RegExp(t.pattern||`.*`),{error:`${t.label} is not in the correct format`}).refine(rt,{error:`${t.label} is not a valid URL`});t.required||(e=e.nullable(),e=e.optional()),t.defaultValue&&(e=e.default(t.defaultValue)),n[t.name]=TI(e=>typeof e==`string`?e.trim():e,e);break}case`select`:{let e=Un(t),r=SI(n=>!t.required&&n==null||qn(n)&&e.has(Jn(n)),{error:`${t.label} is not a valid option`});t.required||(r=r.optional()),t.defaultValue&&(r=r.default(t.defaultValue)),n[t.name]=TI(t=>{if(qn(t)){let n=e.get(Jn(t));if(n)return Gn(n.value)}return t},r);break}}return t?JF(n):qF(n)},kI=({defaultInputParameters:e})=>e.reduce((e,t)=>
106(e[t.label]=t.name,e),{}),AI=({inputParameter:e,availableInputParameterNames:t})=>{let n=(0,DI.cloneDeep)(e);for(let[r,i]of Object.entries(t))e[r]!==void 0&&(delete n[r],n[i]=e[r]);return n};function jI({inputParameter:e,value:t,onChange:n,disabled:r,defaultValueButtonMode:i=`hide`,isSavingAsDefault:a,onClickDefaultButton:s,inlineInLargeScreens:c=!0}){let{name:l,options:u,label:d,required:f}=e,p=[...f?[]:[{label:Yn,value:Jn(Wn)}],...u];return z.useEffect(()=>{f&&!t&&u.length>0&&n(u[0].value)},[f,t,n,u]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:o(`py-2 font-medium md:flex`,{"sm:pr-2":c,"md:flex-col":!c,"cursor-not-allowed":r}),children:[(0,B.jsxs)(`div`,{className:o(`mb-1 mr-2 flex items-center md:mb-0 md:max-h-11`,{"cursor-not-allowed text-gray-400":r}),title:d,children:[d,f?(0,B.jsx)(`span`,{className:`text-primary`,children:` *`}):null]}),(0,B.jsx)(`div`,{className:o({"sm:flex-1 sm:self-center":c}),children:(0,B.jsx)(tr,{options:p,name:l,disabled:r,value:t,size:`md`,isSearchable:!0,onChange:n,rightElement:i===`hide`?void 0:(0,B.jsx)(T,{size:`small`,loading:a,onClick:s,"data-test":`save-as-default-parameter`,children:i===`switchToDefault`?`Switch to default`:`Save as default`})})})]}),e.description&&(0,B.jsx)(`div`,{className:o(`text-sm`,`text-gray-500`),children:(0,B.jsxs)(ge,{children:[(0,B.jsx)(`span`,{className:`break-words`,children:e.description}),e.descriptionLink&&(0,B.jsxs)(B.Fragment,{children:[`\xA0\xA0`,(0,B.jsxs)(Fn,{to:e.descriptionLink,children:[`Learn more `,(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`→`})]})]})]})})]})}function MI({defaultInputParameter:e,defaultInputParameters:t,onChange:n,values:r,disabled:i,defaultValueButtonMode:a,inlineInLargeScreens:o,currentRobotVersionId:s,autoFocus:c,"data-ph-unmask-input":l=void 0}){let u=OI(t.map(e=>e.encrypted?{...e,defaultValue:`[browseai_redacted]`}:e),!1),d=Je(),f=z.useRef(null),[p,m]=z.useState(``),[h,g]=z.useState(void 0),[_,{loading:v}]=$t({onCompleted:()=>{m(``),n(e=>{let n={...e};return t.forEach(e=>{e.encrypted&&delete n[e.name]}),{values:n,isValid:!0}})},onError:d}),{name:y,defaultValue:b,label:x,encrypted:S,type:C}=e,w=v&&p===y,E=x;t.forEach(e=>{let{name:t,defaultValue:n}=e,i=t in r?r[t]:n;E=E.replace(Vr(e.name,e.type),String(qn(i)?Jn(i):i))});let D=y in r?r[y]:b,O=a!==`hide`&&!(0,EI.default)(D,b),k=String(qn(D)?Jn(D):D);return C===`select`?(0,B.jsx)(jI,{inputParameter:e,value:k,onChange:t=>{ee(t,e)},disabled:i||w,defaultValueButtonMode:O?a:void 0,isSavingAsDefault:w,onClickDefaultButton:()=>{a===`switchToDefault`?j():A(y,k)},inlineInLargeScreens:o}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(lt,{"data-ph-unmask-input":l,ref:f,autoFocus:c,fill:!0,name:y,disabled:i||w,label:E,type:C,value:k,required:`required`in e?e.required:void 0,min:`min`in e?e.min:void 0,max:`max`in e?e.max:void 0,pattern:`pattern`in e?e.pattern:void 0,inlineInLargeScreens:o,onChange:t=>{ee(t,e)},autoComplete:S,rightElement:O?(0,B.jsx)(T,{variant:`secondaryColored`,size:`small`,type:`button`,disabled:i,loading:w,onClick:()=>{if(a===`switchToDefault`)j();else{var e;if(!((e=f.current)!=null&&e.reportValidity()))return;A(y,k)}},"data-test":`toggle-default-value`,children:a===`switchToDefault`?`Switch to default`:`Save as default`}):void 0,errorMessage:h}),e.description&&(0,B.jsx)(`div`,{className:`text-sm text-gray-500`,children:(0,B.jsxs)(ge,{children:[(0,B.jsx)(`span`,{className:`break-words`,children:e.description}),e.descriptionLink&&(0,B.jsxs)(B.Fragment,{children:[`\xA0\xA0`,(0,B.jsxs)(Fn,{to:e.descriptionLink,children:[`Learn more `,(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`→`})]})]})]})})]});function ee(e,t){let{name:i,defaultValue:a,type:o}=t,s,c=Xn({inputParameter:t,value:e});s=o===`select`&&qn(c)?c:o===`number`?parseInt(e,10):e;let l={...r,[i]:s};(0,EI.default)(s,a)&&delete l[i];let d=u.safeParse(l);if(d.success===!1){var f;let e=(f=d.error.issues.find(e=>e.path.includes(t.name)))==null?void 0:f.message;g(e)}else g(void 0);n(()=>({values:l,isValid:d.success}))}function A(e,n){if(!s)return;let r=t.map(t=>t.name===e?t.type===`select`?{...t,defaultValue:Gn(n)}:{...t,defaultValue:n}:t);m(e),_({variables:{robotVersionId:s,defaultInputParameters:r}})}function j(){let e={...r};delete e[y];let t=u.safeParse(e);if(t.success===!1){var i;let e=(i=t.error.issues.find(e=>e.path.includes(y)))==null?void 0:i.message;g(e)}else g(void 0);n(()=>({values:e,isValid:t.success}))}}var NI=({disabled:e,defaultInputParameters:t,values:n,onChange:r,defaultValueButtonMode:i=`saveAsDefault`,inlineInLargeScreens:a,hideInputParameters:o,currentRobotVersionId:s,autoFocusOnFirstInput:c,"data-ph-unmask-input":l=void 0})=>(0,B.jsx)(B.Fragment,{children:t.filter(({name:e})=>!(o!=null&&o.includes(e))).map((o,u)=>(0,B.jsx)(MI,{autoFocus:c&&u===0,defaultInputParameter:o,defaultInputParameters:t,onChange:r,values:n,disabled:e,inlineInLargeScreens:a,defaultValueButtonMode:i,currentRobotVersionId:s,"data-ph-unmask-input":l},o.name))}),PI=({vars:e,onChange:t,sharedRobot:n})=>(0,B.jsx)(`div`,{children:(0,B.jsx)(NI,{"data-ph-unmask-input":!0,defaultInputParameters:n.defaultInputParameters,values:e,onChange:t,defaultValueButtonMode:`hide`,inlineInLargeScreens:!1})}),FI=60,II=1440,LI=[15,FI,II,7*II,30*II],RI=k(`dashboard/src/components/CreateNewSharedRobotScreen/CreateNewSharedRobotScreen.tsx`),zI=yt(`pendingSharedRobots`),BI={},VI=({step:e})=>{var t;
106let n=f(),{pathname:r}=u(),i=Rk(),a=Je(),{querystringParams:s}=Ik(),{sharedRobotSlug:c,workspaceName:l}=Dg(),{userIsLoggedIn:d,userProfile:p}=le(),h=Eg((p==null?void 0:p.email)||``),g=l||h||`personal`,[_,{called:v,loading:y,error:b,data:x}]=ln({variables:{sharedRobotSlug:c}}),[S,{called:C,loading:w,error:E,data:D,refetch:O}]=On({variables:{sharedRobotSlug:c,teamName:g},onCompleted:({myUser:t,team:i})=>{i?l?e===`EMAIL_VERIFICATION`&&!t.enforceEmailVerification&&n(F({to:`create-new-shared-robot`,sharedRobotSlug:c,workspaceName:g,step:`review`}),{replace:!0}):n(Nk(r,xg(i.name)),{replace:!0}):n(F({to:`workspace-root`,querystringParams:s}),{replace:!0})}});z.useEffect(()=>{e===`EMAIL_VERIFICATION`&&i&&O()},[i]);let k=!1,ee,A,j;C?(k=w,ee=E?Sg(E)?void 0:E:void 0,A=D,j=D==null?void 0:D.myUser):v?(k=y,ee=b,A=x):k=!0;let te=A&&`team`in A?A.team:void 0,[ne,re]=zI(BI),[ie,{loading:M}]=bn({onError:a});z.useEffect(()=>{d?S():_()},[d,_,S]);let ae={createdAt:new Date().getTime(),updatedAt:new Date().getTime(),taskName:(A==null||(t=A.sharedRobot)==null?void 0:t.title)||`Unnamed Automation`,inputParametersValue:{},isInputParametersValid:!0,runEveryMinutes:II,notifyOnChange:!0},oe=e=>c in ne&&e in ne[c]?ne[c][e]:ae[e],se=e=>{re(t=>({...t,[c]:{...c in t?t[c]:ae,updatedAt:ae.updatedAt,...e}}))},ce=e=>{re(t=>{let n=c in t?t[c]:ae,{values:r,isValid:i}=e(n.inputParametersValue);return{...t,[c]:{...n,updatedAt:ae.updatedAt,inputParametersValue:r,isInputParametersValid:i}}})};if(z.useEffect(()=>{let e=Object.keys(ne).filter(e=>{var t;return new Date().getTime()-((t=ne[e])==null?void 0:t.updatedAt)>2592e3});e.length>0&&re(t=>{let n={...t};return e.forEach(e=>{delete n[e]}),n})},[]),ee)return(0,B.jsx)(Kk,{error:ee});if(!A||k)return(0,B.jsx)(Qn,{});if(!A.sharedRobot)return(0,B.jsx)(m,{to:F({to:`create-new-robot`,workspaceName:g}),replace:!0});let N=A.sharedRobot.purpose,ue=(j==null?void 0:j.emailVerified)===!1&&j.enforceEmailVerification,de=[{key:`SETUP`,title:`Setup`,link:F({to:`create-new-shared-robot`,sharedRobotSlug:c,workspaceName:g,step:`setup`})}];N===`monitor`&&de.push({key:`MONITOR`,title:`Monitor`,link:F({to:`create-new-shared-robot`,sharedRobotSlug:c,workspaceName:g,step:`monitor`})}),d||de.push({key:`AUTHENTICATE`,title:`Sign Up`,link:F({to:`create-new-shared-robot`,sharedRobotSlug:c,workspaceName:g,step:`authenticate`})}),(ue||e===`EMAIL_VERIFICATION`)&&de.push({key:`EMAIL_VERIFICATION`,title:`Account`,link:F({to:`create-new-shared-robot`,sharedRobotSlug:c,workspaceName:g,step:`email-verification`})}),de.push({key:`REVIEW`,title:`Review`,link:F({to:`create-new-shared-robot`,sharedRobotSlug:c,workspaceName:g,step:`review`})});let fe=de.map(e=>({label:e.title})),me=de.findIndex(({key:t})=>t===e),_e=de.findIndex(({key:e})=>e===`AUTHENTICATE`);if(d&&e===`AUTHENTICATE`)return(0,B.jsx)(m,{to:F({to:`create-new-shared-robot`,sharedRobotSlug:c,workspaceName:g,step:(j==null?void 0:j.emailVerified)===!1&&j.enforceEmailVerification?`email-verification`:`review`}),replace:!0});if(e===`REVIEW`&&ue)return(0,B.jsx)(m,{to:F({to:`create-new-shared-robot`,sharedRobotSlug:c,workspaceName:g,step:`email-verification`}),replace:!0});if(me===-1)return(0,B.jsx)(m,{to:F({to:`create-new-shared-robot`,workspaceName:g,sharedRobotSlug:c,step:`setup`}),replace:!0});if(!d&&_e<me)return(0,B.jsx)(m,{to:F({to:`create-new-shared-robot`,workspaceName:g,sharedRobotSlug:c,step:`authenticate`}),replace:!0});let ve=de[me],ye=me>=1?de[me-1].link:void 0,be=me===de.length-1,xe=be?void 0:ve.key===`AUTHENTICATE`?`${F({to:`signup`})}?${s.join(`&`)}`:de[me+1].link,Se=be?N===`test`?`Start Testing`:N===`extract`?`Start Extracting`:N===`monitor`?`Start Monitoring`:N===`automate`?`Start Automating`:`Finish`:`Next Step`,Ce=oe(`runEveryMinutes`);return(0,B.jsxs)(jn,{children:[(0,B.jsx)(Fe,{title:`${ve.title} – ${A.sharedRobot.title}`}),(0,B.jsx)(Re,{onSubmit:async()=>{if(xe){n(xe);return}if(!(!be||!(A!=null&&A.sharedRobot)))try{var e;let t=new X({freq:Y.MINUTELY,interval:oe(`runEveryMinutes`),byweekday:[X.MO,X.TU,X.WE,X.TH,X.FR,X.SA,X.SU]}).toString(),r=await ie({variables:{referenceSharedRobotId:A.sharedRobot.id,name:oe(`taskName`),inputParametersValue:oe(`inputParametersValue`),notifyOnChange:oe(`notifyOnChange`),recurrenceRule:t}});if(((e=r.data)==null?void 0:e.createRobotFromSharedRobot.__typename)===`Robot`){let e=r.data.createRobotFromSharedRobot;re(e=>{let t={...e};return delete t[c],t}),n(F(e.tasks.items.length>0?{to:`task`,robotId:e.id,taskId:e.tasks.items[0].id,workspaceName:g}:{to:`robot`,robotId:e.id,workspaceName:g}))}}catch(e){RI(`error`,`An error occurred creating new robot`,{error:e})}},children:(0,B.jsxs)(`div`,{className:`pt-5`,children:[(0,B.jsx)(xn,{}),(0,B.jsx)(Si,{children:(0,B.jsx)(Ir,{textAlign:`center`,children:(0,B.jsxs)(zr,{level:1,marginY:4,children:[A.sharedRobot.sites.length>0&&(0,B.jsx)(`img`,{className:`mr-3 inline-block align-sub`,src:A.sharedRobot.sites[0].logoMedium,alt:`${A.sharedRobot.sites[0].title} logo`,width:`33`}),(0,B.jsxs)(`div`,{className:`inline-block max-w-[calc(100%-45px)] text-left`,children:[(0,B.jsx)(`div`,{className:o(`-mt-2.5 pl-[0.15rem] text-md font-normal transition-opacity duration-300`,{"opacity-60":A.sharedRobot&&A.sharedRobot.title!==oe(`taskName`),"opacity-0":!A.sharedRobot||A.sharedRobot.title===oe(`taskName`)},`indent-0.5`),children:A.sharedRobot.title}),(0,B.jsx)(zk,{maxLength:150,disabled:M,name:`taskName`,placeholder:`Name this robot`,"aria-label":`Name this robot`,value:oe(`taskName`),onChange:e=>{se({taskName:e.target.value})}})]})]})})}),(0,B.jsxs)(`div`,{className:`mx-auto my-6 min-h-[30rem] w-full max-w-2xl rounded-xl border border-gray-200 bg-white px-0 pt-0`,children:[(0,B.jsx)(`div`,{className:`rounded-t-xl bg-gray-50 p-4`,children:(0,B.jsx)(Qs,{size:`sm`,currentIndex:me,items:fe})}),(0,B.jsx)(`div`,{className:`p-6`,children:ve.key===`SETUP`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex flex-col items-start justify-start gap-1 self-stretch pb-6`,children:[(0,B.jsx)(`div`,{className:`text-lg font-semibold text-gray-900`,children:`Setup Prebuilt Robot`}),(0,B.jsx)(`div`,{className:`self-stretch text-sm font-normal leading-tight text-gray-600`,children:`This robot needs some input parameters from you, please fill them and click on the next button to continue.`})]}),(0,B.jsx)(PI,{sharedRobot:A.sharedRobot,vars:oe(`inputParametersValue`),onChange:ce})]}):ve.key===`MONITOR`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`text-lg font-semibold text-gray-900`,children:[`Monitor `,A.sharedRobot.targetTitleSingular]}),(0,B.jsxs)(_i,{name:`runEveryMinutes`,onValueChanged:e=>se({runEveryMinutes:e}),selectedValue:Ce||II,children:[(0,B.jsx)(`p`,{children:`Check for changes...`}),LI.map(e=>(0,B.jsx)(xi,{label:`Every ${Ok(e)}`,value:e,disabled:((te==null?void 0:te.minRobotMonitorScheduleInterval)||86400)>e*60,marginTop:3},e))]}),(0,B.jsx)(xn,{}),(0,B.jsx)(zr,{level:3,marginY:4,children:`Notifications`}),(0,B.jsx)(Ze,{name:`notifyOnChange`,label:`Email me if changes are detected.`,onChange:e=>se({notifyOnChange:e.target.checked}),checked:oe(`notifyOnChange`),"data-test":`shared-robot-notify-on-change`})]}):ve.key===`REVIEW`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`text-lg font-semibold text-gray-900`,children:`Review Robot`}),A.sharedRobot.purpose===`extract`?(0,B.jsxs)(ge,{marginY:4,children:[`Data will be extracted after you press `,Se,`. You can download the data and access this robot again from your dashboard.`]}):A.sharedRobot.purpose===`monitor`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(ge,{marginY:4,children:[`Monitoring will start after you press `,Se,`.`]}),oe(`notifyOnChange`)?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ge,{marginY:4,children:`After that, you can close this window. We will notify you via email if we detect a change.`}),(0,B.jsx)(ge,{marginY:4,children:`You can always access this monitoring robot again from your dashboard.`})]}):(0,B.jsx)(ge,{marginY:4,children:`You can always access this monitoring robot from your dashboard and see the results of every recent check.`})]}):null,(0,B.jsx)(xn,{}),(0,B.jsx)(zr,{level:3,marginY:4,children:`Configuration`}),(0,B.jsx)(Uk,{values:oe(`inputParametersValue`),defaultInputParameters:A.sharedRobot.defaultInputParameters}),typeof Ce==`number`&&Ce>0&&A.sharedRobot.purpose===`monitor`&&(0,B.jsxs)(ge,{marginTop:4,children:[(0,B.jsx)(pe,{name:`clock`,size:4}),` \xA0Check every`,` `,Ok(Ce),oe(`notifyOnChange`)&&` and email me if changes are detected`]}
106)]}):ve.key===`AUTHENTICATE`?(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(`div`,{className:`flex min-h-[20rem] flex-col items-center justify-center gap-2.5 px-6`,children:(0,B.jsxs)(`div`,{className:`inline-flex shrink grow basis-0 flex-col items-center justify-center gap-8`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-5 self-stretch`,children:[(0,B.jsx)(he,{icon:`user`,intent:`gray`,size:`xl`,theme:`modern`}),(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 self-stretch`,children:[(0,B.jsx)(`div`,{className:`self-stretch text-center text-xl font-semibold leading-7 text-gray-900`,children:`Account Needed`}),(0,B.jsx)(`div`,{className:`self-stretch text-center text-base font-normal leading-normal text-gray-600`,children:`Quickly create a free account to save your new robot.`})]})]}),(0,B.jsxs)(`div`,{className:`inline-flex items-center justify-center gap-3`,children:[(0,B.jsx)(T,{variant:`secondary`,onClick:()=>n(`${F({to:`login`})}?${s.join(`&`)}`),loading:M,"data-test":`login-to-save-robot`,children:`Login`}),(0,B.jsx)(T,{variant:`primary`,onClick:()=>n(`${F({to:`signup`})}?${s.join(`&`)}`),loading:M,"data-test":`create-account-to-save-robot`,children:`Create an Account`})]})]})})}):ve.key===`EMAIL_VERIFICATION`&&D?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`text-lg font-semibold text-gray-900`,children:`Verification Needed`}),(0,B.jsx)(`div`,{className:`mt-5`,children:(0,B.jsx)(Hk,{user:D.myUser})})]}):null})]}),(0,B.jsx)(`div`,{className:`mx-auto max-w-[42rem]`,children:(0,B.jsxs)(Si,{children:[(0,B.jsx)(Ir,{xs:6,children:ye?(0,B.jsx)(T,{variant:`secondary`,link:ye,disabled:M,"data-test":`previous-step`,children:`Previous Step`}):(0,B.jsx)(T,{variant:`secondary`,link:Mk({to:`1-click-automations`}),disabled:M,"data-test":`back-to-prebuilt-robots`,children:`Back to Prebuilt Robots`})}),(0,B.jsx)(Ir,{xs:6,textAlign:`right`,children:(0,B.jsx)(T,{variant:`primary`,rightIcon:`arrow-right`,type:`submit`,loading:M,disabled:M||!oe(`taskName`)||ve.key===`EMAIL_VERIFICATION`||(ve.key===`SETUP`||ve.key===`REVIEW`)&&!oe(`isInputParametersValid`),"data-test":`submit-shared-robot`,children:ve.key===`AUTHENTICATE`?`Sign Up`:Se})})]})})]})})]})},HI=()=>(0,B.jsx)(uD,{children:(0,B.jsxs)(h,{children:[(0,B.jsx)(l,{path:`setup/*`,element:(0,B.jsx)(VI,{step:`SETUP`})}),(0,B.jsx)(l,{path:`authenticate/*`,element:(0,B.jsx)(VI,{step:`AUTHENTICATE`})}),(0,B.jsx)(l,{path:`email-verification/*`,element:(0,B.jsx)(VI,{step:`EMAIL_VERIFICATION`})}),(0,B.jsx)(l,{path:`monitor/*`,element:(0,B.jsx)(VI,{step:`MONITOR`})}),(0,B.jsx)(l,{path:`review/*`,element:(0,B.jsx)(VI,{step:`REVIEW`})}),(0,B.jsx)(l,{index:!0,element:(0,B.jsx)(m,{to:`setup`,replace:!0})})]})}),UI=k(`dashboard/src/components/LazyLoading.tsx`),WI=class extends z.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}resetError(){this.setState({error:null})}componentDidCatch(e,t){UI(`error`,`Error occurred while lazy loading component`,{error:e,errorInfo:t}),N.captureException(e,{source:`lazy-loading-boundary`,errorInfo:t})}render(){return this.state.error?(0,B.jsx)(Ke,{onDismiss:this.resetError,error:this.state.error}):this.props.children}},GI=(0,B.jsx)(`div`,{style:{display:`flex`,flex:`1`,flexDirection:`column`,minHeight:`100%`},children:(0,B.jsx)(Qn,{})}),KI=({children:e,fallback:t=GI})=>(0,B.jsx)(WI,{children:(0,B.jsx)(z.default.Suspense,{fallback:t,children:e})}),qI=()=>{let{logout:e}=le(),{search:t}=u(),n=t===`?done=1`;return z.useEffect(()=>{n||e(`${F({to:`logout`})}?done=1`),St.shutdown()},[]),n?(0,B.jsx)(m,{to:F({to:`login`}),replace:!0}):null},JI=k(`dashboard/src/components/OAuth/AirtableCallback/AirtableCallback.tsx`),YI=()=>{let{search:e}=u(),t=Ag.parse(e),n=t.code,r=t.state,i=t.error,a=t.error_description,[o,s]=z.useState();i&&JI(`warn`,`something went wrong while Airtable authorization.`,{queryParamError:i,errorDescription:a});let[c,{loading:l}]=kn({onCompleted:()=>{window.close()},onError:e=>s(e)});return z.useEffect(()=>{typeof n!=`string`||typeof r!=`string`?s(Error(`When redirected from Airtable to Dashboard, the code or state query string was empty`)):c({variables:{authorizationCode:n,authorizationState:r}})},[c,n,r]),(0,B.jsx)(`div`,{className:`flex h-full flex-row justify-center`,children:o?(0,B.jsx)(Kk,{error:o}):a?(0,B.jsx)(`p`,{children:a}):l?(0,B.jsx)(Qn,{}):null})},XI=()=>(0,B.jsx)(h,{children:(0,B.jsx)(l,{path:`airtable/callback/*`,element:(0,B.jsx)(YI,{})})}),ZI=({guestOnly:e,element:t})=>{let{userIsLoggedIn:n}=le(),{redirectTo:r,querystringParams:i}=Ik();return e&&n?(0,B.jsx)(m,{to:M(r),replace:!0}):!e&&!n?(0,B.jsx)(m,{to:`${F({to:`login`})}?${i.join(`&`)}`,replace:!0}):t},QI=z.lazy(()=>zl(()=>import(`./GuestRoutes-C6WMjOrK.js`),__vite__mapDeps([3,4,5,6,7,8,9]))),$I=({screen:e})=>(0,B.jsx)(KI,{children:(0,B.jsx)(QI,{screen:e})}),eL=z.lazy(()=>zl(()=>import(`./UserRoutes-CaWoiSeN.js`).then(e=>e.t),__vite__mapDeps([10,4,11,5,12,13,14,6,7,15,16,17,8,18,9,19,20,21,22,23,24,25]))),tL=()=>(0,B.jsx)(KI,{fallback:(0,B.jsx)(dD,{}),children:(0,B.jsx)(eL,{})}),nL=({screen:e})=>(0,B.jsx)(ZI,{guestOnly:!0,element:(0,B.jsx)(uD,{children:(0,B.jsx)($I,{screen:e})})}),rL=(0,B.jsxs)(h,{children:[(0,B.jsx)(l,{path:`/new-robot/:sharedRobotSlug/*`,element:(0,B.jsx)(HI,{})}
106),(0,B.jsx)(l,{path:`/workspaces/:workspaceName/new-robot/:sharedRobotSlug/*`,element:(0,B.jsx)(HI,{})}),(0,B.jsx)(l,{path:`/login/*`,element:(0,B.jsx)(nL,{screen:`login`})}),(0,B.jsx)(l,{path:`/signup/*`,element:(0,B.jsx)(nL,{screen:`signup`})}),(0,B.jsx)(l,{path:`/s/login/*`,element:(0,B.jsx)(nL,{})}),(0,B.jsx)(l,{path:`/logout`,element:(0,B.jsx)(qI,{})}),(0,B.jsx)(l,{path:`/oauth/*`,element:(0,B.jsx)(XI,{})}),(0,B.jsx)(l,{path:`*`,element:(0,B.jsx)(ZI,{element:(0,B.jsx)(tL,{})})})]});function iL(e){return new vp(function(t,n){var r=vt(t,[]);return new G(function(i){var a,o=!1;return Promise.resolve(r).then(function(n){return e(n,t.getContext())}).then(t.setContext).then(function(){o||(a=n(t).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){o=!0,a&&a.unsubscribe()}})})}var aL=k(`dashboard/src/services/apollo/links/auth.ts`),oL=e=>{let t=e.match(/\/workspaces\/([^/]+)\//);return t?t[1]:null},sL=({authenticating:e,userIsLoggedIn:t,getAccessTokenSilently:n})=>iL(async({variables:r},{headers:i})=>{let a;try{!e&&t&&(a=await n())}catch(e){e.error!==`login_required`&&aL(`warn`,`unable to silently retrieve the access token.`,{error:e})}let o=oL(window.location.href),s=(r==null?void 0:r.teamName)||o;return{headers:{...i,authorization:a?`Bearer ${a}`:``,...s?{"x-team-name":s}:{}}}});function cL(e){return new vp(function(t,n){return new G(function(r){var i,a,o;try{i=n(t).subscribe({next:function(i){if(i.errors&&(o=e({graphQLErrors:i.errors,response:i,operation:t,forward:n}),o)){a=o.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)});return}r.next(i)},error:function(i){if(o=e({operation:t,networkError:i,graphQLErrors:i&&i.result&&i.result.errors||void 0,forward:n}),o){a=o.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)});return}r.error(i)},complete:function(){o||r.complete.bind(r)()}})}catch(i){e({networkError:i,operation:t,forward:n}),r.error(i)}return function(){i&&i.unsubscribe(),a&&i.unsubscribe()}})})}(function(e){en(t,e);function t(t){var n=e.call(this)||this;return n.link=cL(t),n}return t.prototype.request=function(e,t){return this.link.request(e,t)},t})(vp);var lL=new Set([`UNAUTHENTICATED`,`FORBIDDEN`,`BAD_USER_INPUT`,`VALIDATION_ERROR`]),uL=cL(({graphQLErrors:e,networkError:t,operation:n})=>{let r=n.operationName;if(e==null||e.forEach(e=>{let t=dL(e);if(t!==void 0&&lL.has(t)){N.capture(`graphql_expected_error`,{graphql_operation:r,code:t,message:e.message});return}N.captureException(e,{source:`graphql`,graphql_operation:r,kind:`GraphQLError`,code:t,$exception_fingerprint:`graphql:${r}:${t==null?`UNKNOWN`:t}`})}),!t||t.name===`AbortError`)return;let i=fL(t);if(i===void 0){N.capture(`graphql_network_failure`,{graphql_operation:r,message:t.message,online:navigator.onLine});return}N.captureException(t,{source:`graphql`,graphql_operation:r,kind:`NetworkError`,statusCode:i,$exception_fingerprint:`graphql:${r}:http-${i}`})});function dL(e){var t;let n=(t=e.extensions)==null?void 0:t.code;return typeof n==`string`?n:void 0}function fL(e){if(`statusCode`in e)return e.statusCode}var pL=qp({uri:`https://internal-api.browse.ai`,credentials:`include`}),mL=({openModal:e})=>new vp((t,n)=>n(t).map(n=>(n.data&&(hL({data:n.data,operation:t,openModal:e}),gL({data:n.data,operation:t,openModal:e}),_L({data:n.data,operation:t,openModal:e}),vL({data:n.data,operation:t,openModal:e}),yL({data:n.data,operation:t,openModal:e})),n)));function hL({data:e,operation:t,openModal:n}){let r=bL(`CreditsLimitReached`,e);if(r&&r.__typename===`CreditsLimitReached`){var i;let{onCreditLimitReached:e,onDismiss:a,onResolve:o}=(i=t.getContext().limitationHandlers)==null?{}:i;typeof e==`function`&&e(r),n(K.CreditLimitReached,{context:{remainingCredits:r.currentCredits,lockedCredits:r.lockedCredits,creditsNeeded:r.requiredCredits},onComplete:o,onClose:a})}}function gL({data:e,operation:t,openModal:n}){let r=bL(`MaxRobotsLimitReached`,e);if(r&&r.__typename===`MaxRobotsLimitReached`){var i;let{onRobotsLimitReached:e,onDismiss:a,onResolve:o}=(i=t.getContext().limitationHandlers)==null?{}:i;typeof e==`function`&&e(r),n(K.RobotsLimitReached,{onComplete:o,onClose:a})}}function _L({data:e,operation:t,openModal:n}
106){let r=bL(`MaxSitesLimitReached`,e);if(r&&r.__typename===`MaxSitesLimitReached`){var i;let{onWebsitesLimitReached:e,onDismiss:a,onResolve:o}=(i=t.getContext().limitationHandlers)==null?{}:i;typeof e==`function`&&e(r),n(K.WebsiteLimitReached,{onComplete:o,onClose:a})}}function vL({data:e,operation:t,openModal:n}){let r=bL(`AiBudgetLimitReached`,e);if(r&&r.__typename===`AiBudgetLimitReached`){var i;let{onAiBudgetLimitReached:e,onDismiss:a,onResolve:o}=(i=t.getContext().limitationHandlers)==null?{}:i;typeof e==`function`&&e(r),n(K.AiBudgetLimitReached,{onComplete:o,onClose:a})}}function yL({data:e,operation:t,openModal:n}){let r=bL(`MonitorScheduleLimitReached`,e);if(r&&r.__typename===`MonitorScheduleLimitReached`){var i;let{onDismiss:e,onResolve:r}=(i=t.getContext().limitationHandlers)==null?{}:i;n(K.ChangePlan,{onComplete:r,onClose:e})}}function bL(e,t){if(Array.isArray(t))for(let n of t){let t=bL(e,n);if(t)return t}else if(t&&typeof t==`object`)return`__typename`in t&&t.__typename===e?t:bL(e,Object.values(t))}var xL=iL((e,{headers:t})=>{let n;try{n=N.get_session_id()}catch{}return n?{headers:{...t,"x-posthog-session-id":n}}:{headers:t}}
106),SL=({authenticating:e,userIsLoggedIn:t,openModal:n,getAccessTokenSilently:r})=>new kh({link:yp([uL,mL({openModal:n}),xL,sL({authenticating:e,userIsLoggedIn:t,getAccessTokenSilently:r}).concat(pL)]),cache:new dh({typePolicies:{UserTeam:{keyFields:[`userId`,`teamId`]},TableConfiguration:{keyFields:[`robotId`]},Robot:{fields:{dataTableTasks:{merge(e,t){return{...e,...t}}}}},Table:{fields:{rowsCount:{keyArgs:[`query`]},rows:{keyArgs:[`query`,`pageNumber`,`pageSize`,`cursor`]}}},Team:{fields:{table:{keyArgs:[`tableId`],merge(e,t){return{...e,...t}}},draftTable:{keyArgs:[`draftTableId`,`tableId`],merge(e,t){return{...e,...t}}}}}}}),connectToDevTools:!1}),CL=k(`dashboard/src/rootRouter.tsx`),wL=`BClKZbm39pMYrh0YMfyPc5s7VCHyjEWh`,TL=`auth.browse.ai`,EL=`bcyfauog`,DL=()=>{let{authenticating:e,userIsLoggedIn:t,getAccessTokenSilently:n,error:r}=le();r&&CL(`warn`,`unable to authorize user access with the provided accessToken`,{userIsLoggedIn:t,authenticating:e,error:r}),Ph({appId:EL}),z.useEffect(()=>{e||(t?ce():j())},[e,t]);let{openModal:i}=Bh(),a=z.useMemo(()=>SL({openModal:i,authenticating:e,userIsLoggedIn:t,getAccessTokenSilently:n}),[i,e,t,n]);return(0,B.jsx)(Zn,{children:(0,B.jsx)(jh,{client:a,children:(0,B.jsx)(De,{children:(0,B.jsx)(Tn,{children:rL})})})})},OL=({children:e,...t})=>{let n=f();return(0,B.jsx)(se,{onRedirectCallback:e=>{n(e&&e.returnTo||window.location.pathname,{replace:!0})},...t,children:e})},kL=()=>(Ht(),null);function AL(){return(0,B.jsxs)(Fh,{children:[(0,B.jsx)(Ih,{}),(0,B.jsx)(kL,{}),(0,B.jsx)(OL,{clientId:wL,domain:TL,authorizationParams:{redirect_uri:`https://dashboard.browse.ai/login`},cacheLocation:`localstorage`,children:(0,B.jsx)(zh,{children:(0,B.jsx)(DL,{})})})]})}function jL(){return b([{path:`*`,element:(0,B.jsx)(AL,{})}],{basename:{}.REACT_APP_BASE_PATH})}window.location.hostname===`localhost`||window.location.hostname===`[::1]`||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)){3}$/);function ML(){`serviceWorker`in navigator&&navigator.serviceWorker.ready.then(e=>{e.unregister()})}au.init();var NL=document.getElementById(`root`),PL=jL();Br.render((0,B.jsx)(z.default.StrictMode,{children:(0,B.jsx)(sc,{children:(0,B.jsx)(C,{router:PL})})}),NL),ML();export{Ky as $,ts as $t,qE as A,Bi as An,Nh as At,vb as B,Si as Bn,Rc as Bt,Mk as C,ma as Cn,Eg as Ct,pD as D,Yi as Dn,tg as Dt,Y as E,ia as En,xg as Et,GS as F,Mi as Fn,fl as Ft,eb as G,Vr as Gn,fc as Gt,fb as H,_i as Hn,Fc as Ht,US as I,Pi as In,tl as It,Gy as J,kr as Jn,Qs as Jt,Qy as K,zr as Kn,uc as Kt,TS as L,Ti as Ln,rl as Lt,zC as M,Ri as Mn,ml as Mt,UC as N,zi as Nn,pl as Nt,uD as O,Ii as On,Bh as Ot,FC as P,Ni as Pn,hl as Pt,qy as Q,ns as Qt,Rb as R,wi as Rn,Jc as Rt,Nk as S,ha as Sn,Tg as St,X as T,ca as Tn,bg as Tt,tb as U,qr as Un,gc as Ut,mb as V,xi as Vn,zc as Vt,$y as W,Ur as Wn,pc as Wt,Ly as X,bs as Xt,Wy as Y,Zs as Yt,Ry as Z,os as Zt,Vk as _,lo as _n,I_ as _t,kI as a,vo as an,Ny as at,Fk as b,Aa as bn,Og as bt,aA as c,go as cn,Dy as ct,Zk as d,So as dn,Vv as dt,es as en,zy as et,Xk as f,fo as fn,tv as ft,Hk as g,uo as gn,B_ as gt,Wk as h,co as hn,H_ as ht,OI as i,Uo as in,Py as it,zE as j,V as jn,zl as jt,KE as k,Li as kn,K as kt,iA as l,Co as ln,xy as lt,Kk as m,po as mn,V_ as mt,NI as n,Go as nn,Vy as nt,AI as o,ho as on,jy as ot,Yk as p,mo as pn,ev as pt,By as q,Ir as qn,oc as qt,jI as r,Yo as rn,Uy as rt,hF as s,_o as sn,ky as st,KI as t,Wo as tn,Hy as tt,eA as u,wo as un,uy as ut,zk as v,so as vn,Ig as vt,Ok as w,da as wn,yg as wt,Ik as x,ka as xn,Dg as xt,Rk as y,Ba as yn,Fg as yt,Pb as z,Ci as zn,Kc as zt};
107//# sourceMappingURL=index-BVlNHCVc.js.map
108//# chunkId=01a0ce9a-fb07-7ff2-ada3-fdddcdb912f3

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.