local-operator-ui 0.34.55 → 0.34.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/main/index.js +1 -1
- package/out/renderer/assets/{_basePickBy-Be_5LfVS.js → _basePickBy-BZpmSLU-.js} +1 -1
- package/out/renderer/assets/{_baseUniq-hdy9kmQQ.js → _baseUniq-5Fk4AsiY.js} +1 -1
- package/out/renderer/assets/{agent-details-page-CLbcLEwm.js → agent-details-page-BEoctGwH.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-Bf5Aw-Jn.js → agent-hub-page-DVtEYZne.js} +1 -1
- package/out/renderer/assets/{agents-page-BpaQBOFJ.js → agents-page-CqlFD0Ps.js} +3 -3
- package/out/renderer/assets/{arc-CgN-UZqL.js → arc-Cgq0RekE.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-DowMu2Qf.js → architectureDiagram-IEHRJDOE-SKpw5bNL.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-DgKTIFqt.js → blockDiagram-JOT3LUYC-jQv0ffHr.js} +1 -1
- package/out/renderer/assets/{book-open-yKrSTgbR.js → book-open--60aKTv6.js} +1 -1
- package/out/renderer/assets/browser-page-jc3r193W.js +1 -0
- package/out/renderer/assets/{browser-webauthn-prompt-CJ6FJJMN.js → browser-webauthn-prompt-PeVRs-qh.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-Ctyv3nA_.js → c4Diagram-VJAJSXHY-BlRyRK9C.js} +1 -1
- package/out/renderer/assets/channel-BpN7da5J.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-CW43fWPt.js → chunk-4BMEZGHF-BBVAaHlr.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-BfdEIIIg.js → chunk-A2AXSNBT-sJR5i1wN.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-Bx4nZ-57.js → chunk-AEK57VVT-C8IWMgPw.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-BA6hwejS.js → chunk-D6G4REZN-DTfUS03C.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-Civ6_Z-P.js → chunk-RZ5BOZE2-DiGk8o7V.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-BVPRrS8K.js → chunk-XZIHB7SX-Mamouuqj.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-IcRW-YOl.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-IcRW-YOl.js +1 -0
- package/out/renderer/assets/clone-Dri7yO5y.js +1 -0
- package/out/renderer/assets/{console-mirror-D12eLWy7.js → console-mirror-Ch4jKiRK.js} +1 -1
- package/out/renderer/assets/{consoleCapture-B5s47GGM.js → consoleCapture-BYlfSgpd.js} +1 -1
- package/out/renderer/assets/{conversation-input-sync-oIWpPfzj.js → conversation-input-sync-Cs9wr7F7.js} +4 -4
- package/out/renderer/assets/{dagre-OKDRZEBW-CayNWWG3.js → dagre-OKDRZEBW-D5TY-UFL.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-CNrEYtm4.js → diagram-SSKATNLV-BTiHJkCz.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-jzZ7n3uT.js → diagram-VNBRO52H-CBxLprav.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-9BaZ6ZkV.js → erDiagram-Q7BY3M3F-9aF5V3AY.js} +1 -1
- package/out/renderer/assets/{error-boundary-BfL6ia-P.js → error-boundary-B5YLbOOu.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-CptBIl13.js → flowDiagram-4HSFHLVR-BXlN8K06.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-CgcFEyO7.js → ganttDiagram-APWFNJXF-1FcF-Cau.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-cmMetjXL.js → gitGraphDiagram-7IBYFJ6S-CjCM20j_.js} +1 -1
- package/out/renderer/assets/{graph-R1Ok41yA.js → graph-CGuSrplO.js} +1 -1
- package/out/renderer/assets/{index-BFzgup69.js → index-5brl9P13.js} +1 -1
- package/out/renderer/assets/{index-pufheB69.css → index-BUuvY2SU.css} +1 -1
- package/out/renderer/assets/{index-Dsm4DzII.js → index-CalJ1cZq.js} +1 -1
- package/out/renderer/assets/{index-CsR1USrT.js → index-DbzmFwlT.js} +1 -1
- package/out/renderer/assets/{index-CNvEPxPr.js → index-rnB6EiBX.js} +3 -3
- package/out/renderer/assets/{infoDiagram-PH2N3AL5-DeSmG1nL.js → infoDiagram-PH2N3AL5-Bqs15-nE.js} +1 -1
- package/out/renderer/assets/{installer-BM-QRi7Y.js → installer-DZXz4Bgj.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I--ZNfC2qt.js → journeyDiagram-U35MCT3I-BkSqHNi1.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-kUi3-HdL.js → kanban-definition-NDS4AKOZ-CGnCYoin.js} +1 -1
- package/out/renderer/assets/{layout-DQq3NfPk.js → layout-BM7AzCJ1.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-D0vembfV.js → legacy-agents-page-B8f2tJOf.js} +1 -1
- package/out/renderer/assets/{mermaid.core-kSHzKq9G.js → mermaid.core-C14g_ZP7.js} +5 -5
- package/out/renderer/assets/{mesh-page-BhfRHXQS.js → mesh-page-DCCummN5.js} +1 -1
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-BsJiNdkz.js → mindmap-definition-ALO5MXBD-D7Z-SM4X.js} +1 -1
- package/out/renderer/assets/{mini-DngBC0gl.js → mini-CcJI0pQs.js} +1 -1
- package/out/renderer/assets/{notebook-pen-BbGvgaYT.js → notebook-pen-Dj0km82T.js} +1 -1
- package/out/renderer/assets/{org-access-DVLt_Z75.js → org-access-D0eAQUWQ.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-J1G29FUu.js → org-surface-gate-Bgznt94a.js} +1 -1
- package/out/renderer/assets/{page-header-BSVtXSul.js → page-header-B3mzM2nC.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-D9NPKlbA.js → pieDiagram-IB7DONF6-3pVvYdop.js} +1 -1
- package/out/renderer/assets/{projects-page-CV3ap9Ch.js → projects-page-T2Yw-kRf.js} +1 -1
- package/out/renderer/assets/{publication-validation-CXXK8RMX.js → publication-validation-BIJPIOf1.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-Dp6sSgy_.js → quadrantDiagram-7GDLP6J5-Dttg4cdR.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-BdYaxH9C.js → radar-MK3ICKWK-Bd7wnpF5.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-2gyRX5Xg.js → radient-auth-buttons-MPoHRsQX.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-CSxZpxDc.js → requirementDiagram-KVF5MWMF-Jiaz4ehK.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-DNfJtnGS.js → sankeyDiagram-QLVOVGJD-C4tMl9ww.js} +1 -1
- package/out/renderer/assets/{schedules-page-BMY6s4UJ.js → schedules-page-CR7bLqQt.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-wP1VuU8h.js → sequenceDiagram-X6HHIX6F-DncET3lE.js} +1 -1
- package/out/renderer/assets/{settings-page-CVUD4U35.js → settings-page-B_D-wGm4.js} +1 -1
- package/out/renderer/assets/{stateDiagram-DGXRK772-BRguDCdq.js → stateDiagram-DGXRK772-BI1ziKRV.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-Bqeb-TkR.js +1 -0
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-Sovor235.js → timeline-definition-BDJGKUSR-DxR2rlJV.js} +1 -1
- package/out/renderer/assets/{ui-preferences-store-g6-xQ9NA.js → ui-preferences-store-D1IJShox.js} +1 -1
- package/out/renderer/assets/{use-download-agent-mutation-CKVzPGPY.js → use-download-agent-mutation-C6TvAwyM.js} +1 -1
- package/out/renderer/assets/{use-memberships-query-BgAi_tHu.js → use-memberships-query-AlVCuF9E.js} +1 -1
- package/out/renderer/assets/{use-session-snapshot-Ba7FspxL.js → use-session-snapshot-XM0bTxHC.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-BBlbpFBv.js → xychartDiagram-VJFVF3MP-CJW_dOUR.js} +1 -1
- package/out/renderer/console-capture.html +5 -5
- package/out/renderer/index.html +7 -7
- package/out/renderer/installer.html +4 -4
- package/out/renderer/mini.html +7 -7
- package/package.json +1 -1
- package/out/renderer/assets/browser-page-CKyYrwF0.js +0 -1
- package/out/renderer/assets/channel-DaruqAQQ.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-D8vhGZVf.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-D8vhGZVf.js +0 -1
- package/out/renderer/assets/clone-HcmO38Fx.js +0 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CqO4MBYu.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./agent-details-page-
|
|
2
|
-
import{r as g,j as c,c as T,b as $e,i as BA,p as P$,y as I$,o as N$,t as x,z as H1,L as Ro,A as M$,a as O$,R as L$}from"./index-CsR1USrT.js";import{ar as Ce,e8 as B$,e9 as U1,ea as Nw,cd as yb,bI as Yh,cb as Ya,bQ as Ok,C as fs,ah as Ca,ai as Es,a4 as zt,aK as Kn,aL as Bs,u as nn,a3 as au,aR as k0,ce as j$,aS as T0,eb as g4,ec as H$,a as jn,c as yt,e as R0,ed as ym,ee as U$,ef as G$,eg as V$,eh as W$,aO as m4,aN as ti,ei as Lk,ej as fl,ek as ly,el as cy,dz as _l,cf as Bk,cZ as zl,cy as _b,cx as $$,cw as Ys,cz as ln,em as v4,en as z$,eo as G1,d as xt,cF as jk,d9 as q$,Z as Vi,ay as Wa,D as Hk,ep as jA,eq as K$,er as Y$,es as V1,et as X$,eu as Q$,ev as J$,ew as Z$,aC as Xh,ex as HA,ey as UA,ez,eA as tz,eB as nz,eC as b4,eD as sz,eE as rz,eF as x4,eG as Mw,eH as Ow,eI as iz,eJ as az,eK as oz,eL as GA,eM as lz,eN as Hh,eO as w4,eP as cz,eQ as uz,eR as dz,eS as hz,eT as fz,eU as pz,eV as gz,eW as C4,eX as mz,eY as vz,a0 as Ci,eZ as y4,e_ as bz,e$ as VA,f0 as xz,f1 as wz,f2 as Wi,f3 as Lw,f4 as _4,f5 as Cz,f6 as yz,f7 as WA,f8 as _z,f9 as Sz,aT as rp,fa as Ez,fb as kz,fc as Tz,bq as S4,fd as Rz,fe as Az,ff as Fz,e3 as E4,fg as Dz,bH as Bo,fh as Pz,fi as Iz,bG as vd,fj as Yc,fk as Nz,ad as Uk,fl as $A,fm as Mz,fn as Oz,fo as Lz,fp as Bz,fq as jz,fr as Hz,fs as Fh,d1 as Uz,ft as Gz,fu as Vz,d4 as Wz,fv as Bw,fw as W1,fx as jw,fy as $z,fz as zz,fA as qz,fB as Kz,at as Zu,fC as uy,_ as k4,fD as T4,aV as R4,aX as va,fE as Gk,bu as A4,aP as Vk,c_ as Hw,fF as F4,bM as Xc,ck as Uw,fG as Yz,cl as Gw,bE as bd,fH as Xz,fI as Qz,fJ as Jz,fK as Zz,fL as eq,fM as tq,fN as nq,fO as sq,fP as zA,fQ as rq,fR as iq,fS as Wk,fT as qA,d6 as aq,fU as oq,fV as D4,fW as lq,fX as cq,fY as P4,fZ as $1,f_ as uq,b as I4,f$ as Qh,g0 as ip,g1 as dq,g2 as $k,bv as hq,g3 as fq,g4 as pq,g5 as gq,g6 as KA,g7 as mq,g8 as Vw,g9 as vq,ga as bq,gb as N4,gc as M4,gd as xq,ge as O4,gf as Zb,gg as wq,gh as Cq,gi as yq,gj as _q,gk as Sq,gl as Eq,gm as kq,av as ls,gn as Tq,au as Pc,go as L4,gp as B4,gq as Rq,gr as Aq,gs as Fq,cn as Ww,co as $w,gt as zw,gu as ya,gv as Dq,gw as Tn,gx as en,gy as A0,gz as _m,gA as qw,gB as zk,gC as Kw,gD as Pq,gE as Iq,gF as Nq,gG as fn,gH as Sm,gI as j4,gJ as oa,gK as xd,gL as Mq,gM as Oq,gN as Lq,gO as Bq,gP as YA,gQ as jq,gR as Hq,gS as Uq,cm as Gq,gT as Vq,gU as Jh,gV as H4,gW as U4,gX as qk,gY as ex,gZ as G4,V as Kk,g_ as z1,g$ as Yk,h0 as dy,h1 as Wq,h2 as $q,h3 as zq,h4 as Uh,h5 as q1,h6 as V4,h7 as qq,h8 as W4,h9 as Kq,ha as Yq,hb as Xq,hc as Qq,hd as Jq,he as Zq,hf as eK,hg as tK,hh as nK,hi as sK,hj as tx,hk as rK,hl as iK,hm as aK,hn as oK,ho as lK,hp as cK,hq as Xk,hr as uK,hs as $4,I as rt,ht as dK,hu as Yw,hv as ap,bP as z4,bT as hK,hw as XA,bl as q4,hx as fK,hy as pK,hz as gK,hA as mK,hB as vK,hC as bK,aA as Sr,hD as xK,hE as wK,hF as CK,hG as yK,hH as _K,hI as SK,hJ as EK,hK as kK,hL as TK,hM as RK,hN as AK,hO as FK,hP as K4,hQ as Xw,hR as Y4,hS as Qk,hT as Tf,hU as Qw,hV as Jk,hW as DK,hX as PK,hY as IK,hZ as X4,h_ as NK,h$ as QA,i0 as MK,i1 as Zk,i2 as OK,i3 as eT,i4 as F0,i5 as D0,i6 as LK,i7 as Q4,i8 as Em,i9 as BK,ia as jK,ib as HK,ic as UK,id as GK,ie as VK,ig as JA,ih as J4,ci as Z4,ii as WK,ij as $K,ik as zK,aW as Jw,il as qK,im as KK,io as ZA,ip as YK,iq as XK,ir as eB,is as eF,it as QK,iu as JK,iv as ZK,iw as tB,ix as hy,iy as eY,iz as nB,bD as Lg,iA as tT,dU as tY,iB as nY,bS as nT,iC as Hc,iD as sT,iE as sB,iF as sY,bz as rY,bA as Zw,bx as Rf,iG as rB,iH as iY,iI as iB,iJ as aB,cv as fy,aM as P0,iK as tF,iL as aY,iM as nx,iN as nF,iO as oY,iP as lY,iQ as cY,iR as uY,iS as oB,iT as dY,iU as sF,c7 as Dh,iV as hY,iW as fY,iX as pY,iY as gY,iZ as lB,c8 as mY,i_ as vY,i$ as bY,j0 as xY,j1 as wY,j2 as CY,dq as yY,j3 as _Y,j4 as rT,j5 as SY,j6 as EY,j7 as vv,j8 as cB,j9 as K1,a8 as rF,cK as kY,ja as TY,jb as RY,jc as ed,du as uB,dv as iT,jd as AY,je as FY,jf as DY,jg as dB,cg as PY,jh as iF,ae as aF,ji as IY,aD as hB,dt as NY,jj as Bg,jk as MY,bL as fB,jl as OY,jm as LY,jn as BY,jo as jY,jp as HY,jq as UY,jr as GY,bn as oF,bo as lF,bp as cF,aB as VY,js as WY,jt as $Y,ju as zY,jv as fh,jw as ph,jx as qY,jy as KY,jz as YY,jA as XY,jB as pB,jC as QY,jD as gB,jE as Y1,jF as X1,jG as py,jH as JY,jI as ZY,jJ as Ph,jK as eX,aq as sx,as as mB,aw as tX,aa as uF,jL as nX,jM as sX,jN as rX,jO as iX,jP as aX,jQ as oX,jR as lX,jS as vB,jT as cX,jU as Q1,jV as bB,jW as xB,jX as uX,jY as dX,jZ as hX,j_ as fX,j$ as wB,k0 as op,k1 as pX,k2 as gX,k3 as aT,br as mX,k4 as vX,k5 as bX,k6 as xX,k7 as wX,k8 as CX,k9 as yX,ka as _X,kb as SX,kc as EX,kd as kX,bm as TX,ke as dF,kf as RX,kg as gy,kh as hF,ki as AX,kj as FX,kk as DX,kl as PX,km as IX,kn as NX,ko as MX,kp as OX,kq as LX,kr as BX,ks as jX,kt as HX,ku as UX,kv as GX,kw as VX,kx as WX,ky as fF,kz as $X,kA as zX,al as qX,am as KX,an as YX,ao as XX,ap as QX,kB as JX,kC as ZX,kD as eQ,kE as tQ,kF as nQ,ax as sQ,kG as rQ,kH as iQ,kI as aQ,kJ as pF,d5 as CB,kK as oT,kL as oQ,aU as yB,kM as _B,kN as lQ,kO as cQ,kP as SB,kQ as uQ,kR as Er,kS as dQ,kT as Cc,kU as EB,kV as kB,kW as TB,kX as lT,kY as Di,kZ as hQ,k_ as fQ,k$ as pQ,l0 as gQ,l1 as mQ,l2 as vQ,l3 as bQ,l4 as xQ,l5 as wQ,l6 as CQ,l7 as yQ,l8 as RB,l9 as _Q,la as SQ,lb as EQ,lc as kQ,ld as TQ,le as J1,lf as RQ,lg as AQ,lh as gF,li as AB,lj as FQ,lk as DQ,ll as PQ,lm as mF,ln as IQ,lo as NQ,lp as MQ,lq as OQ,lr as LQ,ls as BQ,lt as jQ,lu as HQ,lv as FB,lw as UQ,lx as GQ,cR as rx,ly as VQ,dk as WQ,lz as vF,lA as $Q,lB as zQ,lC as qQ,cV as KQ,db as YQ,lD as XQ,lE as QQ,lF as JQ,B as DB,da as bF,lG as ZQ,af as eJ,bF as ql,lH as tJ,lI as nJ,lJ as sJ,lK as oi,aY as xF,lL as ix,lM as rJ,lN as wF,lO as iJ,lP as my,lQ as vy,lR as CF,lS as by,lT as yF,lU as PB,lV as IB,aJ,lW as NB,lX as oJ,aG as lJ,aH as cJ,aE as uJ,aF as dJ,lY as hJ,aI as fJ}from"./conversation-input-sync-oIWpPfzj.js";import{c as pt,af as pJ,ag as MB,ah as gJ,ai as mJ,aj as vJ,ak as bJ,al as xJ,am as wJ,an as Gp,ao as CJ,e as ou,S as pn,p as so,u as Et,B as ce,L as nr,I as ps,T as cT,g as js,X as Pn,ap as Z1,aq as Sl,D as Kl,a as Yl,d as jo,y as ba,x as vi,o as I0,h as Af,ae as eC,l as Ze,a0 as lp,b as tC,A as Qr,f as nC,F as km,G as Tm,H as Rm,J as Am,K as Fm,q as Ll,r as Ho,s as Bl,t as eS,v as Jr,w as Gt,ar as N0,as as yJ,at as _J,z as jl,ac as OB,au as tS,av as SJ,aw as EJ,ax as kJ,Y as LB,Z as BB,_ as nS,k as Sb,ad as TJ,a1 as Dm,a2 as jB,a3 as Ff,ay as Zh,az as RJ,M as _F,i as HB,aA as AJ,j as UB,aB as FJ,aC as SF,a4 as DJ,aa as sS,C as PJ,aD as Vp,aE as uT,N as dT,$ as IJ,a5 as NJ,a6 as MJ,a7 as OJ,a8 as LJ,a9 as BJ,aF as jJ,aG as HJ,aH as UJ,aI as GJ,aJ as GB,m as EF,n as kF,E as VJ}from"./error-boundary-BfL6ia-P.js";import{e as cp,g as VB,s as WJ,t as $J,v as rS,w as iS,x as zJ,u as Ke,y as WB,z as $B,A as sC,S as qJ,B as zB,C as KJ,R as YJ,E as XJ,F as El,G as TF,H as QJ,I as JJ,J as ZJ,M as RF,L as rC,N as eZ,O as tZ,Q as vg,U as nZ,V as qB,W as sZ,X as AF,Y as FF,Z as rZ,_ as DF,$ as iZ,a0 as Su,a1 as bv,a2 as aZ,a3 as oZ,a4 as lZ,a5 as PF,a6 as IF,a7 as cZ,a8 as uZ,a9 as dZ,aa as hZ,ab as NF,ac as MF,ad as OF,ae as fZ,af as pZ,ag as gZ,ah as mZ,ai as vZ,aj as LF,ak as bZ,al as xZ,am as BF,an as wZ,ao as CZ,ap as yZ,aq as _Z,ar as SZ,as as EZ,at as KB,r as jF,au as kZ,T as TZ,av as RZ,aw as AZ,ax as FZ,ay as xv,az as wv,aA as HF,aB as Cv,aC as yv,aD as UF,aE as GF,aF as DZ,aG as Eb,aH as PZ,aI as IZ,aJ as NZ,aK as MZ,aL as VF,aM as OZ,aN as LZ,aO as WF,aP as BZ}from"./ui-preferences-store-g6-xQ9NA.js";import{C as jZ}from"./console-mirror-D12eLWy7.js";const aS=8e3,YB=1e4;function HZ(e){return e?`“${e}”`:"Conversation"}const UZ="archived.";function GZ(e){return Ce.getState().archiveFacts[e]}function VZ(e){const t=Ce.getState(),n=t.archiveFacts[e];return n?n.archived:t.sessions.find(s=>s.session_id===e)?.archived}function WZ(){const e=Ce(t=>t.archiveUndo);g.useEffect(()=>{if(e===null)return;let t=!1;const n=()=>{t||(t=!0,r())},s=()=>{n();const i=Ce.getState().archiveUndo;i!==null&&i.sessionId===e.sessionId&&i.at===e.at&&Ce.getState().setArchiveUndo(null)},r=Ce.subscribe(()=>{const i=GZ(e.sessionId);i!==void 0&&!i.answered||B$(e.archived,VZ(e.sessionId))||s()});return n},[e])}function $Z(e){return e===1?"Draft":`${e} drafts`}const zZ="discarded.",qZ=e=>{const t=U1(e),n=t.length,s=t.filter(o=>!o.active).length,r=n===1?"chat":"chats",i=e.filter(o=>Nw(o)!==null&&U1([o]).length===0).length,a=[`Mark ${n} unread ${r} as read${s>0?`, including ${s} in Previous chats`:""}.`];return i>0&&a.push(`${i} unread ${i===1?"mark":"marks"} with no completion token cannot be cleared.`),{count:n,label:`Mark all ${n} read`,scope:a.join(" "),nameSuffix:s>0?`, including ${s} in Previous chats`:""}},XB=e=>e===1?"1 lives on another device and clears when that device updates.":`${e} live on other devices and clear when those devices update.`,KZ=e=>{if(e.attempted===0)return{tone:"success",message:"Nothing to clear."};const t=e.unknown-e.deferred,n=[e.superseded>0?`${e.superseded} ${e.superseded===1?"has a newer result and stays":"have newer results and stay"} unread.`:null,t>0?`${t} could not be cleared and ${t===1?"stays":"stay"} unread.`:null,e.deferred>0?XB(e.deferred):null].filter(s=>s!==null);return e.cleared===0?{tone:"warning",message:["Nothing was cleared.",...n].join(" ")}:{tone:"success",message:[`Marked ${e.cleared} ${e.cleared===1?"chat":"chats"} as read.`,...n].join(" ")}},xy="archive",$F="drafts-undo",zF="bulk-read-deferral",YZ=8e3;function XZ(){const e=Ce(h=>h.archiveFailure),t=Ce(h=>h.archiveUndo),n=Ce(h=>h.draftsUndo),s=Ce(h=>h.bulkReadDeferral),r=Ce(h=>h.clearArchiveFailure),i=Ce(h=>h.setArchiveUndo),a=Ce(h=>h.setSessionArchived),o=Ce(h=>h.restoreDraftsUndo);WZ();const l=g.useRef(null);g.useEffect(()=>{if(e===null&&t===null){if(l.current===null)return;l.current=null,yb(xy);return}const h=e&&t?t.at>e.at?"offer":"failure":e?"failure":"offer",f=h==="offer"?t?.at??0:e?.at??0,p=l.current;l.current={kind:h,at:f},p!==null&&p.kind!==h&&f>p.at&&(h==="failure"?i(null):r());const m=(v,b)=>()=>{const w=Ce.getState();v==="offer"?w.archiveUndo?.at===b&&w.setArchiveUndo(null):w.archiveFailure?.at===b&&w.clearArchiveFailure();const C=l.current;C!==null&&C.kind===v&&C.at===b&&(l.current=null)};if(h==="failure"&&e){Yh(`Could not ${e.archived?"archive":"unarchive"} “${e.title}”.${e.detail?` ${e.detail}`:""}`,{id:xy,duration:YB,onAutoClose:m("failure",e.at),onDismiss:m("failure",e.at),action:{label:"Retry",onClick:v=>{v.preventDefault(),a(e.sessionId,e.archived,e.title)}}});return}t&&Ya(c.jsxs("span",{className:T("flex min-w-0 items-baseline gap-1"),children:[c.jsx("span",{className:T("min-w-0 truncate"),children:HZ(t.title)}),c.jsx("span",{className:T("shrink-0"),children:UZ})]}),{id:xy,duration:aS,classNames:{content:"min-w-0"},onAutoClose:m("offer",t.at),onDismiss:m("offer",t.at),action:{label:"Undo",onClick:v=>{v.preventDefault(),a(t.sessionId,!t.archived,t.title)}}})},[e,t,i,r,a]);const u=g.useRef(!1);g.useEffect(()=>{if(n===null){if(!u.current)return;u.current=!1,yb($F);return}u.current=!0;const h=()=>{const f=Ce.getState();f.draftsUndo?.at===n.at&&(f.setDraftsUndo(null),u.current=!1)};Ya(c.jsxs("span",{className:T("flex min-w-0 items-baseline gap-1"),children:[c.jsx("span",{className:T("min-w-0 truncate"),children:$Z(n.keys.length)}),c.jsx("span",{className:T("shrink-0"),children:zZ})]}),{id:$F,duration:aS,classNames:{content:"min-w-0"},onAutoClose:h,onDismiss:h,action:{label:"Undo",onClick:f=>{f.preventDefault(),o();const p=Ce.getState(),m=p.stagedByDiscard;p.setStagedByDiscard(null),n.keys.length===1&&m!==null&&Ce.getState().activeDraftKey===m&&Ce.getState().openDraft(n.keys[0])}}})},[n,o]);const d=g.useRef(!1);return g.useEffect(()=>{if(s===null){if(!d.current)return;d.current=!1,yb(zF);return}d.current=!0;const h=()=>{const f=Ce.getState();f.bulkReadDeferral?.at===s.at&&(f.clearBulkReadDeferral(),d.current=!1)};Ya(XB(s.count),{id:zF,duration:YZ,onAutoClose:h,onDismiss:h})},[s]),null}var $a,Be=typeof window<"u"?window:void 0,fi=typeof globalThis<"u"?globalThis:Be,QB=Array.prototype,qF=QB.forEach,KF=QB.indexOf,Oi=fi?.navigator,_t=fi?.document,di=fi?.location,oS=fi?.fetch,lS=fi!=null&&fi.XMLHttpRequest&&"withCredentials"in new fi.XMLHttpRequest?fi.XMLHttpRequest:void 0,YF=fi?.AbortController,Ms=Oi?.userAgent,Vt=Be??{},bl={DEBUG:!1,LIB_VERSION:"1.235.6"},wy="$copy_autocapture",QZ=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];(function(e){e.GZipJS="gzip-js",e.Base64="base64"})($a||($a={}));var JZ=["fatal","error","warning","log","info","debug"];function Zt(e,t){return e.indexOf(t)!==-1}var iC=function(e){return e.trim()},hT=function(e){return e.replace(/^\$/,"")},ZZ=Array.isArray,JB=Object.prototype,ZB=JB.hasOwnProperty,aC=JB.toString,cs=ZZ||function(e){return aC.call(e)==="[object Array]"},Xa=e=>typeof e=="function",us=e=>e===Object(e)&&!cs(e),Gh=e=>{if(us(e)){for(var t in e)if(ZB.call(e,t))return!1;return!0}return!1},wt=e=>e===void 0,Ls=e=>aC.call(e)=="[object String]",cS=e=>Ls(e)&&e.trim().length===0,lu=e=>e===null,kn=e=>wt(e)||lu(e),Xr=e=>aC.call(e)=="[object Number]",wl=e=>aC.call(e)==="[object Boolean]",eee=e=>e instanceof FormData,tee=e=>Zt(QZ,e),e6=e=>{var t={_log:function(n){if(Be&&(bl.DEBUG||Vt.POSTHOG_DEBUG)&&!wt(Be.console)&&Be.console){for(var s=("__rrweb_original__"in Be.console[n])?Be.console[n].__rrweb_original__:Be.console[n],r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];s(e,...i)}},info:function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];t._log("log",...s)},warn:function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];t._log("warn",...s)},error:function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];t._log("error",...s)},critical:function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];console.error(e,...s)},uninitializedWarning:n=>{t.error("You must initialize PostHog before calling ".concat(n))},createLogger:n=>e6("".concat(e," ").concat(n))};return t},Rt=e6("[PostHog.js]"),Nr=Rt.createLogger,nee=Nr("[ExternalScriptsLoader]"),XF=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return nee.warn("".concat(t," was requested but loading of external scripts is disabled.")),n("Loading of external scripts is disabled");var s=_t?.querySelectorAll("script");if(s){for(var r=0;r<s.length;r++)if(s[r].src===t)return n()}var i=()=>{if(!_t)return n("document not found");var a=_t.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=t,a.onload=u=>n(void 0,u),a.onerror=u=>n(u),e.config.prepare_external_dependency_script&&(a=e.config.prepare_external_dependency_script(a)),!a)return n("prepare_external_dependency_script returned null");var o,l=_t.querySelectorAll("body > script");l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(a,l[0]):_t.body.appendChild(a)};_t!=null&&_t.body?i():_t?.addEventListener("DOMContentLoaded",i)};function QF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function We(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QF(Object(n),!0).forEach(function(s){ht(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t6(e,t){if(e==null)return{};var n,s,r=function(a,o){if(a==null)return{};var l,u,d={},h=Object.keys(a);for(u=0;u<h.length;u++)l=h[u],o.indexOf(l)>=0||(d[l]=a[l]);return d}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}Vt.__PosthogExtensions__=Vt.__PosthogExtensions__||{},Vt.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var s="/static/".concat(t,".js")+"?v=".concat(e.version);if(t==="remote-config"&&(s="/array/".concat(e.config.token,"/config.js")),t==="toolbar"){var r=3e5,i=Math.floor(Date.now()/r)*r;s="".concat(s,"&t=").concat(i)}var a=e.requestRouter.endpointFor("assets",s);XF(e,a,n)},Vt.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var s=e.requestRouter.endpointFor("api",t);XF(e,s,n)};var ax={};function Uc(e,t,n){if(cs(e)){if(qF&&e.forEach===qF)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var s=0,r=e.length;s<r;s++)if(s in e&&t.call(n,e[s],s)===ax)return}}}function Mn(e,t,n){if(!kn(e)){if(cs(e))return Uc(e,t,n);if(eee(e)){for(var s of e.entries())if(t.call(n,s[1],s[0])===ax)return}else for(var r in e)if(ZB.call(e,r)&&t.call(n,e[r],r)===ax)return}}var ws=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Uc(n,function(r){for(var i in r)r[i]!==void 0&&(e[i]=r[i])}),e},kb=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Uc(n,function(r){Uc(r,function(i){e.push(i)})}),e};function Tb(e){for(var t=Object.keys(e),n=t.length,s=new Array(n);n--;)s[n]=[t[n],e[t[n]]];return s}var JF=function(e){try{return e()}catch{return}},see=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e.apply(this,n)}catch(r){Rt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Rt.critical(r)}}},Pm=function(e){var t={};return Mn(e,function(n,s){Ls(n)&&n.length>0&&(t[s]=n)}),t};function ree(e,t){return n=e,s=i=>Ls(i)&&!lu(t)?i.slice(0,t):i,r=new Set,function i(a,o){return a!==Object(a)?s?s(a,o):a:r.has(a)?void 0:(r.add(a),cs(a)?(l=[],Uc(a,u=>{l.push(i(u))})):(l={},Mn(a,(u,d)=>{r.has(u)||(l[d]=i(u,d))})),l);var l}(n);var n,s,r}var iee=["herokuapp.com","vercel.app","netlify.app"];function aee(e){var t=e?.hostname;if(!Ls(t))return!1;var n=t.split(".").slice(-2).join(".");for(var s of iee)if(n===s)return!1;return!0}function n6(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function ys(e,t,n,s){var{capture:r=!1,passive:i=!0}=s??{};e?.addEventListener(t,n,{capture:r,passive:i})}var s6="$people_distinct_id",bg="__alias",xg="__timers",ZF="$autocapture_disabled_server_side",uS="$heatmaps_enabled_server_side",eD="$exception_capture_enabled_server_side",tD="$web_vitals_enabled_server_side",r6="$dead_clicks_enabled_server_side",nD="$web_vitals_allowed_metrics",dS="$session_recording_enabled_server_side",sD="$console_log_recording_enabled_server_side",rD="$session_recording_network_payload_capture",iD="$session_recording_masking",aD="$session_recording_canvas_recording",oD="$replay_sample_rate",lD="$replay_minimum_duration",cD="$replay_script_config",ox="$sesid",wg="$session_is_sampled",Cy="$session_recording_url_trigger_activated_session",yy="$session_recording_event_trigger_activated_session",Vh="$enabled_feature_flags",Rb="$early_access_features",hS="$feature_flag_details",Cg="$stored_person_properties",Iu="$stored_group_properties",fS="$surveys",_v="$surveys_activated",lx="$flag_call_reported",gl="$user_state",pS="$client_session_props",gS="$capture_rate_limit",mS="$initial_campaign_params",vS="$initial_referrer_info",bS="$initial_person_info",cx="$epp",i6="__POSTHOG_TOOLBAR__",uD="$posthog_cookieless",oee=[s6,bg,"__cmpns",xg,dS,uS,ox,Vh,gl,Rb,hS,Iu,Cg,fS,lx,pS,gS,mS,vS,cx];function dD(e){var t;return e instanceof Element&&(e.id===i6||!((t=e.closest)===null||t===void 0||!t.call(e,".toolbar-global-fade-container")))}function oC(e){return!!e&&e.nodeType===1}function Gc(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function a6(e){return!!e&&e.nodeType===3}function o6(e){return!!e&&e.nodeType===11}function fT(e){return e?iC(e).split(/\s+/):[]}function hD(e){var t=Be?.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function ux(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return fT(t)}function l6(e){return kn(e)?null:iC(e).split(/(\s+)/).filter(t=>Df(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function lC(e){var t="";return wS(e)&&!d6(e)&&e.childNodes&&e.childNodes.length&&Mn(e.childNodes,function(n){var s;a6(n)&&n.textContent&&(t+=(s=l6(n.textContent))!==null&&s!==void 0?s:"")}),iC(t)}function c6(e){return wt(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var xS=["a","button","form","input","select","textarea","label"];function u6(e){var t=e.parentNode;return!(!t||!oC(t))&&t}function lee(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!Be||!e||Gc(e,"html")||!oC(e)||n!=null&&n.url_allowlist&&!hD(n.url_allowlist)||n!=null&&n.url_ignorelist&&hD(n.url_ignorelist))return!1;if(n!=null&&n.dom_event_allowlist){var i=n.dom_event_allowlist;if(i&&!i.some(p=>t.type===p))return!1}for(var a=!1,o=[e],l=!0,u=e;u.parentNode&&!Gc(u,"body");)if(o6(u.parentNode))o.push(u.parentNode.host),u=u.parentNode.host;else{if(!(l=u6(u)))break;if(s||xS.indexOf(l.tagName.toLowerCase())>-1)a=!0;else{var d=Be.getComputedStyle(l);d&&d.getPropertyValue("cursor")==="pointer"&&(a=!0)}o.push(l),u=l}if(!function(p,m){var v=m?.element_allowlist;if(wt(v))return!0;var b=function(y){if(v.some(k=>y.tagName.toLowerCase()===k))return{v:!0}};for(var w of p){var C=b(w);if(typeof C=="object")return C.v}return!1}(o,n)||!function(p,m){var v=m?.css_selector_allowlist;if(wt(v))return!0;var b=function(y){if(v.some(k=>y.matches(k)))return{v:!0}};for(var w of p){var C=b(w);if(typeof C=="object")return C.v}return!1}(o,n))return!1;var h=Be.getComputedStyle(e);if(h&&h.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return a?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(xS.indexOf(f)>-1||e.getAttribute("contenteditable")==="true")}}function wS(e){for(var t=e;t.parentNode&&!Gc(t,"body");t=t.parentNode){var n=ux(t);if(Zt(n,"ph-sensitive")||Zt(n,"ph-no-capture"))return!1}if(Zt(ux(e),"ph-include"))return!0;var s=e.type||"";if(Ls(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!(Ls(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function d6(e){return!!(Gc(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Gc(e,"select")||Gc(e,"textarea")||e.getAttribute("contenteditable")==="true")}var h6="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",cee=new RegExp("^(?:".concat(h6,")$")),uee=new RegExp(h6),f6="\\d{3}-?\\d{2}-?\\d{4}",dee=new RegExp("^(".concat(f6,")$")),hee=new RegExp("(".concat(f6,")"));function Df(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(kn(e)||Ls(e)&&(e=iC(e),(t?cee:uee).test((e||"").replace(/[- ]/g,""))||(t?dee:hee).test(e)))}function p6(e){var t=lC(e);return Df(t="".concat(t," ").concat(g6(e)).trim())?t:""}function g6(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Mn(e.childNodes,function(n){var s;if(n&&((s=n.tagName)===null||s===void 0?void 0:s.toLowerCase())==="span")try{var r=lC(n);t="".concat(t," ").concat(r).trim(),n.childNodes&&n.childNodes.length&&(t="".concat(t," ").concat(g6(n)).trim())}catch(i){Rt.error("[AutoCapture]",i)}}),t}function fee(e){return function(t){var n=t.map(s=>{var r,i,a="";if(s.tag_name&&(a+=s.tag_name),s.attr_class)for(var o of(s.attr_class.sort(),s.attr_class))a+=".".concat(o.replace(/"/g,""));var l=We(We(We(We({},s.text?{text:s.text}:{}),{},{"nth-child":(r=s.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(i=s.nth_of_type)!==null&&i!==void 0?i:0},s.href?{href:s.href}:{}),s.attr_id?{attr_id:s.attr_id}:{}),s.attributes),u={};return Tb(l).sort((d,h)=>{var[f]=d,[p]=h;return f.localeCompare(p)}).forEach(d=>{var[h,f]=d;return u[fD(h.toString())]=fD(f.toString())}),a+=":",a+=Tb(l).map(d=>{var[h,f]=d;return"".concat(h,'="').concat(f,'"')}).join("")});return n.join(";")}(function(t){return t.map(n=>{var s,r,i={text:(s=n.$el_text)===null||s===void 0?void 0:s.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)===null||r===void 0?void 0:r.slice(0,2048),attr_class:pee(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Tb(n).filter(a=>{var[o]=a;return o.indexOf("attr__")===0}).forEach(a=>{var[o,l]=a;return i.attributes[o]=l}),i})}(e))}function fD(e){return e.replace(/"|\\"/g,'\\"')}function pee(e){var t=e.attr__class;return t?cs(t)?t:fT(t):void 0}class m6{constructor(){this.clicks=[]}isRageClick(t,n,s){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(n-r.y)<30&&s-r.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:s}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:s}];return!1}}var gee=["localhost","127.0.0.1"],ef=e=>{var t=_t?.createElement("a");return wt(t)?null:(t.href=e,t)},mee=function(e){var t,n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return Mn(e,function(i,a){wt(i)||wt(a)||a==="undefined"||(t=encodeURIComponent((o=>o instanceof File)(i)?i.name:i.toString()),n=encodeURIComponent(a),r[r.length]=n+"="+t)}),r.join(s)},dx=function(e,t){for(var n,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++){var i=s[r].split("=");if(i[0]===t){n=i;break}}if(!cs(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{Rt.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},_y=function(e,t,n){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[0]||"",i=s[1],a=r.split("?"),o=a[1],l=a[0],u=(o||"").split("&"),d=[],h=0;h<u.length;h++){var f=u[h].split("=");cs(f)&&(t.includes(f[0])?d.push(f[0]+"="+n):d.push(u[h]))}var p=l;return o!=null&&(p+="?"+d.join("&")),i!=null&&(p+="#"+i),p},hx=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},pD=Nr("[AutoCapture]");function Sy(e,t){return t.length>e?t.slice(0,e)+"...":t}function vee(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!oC(t));return t}function bee(e,t,n,s){var r=e.tagName.toLowerCase(),i={tag_name:r};xS.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?i.$el_text=Sy(1024,p6(e)):i.$el_text=Sy(1024,lC(e)));var a=ux(e);a.length>0&&(i.classes=a.filter(function(d){return d!==""})),Mn(e.attributes,function(d){var h;if((!d6(e)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(s==null||!s.includes(d.name))&&!t&&Df(d.value)&&(h=d.name,!Ls(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var f=d.value;d.name==="class"&&(f=fT(f).join(" ")),i["attr__"+d.name]=Sy(1024,f)}});for(var o=1,l=1,u=e;u=vee(u);)o++,u.tagName===e.tagName&&l++;return i.nth_child=o,i.nth_of_type=l,i}function xee(e,t){for(var n,s,{e:r,maskAllElementAttributes:i,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:l}=t,u=[e],d=e;d.parentNode&&!Gc(d,"body");)o6(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var h,f=[],p={},m=!1,v=!1;if(Mn(u,k=>{var _=wS(k);k.tagName.toLowerCase()==="a"&&(m=k.getAttribute("href"),m=_&&m&&Df(m)&&m),Zt(ux(k),"ph-no-capture")&&(v=!0),f.push(bee(k,i,a,o));var E=function(R){if(!wS(R))return{};var F={};return Mn(R.attributes,function(A){if(A.name&&A.name.indexOf("data-ph-capture-attribute")===0){var N=A.name.replace("data-ph-capture-attribute-",""),M=A.value;N&&M&&Df(M)&&(F[N]=M)}}),F}(k);ws(p,E)}),v)return{props:{},explicitNoCapture:v};if(a||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?f[0].$el_text=p6(e):f[0].$el_text=lC(e)),m){var b,w;f[0].attr__href=m;var C=(b=ef(m))===null||b===void 0?void 0:b.host,y=Be==null||(w=Be.location)===null||w===void 0?void 0:w.host;C&&y&&C!==y&&(h=m)}return{props:ws({$event_type:r.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:fee(f)},(n=f[0])!==null&&n!==void 0&&n.$el_text?{$el_text:(s=f[0])===null||s===void 0?void 0:s.$el_text}:{},h&&r.type==="click"?{$external_click_url:h}:{},p)}}let wee=class{constructor(t){ht(this,"_initialized",!1),ht(this,"_isDisabledServerSide",null),ht(this,"rageclicks",new m6),ht(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}get config(){var t,n,s=us(this.instance.config.autocapture)?this.instance.config.autocapture:{};return s.url_allowlist=(t=s.url_allowlist)===null||t===void 0?void 0:t.map(r=>new RegExp(r)),s.url_ignorelist=(n=s.url_ignorelist)===null||n===void 0?void 0:n.map(r=>new RegExp(r)),s}_addDomEventHandlers(){if(this.isBrowserSupported()){if(Be&&_t){var t=s=>{s=s||Be?.event;try{this._captureEvent(s)}catch(r){pD.error("Failed to capture event",r)}};if(ys(_t,"submit",t,{capture:!0}),ys(_t,"change",t,{capture:!0}),ys(_t,"click",t,{capture:!0}),this.config.capture_copied_text){var n=s=>{s=s||Be?.event,this._captureEvent(s,wy)};ys(_t,"copy",n,{capture:!0}),ys(_t,"cut",n,{capture:!0})}}}else pD.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this._elementsChainAsString=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ZF]:!!t.autocapture_opt_out}),this._isDisabledServerSide=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this._elementSelectors=t}getElementSelectors(t){var n,s=[];return(n=this._elementSelectors)===null||n===void 0||n.forEach(r=>{var i=_t?.querySelectorAll(r);i?.forEach(a=>{t===a&&s.push(r)})}),s}get isEnabled(){var t,n,s=(t=this.instance.persistence)===null||t===void 0?void 0:t.props[ZF],r=this._isDisabledServerSide;if(lu(r)&&!wl(s)&&!this.instance.config.advanced_disable_decide)return!1;var i=(n=this._isDisabledServerSide)!==null&&n!==void 0?n:!!s;return!!this.instance.config.autocapture&&!i}_captureEvent(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var s,r=c6(t);a6(r)&&(r=r.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(s=this.rageclicks)!==null&&s!==void 0&&s.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._captureEvent(t,"$rageclick");var i=n===wy;if(r&&lee(r,t,this.config,i,i?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=xee(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),n===wy){var u,d=l6(Be==null||(u=Be.getSelection())===null||u===void 0?void 0:u.toString()),h=t.type||"clipboard";if(!d)return!1;a.$selected_content=d,a.$copy_type=h}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return Xa(_t?.querySelectorAll)}};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Xr(e)&&isFinite(e)&&Math.floor(e)===e});var gD="0123456789abcdef";let Cee=class CS{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,s,r){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(s)||!Number.isInteger(r)||t<0||n<0||s<0||r<0||t>0xffffffffffff||n>4095||s>1073741823||r>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=t/Math.pow(2,40),i[1]=t/Math.pow(2,32),i[2]=t/Math.pow(2,24),i[3]=t/Math.pow(2,16),i[4]=t/Math.pow(2,8),i[5]=t,i[6]=112|n>>>8,i[7]=n,i[8]=128|s>>>24,i[9]=s>>>16,i[10]=s>>>8,i[11]=s,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r,new CS(i)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+gD.charAt(this.bytes[n]>>>4)+gD.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new CS(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var s=this.bytes[n]-t.bytes[n];if(s!==0)return Math.sign(s)}return 0}},yee=class{constructor(){ht(this,"timestamp",0),ht(this,"counter",0),ht(this,"random",new _ee)}generate(){var t=this.generateOrAbort();if(wt(t)){this.timestamp=0;var n=this.generateOrAbort();if(wt(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Cee.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}};var mD,v6=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Be&&!wt(Be.crypto)&&crypto.getRandomValues&&(v6=e=>crypto.getRandomValues(e));let _ee=class{constructor(){ht(this,"buffer",new Uint32Array(8)),ht(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(v6(this.buffer),this.cursor=0),this.buffer[this.cursor++]}};var Ic=()=>See().toString(),See=()=>(mD||(mD=new yee)).generate(),Eee="Thu, 01 Jan 1970 00:00:00 GMT",Wp="",kee=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Tee(e,t){if(t){var n=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t;if(Wp)return Wp;if(!i||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),o=Math.min(a.length,8),l="dmn_chk_"+Ic(),u=new RegExp("(^|;)\\s*"+l+"=1");!Wp&&o--;){var d=a.slice(o).join("."),h=l+"=1;domain=."+d;i.cookie=h,u.test(i.cookie)&&(i.cookie=h+";expires="+Eee,Wp=d)}return Wp}(e);if(!n){var s=(r=>{var i=r.match(kee);return i?i[0]:""})(e);s!==n&&Rt.info("Warning: cookie subdomain discovery mismatch",s,n),n=s}return n?"; domain=."+n:""}return""}var kc,Tl={is_supported:()=>!!_t,error:function(e){Rt.error("cookieStore error: "+e)},get:function(e){if(_t){try{for(var t=e+"=",n=_t.cookie.split(";").filter(i=>i.length),s=0;s<n.length;s++){for(var r=n[s];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(t)===0)return decodeURIComponent(r.substring(t.length,r.length))}}catch{}return null}},parse:function(e){var t;try{t=JSON.parse(Tl.get(e))||{}}catch{}return t},set:function(e,t,n,s,r){if(_t)try{var i="",a="",o=Tee(_t.location.hostname,s);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),i="; expires="+l.toUTCString()}r&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&Rt.warn("cookieStore warning: large cookie, len="+u.length),_t.cookie=u,u}catch{return}},remove:function(e,t){try{Tl.set(e,"",-1,t)}catch{return}}},Ey=null,Us={is_supported:function(){if(!lu(Ey))return Ey;var e=!0;if(wt(Be))e=!1;else try{var t="__mplssupport__";Us.set(t,"xyz"),Us.get(t)!=='"xyz"'&&(e=!1),Us.remove(t)}catch{e=!1}return e||Rt.error("localStorage unsupported; falling back to cookie store"),Ey=e,e},error:function(e){Rt.error("localStorage error: "+e)},get:function(e){try{return Be?.localStorage.getItem(e)}catch(t){Us.error(t)}return null},parse:function(e){try{return JSON.parse(Us.get(e))||{}}catch{}return null},set:function(e,t){try{Be?.localStorage.setItem(e,JSON.stringify(t))}catch(n){Us.error(n)}},remove:function(e){try{Be?.localStorage.removeItem(e)}catch(t){Us.error(t)}}},Ree=["distinct_id",ox,wg,cx,bS],Sv=We(We({},Us),{},{parse:function(e){try{var t={};try{t=Tl.parse(e)||{}}catch{}var n=ws(t,JSON.parse(Us.get(e)||"{}"));return Us.set(e,n),n}catch{}return null},set:function(e,t,n,s,r,i){try{Us.set(e,t,void 0,void 0,i);var a={};Ree.forEach(o=>{t[o]&&(a[o]=t[o])}),Object.keys(a).length&&Tl.set(e,a,n,s,r,i)}catch(o){Us.error(o)}},remove:function(e,t){try{Be?.localStorage.removeItem(e),Tl.remove(e,t)}catch(n){Us.error(n)}}}),Ev={},Aee={is_supported:function(){return!0},error:function(e){Rt.error("memoryStorage error: "+e)},get:function(e){return Ev[e]||null},parse:function(e){return Ev[e]||null},set:function(e,t){Ev[e]=t},remove:function(e){delete Ev[e]}},Eu=null,fr={is_supported:function(){if(!lu(Eu))return Eu;if(Eu=!0,wt(Be))Eu=!1;else try{var e="__support__";fr.set(e,"xyz"),fr.get(e)!=='"xyz"'&&(Eu=!1),fr.remove(e)}catch{Eu=!1}return Eu},error:function(e){Rt.error("sessionStorage error: ",e)},get:function(e){try{return Be?.sessionStorage.getItem(e)}catch(t){fr.error(t)}return null},parse:function(e){try{return JSON.parse(fr.get(e))||null}catch{}return null},set:function(e,t){try{Be?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){fr.error(n)}},remove:function(e){try{Be?.sessionStorage.removeItem(e)}catch(t){fr.error(t)}}};(function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"})(kc||(kc={}));let Fee=class{constructor(t){this.instance=t}get config(){return this.instance.config}get consent(){return this.getDnt()?kc.DENIED:this.storedConsent}isOptedOut(){return this.consent===kc.DENIED||this.consent===kc.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(t){this.storage.set(this.storageKey,t?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:t,opt_out_capturing_cookie_prefix:n}=this.instance.config;return(n||"__ph_opt_in_out_")+t}get storedConsent(){var t=this.storage.get(this.storageKey);return t==="1"?kc.GRANTED:t==="0"?kc.DENIED:kc.PENDING}get storage(){if(!this._storage){var t=this.config.opt_out_capturing_persistence_type;this._storage=t==="localStorage"?Us:Tl;var n=t==="localStorage"?Tl:Us;n.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(n.get(this.storageKey)==="1"),n.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!n6([Oi?.doNotTrack,Oi?.msDoNotTrack,Vt.doNotTrack],t=>Zt([!0,1,"1","yes"],t))}};var kv=Nr("[Dead Clicks]"),Dee=()=>!0,Pee=e=>{var t,n=!((t=e.instance.persistence)===null||t===void 0||!t.get_property(r6)),s=e.instance.config.capture_dead_clicks;return wl(s)?s:n};let b6=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(t,n,s){this.instance=t,this.isEnabled=n,this.onCapture=s,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[r6]:t?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(t){var n,s,r;(n=Vt.__PosthogExtensions__)!==null&&n!==void 0&&n.initDeadClicksAutocapture&&t(),(s=Vt.__PosthogExtensions__)===null||s===void 0||(r=s.loadExternalDependency)===null||r===void 0||r.call(s,this.instance,"dead-clicks-autocapture",i=>{i?kv.error("failed to load script",i):t()})}start(){var t;if(_t){if(!this._lazyLoadedDeadClicksAutocapture&&(t=Vt.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture){var n=us(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=Vt.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this._lazyLoadedDeadClicksAutocapture.start(_t),kv.info("starting...")}}else kv.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,kv.info("stopping..."))}};var ky=Nr("[ExceptionAutocapture]");let Iee=class{constructor(t){var n;ht(this,"startCapturing",()=>{var s;if(Be&&this.isEnabled&&(s=Vt.__PosthogExtensions__)!==null&&s!==void 0&&s.errorWrappingFunctions){var r=Vt.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Vt.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=Vt.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.unwrapOnError&&this.config.capture_unhandled_errors&&(this.unwrapOnError=r(this.captureException.bind(this))),!this.unwrapUnhandledRejection&&this.config.capture_unhandled_rejections&&(this.unwrapUnhandledRejection=i(this.captureException.bind(this))),!this.unwrapConsoleError&&this.config.capture_console_errors&&(this.unwrapConsoleError=a(this.captureException.bind(this)))}catch(o){ky.error("failed to start",o),this.stopCapturing()}}}),this.instance=t,this.remoteEnabled=!((n=this.instance.persistence)===null||n===void 0||!n.props[eD]),this.config=this.requiredConfig(),this.startIfEnabled()}requiredConfig(){var t=this.instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return us(t)?n=We(We({},n),t):(wt(t)?this.remoteEnabled:t)&&(n=We(We({},n),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.config.capture_console_errors||this.config.capture_unhandled_errors||this.config.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(ky.info("enabled"),this.loadScript(this.startCapturing))}loadScript(t){var n,s,r;(n=Vt.__PosthogExtensions__)!==null&&n!==void 0&&n.errorWrappingFunctions&&t(),(s=Vt.__PosthogExtensions__)===null||s===void 0||(r=s.loadExternalDependency)===null||r===void 0||r.call(s,this.instance,"exception-autocapture",i=>{if(i)return ky.error("failed to load script",i);t()})}stopCapturing(){var t,n,s;(t=this.unwrapOnError)===null||t===void 0||t.call(this),this.unwrapOnError=void 0,(n=this.unwrapUnhandledRejection)===null||n===void 0||n.call(this),this.unwrapUnhandledRejection=void 0,(s=this.unwrapConsoleError)===null||s===void 0||s.call(this),this.unwrapConsoleError=void 0}onRemoteConfig(t){var n=t.autocaptureExceptions;this.remoteEnabled=!!n||!1,this.config=this.requiredConfig(),this.instance.persistence&&this.instance.persistence.register({[eD]:this.remoteEnabled}),this.startIfEnabled()}captureException(t){var n=this.instance.requestRouter.endpointFor("ui");t.$exception_personURL="".concat(n,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(t)}};function x6(e){return!wt(Event)&&w6(e,Event)}function w6(e,t){try{return e instanceof t}catch{return!1}}function Ab(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function Ty(e){return Ab(e,"DOMError")}var vD=/\(error: (.*)\)/,bD=50,Wh="?";function Ry(e,t,n,s){var r={platform:"web:javascript",filename:e,function:t==="<anonymous>"?Wh:t,in_app:!0};return wt(n)||(r.lineno=n),wt(s)||(r.colno=s),r}var Nee=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Mee=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Oee=/\((\S*)(?::(\d+))(?::(\d+))\)/,Lee=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Bee=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,jee=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var s=t.sort((r,i)=>r[0]-i[0]).map(r=>r[1]);return function(r){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=[],o=r.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./agent-details-page-BEoctGwH.js","./index-DbzmFwlT.js","./index-BUuvY2SU.css","./publication-validation-BIJPIOf1.js","./conversation-input-sync-Cs9wr7F7.js","./ui-preferences-store-D1IJShox.js","./error-boundary-B5YLbOOu.js","./conversation-input-sync-CAX4_ErH.css","./use-memberships-query-AlVCuF9E.js","./use-download-agent-mutation-C6TvAwyM.js","./en-US-CHJkXXr4.js","./book-open--60aKTv6.js","./console-mirror-Ch4jKiRK.js","./console-mirror-DOrYoP_4.css","./agent-hub-page-DVtEYZne.js","./page-header-B3mzM2nC.js","./org-access-D0eAQUWQ.js","./radient-auth-buttons-MPoHRsQX.js","./format-esAOn2VS.js","./org-surface-gate-Bgznt94a.js","./agents-page-CqlFD0Ps.js","./schedules-page-CR7bLqQt.js","./parseISO-BHJWTxrA.js","./projects-page-T2Yw-kRf.js","./use-session-snapshot-XM0bTxHC.js","./browser-page-jc3r193W.js","./mesh-page-DCCummN5.js","./settings-page-B_D-wGm4.js","./notebook-pen-Dj0km82T.js","./browser-webauthn-prompt-PeVRs-qh.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as g,j as c,c as T,b as $e,i as BA,p as P$,y as I$,o as N$,t as x,z as H1,L as Ro,A as M$,a as O$,R as L$}from"./index-DbzmFwlT.js";import{ar as Ce,e8 as B$,e9 as U1,ea as Nw,cd as yb,bI as Yh,cb as Ya,bQ as Ok,C as fs,ah as Ca,ai as Es,a4 as zt,aK as Kn,aL as Bs,u as nn,a3 as au,aR as k0,ce as j$,aS as T0,eb as g4,ec as H$,a as jn,c as yt,e as R0,ed as ym,ee as U$,ef as G$,eg as V$,eh as W$,aO as m4,aN as ti,ei as Lk,ej as fl,ek as ly,el as cy,dz as _l,cf as Bk,cZ as zl,cy as _b,cx as $$,cw as Ys,cz as ln,em as v4,en as z$,eo as G1,d as xt,cF as jk,d9 as q$,Z as Vi,ay as Wa,D as Hk,ep as jA,eq as K$,er as Y$,es as V1,et as X$,eu as Q$,ev as J$,ew as Z$,aC as Xh,ex as HA,ey as UA,ez,eA as tz,eB as nz,eC as b4,eD as sz,eE as rz,eF as x4,eG as Mw,eH as Ow,eI as iz,eJ as az,eK as oz,eL as GA,eM as lz,eN as Hh,eO as w4,eP as cz,eQ as uz,eR as dz,eS as hz,eT as fz,eU as pz,eV as gz,eW as C4,eX as mz,eY as vz,a0 as Ci,eZ as y4,e_ as bz,e$ as VA,f0 as xz,f1 as wz,f2 as Wi,f3 as Lw,f4 as _4,f5 as Cz,f6 as yz,f7 as WA,f8 as _z,f9 as Sz,aT as rp,fa as Ez,fb as kz,fc as Tz,bq as S4,fd as Rz,fe as Az,ff as Fz,e3 as E4,fg as Dz,bH as Bo,fh as Pz,fi as Iz,bG as vd,fj as Yc,fk as Nz,ad as Uk,fl as $A,fm as Mz,fn as Oz,fo as Lz,fp as Bz,fq as jz,fr as Hz,fs as Fh,d1 as Uz,ft as Gz,fu as Vz,d4 as Wz,fv as Bw,fw as W1,fx as jw,fy as $z,fz as zz,fA as qz,fB as Kz,at as Zu,fC as uy,_ as k4,fD as T4,aV as R4,aX as va,fE as Gk,bu as A4,aP as Vk,c_ as Hw,fF as F4,bM as Xc,ck as Uw,fG as Yz,cl as Gw,bE as bd,fH as Xz,fI as Qz,fJ as Jz,fK as Zz,fL as eq,fM as tq,fN as nq,fO as sq,fP as zA,fQ as rq,fR as iq,fS as Wk,fT as qA,d6 as aq,fU as oq,fV as D4,fW as lq,fX as cq,fY as P4,fZ as $1,f_ as uq,b as I4,f$ as Qh,g0 as ip,g1 as dq,g2 as $k,bv as hq,g3 as fq,g4 as pq,g5 as gq,g6 as KA,g7 as mq,g8 as Vw,g9 as vq,ga as bq,gb as N4,gc as M4,gd as xq,ge as O4,gf as Zb,gg as wq,gh as Cq,gi as yq,gj as _q,gk as Sq,gl as Eq,gm as kq,av as ls,gn as Tq,au as Pc,go as L4,gp as B4,gq as Rq,gr as Aq,gs as Fq,cn as Ww,co as $w,gt as zw,gu as ya,gv as Dq,gw as Tn,gx as en,gy as A0,gz as _m,gA as qw,gB as zk,gC as Kw,gD as Pq,gE as Iq,gF as Nq,gG as fn,gH as Sm,gI as j4,gJ as oa,gK as xd,gL as Mq,gM as Oq,gN as Lq,gO as Bq,gP as YA,gQ as jq,gR as Hq,gS as Uq,cm as Gq,gT as Vq,gU as Jh,gV as H4,gW as U4,gX as qk,gY as ex,gZ as G4,V as Kk,g_ as z1,g$ as Yk,h0 as dy,h1 as Wq,h2 as $q,h3 as zq,h4 as Uh,h5 as q1,h6 as V4,h7 as qq,h8 as W4,h9 as Kq,ha as Yq,hb as Xq,hc as Qq,hd as Jq,he as Zq,hf as eK,hg as tK,hh as nK,hi as sK,hj as tx,hk as rK,hl as iK,hm as aK,hn as oK,ho as lK,hp as cK,hq as Xk,hr as uK,hs as $4,I as rt,ht as dK,hu as Yw,hv as ap,bP as z4,bT as hK,hw as XA,bl as q4,hx as fK,hy as pK,hz as gK,hA as mK,hB as vK,hC as bK,aA as Sr,hD as xK,hE as wK,hF as CK,hG as yK,hH as _K,hI as SK,hJ as EK,hK as kK,hL as TK,hM as RK,hN as AK,hO as FK,hP as K4,hQ as Xw,hR as Y4,hS as Qk,hT as Tf,hU as Qw,hV as Jk,hW as DK,hX as PK,hY as IK,hZ as X4,h_ as NK,h$ as QA,i0 as MK,i1 as Zk,i2 as OK,i3 as eT,i4 as F0,i5 as D0,i6 as LK,i7 as Q4,i8 as Em,i9 as BK,ia as jK,ib as HK,ic as UK,id as GK,ie as VK,ig as JA,ih as J4,ci as Z4,ii as WK,ij as $K,ik as zK,aW as Jw,il as qK,im as KK,io as ZA,ip as YK,iq as XK,ir as eB,is as eF,it as QK,iu as JK,iv as ZK,iw as tB,ix as hy,iy as eY,iz as nB,bD as Lg,iA as tT,dU as tY,iB as nY,bS as nT,iC as Hc,iD as sT,iE as sB,iF as sY,bz as rY,bA as Zw,bx as Rf,iG as rB,iH as iY,iI as iB,iJ as aB,cv as fy,aM as P0,iK as tF,iL as aY,iM as nx,iN as nF,iO as oY,iP as lY,iQ as cY,iR as uY,iS as oB,iT as dY,iU as sF,c7 as Dh,iV as hY,iW as fY,iX as pY,iY as gY,iZ as lB,c8 as mY,i_ as vY,i$ as bY,j0 as xY,j1 as wY,j2 as CY,dq as yY,j3 as _Y,j4 as rT,j5 as SY,j6 as EY,j7 as vv,j8 as cB,j9 as K1,a8 as rF,cK as kY,ja as TY,jb as RY,jc as ed,du as uB,dv as iT,jd as AY,je as FY,jf as DY,jg as dB,cg as PY,jh as iF,ae as aF,ji as IY,aD as hB,dt as NY,jj as Bg,jk as MY,bL as fB,jl as OY,jm as LY,jn as BY,jo as jY,jp as HY,jq as UY,jr as GY,bn as oF,bo as lF,bp as cF,aB as VY,js as WY,jt as $Y,ju as zY,jv as fh,jw as ph,jx as qY,jy as KY,jz as YY,jA as XY,jB as pB,jC as QY,jD as gB,jE as Y1,jF as X1,jG as py,jH as JY,jI as ZY,jJ as Ph,jK as eX,aq as sx,as as mB,aw as tX,aa as uF,jL as nX,jM as sX,jN as rX,jO as iX,jP as aX,jQ as oX,jR as lX,jS as vB,jT as cX,jU as Q1,jV as bB,jW as xB,jX as uX,jY as dX,jZ as hX,j_ as fX,j$ as wB,k0 as op,k1 as pX,k2 as gX,k3 as aT,br as mX,k4 as vX,k5 as bX,k6 as xX,k7 as wX,k8 as CX,k9 as yX,ka as _X,kb as SX,kc as EX,kd as kX,bm as TX,ke as dF,kf as RX,kg as gy,kh as hF,ki as AX,kj as FX,kk as DX,kl as PX,km as IX,kn as NX,ko as MX,kp as OX,kq as LX,kr as BX,ks as jX,kt as HX,ku as UX,kv as GX,kw as VX,kx as WX,ky as fF,kz as $X,kA as zX,al as qX,am as KX,an as YX,ao as XX,ap as QX,kB as JX,kC as ZX,kD as eQ,kE as tQ,kF as nQ,ax as sQ,kG as rQ,kH as iQ,kI as aQ,kJ as pF,d5 as CB,kK as oT,kL as oQ,aU as yB,kM as _B,kN as lQ,kO as cQ,kP as SB,kQ as uQ,kR as Er,kS as dQ,kT as Cc,kU as EB,kV as kB,kW as TB,kX as lT,kY as Di,kZ as hQ,k_ as fQ,k$ as pQ,l0 as gQ,l1 as mQ,l2 as vQ,l3 as bQ,l4 as xQ,l5 as wQ,l6 as CQ,l7 as yQ,l8 as RB,l9 as _Q,la as SQ,lb as EQ,lc as kQ,ld as TQ,le as J1,lf as RQ,lg as AQ,lh as gF,li as AB,lj as FQ,lk as DQ,ll as PQ,lm as mF,ln as IQ,lo as NQ,lp as MQ,lq as OQ,lr as LQ,ls as BQ,lt as jQ,lu as HQ,lv as FB,lw as UQ,lx as GQ,cR as rx,ly as VQ,dk as WQ,lz as vF,lA as $Q,lB as zQ,lC as qQ,cV as KQ,db as YQ,lD as XQ,lE as QQ,lF as JQ,B as DB,da as bF,lG as ZQ,af as eJ,bF as ql,lH as tJ,lI as nJ,lJ as sJ,lK as oi,aY as xF,lL as ix,lM as rJ,lN as wF,lO as iJ,lP as my,lQ as vy,lR as CF,lS as by,lT as yF,lU as PB,lV as IB,aJ,lW as NB,lX as oJ,aG as lJ,aH as cJ,aE as uJ,aF as dJ,lY as hJ,aI as fJ}from"./conversation-input-sync-Cs9wr7F7.js";import{c as pt,af as pJ,ag as MB,ah as gJ,ai as mJ,aj as vJ,ak as bJ,al as xJ,am as wJ,an as Gp,ao as CJ,e as ou,S as pn,p as so,u as Et,B as ce,L as nr,I as ps,T as cT,g as js,X as Pn,ap as Z1,aq as Sl,D as Kl,a as Yl,d as jo,y as ba,x as vi,o as I0,h as Af,ae as eC,l as Ze,a0 as lp,b as tC,A as Qr,f as nC,F as km,G as Tm,H as Rm,J as Am,K as Fm,q as Ll,r as Ho,s as Bl,t as eS,v as Jr,w as Gt,ar as N0,as as yJ,at as _J,z as jl,ac as OB,au as tS,av as SJ,aw as EJ,ax as kJ,Y as LB,Z as BB,_ as nS,k as Sb,ad as TJ,a1 as Dm,a2 as jB,a3 as Ff,ay as Zh,az as RJ,M as _F,i as HB,aA as AJ,j as UB,aB as FJ,aC as SF,a4 as DJ,aa as sS,C as PJ,aD as Vp,aE as uT,N as dT,$ as IJ,a5 as NJ,a6 as MJ,a7 as OJ,a8 as LJ,a9 as BJ,aF as jJ,aG as HJ,aH as UJ,aI as GJ,aJ as GB,m as EF,n as kF,E as VJ}from"./error-boundary-B5YLbOOu.js";import{e as cp,g as VB,s as WJ,t as $J,v as rS,w as iS,x as zJ,u as Ke,y as WB,z as $B,A as sC,S as qJ,B as zB,C as KJ,R as YJ,E as XJ,F as El,G as TF,H as QJ,I as JJ,J as ZJ,M as RF,L as rC,N as eZ,O as tZ,Q as vg,U as nZ,V as qB,W as sZ,X as AF,Y as FF,Z as rZ,_ as DF,$ as iZ,a0 as Su,a1 as bv,a2 as aZ,a3 as oZ,a4 as lZ,a5 as PF,a6 as IF,a7 as cZ,a8 as uZ,a9 as dZ,aa as hZ,ab as NF,ac as MF,ad as OF,ae as fZ,af as pZ,ag as gZ,ah as mZ,ai as vZ,aj as LF,ak as bZ,al as xZ,am as BF,an as wZ,ao as CZ,ap as yZ,aq as _Z,ar as SZ,as as EZ,at as KB,r as jF,au as kZ,T as TZ,av as RZ,aw as AZ,ax as FZ,ay as xv,az as wv,aA as HF,aB as Cv,aC as yv,aD as UF,aE as GF,aF as DZ,aG as Eb,aH as PZ,aI as IZ,aJ as NZ,aK as MZ,aL as VF,aM as OZ,aN as LZ,aO as WF,aP as BZ}from"./ui-preferences-store-D1IJShox.js";import{C as jZ}from"./console-mirror-Ch4jKiRK.js";const aS=8e3,YB=1e4;function HZ(e){return e?`“${e}”`:"Conversation"}const UZ="archived.";function GZ(e){return Ce.getState().archiveFacts[e]}function VZ(e){const t=Ce.getState(),n=t.archiveFacts[e];return n?n.archived:t.sessions.find(s=>s.session_id===e)?.archived}function WZ(){const e=Ce(t=>t.archiveUndo);g.useEffect(()=>{if(e===null)return;let t=!1;const n=()=>{t||(t=!0,r())},s=()=>{n();const i=Ce.getState().archiveUndo;i!==null&&i.sessionId===e.sessionId&&i.at===e.at&&Ce.getState().setArchiveUndo(null)},r=Ce.subscribe(()=>{const i=GZ(e.sessionId);i!==void 0&&!i.answered||B$(e.archived,VZ(e.sessionId))||s()});return n},[e])}function $Z(e){return e===1?"Draft":`${e} drafts`}const zZ="discarded.",qZ=e=>{const t=U1(e),n=t.length,s=t.filter(o=>!o.active).length,r=n===1?"chat":"chats",i=e.filter(o=>Nw(o)!==null&&U1([o]).length===0).length,a=[`Mark ${n} unread ${r} as read${s>0?`, including ${s} in Previous chats`:""}.`];return i>0&&a.push(`${i} unread ${i===1?"mark":"marks"} with no completion token cannot be cleared.`),{count:n,label:`Mark all ${n} read`,scope:a.join(" "),nameSuffix:s>0?`, including ${s} in Previous chats`:""}},XB=e=>e===1?"1 lives on another device and clears when that device updates.":`${e} live on other devices and clear when those devices update.`,KZ=e=>{if(e.attempted===0)return{tone:"success",message:"Nothing to clear."};const t=e.unknown-e.deferred,n=[e.superseded>0?`${e.superseded} ${e.superseded===1?"has a newer result and stays":"have newer results and stay"} unread.`:null,t>0?`${t} could not be cleared and ${t===1?"stays":"stay"} unread.`:null,e.deferred>0?XB(e.deferred):null].filter(s=>s!==null);return e.cleared===0?{tone:"warning",message:["Nothing was cleared.",...n].join(" ")}:{tone:"success",message:[`Marked ${e.cleared} ${e.cleared===1?"chat":"chats"} as read.`,...n].join(" ")}},xy="archive",$F="drafts-undo",zF="bulk-read-deferral",YZ=8e3;function XZ(){const e=Ce(h=>h.archiveFailure),t=Ce(h=>h.archiveUndo),n=Ce(h=>h.draftsUndo),s=Ce(h=>h.bulkReadDeferral),r=Ce(h=>h.clearArchiveFailure),i=Ce(h=>h.setArchiveUndo),a=Ce(h=>h.setSessionArchived),o=Ce(h=>h.restoreDraftsUndo);WZ();const l=g.useRef(null);g.useEffect(()=>{if(e===null&&t===null){if(l.current===null)return;l.current=null,yb(xy);return}const h=e&&t?t.at>e.at?"offer":"failure":e?"failure":"offer",f=h==="offer"?t?.at??0:e?.at??0,p=l.current;l.current={kind:h,at:f},p!==null&&p.kind!==h&&f>p.at&&(h==="failure"?i(null):r());const m=(v,b)=>()=>{const w=Ce.getState();v==="offer"?w.archiveUndo?.at===b&&w.setArchiveUndo(null):w.archiveFailure?.at===b&&w.clearArchiveFailure();const C=l.current;C!==null&&C.kind===v&&C.at===b&&(l.current=null)};if(h==="failure"&&e){Yh(`Could not ${e.archived?"archive":"unarchive"} “${e.title}”.${e.detail?` ${e.detail}`:""}`,{id:xy,duration:YB,onAutoClose:m("failure",e.at),onDismiss:m("failure",e.at),action:{label:"Retry",onClick:v=>{v.preventDefault(),a(e.sessionId,e.archived,e.title)}}});return}t&&Ya(c.jsxs("span",{className:T("flex min-w-0 items-baseline gap-1"),children:[c.jsx("span",{className:T("min-w-0 truncate"),children:HZ(t.title)}),c.jsx("span",{className:T("shrink-0"),children:UZ})]}),{id:xy,duration:aS,classNames:{content:"min-w-0"},onAutoClose:m("offer",t.at),onDismiss:m("offer",t.at),action:{label:"Undo",onClick:v=>{v.preventDefault(),a(t.sessionId,!t.archived,t.title)}}})},[e,t,i,r,a]);const u=g.useRef(!1);g.useEffect(()=>{if(n===null){if(!u.current)return;u.current=!1,yb($F);return}u.current=!0;const h=()=>{const f=Ce.getState();f.draftsUndo?.at===n.at&&(f.setDraftsUndo(null),u.current=!1)};Ya(c.jsxs("span",{className:T("flex min-w-0 items-baseline gap-1"),children:[c.jsx("span",{className:T("min-w-0 truncate"),children:$Z(n.keys.length)}),c.jsx("span",{className:T("shrink-0"),children:zZ})]}),{id:$F,duration:aS,classNames:{content:"min-w-0"},onAutoClose:h,onDismiss:h,action:{label:"Undo",onClick:f=>{f.preventDefault(),o();const p=Ce.getState(),m=p.stagedByDiscard;p.setStagedByDiscard(null),n.keys.length===1&&m!==null&&Ce.getState().activeDraftKey===m&&Ce.getState().openDraft(n.keys[0])}}})},[n,o]);const d=g.useRef(!1);return g.useEffect(()=>{if(s===null){if(!d.current)return;d.current=!1,yb(zF);return}d.current=!0;const h=()=>{const f=Ce.getState();f.bulkReadDeferral?.at===s.at&&(f.clearBulkReadDeferral(),d.current=!1)};Ya(XB(s.count),{id:zF,duration:YZ,onAutoClose:h,onDismiss:h})},[s]),null}var $a,Be=typeof window<"u"?window:void 0,fi=typeof globalThis<"u"?globalThis:Be,QB=Array.prototype,qF=QB.forEach,KF=QB.indexOf,Oi=fi?.navigator,_t=fi?.document,di=fi?.location,oS=fi?.fetch,lS=fi!=null&&fi.XMLHttpRequest&&"withCredentials"in new fi.XMLHttpRequest?fi.XMLHttpRequest:void 0,YF=fi?.AbortController,Ms=Oi?.userAgent,Vt=Be??{},bl={DEBUG:!1,LIB_VERSION:"1.235.6"},wy="$copy_autocapture",QZ=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];(function(e){e.GZipJS="gzip-js",e.Base64="base64"})($a||($a={}));var JZ=["fatal","error","warning","log","info","debug"];function Zt(e,t){return e.indexOf(t)!==-1}var iC=function(e){return e.trim()},hT=function(e){return e.replace(/^\$/,"")},ZZ=Array.isArray,JB=Object.prototype,ZB=JB.hasOwnProperty,aC=JB.toString,cs=ZZ||function(e){return aC.call(e)==="[object Array]"},Xa=e=>typeof e=="function",us=e=>e===Object(e)&&!cs(e),Gh=e=>{if(us(e)){for(var t in e)if(ZB.call(e,t))return!1;return!0}return!1},wt=e=>e===void 0,Ls=e=>aC.call(e)=="[object String]",cS=e=>Ls(e)&&e.trim().length===0,lu=e=>e===null,kn=e=>wt(e)||lu(e),Xr=e=>aC.call(e)=="[object Number]",wl=e=>aC.call(e)==="[object Boolean]",eee=e=>e instanceof FormData,tee=e=>Zt(QZ,e),e6=e=>{var t={_log:function(n){if(Be&&(bl.DEBUG||Vt.POSTHOG_DEBUG)&&!wt(Be.console)&&Be.console){for(var s=("__rrweb_original__"in Be.console[n])?Be.console[n].__rrweb_original__:Be.console[n],r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];s(e,...i)}},info:function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];t._log("log",...s)},warn:function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];t._log("warn",...s)},error:function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];t._log("error",...s)},critical:function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];console.error(e,...s)},uninitializedWarning:n=>{t.error("You must initialize PostHog before calling ".concat(n))},createLogger:n=>e6("".concat(e," ").concat(n))};return t},Rt=e6("[PostHog.js]"),Nr=Rt.createLogger,nee=Nr("[ExternalScriptsLoader]"),XF=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return nee.warn("".concat(t," was requested but loading of external scripts is disabled.")),n("Loading of external scripts is disabled");var s=_t?.querySelectorAll("script");if(s){for(var r=0;r<s.length;r++)if(s[r].src===t)return n()}var i=()=>{if(!_t)return n("document not found");var a=_t.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=t,a.onload=u=>n(void 0,u),a.onerror=u=>n(u),e.config.prepare_external_dependency_script&&(a=e.config.prepare_external_dependency_script(a)),!a)return n("prepare_external_dependency_script returned null");var o,l=_t.querySelectorAll("body > script");l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(a,l[0]):_t.body.appendChild(a)};_t!=null&&_t.body?i():_t?.addEventListener("DOMContentLoaded",i)};function QF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function We(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QF(Object(n),!0).forEach(function(s){ht(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t6(e,t){if(e==null)return{};var n,s,r=function(a,o){if(a==null)return{};var l,u,d={},h=Object.keys(a);for(u=0;u<h.length;u++)l=h[u],o.indexOf(l)>=0||(d[l]=a[l]);return d}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}Vt.__PosthogExtensions__=Vt.__PosthogExtensions__||{},Vt.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var s="/static/".concat(t,".js")+"?v=".concat(e.version);if(t==="remote-config"&&(s="/array/".concat(e.config.token,"/config.js")),t==="toolbar"){var r=3e5,i=Math.floor(Date.now()/r)*r;s="".concat(s,"&t=").concat(i)}var a=e.requestRouter.endpointFor("assets",s);XF(e,a,n)},Vt.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var s=e.requestRouter.endpointFor("api",t);XF(e,s,n)};var ax={};function Uc(e,t,n){if(cs(e)){if(qF&&e.forEach===qF)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var s=0,r=e.length;s<r;s++)if(s in e&&t.call(n,e[s],s)===ax)return}}}function Mn(e,t,n){if(!kn(e)){if(cs(e))return Uc(e,t,n);if(eee(e)){for(var s of e.entries())if(t.call(n,s[1],s[0])===ax)return}else for(var r in e)if(ZB.call(e,r)&&t.call(n,e[r],r)===ax)return}}var ws=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Uc(n,function(r){for(var i in r)r[i]!==void 0&&(e[i]=r[i])}),e},kb=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Uc(n,function(r){Uc(r,function(i){e.push(i)})}),e};function Tb(e){for(var t=Object.keys(e),n=t.length,s=new Array(n);n--;)s[n]=[t[n],e[t[n]]];return s}var JF=function(e){try{return e()}catch{return}},see=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e.apply(this,n)}catch(r){Rt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Rt.critical(r)}}},Pm=function(e){var t={};return Mn(e,function(n,s){Ls(n)&&n.length>0&&(t[s]=n)}),t};function ree(e,t){return n=e,s=i=>Ls(i)&&!lu(t)?i.slice(0,t):i,r=new Set,function i(a,o){return a!==Object(a)?s?s(a,o):a:r.has(a)?void 0:(r.add(a),cs(a)?(l=[],Uc(a,u=>{l.push(i(u))})):(l={},Mn(a,(u,d)=>{r.has(u)||(l[d]=i(u,d))})),l);var l}(n);var n,s,r}var iee=["herokuapp.com","vercel.app","netlify.app"];function aee(e){var t=e?.hostname;if(!Ls(t))return!1;var n=t.split(".").slice(-2).join(".");for(var s of iee)if(n===s)return!1;return!0}function n6(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function ys(e,t,n,s){var{capture:r=!1,passive:i=!0}=s??{};e?.addEventListener(t,n,{capture:r,passive:i})}var s6="$people_distinct_id",bg="__alias",xg="__timers",ZF="$autocapture_disabled_server_side",uS="$heatmaps_enabled_server_side",eD="$exception_capture_enabled_server_side",tD="$web_vitals_enabled_server_side",r6="$dead_clicks_enabled_server_side",nD="$web_vitals_allowed_metrics",dS="$session_recording_enabled_server_side",sD="$console_log_recording_enabled_server_side",rD="$session_recording_network_payload_capture",iD="$session_recording_masking",aD="$session_recording_canvas_recording",oD="$replay_sample_rate",lD="$replay_minimum_duration",cD="$replay_script_config",ox="$sesid",wg="$session_is_sampled",Cy="$session_recording_url_trigger_activated_session",yy="$session_recording_event_trigger_activated_session",Vh="$enabled_feature_flags",Rb="$early_access_features",hS="$feature_flag_details",Cg="$stored_person_properties",Iu="$stored_group_properties",fS="$surveys",_v="$surveys_activated",lx="$flag_call_reported",gl="$user_state",pS="$client_session_props",gS="$capture_rate_limit",mS="$initial_campaign_params",vS="$initial_referrer_info",bS="$initial_person_info",cx="$epp",i6="__POSTHOG_TOOLBAR__",uD="$posthog_cookieless",oee=[s6,bg,"__cmpns",xg,dS,uS,ox,Vh,gl,Rb,hS,Iu,Cg,fS,lx,pS,gS,mS,vS,cx];function dD(e){var t;return e instanceof Element&&(e.id===i6||!((t=e.closest)===null||t===void 0||!t.call(e,".toolbar-global-fade-container")))}function oC(e){return!!e&&e.nodeType===1}function Gc(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function a6(e){return!!e&&e.nodeType===3}function o6(e){return!!e&&e.nodeType===11}function fT(e){return e?iC(e).split(/\s+/):[]}function hD(e){var t=Be?.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function ux(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return fT(t)}function l6(e){return kn(e)?null:iC(e).split(/(\s+)/).filter(t=>Df(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function lC(e){var t="";return wS(e)&&!d6(e)&&e.childNodes&&e.childNodes.length&&Mn(e.childNodes,function(n){var s;a6(n)&&n.textContent&&(t+=(s=l6(n.textContent))!==null&&s!==void 0?s:"")}),iC(t)}function c6(e){return wt(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var xS=["a","button","form","input","select","textarea","label"];function u6(e){var t=e.parentNode;return!(!t||!oC(t))&&t}function lee(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!Be||!e||Gc(e,"html")||!oC(e)||n!=null&&n.url_allowlist&&!hD(n.url_allowlist)||n!=null&&n.url_ignorelist&&hD(n.url_ignorelist))return!1;if(n!=null&&n.dom_event_allowlist){var i=n.dom_event_allowlist;if(i&&!i.some(p=>t.type===p))return!1}for(var a=!1,o=[e],l=!0,u=e;u.parentNode&&!Gc(u,"body");)if(o6(u.parentNode))o.push(u.parentNode.host),u=u.parentNode.host;else{if(!(l=u6(u)))break;if(s||xS.indexOf(l.tagName.toLowerCase())>-1)a=!0;else{var d=Be.getComputedStyle(l);d&&d.getPropertyValue("cursor")==="pointer"&&(a=!0)}o.push(l),u=l}if(!function(p,m){var v=m?.element_allowlist;if(wt(v))return!0;var b=function(y){if(v.some(k=>y.tagName.toLowerCase()===k))return{v:!0}};for(var w of p){var C=b(w);if(typeof C=="object")return C.v}return!1}(o,n)||!function(p,m){var v=m?.css_selector_allowlist;if(wt(v))return!0;var b=function(y){if(v.some(k=>y.matches(k)))return{v:!0}};for(var w of p){var C=b(w);if(typeof C=="object")return C.v}return!1}(o,n))return!1;var h=Be.getComputedStyle(e);if(h&&h.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return a?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(xS.indexOf(f)>-1||e.getAttribute("contenteditable")==="true")}}function wS(e){for(var t=e;t.parentNode&&!Gc(t,"body");t=t.parentNode){var n=ux(t);if(Zt(n,"ph-sensitive")||Zt(n,"ph-no-capture"))return!1}if(Zt(ux(e),"ph-include"))return!0;var s=e.type||"";if(Ls(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!(Ls(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function d6(e){return!!(Gc(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Gc(e,"select")||Gc(e,"textarea")||e.getAttribute("contenteditable")==="true")}var h6="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",cee=new RegExp("^(?:".concat(h6,")$")),uee=new RegExp(h6),f6="\\d{3}-?\\d{2}-?\\d{4}",dee=new RegExp("^(".concat(f6,")$")),hee=new RegExp("(".concat(f6,")"));function Df(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(kn(e)||Ls(e)&&(e=iC(e),(t?cee:uee).test((e||"").replace(/[- ]/g,""))||(t?dee:hee).test(e)))}function p6(e){var t=lC(e);return Df(t="".concat(t," ").concat(g6(e)).trim())?t:""}function g6(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Mn(e.childNodes,function(n){var s;if(n&&((s=n.tagName)===null||s===void 0?void 0:s.toLowerCase())==="span")try{var r=lC(n);t="".concat(t," ").concat(r).trim(),n.childNodes&&n.childNodes.length&&(t="".concat(t," ").concat(g6(n)).trim())}catch(i){Rt.error("[AutoCapture]",i)}}),t}function fee(e){return function(t){var n=t.map(s=>{var r,i,a="";if(s.tag_name&&(a+=s.tag_name),s.attr_class)for(var o of(s.attr_class.sort(),s.attr_class))a+=".".concat(o.replace(/"/g,""));var l=We(We(We(We({},s.text?{text:s.text}:{}),{},{"nth-child":(r=s.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(i=s.nth_of_type)!==null&&i!==void 0?i:0},s.href?{href:s.href}:{}),s.attr_id?{attr_id:s.attr_id}:{}),s.attributes),u={};return Tb(l).sort((d,h)=>{var[f]=d,[p]=h;return f.localeCompare(p)}).forEach(d=>{var[h,f]=d;return u[fD(h.toString())]=fD(f.toString())}),a+=":",a+=Tb(l).map(d=>{var[h,f]=d;return"".concat(h,'="').concat(f,'"')}).join("")});return n.join(";")}(function(t){return t.map(n=>{var s,r,i={text:(s=n.$el_text)===null||s===void 0?void 0:s.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)===null||r===void 0?void 0:r.slice(0,2048),attr_class:pee(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Tb(n).filter(a=>{var[o]=a;return o.indexOf("attr__")===0}).forEach(a=>{var[o,l]=a;return i.attributes[o]=l}),i})}(e))}function fD(e){return e.replace(/"|\\"/g,'\\"')}function pee(e){var t=e.attr__class;return t?cs(t)?t:fT(t):void 0}class m6{constructor(){this.clicks=[]}isRageClick(t,n,s){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(n-r.y)<30&&s-r.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:s}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:s}];return!1}}var gee=["localhost","127.0.0.1"],ef=e=>{var t=_t?.createElement("a");return wt(t)?null:(t.href=e,t)},mee=function(e){var t,n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return Mn(e,function(i,a){wt(i)||wt(a)||a==="undefined"||(t=encodeURIComponent((o=>o instanceof File)(i)?i.name:i.toString()),n=encodeURIComponent(a),r[r.length]=n+"="+t)}),r.join(s)},dx=function(e,t){for(var n,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++){var i=s[r].split("=");if(i[0]===t){n=i;break}}if(!cs(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{Rt.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},_y=function(e,t,n){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[0]||"",i=s[1],a=r.split("?"),o=a[1],l=a[0],u=(o||"").split("&"),d=[],h=0;h<u.length;h++){var f=u[h].split("=");cs(f)&&(t.includes(f[0])?d.push(f[0]+"="+n):d.push(u[h]))}var p=l;return o!=null&&(p+="?"+d.join("&")),i!=null&&(p+="#"+i),p},hx=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},pD=Nr("[AutoCapture]");function Sy(e,t){return t.length>e?t.slice(0,e)+"...":t}function vee(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!oC(t));return t}function bee(e,t,n,s){var r=e.tagName.toLowerCase(),i={tag_name:r};xS.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?i.$el_text=Sy(1024,p6(e)):i.$el_text=Sy(1024,lC(e)));var a=ux(e);a.length>0&&(i.classes=a.filter(function(d){return d!==""})),Mn(e.attributes,function(d){var h;if((!d6(e)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(s==null||!s.includes(d.name))&&!t&&Df(d.value)&&(h=d.name,!Ls(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var f=d.value;d.name==="class"&&(f=fT(f).join(" ")),i["attr__"+d.name]=Sy(1024,f)}});for(var o=1,l=1,u=e;u=vee(u);)o++,u.tagName===e.tagName&&l++;return i.nth_child=o,i.nth_of_type=l,i}function xee(e,t){for(var n,s,{e:r,maskAllElementAttributes:i,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:l}=t,u=[e],d=e;d.parentNode&&!Gc(d,"body");)o6(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var h,f=[],p={},m=!1,v=!1;if(Mn(u,k=>{var _=wS(k);k.tagName.toLowerCase()==="a"&&(m=k.getAttribute("href"),m=_&&m&&Df(m)&&m),Zt(ux(k),"ph-no-capture")&&(v=!0),f.push(bee(k,i,a,o));var E=function(R){if(!wS(R))return{};var F={};return Mn(R.attributes,function(A){if(A.name&&A.name.indexOf("data-ph-capture-attribute")===0){var N=A.name.replace("data-ph-capture-attribute-",""),M=A.value;N&&M&&Df(M)&&(F[N]=M)}}),F}(k);ws(p,E)}),v)return{props:{},explicitNoCapture:v};if(a||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?f[0].$el_text=p6(e):f[0].$el_text=lC(e)),m){var b,w;f[0].attr__href=m;var C=(b=ef(m))===null||b===void 0?void 0:b.host,y=Be==null||(w=Be.location)===null||w===void 0?void 0:w.host;C&&y&&C!==y&&(h=m)}return{props:ws({$event_type:r.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:fee(f)},(n=f[0])!==null&&n!==void 0&&n.$el_text?{$el_text:(s=f[0])===null||s===void 0?void 0:s.$el_text}:{},h&&r.type==="click"?{$external_click_url:h}:{},p)}}let wee=class{constructor(t){ht(this,"_initialized",!1),ht(this,"_isDisabledServerSide",null),ht(this,"rageclicks",new m6),ht(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}get config(){var t,n,s=us(this.instance.config.autocapture)?this.instance.config.autocapture:{};return s.url_allowlist=(t=s.url_allowlist)===null||t===void 0?void 0:t.map(r=>new RegExp(r)),s.url_ignorelist=(n=s.url_ignorelist)===null||n===void 0?void 0:n.map(r=>new RegExp(r)),s}_addDomEventHandlers(){if(this.isBrowserSupported()){if(Be&&_t){var t=s=>{s=s||Be?.event;try{this._captureEvent(s)}catch(r){pD.error("Failed to capture event",r)}};if(ys(_t,"submit",t,{capture:!0}),ys(_t,"change",t,{capture:!0}),ys(_t,"click",t,{capture:!0}),this.config.capture_copied_text){var n=s=>{s=s||Be?.event,this._captureEvent(s,wy)};ys(_t,"copy",n,{capture:!0}),ys(_t,"cut",n,{capture:!0})}}}else pD.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this._elementsChainAsString=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ZF]:!!t.autocapture_opt_out}),this._isDisabledServerSide=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this._elementSelectors=t}getElementSelectors(t){var n,s=[];return(n=this._elementSelectors)===null||n===void 0||n.forEach(r=>{var i=_t?.querySelectorAll(r);i?.forEach(a=>{t===a&&s.push(r)})}),s}get isEnabled(){var t,n,s=(t=this.instance.persistence)===null||t===void 0?void 0:t.props[ZF],r=this._isDisabledServerSide;if(lu(r)&&!wl(s)&&!this.instance.config.advanced_disable_decide)return!1;var i=(n=this._isDisabledServerSide)!==null&&n!==void 0?n:!!s;return!!this.instance.config.autocapture&&!i}_captureEvent(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var s,r=c6(t);a6(r)&&(r=r.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(s=this.rageclicks)!==null&&s!==void 0&&s.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._captureEvent(t,"$rageclick");var i=n===wy;if(r&&lee(r,t,this.config,i,i?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=xee(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),n===wy){var u,d=l6(Be==null||(u=Be.getSelection())===null||u===void 0?void 0:u.toString()),h=t.type||"clipboard";if(!d)return!1;a.$selected_content=d,a.$copy_type=h}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return Xa(_t?.querySelectorAll)}};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Xr(e)&&isFinite(e)&&Math.floor(e)===e});var gD="0123456789abcdef";let Cee=class CS{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,s,r){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(s)||!Number.isInteger(r)||t<0||n<0||s<0||r<0||t>0xffffffffffff||n>4095||s>1073741823||r>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=t/Math.pow(2,40),i[1]=t/Math.pow(2,32),i[2]=t/Math.pow(2,24),i[3]=t/Math.pow(2,16),i[4]=t/Math.pow(2,8),i[5]=t,i[6]=112|n>>>8,i[7]=n,i[8]=128|s>>>24,i[9]=s>>>16,i[10]=s>>>8,i[11]=s,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r,new CS(i)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+gD.charAt(this.bytes[n]>>>4)+gD.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new CS(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var s=this.bytes[n]-t.bytes[n];if(s!==0)return Math.sign(s)}return 0}},yee=class{constructor(){ht(this,"timestamp",0),ht(this,"counter",0),ht(this,"random",new _ee)}generate(){var t=this.generateOrAbort();if(wt(t)){this.timestamp=0;var n=this.generateOrAbort();if(wt(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Cee.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}};var mD,v6=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Be&&!wt(Be.crypto)&&crypto.getRandomValues&&(v6=e=>crypto.getRandomValues(e));let _ee=class{constructor(){ht(this,"buffer",new Uint32Array(8)),ht(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(v6(this.buffer),this.cursor=0),this.buffer[this.cursor++]}};var Ic=()=>See().toString(),See=()=>(mD||(mD=new yee)).generate(),Eee="Thu, 01 Jan 1970 00:00:00 GMT",Wp="",kee=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Tee(e,t){if(t){var n=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t;if(Wp)return Wp;if(!i||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),o=Math.min(a.length,8),l="dmn_chk_"+Ic(),u=new RegExp("(^|;)\\s*"+l+"=1");!Wp&&o--;){var d=a.slice(o).join("."),h=l+"=1;domain=."+d;i.cookie=h,u.test(i.cookie)&&(i.cookie=h+";expires="+Eee,Wp=d)}return Wp}(e);if(!n){var s=(r=>{var i=r.match(kee);return i?i[0]:""})(e);s!==n&&Rt.info("Warning: cookie subdomain discovery mismatch",s,n),n=s}return n?"; domain=."+n:""}return""}var kc,Tl={is_supported:()=>!!_t,error:function(e){Rt.error("cookieStore error: "+e)},get:function(e){if(_t){try{for(var t=e+"=",n=_t.cookie.split(";").filter(i=>i.length),s=0;s<n.length;s++){for(var r=n[s];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(t)===0)return decodeURIComponent(r.substring(t.length,r.length))}}catch{}return null}},parse:function(e){var t;try{t=JSON.parse(Tl.get(e))||{}}catch{}return t},set:function(e,t,n,s,r){if(_t)try{var i="",a="",o=Tee(_t.location.hostname,s);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),i="; expires="+l.toUTCString()}r&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&Rt.warn("cookieStore warning: large cookie, len="+u.length),_t.cookie=u,u}catch{return}},remove:function(e,t){try{Tl.set(e,"",-1,t)}catch{return}}},Ey=null,Us={is_supported:function(){if(!lu(Ey))return Ey;var e=!0;if(wt(Be))e=!1;else try{var t="__mplssupport__";Us.set(t,"xyz"),Us.get(t)!=='"xyz"'&&(e=!1),Us.remove(t)}catch{e=!1}return e||Rt.error("localStorage unsupported; falling back to cookie store"),Ey=e,e},error:function(e){Rt.error("localStorage error: "+e)},get:function(e){try{return Be?.localStorage.getItem(e)}catch(t){Us.error(t)}return null},parse:function(e){try{return JSON.parse(Us.get(e))||{}}catch{}return null},set:function(e,t){try{Be?.localStorage.setItem(e,JSON.stringify(t))}catch(n){Us.error(n)}},remove:function(e){try{Be?.localStorage.removeItem(e)}catch(t){Us.error(t)}}},Ree=["distinct_id",ox,wg,cx,bS],Sv=We(We({},Us),{},{parse:function(e){try{var t={};try{t=Tl.parse(e)||{}}catch{}var n=ws(t,JSON.parse(Us.get(e)||"{}"));return Us.set(e,n),n}catch{}return null},set:function(e,t,n,s,r,i){try{Us.set(e,t,void 0,void 0,i);var a={};Ree.forEach(o=>{t[o]&&(a[o]=t[o])}),Object.keys(a).length&&Tl.set(e,a,n,s,r,i)}catch(o){Us.error(o)}},remove:function(e,t){try{Be?.localStorage.removeItem(e),Tl.remove(e,t)}catch(n){Us.error(n)}}}),Ev={},Aee={is_supported:function(){return!0},error:function(e){Rt.error("memoryStorage error: "+e)},get:function(e){return Ev[e]||null},parse:function(e){return Ev[e]||null},set:function(e,t){Ev[e]=t},remove:function(e){delete Ev[e]}},Eu=null,fr={is_supported:function(){if(!lu(Eu))return Eu;if(Eu=!0,wt(Be))Eu=!1;else try{var e="__support__";fr.set(e,"xyz"),fr.get(e)!=='"xyz"'&&(Eu=!1),fr.remove(e)}catch{Eu=!1}return Eu},error:function(e){Rt.error("sessionStorage error: ",e)},get:function(e){try{return Be?.sessionStorage.getItem(e)}catch(t){fr.error(t)}return null},parse:function(e){try{return JSON.parse(fr.get(e))||null}catch{}return null},set:function(e,t){try{Be?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){fr.error(n)}},remove:function(e){try{Be?.sessionStorage.removeItem(e)}catch(t){fr.error(t)}}};(function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"})(kc||(kc={}));let Fee=class{constructor(t){this.instance=t}get config(){return this.instance.config}get consent(){return this.getDnt()?kc.DENIED:this.storedConsent}isOptedOut(){return this.consent===kc.DENIED||this.consent===kc.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(t){this.storage.set(this.storageKey,t?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:t,opt_out_capturing_cookie_prefix:n}=this.instance.config;return(n||"__ph_opt_in_out_")+t}get storedConsent(){var t=this.storage.get(this.storageKey);return t==="1"?kc.GRANTED:t==="0"?kc.DENIED:kc.PENDING}get storage(){if(!this._storage){var t=this.config.opt_out_capturing_persistence_type;this._storage=t==="localStorage"?Us:Tl;var n=t==="localStorage"?Tl:Us;n.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(n.get(this.storageKey)==="1"),n.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!n6([Oi?.doNotTrack,Oi?.msDoNotTrack,Vt.doNotTrack],t=>Zt([!0,1,"1","yes"],t))}};var kv=Nr("[Dead Clicks]"),Dee=()=>!0,Pee=e=>{var t,n=!((t=e.instance.persistence)===null||t===void 0||!t.get_property(r6)),s=e.instance.config.capture_dead_clicks;return wl(s)?s:n};let b6=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(t,n,s){this.instance=t,this.isEnabled=n,this.onCapture=s,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[r6]:t?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(t){var n,s,r;(n=Vt.__PosthogExtensions__)!==null&&n!==void 0&&n.initDeadClicksAutocapture&&t(),(s=Vt.__PosthogExtensions__)===null||s===void 0||(r=s.loadExternalDependency)===null||r===void 0||r.call(s,this.instance,"dead-clicks-autocapture",i=>{i?kv.error("failed to load script",i):t()})}start(){var t;if(_t){if(!this._lazyLoadedDeadClicksAutocapture&&(t=Vt.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture){var n=us(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=Vt.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this._lazyLoadedDeadClicksAutocapture.start(_t),kv.info("starting...")}}else kv.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,kv.info("stopping..."))}};var ky=Nr("[ExceptionAutocapture]");let Iee=class{constructor(t){var n;ht(this,"startCapturing",()=>{var s;if(Be&&this.isEnabled&&(s=Vt.__PosthogExtensions__)!==null&&s!==void 0&&s.errorWrappingFunctions){var r=Vt.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Vt.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=Vt.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.unwrapOnError&&this.config.capture_unhandled_errors&&(this.unwrapOnError=r(this.captureException.bind(this))),!this.unwrapUnhandledRejection&&this.config.capture_unhandled_rejections&&(this.unwrapUnhandledRejection=i(this.captureException.bind(this))),!this.unwrapConsoleError&&this.config.capture_console_errors&&(this.unwrapConsoleError=a(this.captureException.bind(this)))}catch(o){ky.error("failed to start",o),this.stopCapturing()}}}),this.instance=t,this.remoteEnabled=!((n=this.instance.persistence)===null||n===void 0||!n.props[eD]),this.config=this.requiredConfig(),this.startIfEnabled()}requiredConfig(){var t=this.instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return us(t)?n=We(We({},n),t):(wt(t)?this.remoteEnabled:t)&&(n=We(We({},n),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.config.capture_console_errors||this.config.capture_unhandled_errors||this.config.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(ky.info("enabled"),this.loadScript(this.startCapturing))}loadScript(t){var n,s,r;(n=Vt.__PosthogExtensions__)!==null&&n!==void 0&&n.errorWrappingFunctions&&t(),(s=Vt.__PosthogExtensions__)===null||s===void 0||(r=s.loadExternalDependency)===null||r===void 0||r.call(s,this.instance,"exception-autocapture",i=>{if(i)return ky.error("failed to load script",i);t()})}stopCapturing(){var t,n,s;(t=this.unwrapOnError)===null||t===void 0||t.call(this),this.unwrapOnError=void 0,(n=this.unwrapUnhandledRejection)===null||n===void 0||n.call(this),this.unwrapUnhandledRejection=void 0,(s=this.unwrapConsoleError)===null||s===void 0||s.call(this),this.unwrapConsoleError=void 0}onRemoteConfig(t){var n=t.autocaptureExceptions;this.remoteEnabled=!!n||!1,this.config=this.requiredConfig(),this.instance.persistence&&this.instance.persistence.register({[eD]:this.remoteEnabled}),this.startIfEnabled()}captureException(t){var n=this.instance.requestRouter.endpointFor("ui");t.$exception_personURL="".concat(n,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(t)}};function x6(e){return!wt(Event)&&w6(e,Event)}function w6(e,t){try{return e instanceof t}catch{return!1}}function Ab(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function Ty(e){return Ab(e,"DOMError")}var vD=/\(error: (.*)\)/,bD=50,Wh="?";function Ry(e,t,n,s){var r={platform:"web:javascript",filename:e,function:t==="<anonymous>"?Wh:t,in_app:!0};return wt(n)||(r.lineno=n),wt(s)||(r.colno=s),r}var Nee=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Mee=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Oee=/\((\S*)(?::(\d+))(?::(\d+))\)/,Lee=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Bee=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,jee=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var s=t.sort((r,i)=>r[0]-i[0]).map(r=>r[1]);return function(r){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=[],o=r.split(`
|
|
3
3
|
`),l=i;l<o.length;l++){var u=o[l];if(!(u.length>1024)){var d=vD.test(u)?u.replace(vD,"$1"):u;if(!d.match(/\S*Error: /)){for(var h of s){var f=h(d);if(f){a.push(f);break}}if(a.length>=bD)break}}}return function(p){if(!p.length)return[];var m=Array.from(p);return m.reverse(),m.slice(0,bD).map(v=>We(We({},v),{},{filename:v.filename||Hee(m).filename,function:v.function||Wh}))}(a)}}([30,e=>{var t=Nee.exec(e);if(t){var[,n,s,r]=t;return Ry(n,Wh,+s,+r)}var i=Mee.exec(e);if(i){if(i[2]&&i[2].indexOf("eval")===0){var a=Oee.exec(i[2]);a&&(i[2]=a[1],i[3]=a[2],i[4]=a[3])}var[o,l]=wD(i[1]||Wh,i[2]);return Ry(l,o,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}}],[50,e=>{var t=Lee.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=Bee.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var s=t[3],r=t[1]||Wh;return[r,s]=wD(r,s),Ry(s,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]);function Hee(e){return e[e.length-1]||{}}var Tv,xD,Ay,wD=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,s=e.indexOf("safari-web-extension")!==-1;return n||s?[e.indexOf("@")!==-1?e.split("@")[0]:Wh,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},Uee=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function pT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=e.stacktrace||e.stack||"",s=function(a){return a&&Gee.test(a.message)?1:0}(e);try{var r=jee,i=function(a,o){var l=function(u){var d=globalThis._posthogChunkIds;if(!d)return{};var h=Object.keys(d);return Ay&&h.length===xD||(xD=h.length,Ay=h.reduce((f,p)=>{Tv||(Tv={});var m=Tv[p];if(m)f[m[0]]=m[1];else for(var v=u(p),b=v.length-1;b>=0;b--){var w=v[b],C=w?.filename,y=d[p];if(C&&y){f[C]=y,Tv[p]=[C,y];break}}return f},{})),Ay}(o);return a.forEach(u=>{u.filename&&(u.chunk_id=l[u.filename])}),a}(r(n,s),r);return i.slice(0,i.length-t)}catch{}return[]}var Gee=/Minified React error #\d+;/i;function Fy(e,t){var n,s,r=pT(e),i=(n=t?.handled)===null||n===void 0||n,a=(s=t?.synthetic)!==null&&s!==void 0&&s;return{$exception_list:[{type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(o){var l=o.message;return l.error&&typeof l.error.message=="string"?String(l.error.message):String(l)}(e),stacktrace:{frames:r,type:"raw"},mechanism:{handled:i,synthetic:a}}],$exception_level:"error"}}function Dy(e,t){var n,s,r,i=(n=t?.handled)===null||n===void 0||n,a=(s=t?.synthetic)===null||s===void 0||s,o={type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:(r=t?.defaultExceptionType)!==null&&r!==void 0?r:"Error",value:e||t?.defaultExceptionMessage,mechanism:{handled:i,synthetic:a}};if(t!=null&&t.syntheticException){var l=pT(t.syntheticException,1);l.length&&(o.stacktrace={frames:l,type:"raw"})}return{$exception_list:[o],$exception_level:"error"}}function Vee(e){return Ls(e)&&!cS(e)&&JZ.indexOf(e)>=0}function Wee(e,t){var n,s,r=(n=t?.handled)===null||n===void 0||n,i=(s=t?.synthetic)===null||s===void 0||s,a=t!=null&&t.overrideExceptionType?t.overrideExceptionType:x6(e)?e.constructor.name:"Error",o="Non-Error 'exception' captured with keys: ".concat(function(d){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:40,f=Object.keys(d);if(f.sort(),!f.length)return"[object has no keys]";for(var p=f.length;p>0;p--){var m=f.slice(0,p).join(", ");if(!(m.length>h))return p===f.length||m.length<=h?m:"".concat(m.slice(0,h),"...")}return""}(e)),l={type:a,value:o,mechanism:{handled:r,synthetic:i}};if(t!=null&&t.syntheticException){var u=pT(t?.syntheticException,1);u.length&&(l.stacktrace={frames:u,type:"raw"})}return{$exception_list:[l],$exception_level:Vee(e.level)?e.level:"error"}}function $ee(e,t){var{error:n,event:s}=e,r={$exception_list:[]},i=n||s;if(Ty(i)||function(p){return Ab(p,"DOMException")}(i)){var a=i;if(function(p){return"stack"in p}(i))r=Fy(i,t);else{var o=a.name||(Ty(a)?"DOMError":"DOMException"),l=a.message?"".concat(o,": ").concat(a.message):o,u=Ty(a)?"DOMError":"DOMException";r=Dy(l,We(We({},t),{},{overrideExceptionType:u,defaultExceptionMessage:l}))}return"code"in a&&(r.$exception_DOMException_code="".concat(a.code)),r}if(function(p){return Ab(p,"ErrorEvent")}(i)&&i.error)return Fy(i.error,t);if(function(p){switch(Object.prototype.toString.call(p)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return w6(p,Error)}}(i))return Fy(i,t);if(function(p){return Ab(p,"Object")}(i)||x6(i))return Wee(i,t);if(wt(n)&&Ls(s)){var d="Error",h=s,f=s.match(Uee);return f&&(d=f[1],h=f[2]),Dy(h,We(We({},t),{},{overrideExceptionType:d,defaultExceptionMessage:h}))}return Dy(i,t)}function fx(e){var t,n;return((t=JSON.stringify(e,(n=[],function(s,r){if(us(r)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(r)?"[Circular]":(n.push(r),r)}return r})))===null||t===void 0?void 0:t.length)||0}function yS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),s=e.data.slice(0,n),r=e.data.slice(n);return[yS({size:fx(s),data:s,sessionId:e.sessionId,windowId:e.windowId}),yS({size:fx(r),data:r,sessionId:e.sessionId,windowId:e.windowId})].flatMap(i=>i)}return[e]}var ml=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ml||{}),Ga=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Ga||{}),_S="[SessionRecording]",SS="redacted",Rv={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},zee=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],qee=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Kee=["/s/","/e/","/i/"];function CD(e,t,n,s){if(kn(e))return e;var r=t?.["content-length"]||function(i){return new Blob([i]).size}(e);return Ls(r)&&(r=parseInt(r)),r>n?_S+" ".concat(s," body too large to record (").concat(r," bytes)"):e}function yD(e,t){if(kn(e))return e;var n=e;return Df(n,!1)||(n=_S+" "+t+" body "+SS),Mn(qee,s=>{var r,i;(r=n)!==null&&r!==void 0&&r.length&&((i=n)===null||i===void 0?void 0:i.indexOf(s))!==-1&&(n=_S+" "+t+" body "+SS+" as might contain: "+s)}),n}var Yee=(e,t)=>{var n,s,r,i={payloadSizeLimitBytes:Rv.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Rv.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Rv.payloadHostDenyList]},a=e.session_recording.recordHeaders!==!1&&t.recordHeaders,o=e.session_recording.recordBody!==!1&&t.recordBody,l=e.capture_performance!==!1&&t.recordPerformance,u=(n=i,r=Math.min(1e6,(s=n.payloadSizeLimitBytes)!==null&&s!==void 0?s:1e6),f=>(f!=null&&f.requestBody&&(f.requestBody=CD(f.requestBody,f.requestHeaders,r,"Request")),f!=null&&f.responseBody&&(f.responseBody=CD(f.responseBody,f.responseHeaders,r,"Response")),f)),d=f=>{return u(((v,b)=>{var w,C=ef(v.name),y=b.indexOf("http")===0?(w=ef(b))===null||w===void 0?void 0:w.pathname:b;y==="/"&&(y="");var k=C?.pathname.replace(y||"","");if(!(C&&k&&Kee.some(_=>k.indexOf(_)===0)))return v})((m=(p=f).requestHeaders,kn(m)||Mn(Object.keys(m??{}),v=>{zee.includes(v.toLowerCase())&&(m[v]=SS)}),p),e.api_host));var p,m},h=Xa(e.session_recording.maskNetworkRequestFn);return h&&Xa(e.session_recording.maskCapturedNetworkRequestFn)&&Rt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=f=>{var p=e.session_recording.maskNetworkRequestFn({url:f.name});return We(We({},f),{},{name:p?.url})}),i.maskRequestFn=Xa(e.session_recording.maskCapturedNetworkRequestFn)?f=>{var p,m,v,b=d(f);return b&&(p=(m=(v=e.session_recording).maskCapturedNetworkRequestFn)===null||m===void 0?void 0:m.call(v,b))!==null&&p!==void 0?p:void 0}:f=>function(p){if(!wt(p))return p.requestBody=yD(p.requestBody,"Request"),p.responseBody=yD(p.responseBody,"Response"),p}(d(f)),We(We(We({},Rv),i),{},{recordHeaders:a,recordBody:o,recordPerformance:l,recordInitialRequests:l})};function la(e,t,n,s,r){return t>n&&(Rt.warn("min cannot be greater than max."),t=n),Xr(e)?e>n?(s&&Rt.warn(s+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(s&&Rt.warn(s+" cannot be less than min: "+t+". Using min value instead."),t):e:(s&&Rt.warn(s+" must be a number. using max or fallback. max: "+n+", fallback: "+r),la(r||n,t,n,s))}let Xee=class{constructor(t){var n,s,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ht(this,"bucketSize",100),ht(this,"refillRate",10),ht(this,"mutationBuckets",{}),ht(this,"loggedTracker",{}),ht(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(i=>{this.mutationBuckets[i]=this.mutationBuckets[i]+this.refillRate,this.mutationBuckets[i]>=this.bucketSize&&delete this.mutationBuckets[i]})}),ht(this,"getNodeOrRelevantParent",i=>{var a=this.rrweb.mirror.getNode(i);if(a?.nodeName!=="svg"&&a instanceof Element){var o=a.closest("svg");if(o)return[this.rrweb.mirror.getId(o),o]}return[i,a]}),ht(this,"numberOfChanges",i=>{var a,o,l,u,d,h,f,p;return((a=(o=i.removes)===null||o===void 0?void 0:o.length)!==null&&a!==void 0?a:0)+((l=(u=i.attributes)===null||u===void 0?void 0:u.length)!==null&&l!==void 0?l:0)+((d=(h=i.texts)===null||h===void 0?void 0:h.length)!==null&&d!==void 0?d:0)+((f=(p=i.adds)===null||p===void 0?void 0:p.length)!==null&&f!==void 0?f:0)}),ht(this,"throttleMutations",i=>{if(i.type!==3||i.data.source!==0)return i;var a=i.data,o=this.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(u=>{var d,h,f,[p,m]=this.getNodeOrRelevantParent(u.id);return this.mutationBuckets[p]===0?!1:(this.mutationBuckets[p]=(d=this.mutationBuckets[p])!==null&&d!==void 0?d:this.bucketSize,this.mutationBuckets[p]=Math.max(this.mutationBuckets[p]-1,0),this.mutationBuckets[p]===0&&(this.loggedTracker[p]||(this.loggedTracker[p]=!0,(h=(f=this.options).onBlockedNode)===null||h===void 0||h.call(f,p,m))),u)}));var l=this.numberOfChanges(a);return l!==0||o===l?i:void 0}),this.rrweb=t,this.options=r,this.refillRate=la((n=this.options.refillRate)!==null&&n!==void 0?n:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=la((s=this.options.bucketSize)!==null&&s!==void 0?s:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}};var ha=Uint8Array,pi=Uint16Array,Pf=Uint32Array,gT=new ha([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mT=new ha([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_D=new ha([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),C6=function(e,t){for(var n=new pi(31),s=0;s<31;++s)n[s]=t+=1<<e[s-1];var r=new Pf(n[30]);for(s=1;s<30;++s)for(var i=n[s];i<n[s+1];++i)r[i]=i-n[s]<<5|s;return[n,r]},y6=C6(gT,2),Qee=y6[0],ES=y6[1];Qee[28]=258,ES[258]=28;for(var SD=C6(mT,0)[1],_6=new pi(32768),Gn=0;Gn<32768;++Gn){var ku=(43690&Gn)>>>1|(21845&Gn)<<1;ku=(61680&(ku=(52428&ku)>>>2|(13107&ku)<<2))>>>4|(3855&ku)<<4,_6[Gn]=((65280&ku)>>>8|(255&ku)<<8)>>>1}var jg=function(e,t,n){for(var s=e.length,r=0,i=new pi(t);r<s;++r)++i[e[r]-1];var a,o=new pi(t);for(r=0;r<t;++r)o[r]=o[r-1]+i[r-1]<<1;for(a=new pi(s),r=0;r<s;++r)a[r]=_6[o[e[r]-1]++]>>>15-e[r];return a},wd=new ha(288);for(Gn=0;Gn<144;++Gn)wd[Gn]=8;for(Gn=144;Gn<256;++Gn)wd[Gn]=9;for(Gn=256;Gn<280;++Gn)wd[Gn]=7;for(Gn=280;Gn<288;++Gn)wd[Gn]=8;var px=new ha(32);for(Gn=0;Gn<32;++Gn)px[Gn]=5;var Jee=jg(wd,9),Zee=jg(px,5),S6=function(e){return(e/8>>0)+(7&e&&1)},E6=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var s=new(e instanceof pi?pi:e instanceof Pf?Pf:ha)(n-t);return s.set(e.subarray(t,n)),s},hl=function(e,t,n){n<<=7&t;var s=t/8>>0;e[s]|=n,e[s+1]|=n>>>8},$p=function(e,t,n){n<<=7&t;var s=t/8>>0;e[s]|=n,e[s+1]|=n>>>8,e[s+2]|=n>>>16},Py=function(e,t){for(var n=[],s=0;s<e.length;++s)e[s]&&n.push({s,f:e[s]});var r=n.length,i=n.slice();if(!r)return[new ha(0),0];if(r==1){var a=new ha(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort(function(_,E){return _.f-E.f}),n.push({s:-1,f:25001});var o=n[0],l=n[1],u=0,d=1,h=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};d!=r-1;)o=n[n[u].f<n[h].f?u++:h++],l=n[u!=d&&n[u].f<n[h].f?u++:h++],n[d++]={s:-1,f:o.f+l.f,l:o,r:l};var f=i[0].s;for(s=1;s<r;++s)i[s].s>f&&(f=i[s].s);var p=new pi(f+1),m=kS(n[d-1],p,0);if(m>t){s=0;var v=0,b=m-t,w=1<<b;for(i.sort(function(_,E){return p[E.s]-p[_.s]||_.f-E.f});s<r;++s){var C=i[s].s;if(!(p[C]>t))break;v+=w-(1<<m-p[C]),p[C]=t}for(v>>>=b;v>0;){var y=i[s].s;p[y]<t?v-=1<<t-p[y]++-1:++s}for(;s>=0&&v;--s){var k=i[s].s;p[k]==t&&(--p[k],++v)}m=t}return[new ha(p),m]},kS=function(e,t,n){return e.s==-1?Math.max(kS(e.l,t,n+1),kS(e.r,t,n+1)):t[e.s]=n},ED=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new pi(++t),s=0,r=e[0],i=1,a=function(l){n[s++]=l},o=1;o<=t;++o)if(e[o]==r&&o!=t)++i;else{if(!r&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(r),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(r);i=1,r=e[o]}return[n.subarray(0,s),t]},zp=function(e,t){for(var n=0,s=0;s<t.length;++s)n+=e[s]*t[s];return n},TS=function(e,t,n){var s=n.length,r=S6(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var i=0;i<s;++i)e[r+i+4]=n[i];return 8*(r+4+s)},kD=function(e,t,n,s,r,i,a,o,l,u,d){hl(t,d++,n),++r[256];for(var h=Py(r,15),f=h[0],p=h[1],m=Py(i,15),v=m[0],b=m[1],w=ED(f),C=w[0],y=w[1],k=ED(v),_=k[0],E=k[1],R=new pi(19),F=0;F<C.length;++F)R[31&C[F]]++;for(F=0;F<_.length;++F)R[31&_[F]]++;for(var A=Py(R,7),N=A[0],M=A[1],D=19;D>4&&!N[_D[D-1]];--D);var L,V,j,te,X=u+5<<3,re=zp(r,wd)+zp(i,px)+a,G=zp(r,f)+zp(i,v)+a+14+3*D+zp(R,N)+(2*R[16]+3*R[17]+7*R[18]);if(X<=re&&X<=G)return TS(t,d,e.subarray(l,l+u));if(hl(t,d,1+(G<re)),d+=2,G<re){L=jg(f,p),V=f,j=jg(v,b),te=v;var J=jg(N,M);for(hl(t,d,y-257),hl(t,d+5,E-1),hl(t,d+10,D-4),d+=14,F=0;F<D;++F)hl(t,d+3*F,N[_D[F]]);d+=3*D;for(var ae=[C,_],O=0;O<2;++O){var U=ae[O];for(F=0;F<U.length;++F){var P=31&U[F];hl(t,d,J[P]),d+=N[P],P>15&&(hl(t,d,U[F]>>>5&127),d+=U[F]>>>12)}}}else L=Jee,V=wd,j=Zee,te=px;for(F=0;F<o;++F)if(s[F]>255){P=s[F]>>>18&31,$p(t,d,L[P+257]),d+=V[P+257],P>7&&(hl(t,d,s[F]>>>23&31),d+=gT[P]);var z=31&s[F];$p(t,d,j[z]),d+=te[z],z>3&&($p(t,d,s[F]>>>5&8191),d+=mT[z])}else $p(t,d,L[s[F]]),d+=V[s[F]];return $p(t,d,L[256]),d+V[256]},ete=new Pf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),tte=function(){for(var e=new Pf(256),t=0;t<256;++t){for(var n=t,s=9;--s;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),nte=function(){var e=4294967295;return{p:function(t){for(var n=e,s=0;s<t.length;++s)n=tte[255&n^t[s]]^n>>>8;e=n},d:function(){return 4294967295^e}}},ste=function(e,t,n,s,r){return function(i,a,o,l,u,d){var h=i.length,f=new ha(l+h+5*(1+Math.floor(h/7e3))+u),p=f.subarray(l,f.length-u),m=0;if(!a||h<8)for(var v=0;v<=h;v+=65535){var b=v+65535;b<h?m=TS(p,m,i.subarray(v,b)):(p[v]=d,m=TS(p,m,i.subarray(v,h)))}else{for(var w=ete[a-1],C=w>>>13,y=8191&w,k=(1<<o)-1,_=new pi(32768),E=new pi(k+1),R=Math.ceil(o/3),F=2*R,A=function(de){return(i[de]^i[de+1]<<R^i[de+2]<<F)&k},N=new Pf(25e3),M=new pi(288),D=new pi(32),L=0,V=0,j=(v=0,0),te=0,X=0;v<h;++v){var re=A(v),G=32767&v,J=E[re];if(_[G]=J,E[re]=G,te<=v){var ae=h-v;if((L>7e3||j>24576)&&ae>423){m=kD(i,p,0,N,M,D,V,j,X,v-X,m),j=L=V=0,X=v;for(var O=0;O<286;++O)M[O]=0;for(O=0;O<30;++O)D[O]=0}var U=2,P=0,z=y,ne=G-J&32767;if(ae>2&&re==A(v-ne))for(var fe=Math.min(C,ae)-1,ue=Math.min(32767,v),le=Math.min(258,ae);ne<=ue&&--z&&G!=J;){if(i[v+U]==i[v+U-ne]){for(var q=0;q<le&&i[v+q]==i[v+q-ne];++q);if(q>U){if(U=q,P=ne,q>fe)break;var we=Math.min(ne,q-2),B=0;for(O=0;O<we;++O){var be=v-ne+O+32768&32767,ie=be-_[be]+32768&32767;ie>B&&(B=ie,J=be)}}}ne+=(G=J)-(J=_[G])+32768&32767}if(P){N[j++]=268435456|ES[U]<<18|SD[P];var Te=31&ES[U],ee=31&SD[P];V+=gT[Te]+mT[ee],++M[257+Te],++D[ee],te=v+U,++L}else N[j++]=i[v],++M[i[v]]}}m=kD(i,p,d,N,M,D,V,j,X,v-X,m)}return E6(f,0,l+S6(m)+u)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,s,!0)},RS=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},rte=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&RS(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var s=0;s<=n.length;++s)e[s+10]=n.charCodeAt(s)}},ite=function(e){return 10+(e.filename&&e.filename.length+1||0)};function k6(e,t){t===void 0&&(t={});var n=nte(),s=e.length;n.p(e);var r=ste(e,t,ite(t),8),i=r.length;return rte(r,t),RS(r,i-8,n.d()),RS(r,i-4,s),r}function T6(e,t){var n=e.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var s=new ha(e.length+(e.length>>>1)),r=0,i=function(u){s[r++]=u},a=0;a<n;++a){if(r+5>s.length){var o=new ha(r+8+(n-a<<1));o.set(s),s=o}var l=e.charCodeAt(a);l<128||t?i(l):l<2048?(i(192|l>>>6),i(128|63&l)):l>55295&&l<57344?(i(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),i(128|l>>>12&63),i(128|l>>>6&63),i(128|63&l)):(i(224|l>>>12),i(128|l>>>6&63),i(128|63&l))}return E6(s,0,r)}function ate(e,t){return function(n){for(var s=0,r=0;r<n.length;r++)s=(s<<5)-s+n.charCodeAt(r),s|=0;return Math.abs(s)}(e)%100<la(100*t,0,100)}var yg="[SessionRecording]",Cr=Nr(yg);function Av(){var e,t;return Vt==null||(e=Vt.__PosthogExtensions__)===null||e===void 0||(t=e.rrweb)===null||t===void 0?void 0:t.record}var ote=3e5,lte=[Ga.MouseMove,Ga.MouseInteraction,Ga.Scroll,Ga.ViewportResize,Ga.Input,Ga.TouchMove,Ga.MediaInteraction,Ga.Drag],TD=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Tu(e){return function(t,n){for(var s="",r=0;r<t.length;){var i=t[r++];s+=String.fromCharCode(i)}return s}(k6(T6(JSON.stringify(e))))}function RD(e){return e.type===ml.Custom&&e.data.tag==="sessionIdle"}function AD(e,t){return t.some(n=>n.matching==="regex"&&new RegExp(n.url).test(e))}let cte=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(yg+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var t,n;return this.triggerStatus==="trigger_pending"?6e4:(t=(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.full_snapshot_interval_millis)!==null&&t!==void 0?t:ote}get isSampled(){var t=this.instance.get_property(wg);return wl(t)?t:null}get sessionDuration(){var t,n,s=(t=this.buffer)===null||t===void 0?void 0:t.data[((n=this.buffer)===null||n===void 0?void 0:n.data.length)-1],{sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return s?s.timestamp-r:null}get isRecordingEnabled(){var t=!!this.instance.get_property(dS),n=!this.instance.config.disable_session_recording;return Be&&t&&n}get isConsoleLogCaptureEnabled(){var t=!!this.instance.get_property(sD),n=this.instance.config.enable_recording_console_log;return n??t}get canvasRecording(){var t,n,s,r,i,a,o=this.instance.config.session_recording.captureCanvas,l=this.instance.get_property(aD),u=(t=(n=o?.recordCanvas)!==null&&n!==void 0?n:l?.enabled)!==null&&t!==void 0&&t,d=(s=(r=o?.canvasFps)!==null&&r!==void 0?r:l?.fps)!==null&&s!==void 0?s:4,h=(i=(a=o?.canvasQuality)!==null&&a!==void 0?a:l?.quality)!==null&&i!==void 0?i:.4;if(typeof h=="string"){var f=parseFloat(h);h=isNaN(f)?.4:f}return{enabled:u,fps:la(d,0,12,"canvas recording fps",4),quality:la(h,0,1,"canvas recording quality",.4)}}get networkPayloadCapture(){var t,n,s=this.instance.get_property(rD),r={recordHeaders:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordHeaders,recordBody:(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.recordBody},i=r?.recordHeaders||s?.recordHeaders,a=r?.recordBody||s?.recordBody,o=us(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,l=!!(wl(o)?o:s?.capturePerformance);return i||a||l?{recordHeaders:i,recordBody:a,recordPerformance:l}:void 0}get masking(){var t,n,s,r,i,a,o=this.instance.get_property(iD),l={maskAllInputs:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.maskAllInputs,maskTextSelector:(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.maskTextSelector,blockSelector:(s=this.instance.config.session_recording)===null||s===void 0?void 0:s.blockSelector},u=(r=l?.maskAllInputs)!==null&&r!==void 0?r:o?.maskAllInputs,d=(i=l?.maskTextSelector)!==null&&i!==void 0?i:o?.maskTextSelector,h=(a=l?.blockSelector)!==null&&a!==void 0?a:o?.blockSelector;return wt(u)&&wt(d)&&wt(h)?void 0:{maskAllInputs:u==null||u,maskTextSelector:d,blockSelector:h}}get sampleRate(){var t=this.instance.get_property(oD);return Xr(t)?t:null}get minimumDuration(){var t=this.instance.get_property(lD);return Xr(t)?t:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this.isSampled===!1?"disabled":this._urlBlocked?"paused":kn(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":wl(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var t;return this._urlTriggers.length===0?"trigger_disabled":((t=this.instance)===null||t===void 0?void 0:t.get_property(Cy))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var t;return this._eventTriggers.length===0?"trigger_disabled":((t=this.instance)===null||t===void 0?void 0:t.get_property(yy))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var t=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",n=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return t?"trigger_activated":n?"trigger_pending":"trigger_disabled"}constructor(t){if(ht(this,"queuedRRWebEvents",[]),ht(this,"isIdle","unknown"),ht(this,"_linkedFlagSeen",!1),ht(this,"_lastActivityTimestamp",Date.now()),ht(this,"_linkedFlag",null),ht(this,"_removePageViewCaptureHook",void 0),ht(this,"_onSessionIdListener",void 0),ht(this,"_persistDecideOnSessionListener",void 0),ht(this,"_samplingSessionListener",void 0),ht(this,"_urlTriggers",[]),ht(this,"_urlBlocklist",[]),ht(this,"_urlBlocked",!1),ht(this,"_eventTriggers",[]),ht(this,"_removeEventTriggerCaptureHook",void 0),ht(this,"_forceAllowLocalhostNetworkCapture",!1),ht(this,"_onBeforeUnload",()=>{this._flushBuffer()}),ht(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),ht(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),ht(this,"_onVisibilityChange",()=>{if(_t!=null&&_t.visibilityState){var r="window "+_t.visibilityState;this._tryAddCustomEvent(r,{})}}),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Cr.error("started without valid sessionManager"),new Error(yg+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(yg+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:n,windowId:s}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=n,this.windowId=s,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Cr.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(t){this.isRecordingEnabled?(this._startCapture(t),ys(Be,"beforeunload",this._onBeforeUnload),ys(Be,"offline",this._onOffline),ys(Be,"online",this._onOnline),ys(Be,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),kn(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",n=>{try{if(n.event==="$pageview"){var s=n!=null&&n.properties.$current_url?this._maskUrl(n?.properties.$current_url):"";if(!s)return;this._tryAddCustomEvent("$pageview",{href:s})}}catch(r){Cr.error("Could not add $pageview to rrweb session",r)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((n,s,r)=>{var i,a,o,l;r&&(this._tryAddCustomEvent("$session_id_change",{sessionId:n,windowId:s,changeReason:r}),(i=this.instance)===null||i===void 0||(a=i.persistence)===null||a===void 0||a.unregister(yy),(o=this.instance)===null||o===void 0||(l=o.persistence)===null||l===void 0||l.unregister(Cy))}))):this.stopRecording()}stopRecording(){var t,n,s,r;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,Be?.removeEventListener("beforeunload",this._onBeforeUnload),Be?.removeEventListener("offline",this._onOffline),Be?.removeEventListener("online",this._onOnline),Be?.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(t=this._removePageViewCaptureHook)===null||t===void 0||t.call(this),this._removePageViewCaptureHook=void 0,(n=this._removeEventTriggerCaptureHook)===null||n===void 0||n.call(this),this._removeEventTriggerCaptureHook=void 0,(s=this._onSessionIdListener)===null||s===void 0||s.call(this),this._onSessionIdListener=void 0,(r=this._samplingSessionListener)===null||r===void 0||r.call(this),this._samplingSessionListener=void 0,Cr.info("stopped"))}_resetSampling(){var t;(t=this.instance.persistence)===null||t===void 0||t.unregister(wg)}makeSamplingDecision(t){var n,s=this.sessionId!==t,r=this.sampleRate;if(Xr(r)){var i=this.isSampled,a=s||!wl(i),o=a?ate(t,r):i;a&&(o?this._reportStarted("sampled"):Cr.warn("Sample rate (".concat(r,") has determined that this sessionId (").concat(t,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r,isSampled:o})),(n=this.instance.persistence)===null||n===void 0||n.register({[wg]:o})}else this._resetSampling()}onRemoteConfig(t){var n,s,r,i,a,o;if(this._tryAddCustomEvent("$remote_config_received",t),this._persistRemoteConfig(t),this._linkedFlag=((n=t.sessionRecording)===null||n===void 0?void 0:n.linkedFlag)||null,(s=t.sessionRecording)!==null&&s!==void 0&&s.endpoint&&(this._endpoint=(o=t.sessionRecording)===null||o===void 0?void 0:o.endpoint),this._setupSampling(),!kn(this._linkedFlag)&&!this._linkedFlagSeen){var l=Ls(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,u=Ls(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((d,h)=>{var f=us(h)&&l in h,p=u?h[l]===u:f;p&&this._reportStarted("linked_flag_matched",{linkedFlag:l,linkedVariant:u}),this._linkedFlagSeen=p})}(r=t.sessionRecording)!==null&&r!==void 0&&r.urlTriggers&&(this._urlTriggers=t.sessionRecording.urlTriggers),(i=t.sessionRecording)!==null&&i!==void 0&&i.urlBlocklist&&(this._urlBlocklist=t.sessionRecording.urlBlocklist),(a=t.sessionRecording)!==null&&a!==void 0&&a.eventTriggers&&(this._eventTriggers=t.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Xr(this.sampleRate)&&kn(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(t=>{this.makeSamplingDecision(t)}))}_persistRemoteConfig(t){if(this.instance.persistence){var n,s=this.instance.persistence,r=()=>{var i,a,o,l,u,d,h,f,p,m=(i=t.sessionRecording)===null||i===void 0?void 0:i.sampleRate,v=kn(m)?null:parseFloat(m);kn(v)&&this._resetSampling();var b=(a=t.sessionRecording)===null||a===void 0?void 0:a.minimumDurationMilliseconds;s.register({[dS]:!!t.sessionRecording,[sD]:(o=t.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled,[rD]:We({capturePerformance:t.capturePerformance},(l=t.sessionRecording)===null||l===void 0?void 0:l.networkPayloadCapture),[iD]:(u=t.sessionRecording)===null||u===void 0?void 0:u.masking,[aD]:{enabled:(d=t.sessionRecording)===null||d===void 0?void 0:d.recordCanvas,fps:(h=t.sessionRecording)===null||h===void 0?void 0:h.canvasFps,quality:(f=t.sessionRecording)===null||f===void 0?void 0:f.canvasQuality},[oD]:v,[lD]:wt(b)?null:b,[cD]:(p=t.sessionRecording)===null||p===void 0?void 0:p.scriptConfig})};r(),(n=this._persistDecideOnSessionListener)===null||n===void 0||n.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(r)}}log(t){var n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:s,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}_startCapture(t){if(!wt(Object.assign)&&!wt(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var n,s;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),Av()?this._onScriptLoaded():(n=Vt.__PosthogExtensions__)===null||n===void 0||(s=n.loadExternalDependency)===null||s===void 0||s.call(n,this.instance,this.scriptName,r=>{if(r)return Cr.error("could not load recorder",r);this._onScriptLoaded()}),Cr.info("starting"),this.status==="active"&&this._reportStarted(t||"recording_initialized")}}get scriptName(){var t,n,s;return((t=this.instance)===null||t===void 0||(n=t.persistence)===null||n===void 0||(s=n.get_property(cD))===null||s===void 0?void 0:s.script)||"recorder"}isInteractiveEvent(t){var n;return t.type===3&<e.indexOf((n=t.data)===null||n===void 0?void 0:n.source)!==-1}_updateWindowAndSessionIds(t){var n=this.isInteractiveEvent(t);n||this.isIdle||t.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var s=!1;if(n&&(this._lastActivityTimestamp=t.timestamp,this.isIdle)){var r=this.isIdle==="unknown";this.isIdle=!1,r||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:t.type}),s=!0)}if(!this.isIdle){var{windowId:i,sessionId:a}=this.sessionManager.checkAndGetSessionAndWindowId(!n,t.timestamp),o=this.sessionId!==a,l=this.windowId!==i;this.windowId=i,this.sessionId=a,o||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):s&&this._scheduleFullSnapshot()}}_tryRRWebMethod(t){try{return t.rrwebMethod(),!0}catch(n){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt++,rrwebMethod:t.rrwebMethod}):Cr.warn("could not emit queued rrweb event.",n,t),!1}}_tryAddCustomEvent(t,n){return this._tryRRWebMethod(TD(()=>Av().addCustomEvent(t,n)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(TD(()=>Av().takeFullSnapshot()))}_onScriptLoaded(){var t,n,s,r,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},a=this.instance.config.session_recording;for(var[o,l]of Object.entries(a||{}))o in i&&(o==="maskInputOptions"?i.maskInputOptions=We({password:!0},l):i[o]=l);this.canvasRecording&&this.canvasRecording.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.canvasRecording.fps},i.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.masking&&(i.maskAllInputs=(n=this.masking.maskAllInputs)===null||n===void 0||n,i.maskTextSelector=(s=this.masking.maskTextSelector)!==null&&s!==void 0?s:void 0,i.blockSelector=(r=this.masking.blockSelector)!==null&&r!==void 0?r:void 0);var u=Av();if(u){this.mutationRateLimiter=(t=this.mutationRateLimiter)!==null&&t!==void 0?t:new Xee(u,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(h,f)=>{var p="Too many mutations on node '".concat(h,"'. Rate limiting. This could be due to SVG animations or something similar");Cr.info(p,{node:f}),this.log(yg+" "+p,"warn")}});var d=this._gatherRRWebPlugins();this.stopRrweb=u(We({emit:h=>{this.onRRwebEmit(h)},plugins:d},i)),this._lastActivityTimestamp=Date.now(),this.isIdle=wl(this.isIdle)?this.isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:i,activePlugins:d.map(h=>h?.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Cr.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle!==!0){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},t))}}_gatherRRWebPlugins(){var t,n,s,r,i=[],a=(t=Vt.__PosthogExtensions__)===null||t===void 0||(n=t.rrwebPlugins)===null||n===void 0?void 0:n.getRecordConsolePlugin;a&&this.isConsoleLogCaptureEnabled&&i.push(a());var o=(s=Vt.__PosthogExtensions__)===null||s===void 0||(r=s.rrwebPlugins)===null||r===void 0?void 0:r.getRecordNetworkPlugin;return this.networkPayloadCapture&&Xa(o)&&(!gee.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(o(Yee(this.instance.config,this.networkPayloadCapture))):Cr.info("NetworkCapture not started because we are on localhost.")),i}onRRwebEmit(t){var n;if(this._processQueuedEvents(),t&&us(t)){if(t.type===ml.Meta){var s=this._maskUrl(t.data.href);if(this._lastHref=s,!s)return;t.data.href=s}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),!this._urlBlocked||function(h){return h.type===ml.Custom&&h.data.tag==="recording paused"}(t)){t.type===ml.FullSnapshot&&this._scheduleFullSnapshot(),t.type===ml.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var r=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(t):t;if(r){var i=function(h){var f=h;if(f&&us(f)&&f.type===6&&us(f.data)&&f.data.plugin==="rrweb/console@1"){f.data.payload.payload.length>10&&(f.data.payload.payload=f.data.payload.payload.slice(0,10),f.data.payload.payload.push("...[truncated]"));for(var p=[],m=0;m<f.data.payload.payload.length;m++)f.data.payload.payload[m]&&f.data.payload.payload[m].length>2e3?p.push(f.data.payload.payload[m].slice(0,2e3)+"...[truncated]"):p.push(f.data.payload.payload[m]);return f.data.payload.payload=p,h}return h}(r);if(this._updateWindowAndSessionIds(i),this.isIdle!==!0||RD(i)){if(RD(i)){var a=i.data.payload;if(a){var o=a.lastActivityTimestamp,l=a.threshold;i.timestamp=o+l}}var u=(n=this.instance.config.session_recording.compress_events)===null||n===void 0||n?function(h){if(fx(h)<1024)return h;try{if(h.type===ml.FullSnapshot)return We(We({},h),{},{data:Tu(h.data),cv:"2024-10"});if(h.type===ml.IncrementalSnapshot&&h.data.source===Ga.Mutation)return We(We({},h),{},{cv:"2024-10",data:We(We({},h.data),{},{texts:Tu(h.data.texts),attributes:Tu(h.data.attributes),removes:Tu(h.data.removes),adds:Tu(h.data.adds)})});if(h.type===ml.IncrementalSnapshot&&h.data.source===Ga.StyleSheetRule)return We(We({},h),{},{cv:"2024-10",data:We(We({},h.data),{},{adds:h.data.adds?Tu(h.data.adds):void 0,removes:h.data.removes?Tu(h.data.removes):void 0})})}catch(f){Cr.error("could not compress event - will use uncompressed event",f)}return h}(i):i,d={$snapshot_bytes:fx(u),$snapshot_data:u,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(d):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&Be){var t=this._maskUrl(Be.location.href);this._lastHref!==t&&(this._tryAddCustomEvent("$url_changed",{href:t}),this._lastHref=t)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var t=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],t.forEach(n=>{Date.now()-n.enqueuedAt<=2e3&&this._tryRRWebMethod(n)})}}_maskUrl(t){var n=this.instance.config.session_recording;if(n.maskNetworkRequestFn){var s,r={url:t};return(s=r=n.maskNetworkRequestFn(r))===null||s===void 0?void 0:s.url}return t}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,s=Xr(n)&&n>=0,r=Xr(t)&&s&&n<t;return this.status==="buffering"||this.status==="paused"||this.status==="disabled"||r?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&yS(this.buffer).forEach(i=>{this._captureSnapshot({$snapshot_bytes:i.size,$snapshot_data:i.data,$session_id:i.sessionId,$window_id:i.windowId,$lib:"web",$lib_version:bl.LIB_VERSION})}),this.clearBuffer())}_captureSnapshotBuffered(t){var n,s=2+(((n=this.buffer)===null||n===void 0?void 0:n.data.length)||0);!this.isIdle&&(this.buffer.size+t.$snapshot_bytes+s>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(t){this.instance.capture("$snapshot",t,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(Be!==void 0&&Be.location.href){var t=Be.location.href,n=this._urlBlocked,s=AD(t,this._urlBlocklist);s&&!n?this._pauseRecording():!s&&n&&this._resumeRecording(),AD(t,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(t){var n,s;this.triggerStatus==="trigger_pending"&&((n=this.instance)===null||n===void 0||(s=n.persistence)===null||s===void 0||s.register({[t==="url"?Cy:yy]:this.sessionId}),this._flushBuffer(),this._reportStarted(t+"_trigger_matched"))}_pauseRecording(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Cr.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this._urlBlocked&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Cr.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&kn(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",t=>{try{this._eventTriggers.includes(t.event)&&this._activateTrigger("event")}catch(n){Cr.error("Could not activate event trigger",n)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var t;(t=this.instance.persistence)===null||t===void 0||t.register({[wg]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(t){this._activateTrigger(t)}_reportStarted(t,n){this.instance.register_for_session({$session_recording_start_reason:t}),Cr.info(t.replace("_"," "),n),Zt(["recording_initialized","session_id_changed"],t)||this._tryAddCustomEvent(t,n)}get sdkDebugProperties(){var{sessionStartTimestamp:t}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.buffer.data.length,$sdk_debug_replay_internal_buffer_size:this.buffer.size,$sdk_debug_current_session_duration:this.sessionDuration,$sdk_debug_session_start:t}}};var Iy=Nr("[SegmentIntegration]");function ute(e,t){var n=e.config.segment;if(!n)return t();(function(s,r){var i=s.config.segment;if(!i)return r();var a=l=>{var u=()=>l.anonymousId()||Ic();s.config.get_device_id=u,l.id()&&(s.register({distinct_id:l.id(),$device_id:u()}),s.persistence.set_property(gl,"identified")),r()},o=i.user();"then"in o&&Xa(o.then)?o.then(l=>a(l)):a(o)})(e,()=>{n.register((s=>{Promise&&Promise.resolve||Iy.warn("This browser does not have Promise support, and can not use the segment integration");var r=(i,a)=>{var o;if(!a)return i;i.event.userId||i.event.anonymousId===s.get_distinct_id()||(Iy.info("No userId set, resetting PostHog"),s.reset()),i.event.userId&&i.event.userId!==s.get_distinct_id()&&(Iy.info("UserId set, identifying with PostHog"),s.identify(i.event.userId));var l=s._calculate_event_properties(a,(o=i.event.properties)!==null&&o!==void 0?o:{},new Date);return i.event.properties=Object.assign({},l,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:i=>r(i,i.event.event),page:i=>r(i,"$pageview"),identify:i=>r(i,"$identify"),screen:i=>r(i,"$screen")}})(e)).then(()=>{t()})})}var R6="posthog-js";function A6(e){var{organization:t,projectId:n,prefix:s,severityAllowList:r=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=>{var a,o,l,u,d;if(!(r==="*"||r.includes(i.level))||!e.__loaded)return i;i.tags||(i.tags={});var h=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));i.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(i.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=((a=i.exception)===null||a===void 0?void 0:a.values)||[],p=f.map(v=>We(We({},v),{},{stacktrace:v.stacktrace?We(We({},v.stacktrace),{},{type:"raw",frames:(v.stacktrace.frames||[]).map(b=>We(We({},b),{},{platform:"web:javascript"}))}):void 0})),m={$exception_message:((o=f[0])===null||o===void 0?void 0:o.value)||i.message,$exception_type:(l=f[0])===null||l===void 0?void 0:l.type,$exception_personURL:h,$exception_level:i.level,$exception_list:p,$sentry_event_id:i.event_id,$sentry_exception:i.exception,$sentry_exception_message:((u=f[0])===null||u===void 0?void 0:u.value)||i.message,$sentry_exception_type:(d=f[0])===null||d===void 0?void 0:d.type,$sentry_tags:i.tags};return t&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+i.event_id),e.exceptions.sendExceptionEvent(m),i}}let dte=class{constructor(t,n,s,r,i){this.name=R6,this.setupOnce=function(a){a(A6(t,{organization:n,projectId:s,prefix:r,severityAllowList:i}))}}};var vl,hte=Be!=null&&Be.location?hx(Be.location.hash,"__posthog")||hx(location.hash,"state"):null,FD="_postHogToolbarParams",DD=Nr("[Toolbar]");(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"})(vl||(vl={}));class fte{constructor(t){this.instance=t}setToolbarState(t){Vt.ph_toolbar_state=t}getToolbarState(){var t;return(t=Vt.ph_toolbar_state)!==null&&t!==void 0?t:vl.UNINITIALIZED}maybeLoadToolbar(){var t,n,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!Be||!_t)return!1;s=(t=s)!==null&&t!==void 0?t:Be.location,i=(n=i)!==null&&n!==void 0?n:Be.history;try{if(!r){try{Be.localStorage.setItem("test","test"),Be.localStorage.removeItem("test")}catch{return!1}r=Be?.localStorage}var a,o=hte||hx(s.hash,"__posthog")||hx(s.hash,"state"),l=o?JF(()=>JSON.parse(atob(decodeURIComponent(o))))||JF(()=>JSON.parse(decodeURIComponent(o))):null;return l&&l.action==="ph_authorize"?((a=l).source="url",a&&Object.keys(a).length>0&&(l.desiredHash?s.hash=l.desiredHash:i?i.replaceState(i.state,"",s.pathname+s.search):s.hash="")):((a=JSON.parse(r.getItem(FD)||"{}")).source="localstorage",delete a.userIntent),!(!a.token||this.instance.config.token!==a.token)&&(this.loadToolbar(a),!0)}catch{return!1}}_callLoadToolbar(t){var n=Vt.ph_load_toolbar||Vt.ph_load_editor;!kn(n)&&Xa(n)?n(t,this.instance):DD.warn("No toolbar load function found")}loadToolbar(t){var n=!(_t==null||!_t.getElementById(i6));if(!Be||n)return!1;var s=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=We(We({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});if(Be.localStorage.setItem(FD,JSON.stringify(We(We({},r),{},{source:void 0}))),this.getToolbarState()===vl.LOADED)this._callLoadToolbar(r);else if(this.getToolbarState()===vl.UNINITIALIZED){var i,a;this.setToolbarState(vl.LOADING),(i=Vt.__PosthogExtensions__)===null||i===void 0||(a=i.loadExternalDependency)===null||a===void 0||a.call(i,this.instance,"toolbar",o=>{if(o)return DD.error("[Toolbar] Failed to load",o),void this.setToolbarState(vl.UNINITIALIZED);this.setToolbarState(vl.LOADED),this._callLoadToolbar(r)}),ys(Be,"turbolinks:load",()=>{this.setToolbarState(vl.UNINITIALIZED),this.loadToolbar(r)})}return!0}_loadEditor(t){return this.loadToolbar(t)}maybeLoadEditor(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(t,n,s)}}var pte=Nr("[TracingHeaders]");class gte{constructor(t){ht(this,"_restoreXHRPatch",void 0),ht(this,"_restoreFetchPatch",void 0),ht(this,"_startCapturing",()=>{var n,s,r,i;wt(this._restoreXHRPatch)&&((n=Vt.__PosthogExtensions__)===null||n===void 0||(s=n.tracingHeadersPatchFns)===null||s===void 0||s._patchXHR(this.instance.sessionManager)),wt(this._restoreFetchPatch)&&((r=Vt.__PosthogExtensions__)===null||r===void 0||(i=r.tracingHeadersPatchFns)===null||i===void 0||i._patchFetch(this.instance.sessionManager))}),this.instance=t}_loadScript(t){var n,s,r;(n=Vt.__PosthogExtensions__)!==null&&n!==void 0&&n.tracingHeadersPatchFns&&t(),(s=Vt.__PosthogExtensions__)===null||s===void 0||(r=s.loadExternalDependency)===null||r===void 0||r.call(s,this.instance,"tracing-headers",i=>{if(i)return pte.error("failed to load script",i);t()})}startIfEnabledOrStop(){var t,n;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((t=this._restoreXHRPatch)===null||t===void 0||t.call(this),(n=this._restoreFetchPatch)===null||n===void 0||n.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var gc=Nr("[Web Vitals]"),PD=9e5;class mte{constructor(t){var n;ht(this,"_enabledServerSide",!1),ht(this,"_initialized",!1),ht(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),ht(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((s,r)=>We(We({},s),{},{["$web_vitals_".concat(r.name,"_event")]:We({},r),["$web_vitals_".concat(r.name,"_value")]:r.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),ht(this,"_addToBuffer",s=>{var r,i=(r=this.instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0);if(wt(i))gc.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this._currentURL();wt(a)||(kn(s?.name)||kn(s?.value)?gc.error("Invalid metric received",s):this._maxAllowedValue&&s.value>=this._maxAllowedValue?gc.error("Ignoring metric with value >= "+this._maxAllowedValue,s):(this.buffer.url!==a&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),wt(this.buffer.url)&&(this.buffer.url=a),this.buffer.firstMetricTimestamp=wt(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,s.attribution&&s.attribution.interactionTargetElement&&(s.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(We(We({},s),{},{$current_url:a,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),ht(this,"_startCapturing",()=>{var s,r,i,a,o=Vt.__PosthogExtensions__;wt(o)||wt(o.postHogWebVitalsCallbacks)||({onLCP:s,onCLS:r,onFCP:i,onINP:a}=o.postHogWebVitalsCallbacks),s&&r&&i&&a?(this.allowedMetrics.indexOf("LCP")>-1&&s(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this._addToBuffer.bind(this)),this._initialized=!0):gc.error("web vitals callbacks not loaded - not starting")}),this.instance=t,this._enabledServerSide=!((n=this.instance.persistence)===null||n===void 0||!n.props[tD]),this.startIfEnabled()}get allowedMetrics(){var t,n,s=us(this.instance.config.capture_performance)?(t=this.instance.config.capture_performance)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return wt(s)?((n=this.instance.persistence)===null||n===void 0?void 0:n.props[nD])||["CLS","FCP","INP","LCP"]:s}get flushToCaptureTimeoutMs(){return(us(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var t=us(this.instance.config.capture_performance)&&Xr(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:PD;return 0<t&&t<=6e4?PD:t}get isEnabled(){var t=di?.protocol;if(t!=="http:"&&t!=="https:")return gc.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=us(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:wl(this.instance.config.capture_performance)?this.instance.config.capture_performance:void 0;return wl(n)?n:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(gc.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(t){var n=us(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=us(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[tD]:n}),this.instance.persistence.register({[nD]:s})),this._enabledServerSide=n,this.startIfEnabled()}loadScript(t){var n,s,r;(n=Vt.__PosthogExtensions__)!==null&&n!==void 0&&n.postHogWebVitalsCallbacks&&t(),(s=Vt.__PosthogExtensions__)===null||s===void 0||(r=s.loadExternalDependency)===null||r===void 0||r.call(s,this.instance,"web-vitals",i=>{i?gc.error("failed to load script",i):t()})}_currentURL(){var t=Be?Be.location.href:void 0;return t||gc.error("Could not determine current URL"),t}}var vte=Nr("[Heatmaps]");function ID(e){return us(e)&&"clientX"in e&&"clientY"in e&&Xr(e.clientX)&&Xr(e.clientY)}class bte{constructor(t){var n;ht(this,"rageclicks",new m6),ht(this,"_enabledServerSide",!1),ht(this,"_initialized",!1),ht(this,"_flushInterval",null),this.instance=t,this._enabledServerSide=!((n=this.instance.persistence)===null||n===void 0||!n.props[uS])}get flushIntervalMilliseconds(){var t=5e3;return us(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return wt(this.instance.config.capture_heatmaps)?wt(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;vte.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var t,n;clearInterval((t=this._flushInterval)!==null&&t!==void 0?t:void 0),(n=this.deadClicksCapture)===null||n===void 0||n.stop(),this.getAndClearBuffer()}}onRemoteConfig(t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[uS]:n}),this._enabledServerSide=n,this.startIfEnabled()}getAndClearBuffer(){var t=this.buffer;return this.buffer=void 0,t}_onDeadClick(t){this._onClick(t.originalEvent,"deadclick")}_setupListeners(){Be&&_t&&(ys(Be,"beforeunload",this.flush.bind(this)),ys(_t,"click",t=>this._onClick(t||Be?.event),{capture:!0}),ys(_t,"mousemove",t=>this._onMouseMove(t||Be?.event),{capture:!0}),this.deadClicksCapture=new b6(this.instance,Dee,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(t,n){var s=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),a=function(o,l,u){for(var d=o;d&&oC(d)&&!Gc(d,"body");){if(d===u)return!1;if(Zt(l,Be?.getComputedStyle(d).position))return!0;d=u6(d)}return!1}(c6(t),["fixed","sticky"],i);return{x:t.clientX+(a?0:r),y:t.clientY+(a?0:s),target_fixed:a,type:n}}_onClick(t){var n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!dD(t.target)&&ID(t)){var r=this._getProperties(t,s);(n=this.rageclicks)!==null&&n!==void 0&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._capture(We(We({},r),{},{type:"rageclick"})),this._capture(r)}}_onMouseMove(t){!dD(t.target)&&ID(t)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(t,"mousemove"))},500))}_capture(t){if(Be){var n=Be.location.href;this.buffer=this.buffer||{},this.buffer[n]||(this.buffer[n]=[]),this.buffer[n].push(t)}}flush(){this.buffer&&!Gh(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class xte{constructor(t){this._instance=t}doPageView(t,n){var s,r=this._previousPageViewProperties(t,n);return this._currentPageview={pathname:(s=Be?.location.pathname)!==null&&s!==void 0?s:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var n;return this._previousPageViewProperties(t,(n=this._currentPageview)===null||n===void 0?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this._currentPageview)===null||t===void 0?void 0:t.pageViewId}}_previousPageViewProperties(t,n){var s=this._currentPageview;if(!s)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:s.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:u,lastContentY:d,maxContentY:h}=i;if(!(wt(a)||wt(o)||wt(l)||wt(u)||wt(d)||wt(h))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),h=Math.ceil(h);var f=a<=1?1:la(o/a,0,1),p=a<=1?1:la(l/a,0,1),m=u<=1?1:la(d/u,0,1),v=u<=1?1:la(h/u,0,1);r=ws(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:m,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:v})}}return s.pathname&&(r.$prev_pageview_pathname=s.pathname),s.timestamp&&(r.$prev_pageview_duration=(t.getTime()-s.timestamp.getTime())/1e3),r}}let wte=class{constructor(t){this.instance=t}sendExceptionEvent(t){this.instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}};var fa="Mobile",gx="iOS",Ao="Android",Im="Tablet",F6=Ao+" "+Im,D6="iPad",P6="Apple",I6=P6+" Watch",Nm="Safari",If="BlackBerry",N6="Samsung",M6=N6+"Browser",O6=N6+" Internet",Cd="Chrome",Cte=Cd+" OS",L6=Cd+" "+gx,vT="Internet Explorer",B6=vT+" "+fa,bT="Opera",yte=bT+" Mini",xT="Edge",j6="Microsoft "+xT,tf="Firefox",H6=tf+" "+gx,Mm="Nintendo",Om="PlayStation",nf="Xbox",U6=Ao+" "+fa,G6=fa+" "+Nm,_g="Windows",AS=_g+" Phone",ND="Nokia",FS="Ouya",V6="Generic",_te=V6+" "+fa.toLowerCase(),W6=V6+" "+Im.toLowerCase(),DS="Konqueror",zr="(\\d+(\\.\\d+)?)",Ny=new RegExp("Version/"+zr),Ste=new RegExp(nf,"i"),Ete=new RegExp(Om+" \\w+","i"),kte=new RegExp(Mm+" \\w+","i"),wT=new RegExp(If+"|PlayBook|BB10","i"),Tte={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},PS,Rte=(e,t)=>t&&Zt(t,P6)||function(n){return Zt(n,Nm)&&!Zt(n,Cd)&&!Zt(n,Ao)}(e),MD=function(e,t){return t=t||"",Zt(e," OPR/")&&Zt(e,"Mini")?yte:Zt(e," OPR/")?bT:wT.test(e)?If:Zt(e,"IE"+fa)||Zt(e,"WPDesktop")?B6:Zt(e,M6)?O6:Zt(e,xT)||Zt(e,"Edg/")?j6:Zt(e,"FBIOS")?"Facebook "+fa:Zt(e,"UCWEB")||Zt(e,"UCBrowser")?"UC Browser":Zt(e,"CriOS")?L6:Zt(e,"CrMo")||Zt(e,Cd)?Cd:Zt(e,Ao)&&Zt(e,Nm)?U6:Zt(e,"FxiOS")?H6:Zt(e.toLowerCase(),DS.toLowerCase())?DS:Rte(e,t)?Zt(e,fa)?G6:Nm:Zt(e,tf)?tf:Zt(e,"MSIE")||Zt(e,"Trident/")?vT:Zt(e,"Gecko")?tf:""},Ate={[B6]:[new RegExp("rv:"+zr)],[j6]:[new RegExp(xT+"?\\/"+zr)],[Cd]:[new RegExp("("+Cd+"|CrMo)\\/"+zr)],[L6]:[new RegExp("CriOS\\/"+zr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+zr)],[Nm]:[Ny],[G6]:[Ny],[bT]:[new RegExp("(Opera|OPR)\\/"+zr)],[tf]:[new RegExp(tf+"\\/"+zr)],[H6]:[new RegExp("FxiOS\\/"+zr)],[DS]:[new RegExp("Konqueror[:/]?"+zr,"i")],[If]:[new RegExp(If+" "+zr),Ny],[U6]:[new RegExp("android\\s"+zr,"i")],[O6]:[new RegExp(M6+"\\/"+zr)],[vT]:[new RegExp("(rv:|MSIE )"+zr)],Mozilla:[new RegExp("rv:"+zr)]},OD=[[new RegExp(nf+"; "+nf+" (.*?)[);]","i"),e=>[nf,e&&e[1]||""]],[new RegExp(Mm,"i"),[Mm,""]],[new RegExp(Om,"i"),[Om,""]],[wT,[If,""]],[new RegExp(_g,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[AS,""];if(new RegExp(fa).test(t)&&!/IEMobile\b/.test(t))return[_g+" "+fa,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var s=n[1],r=Tte[s]||"";return/arm/i.test(t)&&(r="RT"),[_g,r]}return[_g,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[gx,t.join(".")]}return[gx,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=wt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Ao+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ao+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Ao,t.join(".")]}return[Ao,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Cte,""]],[/Linux|debian/i,["Linux",""]]],LD=function(e){return kte.test(e)?Mm:Ete.test(e)?Om:Ste.test(e)?nf:new RegExp(FS,"i").test(e)?FS:new RegExp("("+AS+"|WPDesktop)","i").test(e)?AS:/iPad/.test(e)?D6:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?I6:wT.test(e)?If:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ND,"i").test(e)?ND:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(fa).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Ao:F6:Ao:new RegExp("(pda|"+fa+")","i").test(e)?_te:new RegExp(Im,"i").test(e)&&!new RegExp(Im+" pc","i").test(e)?W6:""},Fv="https?://(.*)",Fb=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],Fte=kb(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Fb),My="<masked>",Qn={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!_t)return{};var s=t?kb([],Fb,n||[]):[];return this._campaignParamsFromUrl(_y(_t.URL,s,My),e)},_campaignParamsFromUrl:function(e,t){var n=Fte.concat(t||[]),s={};return Mn(n,function(r){var i=dx(e,r);s[r]=i||null}),s},_searchEngine:function(e){return e?e.search(Fv+"google.([^/?]*)")===0?"google":e.search(Fv+"bing.com")===0?"bing":e.search(Fv+"yahoo.com")===0?"yahoo":e.search(Fv+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=Qn._searchEngine(e),n=t!="yahoo"?"q":"p",s={};if(!lu(t)){s.$search_engine=t;var r=_t?dx(_t.referrer,n):"";r.length&&(s.ph_keyword=r)}return s},searchInfo:function(){var e=_t?.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:MD,browserVersion:function(e,t){var n=MD(e,t),s=Ate[n];if(wt(s))return null;for(var r=0;r<s.length;r++){var i=s[r],a=e.match(i);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return typeof e=="string"?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<OD.length;t++){var[n,s]=OD[t],r=n.exec(e),i=r&&(Xa(s)?s(r,e):s);if(i)return i}return["",""]},device:LD,deviceType:function(e){var t=LD(e);return t===D6||t===F6||t==="Kobo"||t==="Kindle Fire"||t===W6?Im:t===Mm||t===nf||t===Om||t===FS?"Console":t===I6?"Wearable":t?fa:"Desktop"},referrer:function(){return _t?.referrer||"$direct"},referringDomain:function(){var e;return _t!=null&&_t.referrer&&((e=ef(_t.referrer))===null||e===void 0?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},personInfo:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e?kb([],Fb,t||[]):[],s=di?.href.substring(0,1e3);return{r:this.referrer().substring(0,1e3),u:s?_y(s,n,My):void 0}},personPropsFromInfo:function(e){var t,{r:n,u:s}=e,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=ef(n))===null||t===void 0?void 0:t.host};if(s){r.$current_url=s;var i=ef(s);r.$host=i?.host,r.$pathname=i?.pathname;var a=this._campaignParamsFromUrl(s);ws(r,a)}if(n){var o=this._searchInfoFromReferrer(n);ws(r,o)}return r},initialPersonPropsFromInfo:function(e){var t=this.personPropsFromInfo(e),n={};return Mn(t,function(s,r){n["$initial_".concat(hT(r))]=s}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Ms)return{};var n=e?kb([],Fb,t||[]):[],[s,r]=Qn.os(Ms);return ws(Pm({$os:s,$os_version:r,$browser:Qn.browser(Ms,navigator.vendor),$device:Qn.device(Ms),$device_type:Qn.deviceType(Ms),$timezone:Qn.timezone(),$timezone_offset:Qn.timezoneOffset()}),{$current_url:_y(di?.href,n,My),$host:di?.host,$pathname:di?.pathname,$raw_user_agent:Ms.length>1e3?Ms.substring(0,997)+"...":Ms,$browser_version:Qn.browserVersion(Ms,navigator.vendor),$browser_language:Qn.browserLanguage(),$browser_language_prefix:Qn.browserLanguagePrefix(),$screen_height:Be?.screen.height,$screen_width:Be?.screen.width,$viewport_height:Be?.innerHeight,$viewport_width:Be?.innerWidth,$lib:"web",$lib_version:bl.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!Ms)return{};var[e,t]=Qn.os(Ms);return ws(Pm({$os:e,$os_version:t,$browser:Qn.browser(Ms,navigator.vendor)}),{$browser_version:Qn.browserVersion(Ms,navigator.vendor)})}},bo=Nr("[FeatureFlags]"),Oy="$active_feature_flags",gh="$override_feature_flags",BD="$feature_flag_payloads",qp="$override_feature_flag_payloads",jD="$feature_flag_request_id",HD=e=>{var t={};for(var[n,s]of Tb(e||{}))s&&(t[n]=s);return t},Dte=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(n=>{var s;return[n,(s=t[n].variant)!==null&&s!==void 0?s:t[n].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(n=>t[n].enabled).filter(n=>{var s;return(s=t[n].metadata)===null||s===void 0?void 0:s.payload}).map(n=>{var s;return[n,(s=t[n].metadata)===null||s===void 0?void 0:s.payload]}))):bo.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e};(function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"})(PS||(PS={}));class Pte{constructor(t){ht(this,"_override_warning",!1),ht(this,"_hasLoadedFlags",!1),ht(this,"_requestInFlight",!1),ht(this,"_reloadingDisabled",!1),ht(this,"_additionalReloadRequested",!1),ht(this,"_decideCalled",!1),ht(this,"_flagsLoadedFromRemote",!1),this.instance=t,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var t=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:t})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.instance.get_property(hS),n=this.instance.get_property(gh),s=this.instance.get_property(qp);if(!s&&!n)return t||{};var r=ws({},t||{}),i=[...new Set([...Object.keys(s||{}),...Object.keys(n||{})])];for(var a of i){var o,l,u=r[a],d=n?.[a],h=wt(d)?(o=u?.enabled)!==null&&o!==void 0&&o:!!d,f=wt(d)?u.variant:typeof d=="string"?d:void 0,p=s?.[a],m=We(We({},u),{},{enabled:h,variant:h?f??u?.variant:void 0});h!==u?.enabled&&(m.original_enabled=u?.enabled),f!==u?.variant&&(m.original_variant=u?.variant),p&&(m.metadata=We(We({},u?.metadata),{},{payload:p,original_payload:u==null||(l=u.metadata)===null||l===void 0?void 0:l.payload})),r[a]=m}return this._override_warning||(bo.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:s,finalDetails:r}),this._override_warning=!0),r}getFlagVariants(){var t=this.instance.get_property(Vh),n=this.instance.get_property(gh);if(!n)return t||{};for(var s=ws({},t),r=Object.keys(n),i=0;i<r.length;i++)s[r[i]]=n[r[i]];return this._override_warning||(bo.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:s}),this._override_warning=!0),s}getFlagPayloads(){var t=this.instance.get_property(BD),n=this.instance.get_property(qp);if(!n)return t||{};for(var s=ws({},t||{}),r=Object.keys(n),i=0;i<r.length;i++)s[r[i]]=n[r[i]];return this._override_warning||(bo.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:s}),this._override_warning=!0),s}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout(()=>{this._callDecideEndpoint()},5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this._reloadingDisabled=t}_callDecideEndpoint(t){var n;if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var s={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:We(We({},((n=this.instance.persistence)===null||n===void 0?void 0:n.get_initial_props())||{}),this.instance.get_property(Cg)||{}),group_properties:this.instance.get_property(Iu)};(t!=null&&t.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0);var r=this.instance.config.__preview_flags_v2&&this.instance.config.__preview_remote_config;r&&(s.timezone=Qn.timezone()),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api",r?"/flags/?v=2":"/decide/?v=4"),data:s,compression:this.instance.config.disable_compression?void 0:$a.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:i=>{var a,o,l,u=!0;i.statusCode===200&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),u=!1),this._requestInFlight=!1,this._decideCalled||(this._decideCalled=!0,this.instance._onRemoteConfig((l=i.json)!==null&&l!==void 0?l:{})),s.disable_flags&&!this._additionalReloadRequested||(this._flagsLoadedFromRemote=!u,i.json&&(a=i.json.quotaLimited)!==null&&a!==void 0&&a.includes(PS.FeatureFlags)?bo.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(this.receivedFeatureFlags((o=i.json)!==null&&o!==void 0?o:{},u),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint())))}})}}getFeatureFlag(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var s=this.getFlagVariants()[t],r="".concat(s),i=this.instance.get_property(jD)||void 0,a=this.instance.get_property(lx)||{};if((n.send_event||!("send_event"in n))&&(!(t in a)||!a[t].includes(r))){var o,l,u,d,h,f,p,m,v,b,w;cs(a[t])?a[t].push(r):a[t]=[r],(o=this.instance.persistence)===null||o===void 0||o.register({[lx]:a});var C=this.getFeatureFlagDetails(t),y={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:i,$feature_flag_bootstrapped_response:((l=this.instance.config.bootstrap)===null||l===void 0||(u=l.featureFlags)===null||u===void 0?void 0:u[t])||null,$feature_flag_bootstrapped_payload:((d=this.instance.config.bootstrap)===null||d===void 0||(h=d.featureFlagPayloads)===null||h===void 0?void 0:h[t])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};wt(C==null||(f=C.metadata)===null||f===void 0?void 0:f.version)||(y.$feature_flag_version=C.metadata.version);var k,_=(p=C==null||(m=C.reason)===null||m===void 0?void 0:m.description)!==null&&p!==void 0?p:C==null||(v=C.reason)===null||v===void 0?void 0:v.code;_&&(y.$feature_flag_reason=_),C!=null&&(b=C.metadata)!==null&&b!==void 0&&b.id&&(y.$feature_flag_id=C.metadata.id),wt(C?.original_variant)&&wt(C?.original_enabled)||(y.$feature_flag_original_response=wt(C.original_variant)?C.original_enabled:C.original_variant),C!=null&&(w=C.metadata)!==null&&w!==void 0&&w.original_payload&&(y.$feature_flag_original_payload=C==null||(k=C.metadata)===null||k===void 0?void 0:k.original_payload),this.instance.capture("$feature_flag_called",y)}return s}bo.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,n){var s=this.instance.config.token;this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this.instance.get_distinct_id(),token:s},compression:this.instance.config.disable_compression?void 0:$a.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,a=(i=r.json)===null||i===void 0?void 0:i.featureFlagPayloads;n(a?.[t]||void 0)}})}isFeatureEnabled(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,n);bo.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==t)}receivedFeatureFlags(t,n){if(this.instance.persistence){this._hasLoadedFlags=!0;var s=this.getFlagVariants(),r=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,o){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{},h=Dte(a),f=h.flags,p=h.featureFlags,m=h.featureFlagPayloads;if(p){var v=a.requestId;if(cs(p)){bo.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var b={};if(p)for(var w=0;w<p.length;w++)b[p[w]]=!0;o&&o.register({[Oy]:p,[Vh]:b})}else{var C=p,y=m,k=f;a.errorsWhileComputingFlags&&(C=We(We({},l),C),y=We(We({},u),y),k=We(We({},d),k)),o&&o.register(We({[Oy]:Object.keys(HD(C)),[Vh]:C||{},[BD]:y||{},[hS]:k||{}},v?{[jD]:v}:{}))}}})(t,this.instance.persistence,s,r,i),this._fireFeatureFlagsCallbacks(n)}}override(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];bo.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this.instance.__loaded||!this.instance.persistence)return bo.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.instance.persistence.unregister(gh),this.instance.persistence.unregister(qp),void this._fireFeatureFlagsCallbacks();if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,s=t;if(this._override_warning=!!((n=s.suppressWarning)!==null&&n!==void 0&&n),"flags"in s){if(s.flags===!1)this.instance.persistence.unregister(gh);else if(s.flags)if(cs(s.flags)){for(var r={},i=0;i<s.flags.length;i++)r[s.flags[i]]=!0;this.instance.persistence.register({[gh]:r})}else this.instance.persistence.register({[gh]:s.flags})}return"payloads"in s&&(s.payloads===!1?this.instance.persistence.unregister(qp):s.payloads&&this.instance.persistence.register({[qp]:s.payloads})),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this._hasLoadedFlags){var{flags:n,flagVariants:s}=this._prepareFeatureFlagsForCallbacks();t(n,s)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n){var s,r=(this.instance.get_property(Rb)||[]).find(l=>l.flagKey===t),i={["$feature_enrollment/".concat(t)]:n},a={$feature_flag:t,$feature_enrollment:n,$set:i};r&&(a.$early_access_feature_name=r.name),this.instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(i,!1);var o=We(We({},this.getFlagVariants()),{},{[t]:n});(s=this.instance.persistence)===null||s===void 0||s.register({[Oy]:Object.keys(HD(o)),[Vh]:o}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],s=arguments.length>2?arguments[2]:void 0,r=this.instance.get_property(Rb),i=s?"&".concat(s.map(a=>"stage=".concat(a)).join("&")):"";if(r&&!n)return t(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token).concat(i)),method:"GET",callback:a=>{var o;if(a.json){var l=a.json.earlyAccessFeatures;return(o=this.instance.persistence)===null||o===void 0||o.register({[Rb]:l}),t(l)}}})}_prepareFeatureFlagsForCallbacks(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(s=>n[s]),flagVariants:Object.keys(n).filter(s=>n[s]).reduce((s,r)=>(s[r]=n[r],s),{})}}_fireFeatureFlagsCallbacks(t){var{flags:n,flagVariants:s}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(r=>r(n,s,{errorsLoading:t}))}setPersonPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],s=this.instance.get_property(Cg)||{};this.instance.register({[Cg]:We(We({},s),t)}),n&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Cg)}setGroupPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],s=this.instance.get_property(Iu)||{};Object.keys(s).length!==0&&Object.keys(s).forEach(r=>{s[r]=We(We({},s[r]),t[r]),delete t[r]}),this.instance.register({[Iu]:We(We({},s),t)}),n&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this.instance.get_property(Iu)||{};this.instance.register({[Iu]:We(We({},n),{},{[t]:{}})})}else this.instance.unregister(Iu)}}var Ite=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Ly{constructor(t){this.config=t,this.props={},this.campaign_params_saved=!1,this.name=(n=>{var s="";return n.token&&(s=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+s+"_posthog"})(t),this.storage=this.buildStorage(t),this.load(),t.debug&&Rt.info("Persistence loaded",t.persistence,We({},this.props)),this.update_config(t,t),this.save()}buildStorage(t){Ite.indexOf(t.persistence.toLowerCase())===-1&&(Rt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=t.persistence.toLowerCase();return n==="localstorage"&&Us.is_supported()?Us:n==="localstorage+cookie"&&Sv.is_supported()?Sv:n==="sessionstorage"&&fr.is_supported()?fr:n==="memory"?Aee:n==="cookie"?Tl:Sv.is_supported()?Sv:Tl}properties(){var t={};return Mn(this.props,function(n,s){if(s===Vh&&us(n))for(var r=Object.keys(n),i=0;i<r.length;i++)t["$feature/".concat(r[i])]=n[r[i]];else o=s,l=!1,(lu(a=oee)?l:KF&&a.indexOf===KF?a.indexOf(o)!=-1:(Mn(a,function(u){if(l||(l=u===o))return ax}),l))||(t[s]=n);var a,o,l}),t}load(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=ws({},t))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(t,n,s){if(us(t)){wt(n)&&(n="None"),this.expire_days=wt(s)?this.default_expiry:s;var r=!1;if(Mn(t,(i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=i,r=!0)}),r)return this.save(),!0}return!1}register(t,n){if(us(t)){this.expire_days=wt(n)?this.default_expiry:n;var s=!1;if(Mn(t,(r,i)=>{t.hasOwnProperty(i)&&this.props[i]!==r&&(this.props[i]=r,s=!0)}),s)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var t=Qn.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Gh(Pm(t))||this.register(t),this.campaign_params_saved=!0}}update_search_keyword(){this.register(Qn.searchInfo())}update_referrer_info(){this.register_once(Qn.referrerInfo(),void 0)}set_initial_person_info(){this.props[mS]||this.props[vS]||this.register_once({[bS]:Qn.personInfo({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties})},void 0)}get_referrer_info(){return Pm({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var t={};Mn([vS,mS],r=>{var i=this.props[r];i&&Mn(i,function(a,o){t["$initial_"+hT(o)]=a})});var n=this.props[bS];if(n){var s=Qn.initialPersonPropsFromInfo(n);ws(t,s)}return t}safe_merge(t){return Mn(this.props,function(n,s){s in t||(t[s]=n)}),t}update_config(t,n){if(this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence){var s=this.buildStorage(t),r=this.props;this.clear(),this.storage=s,this.props=r,this.save()}}set_disabled(t){this.disabled=t,this.disabled?this.remove():this.save()}set_cross_subdomain(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(t){t!==this.secure&&(this.secure=t,this.remove(),this.save())}set_event_timer(t,n){var s=this.props[xg]||{};s[t]=n,this.props[xg]=s,this.save()}remove_event_timer(t){var n=(this.props[xg]||{})[t];return wt(n)||(delete this.props[xg][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var $6,ds,z6,Bu,UD,q6,IS,K6,GD,NS,VD,WD,$D,zD,MS={},Y6=[],Nte=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,CT=Array.isArray;function Nc(e,t){for(var n in t)e[n]=t[n];return e}function X6(e){var t=e.parentNode;t&&t.removeChild(e)}function By(e,t,n,s,r){var i={type:e,props:t,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++z6,__i:-1,__u:0};return r==null&&ds.vnode!=null&&ds.vnode(i),i}function yT(e){return e.children}function Db(e,t){this.props=e,this.context=t}function Nf(e,t){if(t==null)return e.__?Nf(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Nf(e):null}function Q6(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Q6(e)}}function OS(e){(!e.__d&&(e.__d=!0)&&Bu.push(e)&&!mx.__r++||UD!==ds.debounceRendering)&&((UD=ds.debounceRendering)||q6)(mx)}function mx(){var e,t,n,s,r,i,a,o,l;for(Bu.sort(IS);e=Bu.shift();)e.__d&&(t=Bu.length,s=void 0,i=(r=(n=e).__v).__e,o=[],l=[],(a=n.__P)&&((s=Nc({},r)).__v=r.__v+1,ds.vnode&&ds.vnode(s),ej(a,s,r,n.__n,a.ownerSVGElement!==void 0,32&r.__u?[i]:null,o,i??Nf(r),!!(32&r.__u),l),s.__.__k[s.__i]=s,Lte(o,s,l),s.__e!=i&&Q6(s)),Bu.length>t&&Bu.sort(IS));mx.__r=0}function J6(e,t,n,s,r,i,a,o,l,u,d){var h,f,p,m,v,b=s&&s.__k||Y6,w=t.length;for(n.__d=l,Mte(n,t,b),l=n.__d,h=0;h<w;h++)(p=n.__k[h])!=null&&typeof p!="boolean"&&typeof p!="function"&&(f=p.__i===-1?MS:b[p.__i]||MS,p.__i=h,ej(e,p,f,r,i,a,o,l,u,d),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&_T(f.ref,null,p),d.push(p.ref,p.__c||m,p)),v==null&&m!=null&&(v=m),65536&p.__u||f.__k===p.__k?l=Z6(p,l,e):typeof p.type=="function"&&p.__d!==void 0?l=p.__d:m&&(l=m.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=v}function Mte(e,t,n){var s,r,i,a,o,l=t.length,u=n.length,d=u,h=0;for(e.__k=[],s=0;s<l;s++)(r=e.__k[s]=(r=t[s])==null||typeof r=="boolean"||typeof r=="function"?null:typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?By(null,r,null,null,r):CT(r)?By(yT,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?By(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)!=null?(r.__=e,r.__b=e.__b+1,o=Ote(r,n,a=s+h,d),r.__i=o,i=null,o!==-1&&(d--,(i=n[o])&&(i.__u|=131072)),i==null||i.__v===null?(o==-1&&h--,typeof r.type!="function"&&(r.__u|=65536)):o!==a&&(o===a+1?h++:o>a?d>l-a?h+=o-a:h--:h=o<a&&o==a-1?o-a:0,o!==s+h&&(r.__u|=65536))):(i=n[s])&&i.key==null&&i.__e&&(i.__e==e.__d&&(e.__d=Nf(i)),LS(i,i,!1),n[s]=null,d--);if(d)for(s=0;s<u;s++)(i=n[s])!=null&&(131072&i.__u)==0&&(i.__e==e.__d&&(e.__d=Nf(i)),LS(i,i))}function Z6(e,t,n){var s,r;if(typeof e.type=="function"){for(s=e.__k,r=0;s&&r<s.length;r++)s[r]&&(s[r].__=e,t=Z6(s[r],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Ote(e,t,n,s){var r=e.key,i=e.type,a=n-1,o=n+1,l=t[n];if(l===null||l&&r==l.key&&i===l.type)return n;if(s>(l!=null&&(131072&l.__u)==0?1:0))for(;a>=0||o<t.length;){if(a>=0){if((l=t[a])&&(131072&l.__u)==0&&r==l.key&&i===l.type)return a;a--}if(o<t.length){if((l=t[o])&&(131072&l.__u)==0&&r==l.key&&i===l.type)return o;o++}}return-1}function qD(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Nte.test(t)?n:n+"px"}function Dv(e,t,n,s,r){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof s=="string"&&(e.style.cssText=s=""),s)for(t in s)n&&t in n||qD(e.style,t,"");if(n)for(t in n)s&&n[t]===s[t]||qD(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?s?n.u=s.u:(n.u=Date.now(),e.addEventListener(t,i?YD:KD,i)):e.removeEventListener(t,i?YD:KD,i);else{if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function KD(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(ds.event?ds.event(e):e)}function YD(e){return this.l[e.type+!0](ds.event?ds.event(e):e)}function ej(e,t,n,s,r,i,a,o,l,u){var d,h,f,p,m,v,b,w,C,y,k,_,E,R,F,A=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[o=t.__e=n.__e]),(d=ds.__b)&&d(t);e:if(typeof A=="function")try{if(w=t.props,C=(d=A.contextType)&&s[d.__c],y=d?C?C.props.value:d.__:s,n.__c?b=(h=t.__c=n.__c).__=h.__E:("prototype"in A&&A.prototype.render?t.__c=h=new A(w,y):(t.__c=h=new Db(w,y),h.constructor=A,h.render=jte),C&&C.sub(h),h.props=w,h.state||(h.state={}),h.context=y,h.__n=s,f=h.__d=!0,h.__h=[],h._sb=[]),h.__s==null&&(h.__s=h.state),A.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Nc({},h.__s)),Nc(h.__s,A.getDerivedStateFromProps(w,h.__s))),p=h.props,m=h.state,h.__v=t,f)A.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(A.getDerivedStateFromProps==null&&w!==p&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(w,y),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(w,h.__s,y)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(h.props=w,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(N){N&&(N.__=t)}),k=0;k<h._sb.length;k++)h.__h.push(h._sb[k]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(w,h.__s,y),h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(p,m,v)})}if(h.context=y,h.props=w,h.__P=e,h.__e=!1,_=ds.__r,E=0,"prototype"in A&&A.prototype.render){for(h.state=h.__s,h.__d=!1,_&&_(t),d=h.render(h.props,h.state,h.context),R=0;R<h._sb.length;R++)h.__h.push(h._sb[R]);h._sb=[]}else do h.__d=!1,_&&_(t),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++E<25);h.state=h.__s,h.getChildContext!=null&&(s=Nc(Nc({},s),h.getChildContext())),f||h.getSnapshotBeforeUpdate==null||(v=h.getSnapshotBeforeUpdate(p,m)),J6(e,CT(F=d!=null&&d.type===yT&&d.key==null?d.props.children:d)?F:[F],t,n,s,r,i,a,o,l,u),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),b&&(h.__E=h.__=null)}catch(N){t.__v=null,l||i!=null?(t.__e=o,t.__u|=l?160:32,i[i.indexOf(o)]=null):(t.__e=n.__e,t.__k=n.__k),ds.__e(N,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Bte(n.__e,t,n,s,r,i,a,l,u);(d=ds.diffed)&&d(t)}function Lte(e,t,n){t.__d=void 0;for(var s=0;s<n.length;s++)_T(n[s],n[++s],n[++s]);ds.__c&&ds.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(i){i.call(r)})}catch(i){ds.__e(i,r.__v)}})}function Bte(e,t,n,s,r,i,a,o,l){var u,d,h,f,p,m,v,b=n.props,w=t.props,C=t.type;if(C==="svg"&&(r=!0),i!=null){for(u=0;u<i.length;u++)if((p=i[u])&&"setAttribute"in p==!!C&&(C?p.localName===C:p.nodeType===3)){e=p,i[u]=null;break}}if(e==null){if(C===null)return document.createTextNode(w);e=r?document.createElementNS("http://www.w3.org/2000/svg",C):document.createElement(C,w.is&&w),i=null,o=!1}if(C===null)b===w||o&&e.data===w||(e.data=w);else{if(i=i&&$6.call(e.childNodes),b=n.props||MS,!o&&i!=null)for(b={},u=0;u<e.attributes.length;u++)b[(p=e.attributes[u]).name]=p.value;for(u in b)p=b[u],u=="children"||(u=="dangerouslySetInnerHTML"?h=p:u==="key"||u in w||Dv(e,u,null,p,r));for(u in w)p=w[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?d=p:u=="value"?m=p:u=="checked"?v=p:u==="key"||o&&typeof p!="function"||b[u]===p||Dv(e,u,p,b[u],r);if(d)o||h&&(d.__html===h.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(h&&(e.innerHTML=""),J6(e,CT(f)?f:[f],t,n,s,r&&C!=="foreignObject",i,a,i?i[0]:n.__k&&Nf(n,0),o,l),i!=null)for(u=i.length;u--;)i[u]!=null&&X6(i[u]);o||(u="value",m!==void 0&&(m!==e[u]||C==="progress"&&!m||C==="option"&&m!==b[u])&&Dv(e,u,m,b[u],!1),u="checked",v!==void 0&&v!==e[u]&&Dv(e,u,v,b[u],!1))}return e}function _T(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(s){ds.__e(s,n)}}function LS(e,t,n){var s,r;if(ds.unmount&&ds.unmount(e),(s=e.ref)&&(s.current&&s.current!==e.__e||_T(s,null,t)),(s=e.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(i){ds.__e(i,t)}s.base=s.__P=null,e.__c=void 0}if(s=e.__k)for(r=0;r<s.length;r++)s[r]&&LS(s[r],t,n||typeof e.type!="function");n||e.__e==null||X6(e.__e),e.__=e.__e=e.__d=void 0}function jte(e,t,n){return this.constructor(e,n)}$6=Y6.slice,ds={__e:function(e,t,n,s){for(var r,i,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(e)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,s||{}),a=r.__d),a)return r.__E=r}catch(o){e=o}throw e}},z6=0,Db.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Nc({},this.state),typeof e=="function"&&(e=e(Nc({},n),this.props)),e&&Nc(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),OS(this))},Db.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),OS(this))},Db.prototype.render=yT,Bu=[],q6=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,IS=function(e,t){return e.__v.__b-t.__v.__b},mx.__r=0,K6=0,function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}(GD||(GD={})),function(e){e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}(NS||(NS={})),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(VD||(VD={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(WD||(WD={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}($D||($D={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(zD||(zD={}));var Mf=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}},dr=Nr("[Surveys]"),XD={icontains:(e,t)=>e.some(n=>t.toLowerCase().includes(n.toLowerCase())),not_icontains:(e,t)=>e.every(n=>!t.toLowerCase().includes(n.toLowerCase())),regex:(e,t)=>e.some(n=>Mf(t,n)),not_regex:(e,t)=>e.every(n=>!Mf(t,n)),exact:(e,t)=>e.some(n=>t===n),is_not:(e,t)=>e.every(n=>t!==n)};function QD(e){return e??"icontains"}NS.Right;(function(e,t){var n={__c:t="__cC"+K6++,__:e,Consumer:function(s,r){return s.children(r)},Provider:function(s){var r,i;return this.getChildContext||(r=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&r.some(function(o){o.__e=!0,OS(o)})},this.sub=function(a){r.push(a);var o=a.componentWillUnmount;a.componentWillUnmount=function(){r.splice(r.indexOf(a),1),o&&o.call(a)}}),s.children}};n.Provider.__=n.Consumer.contextType=n})({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{}});let tj=class{constructor(){ht(this,"events",{}),this.events={}}on(t,n){return this.events[t]||(this.events[t]=[]),this.events[t].push(n),()=>{this.events[t]=this.events[t].filter(s=>s!==n)}}emit(t,n){for(var s of this.events[t]||[])s(n);for(var r of this.events["*"]||[])r(t,n)}},Hte=class Ih{constructor(t){ht(this,"_debugEventEmitter",new tj),ht(this,"checkStep",(n,s)=>this.checkStepEvent(n,s)&&this.checkStepUrl(n,s)&&this.checkStepElement(n,s)),ht(this,"checkStepEvent",(n,s)=>s==null||!s.event||n?.event===s?.event),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var t;if(!wt((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)){var n;(n=this.instance)===null||n===void 0||n._addCaptureHook((s,r)=>{this.on(s,r)})}}register(t){var n,s;if(!wt((n=this.instance)===null||n===void 0?void 0:n._addCaptureHook)&&(t.forEach(a=>{var o,l;(o=this.actionRegistry)===null||o===void 0||o.add(a),(l=a.steps)===null||l===void 0||l.forEach(u=>{var d;(d=this.actionEvents)===null||d===void 0||d.add(u?.event||"")})}),(s=this.instance)!==null&&s!==void 0&&s.autocapture)){var r,i=new Set;t.forEach(a=>{var o;(o=a.steps)===null||o===void 0||o.forEach(l=>{l!=null&&l.selector&&i.add(l?.selector)})}),(r=this.instance)===null||r===void 0||r.autocapture.setElementSelectors(i)}}on(t,n){var s;n!=null&&t.length!=0&&(this.actionEvents.has(t)||this.actionEvents.has(n?.event))&&this.actionRegistry&&((s=this.actionRegistry)===null||s===void 0?void 0:s.size)>0&&this.actionRegistry.forEach(r=>{this.checkAction(n,r)&&this._debugEventEmitter.emit("actionCaptured",r.name)})}_addActionHook(t){this.onAction("actionCaptured",n=>t(n))}checkAction(t,n){if(n?.steps==null)return!1;for(var s of n.steps)if(this.checkStep(t,s))return!0;return!1}onAction(t,n){return this._debugEventEmitter.on(t,n)}checkStepUrl(t,n){if(n!=null&&n.url){var s,r=t==null||(s=t.properties)===null||s===void 0?void 0:s.$current_url;if(!r||typeof r!="string"||!Ih.matchString(r,n?.url,n?.url_matching||"contains"))return!1}return!0}static matchString(t,n,s){switch(s){case"regex":return!!Be&&Mf(t,n);case"exact":return n===t;case"contains":var r=Ih.escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Mf(t,r);default:return!1}}static escapeStringRegexp(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(t,n){if((n!=null&&n.href||n!=null&&n.tag_name||n!=null&&n.text)&&!this.getElementsList(t).some(i=>!(n!=null&&n.href&&!Ih.matchString(i.href||"",n?.href,n?.href_matching||"exact"))&&(n==null||!n.tag_name||i.tag_name===n?.tag_name)&&!(n!=null&&n.text&&!Ih.matchString(i.text||"",n?.text,n?.text_matching||"exact")&&!Ih.matchString(i.$el_text||"",n?.text,n?.text_matching||"exact"))))return!1;if(n!=null&&n.selector){var s,r=t==null||(s=t.properties)===null||s===void 0?void 0:s.$element_selectors;if(!r||!r.includes(n?.selector))return!1}return!0}getElementsList(t){return t?.properties.$elements==null?[]:t?.properties.$elements}},BS=class nj{constructor(t){this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(t){var n;wt((n=this.instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.setupEventBasedSurveys(t),this.setupActionBasedSurveys(t))}setupActionBasedSurveys(t){var n=t.filter(s=>{var r,i,a,o;return((r=s.conditions)===null||r===void 0?void 0:r.actions)&&((i=s.conditions)===null||i===void 0||(a=i.actions)===null||a===void 0||(o=a.values)===null||o===void 0?void 0:o.length)>0});n.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new Hte(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(s=>{this.onAction(s)})),n.forEach(s=>{var r,i,a,o,l,u,d,h,f,p;s.conditions&&(r=s.conditions)!==null&&r!==void 0&&r.actions&&(i=s.conditions)!==null&&i!==void 0&&(a=i.actions)!==null&&a!==void 0&&a.values&&((o=s.conditions)===null||o===void 0||(l=o.actions)===null||l===void 0||(u=l.values)===null||u===void 0?void 0:u.length)>0&&((d=this.actionMatcher)===null||d===void 0||d.register(s.conditions.actions.values),(h=s.conditions)===null||h===void 0||(f=h.actions)===null||f===void 0||(p=f.values)===null||p===void 0||p.forEach(m=>{if(m&&m.name){var v=this.actionToSurveys.get(m.name);v&&v.push(s.id),this.actionToSurveys.set(m.name,v||[s.id])}}))}))}setupEventBasedSurveys(t){var n;t.filter(s=>{var r,i,a,o;return((r=s.conditions)===null||r===void 0?void 0:r.events)&&((i=s.conditions)===null||i===void 0||(a=i.events)===null||a===void 0||(o=a.values)===null||o===void 0?void 0:o.length)>0}).length!==0&&((n=this.instance)===null||n===void 0||n._addCaptureHook((s,r)=>{this.onEvent(s,r)}),t.forEach(s=>{var r,i,a;(r=s.conditions)===null||r===void 0||(i=r.events)===null||i===void 0||(a=i.values)===null||a===void 0||a.forEach(o=>{if(o&&o.name){var l=this.eventToSurveys.get(o.name);l&&l.push(s.id),this.eventToSurveys.set(o.name,l||[s.id])}})}))}onEvent(t,n){var s,r,i=((s=this.instance)===null||s===void 0||(r=s.persistence)===null||r===void 0?void 0:r.props[_v])||[];if(nj.SURVEY_SHOWN_EVENT_NAME==t&&n&&i.length>0){var a,o=n==null||(a=n.properties)===null||a===void 0?void 0:a.$survey_id;if(o){var l=i.indexOf(o);l>=0&&(i.splice(l,1),this._updateActivatedSurveys(i))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(i.concat(this.eventToSurveys.get(t)||[]))}onAction(t){var n,s,r=((n=this.instance)===null||n===void 0||(s=n.persistence)===null||s===void 0?void 0:s.props[_v])||[];this.actionToSurveys.has(t)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(t)||[]))}_updateActivatedSurveys(t){var n,s;(n=this.instance)===null||n===void 0||(s=n.persistence)===null||s===void 0||s.register({[_v]:[...new Set(t)]})}getSurveys(){var t,n,s=(t=this.instance)===null||t===void 0||(n=t.persistence)===null||n===void 0?void 0:n.props[_v];return s||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};ht(BS,"SURVEY_SHOWN_EVENT_NAME","survey shown");let Ute=class{constructor(t){ht(this,"_isFetchingSurveys",!1),ht(this,"_isInitializingSurveys",!1),ht(this,"_surveyCallbacks",[]),this.instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){var n=t.surveys;if(kn(n))return dr.warn("Decide not loaded yet. Not loading surveys.");var s=cs(n);this._hasSurveys=s?n.length>0:n,dr.info("decide response received, hasSurveys: ".concat(this._hasSurveys)),this._hasSurveys&&this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var t=(()=>{for(var n=[],s=0;s<localStorage.length;s++){var r=localStorage.key(s);r!=null&&r.startsWith("seenSurvey_")&&n.push(r)}return n})();t.forEach(n=>localStorage.removeItem(n))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)dr.info("Already initializing surveys, skipping...");else if(this.instance.config.disable_surveys)dr.info("Disabled. Not loading surveys.");else{var t=Vt?.__PosthogExtensions__;if(t)if(this._hasSurveys){this._isInitializingSurveys=!0;try{var n=t.generateSurveys;if(n)this._surveyManager=n(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new BS(this.instance),dr.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0});else{var s=t.loadExternalDependency;if(s)s(this.instance,"surveys",i=>{if(i||!t.generateSurveys)return dr.error("Could not load surveys script",i),void(this._isInitializingSurveys=!1);this._surveyManager=t.generateSurveys(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new BS(this.instance),dr.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})});else{var r="PostHog loadExternalDependency extension not found. Cannot load remote config.";dr.error(r),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:r})}}}catch(i){throw dr.error("Error initializing surveys",i),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:"Error initializing surveys"}),i}}else dr.info("No surveys to load.");else dr.error("PostHog Extensions not found.")}}onSurveysLoaded(t){return this._surveyCallbacks.push(t),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),()=>{this._surveyCallbacks=this._surveyCallbacks.filter(n=>n!==t)}}getSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return dr.info("Disabled. Not loading surveys."),t([]);var s=this.instance.get_property(fS);if(s&&!n)return t(s,{isLoaded:!0});if(this._isFetchingSurveys)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this._isFetchingSurveys=!0,this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",timeout:this.instance.config.surveys_request_timeout_ms,callback:r=>{var i;this._isFetchingSurveys=!1;var a=r.statusCode;if(a!==200||!r.json){var o="Surveys API could not be loaded, status: ".concat(a);return dr.error(o),t([],{isLoaded:!1,error:o})}var l,u=r.json.surveys||[],d=u.filter(h=>{var f,p,m,v,b,w,C,y,k,_,E,R;return((f=h.conditions)===null||f===void 0?void 0:f.events)&&((p=h.conditions)===null||p===void 0||(m=p.events)===null||m===void 0?void 0:m.values)&&((v=h.conditions)===null||v===void 0||(b=v.events)===null||b===void 0||(w=b.values)===null||w===void 0?void 0:w.length)>0||((C=h.conditions)===null||C===void 0?void 0:C.actions)&&((y=h.conditions)===null||y===void 0||(k=y.actions)===null||k===void 0?void 0:k.values)&&((_=h.conditions)===null||_===void 0||(E=_.actions)===null||E===void 0||(R=E.values)===null||R===void 0?void 0:R.length)>0});return d.length>0&&((l=this._surveyEventReceiver)===null||l===void 0||l.register(d)),(i=this.instance.persistence)===null||i===void 0||i.register({[fS]:u}),t(u,{isLoaded:!0})}})}catch(r){throw this._isFetchingSurveys=!1,r}}_notifySurveyCallbacks(t){for(var n of this._surveyCallbacks)try{t.isLoaded?this.getSurveys(n):n([],t)}catch(s){dr.error("Error in survey callback",s)}}isSurveyFeatureFlagEnabled(t){return!t||this.instance.featureFlags.isFeatureEnabled(t)}getActiveMatchingSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(s=>{var r,i=s.filter(l=>!(!l.start_date||l.end_date)).filter(l=>{var u;if(!l.conditions)return!0;var d=function(p){var m,v,b;if((m=p.conditions)===null||m===void 0||!m.url)return!0;var w=Be==null||(v=Be.location)===null||v===void 0?void 0:v.href;if(!w)return!1;var C=[p.conditions.url];return XD[QD((b=p.conditions)===null||b===void 0?void 0:b.urlMatchType)](C,w)}(l),h=(u=l.conditions)===null||u===void 0||!u.selector||_t?.querySelector(l.conditions.selector),f=function(p){var m,v,b;if((m=p.conditions)===null||m===void 0||!m.deviceTypes||((v=p.conditions)===null||v===void 0?void 0:v.deviceTypes.length)===0)return!0;if(!Ms)return!1;var w=Qn.deviceType(Ms);return XD[QD((b=p.conditions)===null||b===void 0?void 0:b.deviceTypesMatchType)](p.conditions.deviceTypes,w)}(l);return d&&h&&f}),a=(r=this._surveyEventReceiver)===null||r===void 0?void 0:r.getSurveys(),o=i.filter(l=>{var u,d,h,f,p,m,v,b,w;if(!(l.linked_flag_key||l.targeting_flag_key||l.internal_targeting_flag_key||(u=l.feature_flag_keys)!==null&&u!==void 0&&u.length))return!0;var C=this.isSurveyFeatureFlagEnabled(l.linked_flag_key),y=this.isSurveyFeatureFlagEnabled(l.targeting_flag_key),k=((d=(h=l.conditions)===null||h===void 0||(f=h.events)===null||f===void 0||(p=f.values)===null||p===void 0?void 0:p.length)!==null&&d!==void 0?d:0)>0,_=((m=(v=l.conditions)===null||v===void 0||(b=v.actions)===null||b===void 0||(w=b.values)===null||w===void 0?void 0:w.length)!==null&&m!==void 0?m:0)>0,E=!k&&!_||a?.includes(l.id),R=this._canActivateRepeatedly(l)||this.isSurveyFeatureFlagEnabled(l.internal_targeting_flag_key),F=this.checkFlags(l);return C&&y&&R&&E&&F});return t(o)},n)}checkFlags(t){var n;return(n=t.feature_flag_keys)===null||n===void 0||!n.length||t.feature_flag_keys.every(s=>{var{key:r,value:i}=s;return!r||!i||this.instance.featureFlags.isFeatureEnabled(i)})}_canActivateRepeatedly(t){var n;return kn((n=Vt.__PosthogExtensions__)===null||n===void 0?void 0:n.canActivateRepeatedly)?(dr.warn("init was not called"),!1):Vt.__PosthogExtensions__.canActivateRepeatedly(t)}canRenderSurvey(t){if(kn(this._surveyManager))return dr.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=null;return this.getSurveys(s=>{var r=s.filter(i=>i.id===t)[0];n=r?We({},this._surveyManager.canRenderSurvey(r)):{visible:!1,disabledReason:"Survey not found"}}),n}renderSurvey(t,n){kn(this._surveyManager)?dr.warn("init was not called"):this.getSurveys(s=>{var r=s.filter(i=>i.id===t)[0];this._surveyManager.renderSurvey(r,_t?.querySelector(n))})}};var JD=Nr("[RateLimiter]");let Gte=class{constructor(t){var n,s;ht(this,"serverLimits",{}),ht(this,"lastEventRateLimited",!1),ht(this,"checkForLimiting",r=>{var i=r.text;if(i&&i.length)try{(JSON.parse(i).quota_limited||[]).forEach(a=>{JD.info("".concat(a||"events"," is quota limited.")),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void JD.warn('could not rate limit - continuing. Error: "'.concat(a?.message,'"'),{text:i})}}),this.instance=t,this.captureEventsPerSecond=((n=t.config.rate_limiting)===null||n===void 0?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((s=t.config.rate_limiting)===null||s===void 0?void 0:s.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var t,n,s,r=arguments.length>0&&arguments[0]!==void 0&&arguments[0],i=new Date().getTime(),a=(t=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property(gS))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:i};a.tokens+=(i-a.last)/1e3*this.captureEventsPerSecond,a.last=i,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var o=a.tokens<1;return o||r||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(s=this.instance.persistence)===null||s===void 0||s.set_property(gS,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}};var Ru=Nr("[RemoteConfig]");let Vte=class{constructor(t){this.instance=t}get remoteConfig(){var t,n;return(t=Vt._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(n=t[this.instance.config.token])===null||n===void 0?void 0:n.config}_loadRemoteConfigJs(t){var n,s,r;(n=Vt.__PosthogExtensions__)!==null&&n!==void 0&&n.loadExternalDependency?(s=Vt.__PosthogExtensions__)===null||s===void 0||(r=s.loadExternalDependency)===null||r===void 0||r.call(s,this.instance,"remote-config",()=>t(this.remoteConfig)):(Ru.error("PostHog Extensions not found. Cannot load remote config."),t())}_loadRemoteConfigJSON(t){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return Ru.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void Ru.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(t=>{if(!t)return Ru.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(n=>{this.onRemoteConfig(n)});this.onRemoteConfig(t)})}catch(t){Ru.error("Error loading remote config",t)}}onRemoteConfig(t){t?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(t),t.hasFeatureFlags!==!1&&this.instance.featureFlags.ensureFlagsLoaded()):Ru.info("__preview_remote_config is disabled. Logging config instead",t):Ru.error("Failed to fetch remote config from PostHog.")}};var Wte=function(e){var t,n,s,r,i="";for(t=n=0,s=(e=(e+"").replace(/\r\n/g,`
|
|
4
4
|
`).replace(/\r/g,`
|
|
5
5
|
`)).length,r=0;r<s;r++){var a=e.charCodeAt(r),o=null;a<128?n++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),lu(o)||(n>t&&(i+=e.substring(t,n)),i+=o,t=n=r+1)}return n>t&&(i+=e.substring(t,e.length)),i},$te=!!lS||!!oS,ZD="text/plain",vx=(e,t)=>{var[n,s]=e.split("?"),r=We({},t);s?.split("&").forEach(a=>{var[o]=a.split("=");delete r[o]});var i=mee(r);return i=i?(s?s+"&":"")+i:s,"".concat(n,"?").concat(i)},Sg=(e,t)=>JSON.stringify(e,(n,s)=>typeof s=="bigint"?s.toString():s,t),jy=e=>{var{data:t,compression:n}=e;if(t){if(n===$a.GZipJS){var s=k6(T6(Sg(t)),{mtime:0}),r=new Blob([s],{type:ZD});return{contentType:ZD,body:r,estimatedSize:r.size}}if(n===$a.Base64){var i=function(l){var u,d,h,f,p,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",v=0,b=0,w="",C=[];if(!l)return l;l=Wte(l);do u=(p=l.charCodeAt(v++)<<16|l.charCodeAt(v++)<<8|l.charCodeAt(v++))>>18&63,d=p>>12&63,h=p>>6&63,f=63&p,C[b++]=m.charAt(u)+m.charAt(d)+m.charAt(h)+m.charAt(f);while(v<l.length);switch(w=C.join(""),l.length%3){case 1:w=w.slice(0,-2)+"==";break;case 2:w=w.slice(0,-1)+"="}return w}(Sg(t)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Sg(l)))(i);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var o=Sg(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Hg=[];oS&&Hg.push({transport:"fetch",method:e=>{var t,n,{contentType:s,body:r,estimatedSize:i}=(t=jy(e))!==null&&t!==void 0?t:{},a=new Headers;Mn(e.headers,function(d,h){a.append(h,d)}),s&&a.append("Content-Type",s);var o=e.url,l=null;if(YF){var u=new YF;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),e.timeout)}}oS(o,We({method:e?.method||"GET",headers:a,keepalive:e.method==="POST"&&(i||0)<52428.8,body:r,signal:(n=l)===null||n===void 0?void 0:n.signal},e.fetchOptions)).then(d=>d.text().then(h=>{var f,p={statusCode:d.status,text:h};if(d.status===200)try{p.json=JSON.parse(h)}catch(m){Rt.error(m)}(f=e.callback)===null||f===void 0||f.call(e,p)})).catch(d=>{var h;Rt.error(d),(h=e.callback)===null||h===void 0||h.call(e,{statusCode:0,text:d})}).finally(()=>l?clearTimeout(l.timeout):null)}}),lS&&Hg.push({transport:"XHR",method:e=>{var t,n=new lS;n.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}=(t=jy(e))!==null&&t!==void 0?t:{};Mn(e.headers,function(i,a){n.setRequestHeader(a,i)}),s&&n.setRequestHeader("Content-Type",s),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(n.readyState===4){var i,a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}(i=e.callback)===null||i===void 0||i.call(e,a)}},n.send(r)}}),Oi!=null&&Oi.sendBeacon&&Hg.push({transport:"sendBeacon",method:e=>{var t=vx(e.url,{beacon:"1"});try{var n,{contentType:s,body:r}=(n=jy(e))!==null&&n!==void 0?n:{},i=typeof r=="string"?new Blob([r],{type:s}):r;Oi.sendBeacon(t,i)}catch{}}});var jS=3e3;let zte=class{constructor(t,n){ht(this,"isPaused",!0),ht(this,"queue",[]),this.flushTimeoutMs=la(n?.flush_interval_ms||jS,250,5e3,"flush interval",jS),this.sendRequest=t}enqueue(t){this.queue.push(t),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},n=Object.values(t),s=[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)];s.map(r=>{this.sendRequest(We(We({},r),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var t=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var n=this.formatQueue(),s=function(i){var a=n[i],o=new Date().getTime();a.data&&cs(a.data)&&Mn(a.data,l=>{l.offset=Math.abs(l.timestamp-o),delete l.timestamp}),t.sendRequest(a)};for(var r in n)s(r)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var t={};return Mn(this.queue,n=>{var s,r=n,i=(r?r.batchKey:null)||r.url;wt(t[i])&&(t[i]=We(We({},r),{},{data:[]})),(s=t[i].data)===null||s===void 0||s.push(r.data)}),this.queue=[],t}};var qte=["retriesPerformedSoFar"];let Kte=class{constructor(t){ht(this,"isPolling",!1),ht(this,"pollIntervalMs",3e3),ht(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!wt(Be)&&"onLine"in Be.navigator&&(this.areWeOnline=Be.navigator.onLine,ys(Be,"online",()=>{this.areWeOnline=!0,this.flush()}),ys(Be,"offline",()=>{this.areWeOnline=!1}))}retriableRequest(t){var{retriesPerformedSoFar:n}=t,s=t6(t,qte);Xr(n)&&n>0&&(s.url=vx(s.url,{retry_count:n})),this.instance._send_request(We(We({},s),{},{callback:r=>{var i;r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.enqueue(We({retriesPerformedSoFar:n},s)):(i=s.callback)===null||i===void 0||i.call(s,r)}}))}enqueue(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var s=function(a){var o=3e3*Math.pow(2,a),l=o/2,u=Math.min(18e5,o),d=(Math.random()-.5)*(u-l);return Math.ceil(u+d)}(n),r=Date.now()+s;this.queue.push({retryAt:r,requestOptions:t});var i="Enqueued failed request for retry in ".concat(s);navigator.onLine||(i+=" (Browser is offline)"),Rt.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var t=Date.now(),n=[],s=this.queue.filter(i=>i.retryAt<t||(n.push(i),!1));if(this.queue=n,s.length>0)for(var{requestOptions:r}of s)this.retriableRequest(r)}unload(){for(var{requestOptions:t}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(We(We({},t),{},{transport:"sendBeacon"}))}catch(n){Rt.error(n)}this.queue=[]}},Yte=class{constructor(t){ht(this,"_updateScrollData",()=>{var n,s,r,i;this.context||(this.context={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,u=o+(a?.clientHeight||0),d=a?.scrollHeight||0;this.context.lastScrollY=Math.ceil(o),this.context.maxScrollY=Math.max(o,(n=this.context.maxScrollY)!==null&&n!==void 0?n:0),this.context.maxScrollHeight=Math.max(l,(s=this.context.maxScrollHeight)!==null&&s!==void 0?s:0),this.context.lastContentY=u,this.context.maxContentY=Math.max(u,(r=this.context.maxContentY)!==null&&r!==void 0?r:0),this.context.maxContentHeight=Math.max(d,(i=this.context.maxContentHeight)!==null&&i!==void 0?i:0)}),this.instance=t}getContext(){return this.context}resetContext(){var t=this.context;return setTimeout(this._updateScrollData,0),t}startMeasuringScrollPosition(){ys(Be,"scroll",this._updateScrollData,{capture:!0}),ys(Be,"scrollend",this._updateScrollData,{capture:!0}),ys(Be,"resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return Be?.document.documentElement;var t=cs(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var n of t){var s=Be?.document.querySelector(n);if(s)return s}}scrollY(){if(this.instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Be&&(Be.scrollY||Be.pageYOffset||Be.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Be&&(Be.scrollX||Be.pageXOffset||Be.document.documentElement.scrollLeft)||0}};var Xte=e=>Qn.personInfo({maskPersonalDataProperties:e?.config.mask_personal_data_properties,customPersonalDataProperties:e?.config.custom_personal_data_properties});let Qte=class{constructor(t,n,s,r){ht(this,"_onSessionIdCallback",i=>{var a=this._getStored();if(!a||a.sessionId!==i){var o={sessionId:i,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[pS]:o})}}),this.instance=t,this._sessionIdManager=n,this._persistence=s,this._sessionSourceParamGenerator=r||Xte,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[pS]}getSetOnceProps(){var t,n=(t=this._getStored())===null||t===void 0?void 0:t.props;return n?"r"in n?Qn.personPropsFromInfo(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return Mn(Pm(this.getSetOnceProps()),(n,s)=>{s==="$current_url"&&(s="url"),t["$session_entry_".concat(hT(s))]=n}),t}};var eP=Nr("[SessionId]");let Jte=class{constructor(t,n,s){var r;if(ht(this,"_sessionIdChangedHandlers",[]),!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=t.config,this.persistence=t.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||Ic,this._windowIdGenerator=s||Ic;var i=this.config.persistence_name||this.config.token,a=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*la(a,60,36e3,"session_idle_timeout_seconds",1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+i+"_window_id",this._primary_window_exists_storage_key="ph_"+i+"_primary_window_exists",this._canUseSessionStorage()){var o=fr.parse(this._window_id_storage_key),l=fr.parse(this._primary_window_exists_storage_key);o&&!l?this._windowId=o:fr.remove(this._window_id_storage_key),fr.set(this._primary_window_exists_storage_key,!0)}if((r=this.config.bootstrap)!==null&&r!==void 0&&r.sessionID)try{var u=(d=>{var h=d.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),u)}catch(d){eP.error("Invalid sessionID in bootstrap",d)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return wt(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(t),this._sessionId&&t(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(n=>n!==t)}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&fr.is_supported()}_setWindowId(t){t!==this._windowId&&(this._windowId=t,this._canUseSessionStorage()&&fr.set(this._window_id_storage_key,t))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?fr.parse(this._window_id_storage_key):null}_setSessionId(t,n,s){t===this._sessionId&&n===this._sessionActivityTimestamp&&s===this._sessionStartTimestamp||(this._sessionStartTimestamp=s,this._sessionActivityTimestamp=n,this._sessionId=t,this.persistence.register({[ox]:[n,t,s]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var t=this.persistence.props[ox];return cs(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){ys(Be,"beforeunload",()=>{this._canUseSessionStorage()&&fr.remove(this._primary_window_exists_storage_key)},{capture:!1})}checkAndGetSessionAndWindowId(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var s=n||new Date().getTime(),[r,i,a]=this._getSessionId(),o=this._getWindowId(),l=Xr(a)&&a>0&&Math.abs(s-a)>864e5,u=!1,d=!i,h=!t&&Math.abs(s-r)>this.sessionTimeoutMs;d||h||l?(i=this._sessionIdGenerator(),o=this._windowIdGenerator(),eP.info("new session ID generated",{sessionId:i,windowId:o,changeReason:{noSessionId:d,activityTimeout:h,sessionPastMaximumLength:l}}),a=s,u=!0):o||(o=this._windowIdGenerator(),u=!0);var f=r===0||!t||l?s:r,p=a===0?new Date().getTime():a;return this._setWindowId(o),this._setSessionId(i,f,p),t||this.resetIdleTimer(),u&&this._sessionIdChangedHandlers.forEach(m=>m(i,o,u?{noSessionId:d,activityTimeout:h,sessionPastMaximumLength:l}:void 0)),{sessionId:i,windowId:o,sessionStartTimestamp:p,changeReason:u?{noSessionId:d,activityTimeout:h,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}};var Zte=["$set_once","$set"],mc=Nr("[SiteApps]");let ene=class{constructor(t){this.instance=t,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(t,n){if(n){var s=this.globalsForEvent(n);this.bufferedInvocations.push(s),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var t,n;return(t=Vt._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(n=t[this.instance.config.token])===null||n===void 0?void 0:n.siteApps}init(){if(this.isEnabled){var t=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{t(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(t){var n,s,r,i,a,o,l;if(!t)throw new Error("Event payload is required");var u={},d=this.instance.get_property("$groups")||[],h=this.instance.get_property("$stored_group_properties")||{};for(var[f,p]of Object.entries(h))u[f]={id:d[f],type:f,properties:p};var{$set_once:m,$set:v}=t;return{event:We(We({},t6(t,Zte)),{},{properties:We(We(We({},t.properties),v?{$set:We(We({},(n=(s=t.properties)===null||s===void 0?void 0:s.$set)!==null&&n!==void 0?n:{}),v)}:{}),m?{$set_once:We(We({},(r=(i=t.properties)===null||i===void 0?void 0:i.$set_once)!==null&&r!==void 0?r:{}),m)}:{}),elements_chain:(a=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(t){var n=this.apps[t.id],s=()=>{var o;!n.errored&&this.bufferedInvocations.length&&(mc.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(t.id)),this.bufferedInvocations.forEach(l=>{var u;return(u=n.processEvent)===null||u===void 0?void 0:u.call(n,l)}),n.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((o=this.stopBuffering)===null||o===void 0||o.call(this))},r=!1,i=o=>{n.errored=!o,n.loaded=!0,mc.info("Site app with id ".concat(t.id," ").concat(o?"loaded":"errored")),r&&s()};try{var{processEvent:a}=t.init({posthog:this.instance,callback:o=>{i(o)}});a&&(n.processEvent=a),r=!0}catch(o){mc.error("Error while initializing PostHog app with config id ".concat(t.id),o),i(!1)}if(r&&n.loaded)try{s()}catch(o){mc.error("Error while processing buffered events PostHog app with config id ".concat(t.id),o),n.errored=!0}}setupSiteApps(){var t=this.siteAppLoaders||[];for(var n of t)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var s of t)this.setupSiteApp(s)}onCapturedEvent(t){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t);for(var s of Object.values(this.apps))try{var r;(r=s.processEvent)===null||r===void 0||r.call(s,n)}catch(i){mc.error("Error while processing event ".concat(t.event," for site app ").concat(s.id),i)}}}onRemoteConfig(t){var n,s,r,i=this;if((n=this.siteAppLoaders)!==null&&n!==void 0&&n.length)return this.isEnabled?(this.setupSiteApps(),void this.instance.on("eventCaptured",u=>this.onCapturedEvent(u))):void mc.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((s=this.stopBuffering)===null||s===void 0||s.call(this),(r=t.siteApps)!==null&&r!==void 0&&r.length)if(this.isEnabled){var a=function(u,d){var h,f;Vt["__$$ph_site_app_".concat(u)]=i.instance,(h=Vt.__PosthogExtensions__)===null||h===void 0||(f=h.loadSiteApp)===null||f===void 0||f.call(h,i.instance,d,p=>{if(p)return mc.error("Error while initializing PostHog app with config id ".concat(u),p)})};for(var{id:o,url:l}of t.siteApps)a(o,l)}else mc.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}};var qu,tne=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","bytespider"],tP=function(e,t){if(!e)return!1;var n=e.toLowerCase();return tne.concat(t||[]).some(s=>{var r=s.toLowerCase();return n.indexOf(r)!==-1})},sj=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&tP(n,t))return!0;try{var s=e?.userAgentData;if(s!=null&&s.brands&&s.brands.some(r=>tP(r?.brand,t)))return!0}catch{}return!!e.webdriver};function nP(e,t,n){return Sg({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}(function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"})(qu||(qu={}));var sP="i.posthog.com";let nne=class{constructor(t){ht(this,"_regionCache",{}),this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get uiHost(){var t,n=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace(".".concat(sP),".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=qu.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=qu.EU:this._regionCache[this.apiHost]=qu.CUSTOM),this._regionCache[this.apiHost]}endpointFor(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(n&&(n=n[0]==="/"?n:"/".concat(n)),t==="ui")return this.uiHost+n;if(this.region===qu.CUSTOM)return this.apiHost+n;var s=sP+n;switch(t){case"assets":return"https://".concat(this.region,"-assets.").concat(s);case"api":return"https://".concat(this.region,".").concat(s)}}};var sne={icontains:(e,t)=>!!Be&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Be&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!Be&&Mf(t.href,e),not_regex:(e,t)=>!!Be&&!Mf(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};let rne=class qr{constructor(t){var n=this;ht(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var s=arguments.length>0&&arguments[0]!==void 0&&arguments[0];n.getWebExperiments(r=>{qr.logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,r.forEach(i=>{if(i.feature_flag_key){var a;n._flagToExperiments&&(qr.logInfo("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n._flagToExperiments)===null||a===void 0||a.set(i.feature_flag_key,i));var o=n.instance.getFeatureFlag(i.feature_flag_key);Ls(o)&&i.variants[o]&&n.applyTransforms(i.name,o,i.variants[o].transforms)}else if(i.variants)for(var l in i.variants){var u=i.variants[l];qr.matchesTestVariant(u)&&n.applyTransforms(i.name,l,u.transforms)}})},s)}),this.instance=t,this.instance.onFeatureFlags(s=>{this.onFeatureFlags(s)})}onFeatureFlags(t){if(this._is_bot())qr.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(kn(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();qr.logInfo("applying feature flags",t),t.forEach(n=>{var s;if(this._flagToExperiments&&(s=this._flagToExperiments)!==null&&s!==void 0&&s.has(n)){var r,i=this.instance.getFeatureFlag(n),a=(r=this._flagToExperiments)===null||r===void 0?void 0:r.get(n);i&&a!=null&&a.variants[i]&&this.applyTransforms(a.name,i,a.variants[i].transforms)}})}}previewWebExperiment(){var t=qr.getWindowLocation();if(t!=null&&t.search){var n=dx(t?.search,"__experiment_id"),s=dx(t?.search,"__experiment_variant");n&&s&&(qr.logInfo("previewing web experiments ".concat(n," && ").concat(s)),this.getWebExperiments(r=>{this.showPreviewWebExperiment(parseInt(n),s,r)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,s){if(this.instance.config.disable_web_experiments&&!s)return t([]);var r=this.instance.get_property("$web_experiments");if(r&&!n)return t(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:i=>{if(i.statusCode!==200||!i.json)return t([]);var a=i.json.experiments||[];return t(a)}})}showPreviewWebExperiment(t,n,s){var r=s.filter(i=>i.id===t);r&&r.length>0&&(qr.logInfo("Previewing web experiment [".concat(r[0].name,"] with variant [").concat(n,"]")),this.applyTransforms(r[0].name,n,r[0].variants[n].transforms))}static matchesTestVariant(t){return!kn(t.conditions)&&qr.matchUrlConditions(t)&&qr.matchUTMConditions(t)}static matchUrlConditions(t){var n;if(kn(t.conditions)||kn((n=t.conditions)===null||n===void 0?void 0:n.url))return!0;var s,r,i,a=qr.getWindowLocation();return!!a&&((s=t.conditions)===null||s===void 0||!s.url||sne[(r=(i=t.conditions)===null||i===void 0?void 0:i.urlMatchType)!==null&&r!==void 0?r:"icontains"](t.conditions.url,a))}static getWindowLocation(){return Be?.location}static matchUTMConditions(t){var n;if(kn(t.conditions)||kn((n=t.conditions)===null||n===void 0?void 0:n.utm))return!0;var s=Qn.campaignParams();if(s.utm_source){var r,i,a,o,l,u,d,h,f,p,m,v,b,w,C,y,k=(r=t.conditions)===null||r===void 0||(i=r.utm)===null||i===void 0||!i.utm_campaign||((a=t.conditions)===null||a===void 0||(o=a.utm)===null||o===void 0?void 0:o.utm_campaign)==s.utm_campaign,_=(l=t.conditions)===null||l===void 0||(u=l.utm)===null||u===void 0||!u.utm_source||((d=t.conditions)===null||d===void 0||(h=d.utm)===null||h===void 0?void 0:h.utm_source)==s.utm_source,E=(f=t.conditions)===null||f===void 0||(p=f.utm)===null||p===void 0||!p.utm_medium||((m=t.conditions)===null||m===void 0||(v=m.utm)===null||v===void 0?void 0:v.utm_medium)==s.utm_medium,R=(b=t.conditions)===null||b===void 0||(w=b.utm)===null||w===void 0||!w.utm_term||((C=t.conditions)===null||C===void 0||(y=C.utm)===null||y===void 0?void 0:y.utm_term)==s.utm_term;return k&&E&&R&&_}return!1}static logInfo(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];Rt.info("[WebExperiments] ".concat(t),s)}applyTransforms(t,n,s){this._is_bot()?qr.logInfo("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?s.forEach(r=>{if(r.selector){var i;qr.logInfo("applying transform of variant ".concat(n," for experiment ").concat(t," "),r);var a=(i=document)===null||i===void 0?void 0:i.querySelectorAll(r.selector);a?.forEach(o=>{var l=o;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)})}}):qr.logInfo("Control variants leave the page unmodified.")}_is_bot(){return Oi&&this.instance?sj(Oi,this.instance.config.custom_blocked_useragents):void 0}};var Ug={},HS=()=>{},Nh="posthog",rj=!$te&&Ms?.indexOf("MSIE")===-1&&Ms?.indexOf("Mozilla")===-1,rP=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:aee(_t?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:HS,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:di&&Ls(di?.search)&&di.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(Be==null||(e=Be.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;Rt.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:jS},_onCapture:HS}},iP=e=>{var t={};wt(e.process_person)||(t.person_profiles=e.process_person),wt(e.xhr_headers)||(t.request_headers=e.xhr_headers),wt(e.cookie_name)||(t.persistence_name=e.cookie_name),wt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),wt(e.store_google)||(t.save_campaign_params=e.store_google),wt(e.verbose)||(t.debug=e.verbose);var n=ws({},t,e);return cs(e.property_blacklist)&&(wt(e.property_denylist)?n.property_denylist=e.property_blacklist:cs(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:Rt.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class ine{constructor(){ht(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(t){Rt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class cC{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){ht(this,"webPerformance",new ine),ht(this,"_personProcessingSetOncePropertiesSent",!1),ht(this,"version",bl.LIB_VERSION),ht(this,"_internalEventEmitter",new tj),this.config=rP(),this.SentryIntegration=dte,this.sentryIntegration=t=>function(n,s){var r=A6(n,s);return{name:R6,processEvent:i=>r(i)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new Pte(this),this.toolbar=new fte(this),this.scrollManager=new Yte(this),this.pageViewManager=new xte(this),this.surveys=new Ute(this),this.experiments=new rne(this),this.exceptions=new wte(this),this.rateLimiter=new Gte(this),this.requestRouter=new nne(this),this.consent=new Fee(this),this.people={set:(t,n,s)=>{var r=Ls(t)?{[t]:n}:t;this.setPersonProperties(r),s?.({})},set_once:(t,n,s)=>{var r=Ls(t)?{[t]:n}:t;this.setPersonProperties(void 0,r),s?.({})}},this.on("eventCaptured",t=>Rt.info('send "'.concat(t?.event,'"'),t))}init(t,n,s){if(s&&s!==Nh){var r,i=(r=Ug[s])!==null&&r!==void 0?r:new cC;return i._init(t,n,s),Ug[s]=i,Ug[Nh][s]=i,i}return this._init(t,n,s)}_init(t){var n,s,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(wt(t)||cS(t))return Rt.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return Rt.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],r.person_profiles&&(this._initialPersonProfilesConfig=r.person_profiles),this.set_config(ws({},rP(),iP(r),{name:i,token:t})),this.config.on_xhr_error&&Rt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:$a.GZipJS,this.persistence=new Ly(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ly(We(We({},this.config),{},{persistence:"sessionStorage"}));var a=We({},this.persistence.props),o=We({},this.sessionPersistence.props);if(this._requestQueue=new zte(w=>this._send_retriable_request(w),this.config.request_queue_config),this._retryQueue=new Kte(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Jte(this),this.sessionPropsManager=new Qte(this,this.sessionManager,this.persistence)),new gte(this).startIfEnabledOrStop(),this.siteApps=new ene(this),(n=this.siteApps)===null||n===void 0||n.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new cte(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new wee(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new bte(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new mte(this),this.exceptionObserver=new Iee(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new b6(this,Pee),this.deadClicksAutocapture.startIfEnabled(),bl.DEBUG=bl.DEBUG||this.config.debug,bl.DEBUG&&Rt.info("Starting in debug mode",{this:this,config:r,thisC:We({},this.config),p:a,s:o}),this._sync_opt_out_with_persistence(),((s=r.bootstrap)===null||s===void 0?void 0:s.distinctID)!==void 0){var l,u,d=this.config.get_device_id(Ic()),h=(l=r.bootstrap)!==null&&l!==void 0&&l.isIdentifiedID?d:r.bootstrap.distinctID;this.persistence.set_property(gl,(u=r.bootstrap)!==null&&u!==void 0&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var f,p,m=Object.keys(((f=r.bootstrap)===null||f===void 0?void 0:f.featureFlags)||{}).filter(w=>{var C,y;return!((C=r.bootstrap)===null||C===void 0||(y=C.featureFlags)===null||y===void 0||!y[w])}).reduce((w,C)=>{var y,k;return w[C]=((y=r.bootstrap)===null||y===void 0||(k=y.featureFlags)===null||k===void 0?void 0:k[C])||!1,w},{}),v=Object.keys(((p=r.bootstrap)===null||p===void 0?void 0:p.featureFlagPayloads)||{}).filter(w=>m[w]).reduce((w,C)=>{var y,k,_,E;return(y=r.bootstrap)!==null&&y!==void 0&&(k=y.featureFlagPayloads)!==null&&k!==void 0&&k[C]&&(w[C]=(_=r.bootstrap)===null||_===void 0||(E=_.featureFlagPayloads)===null||E===void 0?void 0:E[C]),w},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:v})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:uD,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(Ic());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(gl,"anonymous")}return ys(Be,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),r.segment?ute(this,()=>this._loaded()):this._loaded(),Xa(this.config._onCapture)&&this.config._onCapture!==HS&&(Rt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",w=>this.config._onCapture(w.event,w))),this}_onRemoteConfig(t){var n,s,r,i,a,o,l,u;if(!_t||!_t.body)return Rt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._onRemoteConfig(t)},500);this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Zt(t.supportedCompression,$a.GZipJS)?$a.GZipJS:Zt(t.supportedCompression,$a.Base64)?$a.Base64:void 0),(n=t.analytics)!==null&&n!==void 0&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),(s=this.siteApps)===null||s===void 0||s.onRemoteConfig(t),(r=this.sessionRecording)===null||r===void 0||r.onRemoteConfig(t),(i=this.autocapture)===null||i===void 0||i.onRemoteConfig(t),(a=this.heatmaps)===null||a===void 0||a.onRemoteConfig(t),this.surveys.onRemoteConfig(t),(o=this.webVitalsAutocapture)===null||o===void 0||o.onRemoteConfig(t),(l=this.exceptionObserver)===null||l===void 0||l.onRemoteConfig(t),(u=this.deadClicksAutocapture)===null||u===void 0||u.onRemoteConfig(t)}_loaded(){try{this.config.loaded(this)}catch(t){Rt.critical("`loaded` function failed",t)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new Vte(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var t;this.has_opted_out_capturing()||this.config.request_batching&&((t=this._requestQueue)===null||t===void 0||t.enable())}_dom_loaded(){this.has_opted_out_capturing()||Uc(this.__request_queue,t=>this._send_retriable_request(t)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var t,n;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(t=this._requestQueue)===null||t===void 0||t.unload(),(n=this._retryQueue)===null||n===void 0||n.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(rj?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=vx(t.url,{ip:this.config.ip?1:0}),t.headers=We({},this.config.request_headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var s,r,i,a=We({},n);a.timeout=a.timeout||6e4,a.url=vx(a.url,{_:new Date().getTime().toString(),ver:bl.LIB_VERSION,compression:a.compression});var o=(s=a.transport)!==null&&s!==void 0?s:"fetch",l=(r=(i=n6(Hg,u=>u.transport===o))===null||i===void 0?void 0:i.method)!==null&&r!==void 0?r:Hg[0].method;if(!l)throw new Error("No available transport method");l(a)})(We(We({},t),{},{callback:n=>{var s,r,i;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(i=this.config).on_request_error)===null||r===void 0||r.call(i,n)),(s=t.callback)===null||s===void 0||s.call(t,n)}}))))}_send_retriable_request(t){this._retryQueue?this._retryQueue.retriableRequest(t):this._send_request(t)}_execute_array(t){var n,s=[],r=[],i=[];Uc(t,o=>{o&&(n=o[0],cs(n)?i.push(o):Xa(o)?o.call(this):cs(o)&&n==="alias"?s.push(o):cs(o)&&n.indexOf("capture")!==-1&&Xa(this[n])?i.push(o):r.push(o))});var a=function(o,l){Uc(o,function(u){if(cs(u[0])){var d=l;Mn(u,function(h){d=d[h[0]].apply(d,h.slice(1))})}else this[u[0]].apply(this,u.slice(1))},l)};a(s,this),a(r,this),a(i,this)}_hasBootstrappedFeatureFlags(){var t,n;return((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)===null||n===void 0?void 0:n.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,n,s){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!wt(t)&&Ls(t)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var i=s!=null&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){n!=null&&n.$current_url&&!Ls(n?.$current_url)&&(Rt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,o=s?.timestamp||a,l=Ic(),u={uuid:l,event:t,properties:this._calculate_event_properties(t,n||{},o,l)};i&&(u.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),s?.$set&&(u.$set=s?.$set);var d=this._calculate_set_once_properties(s?.$set_once);d&&(u.$set_once=d),(u=ree(u,s!=null&&s._noTruncate?null:this.config.properties_string_max_length)).timestamp=o,wt(s?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a);var h=We(We({},u.properties.$set),u.$set);if(Gh(h)||this.setPersonPropertiesForFlags(h),!kn(this.config.before_send)){var f=this._runBeforeSend(u);if(!f)return;u=f}this._internalEventEmitter.emit("eventCaptured",u);var p={method:"POST",url:(r=s?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:s?._batchKey};return!this.config.request_batching||s&&(s==null||!s._batchKey)||s!=null&&s.send_instantly?this._send_retriable_request(p):this._requestQueue.enqueue(p),u}Rt.critical("This capture call is ignored due to client rate limiting.")}}else Rt.error("No event name provided to posthog.capture")}else Rt.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}_calculate_event_properties(t,n,s,r){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return n;var i=this.persistence.remove_event_timer(t),a=We({},n);if(a.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(a.$cookieless_mode=!0),t==="$snapshot"){var o=We(We({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=o.distinct_id,(!Ls(a.distinct_id)&&!Xr(a.distinct_id)||cS(a.distinct_id))&&Rt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,u=Qn.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId();a.$session_id=d,a.$window_id=h}this.sessionPropsManager&&ws(a,this.sessionPropsManager.getSessionProps());try{var f,p;this.sessionRecording&&ws(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(f=this._retryQueue)===null||f===void 0||(p=f.queue)===null||p===void 0?void 0:p.length}catch(w){a.$sdk_debug_error_capturing_properties=String(w)}if(this.requestRouter.region===qu.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l=t==="$pageview"?this.pageViewManager.doPageView(s,r):t==="$pageleave"?this.pageViewManager.doPageLeave(s):this.pageViewManager.doEvent(),a=ws(a,l),t==="$pageview"&&_t&&(a.title=_t.title),!wt(i)){var m=s.getTime()-i;a.$duration=parseFloat((m/1e3).toFixed(3))}Ms&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=ws({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),cs(this.config.property_denylist)?Mn(this.config.property_denylist,function(w){delete a[w]}):Rt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var v=this.config.sanitize_properties;v&&(Rt.error("sanitize_properties is deprecated. Use before_send instead"),a=v(a,t));var b=this._hasPersonProcessing();return a.$process_person_profile=b,b&&this._requirePersonProcessing("_calculate_event_properties"),a}_calculate_set_once_properties(t){var n;if(!this.persistence||!this._hasPersonProcessing()||this._personProcessingSetOncePropertiesSent)return t;var s=this.persistence.get_initial_props(),r=(n=this.sessionPropsManager)===null||n===void 0?void 0:n.getSetOnceProps(),i=ws({},s,r||{},t||{}),a=this.config.sanitize_properties;return a&&(Rt.error("sanitize_properties is deprecated. Use before_send instead"),i=a(i,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,Gh(i)?void 0:i}register(t,n){var s;(s=this.persistence)===null||s===void 0||s.register(t,n)}register_once(t,n,s){var r;(r=this.persistence)===null||r===void 0||r.register_once(t,n,s)}register_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.register(t)}unregister(t){var n;(n=this.persistence)===null||n===void 0||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(t)}_register_single(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n)}getEarlyAccessFeatures(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],s=arguments.length>2?arguments[2]:void 0;return this.featureFlags.getEarlyAccessFeatures(t,n,s)}on(t,n){return this._internalEventEmitter.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,s;return(n=(s=this.sessionManager)===null||s===void 0?void 0:s.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}identify(t,n,s){if(!this.__loaded||!this.persistence)return Rt.uninitializedWarning("posthog.identify");if(Xr(t)&&(t=t.toString(),Rt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t){if(["distinct_id","distinctid"].includes(t.toLowerCase()))Rt.critical('The string "'.concat(t,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}t!==r&&t!==this.get_property(bg)&&(this.unregister(bg),this.register({distinct_id:t}));var a=(this.persistence.get_property(gl)||"anonymous")==="anonymous";t!==r&&a?(this.persistence.set_property(gl,"identified"),this.setPersonPropertiesForFlags(We(We({},s||{}),n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:r},{$set:n||{},$set_once:s||{}}),this._cachedPersonProperties=nP(t,n,s),this.featureFlags.setAnonymousDistinctId(r)):(n||s)&&this.setPersonProperties(n,s),t!==r&&(this.reloadFeatureFlags(),this.unregister(lx))}}else Rt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this._requirePersonProcessing("posthog.setPersonProperties")){var s=nP(this.get_distinct_id(),t,n);this._cachedPersonProperties!==s?(this.setPersonPropertiesForFlags(We(We({},n||{}),t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=s):Rt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,s){if(t&&n){if(this._requirePersonProcessing("posthog.group")){var r=this.getGroups();r[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:We(We({},r),{},{[t]:n})}),s&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:s}),this.setGroupPropertiesForFlags({[t]:s})),r[t]===n||s||this.reloadFeatureFlags()}}else Rt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,s,r,i;if(Rt.info("reset"),!this.__loaded)return Rt.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)===null||n===void 0||n.clear(),(s=this.sessionPersistence)===null||s===void 0||s.clear(),this.surveys.reset(),(r=this.persistence)===null||r===void 0||r.set_property(gl,"anonymous"),(i=this.sessionManager)===null||i===void 0||i.resetSessionId(),this._cachedPersonProperties=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:uD,$device_id:null},"");else{var o=this.config.get_device_id(Ic());this.register_once({distinct_id:o,$device_id:t?o:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(t!=null&&t.withTimestamp&&s){var i,a=(i=t.timestampLookBack)!==null&&i!==void 0?i:10;if(!s)return r;var o=Math.max(Math.floor((new Date().getTime()-s)/1e3)-a,0);r+="?t=".concat(o)}return r}alias(t,n){return t===this.get_property(s6)?(Rt.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(wt(n)&&(n=this.get_distinct_id()),t!==n?(this._register_single(bg,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(Rt.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n,s,r,i,a=We({},this.config);us(t)&&(ws(this.config,iP(t)),(n=this.persistence)===null||n===void 0||n.update_config(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ly(We(We({},this.config),{},{persistence:"sessionStorage"})),Us.is_supported()&&Us.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(bl.DEBUG=!0,Rt.info("set_config",JSON.stringify({config:t,oldConfig:a,newConfig:We({},this.config)},null,2))),(s=this.sessionRecording)===null||s===void 0||s.startIfEnabledOrStop(),(r=this.autocapture)===null||r===void 0||r.startIfEnabled(),(i=this.heatmaps)===null||i===void 0||i.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(t){var n=t===!0,s={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(s).some(Boolean)){var r,i,a,o,l;(r=this.sessionManager)===null||r===void 0||r.checkAndGetSessionAndWindowId(),s.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),s.linked_flag&&((a=this.sessionRecording)===null||a===void 0||a.overrideLinkedFlag()),s.url_trigger&&((o=this.sessionRecording)===null||o===void 0||o.overrideTrigger("url")),s.event_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)===null||t===void 0||!t.started)}captureException(t,n){var s=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(We(We({},$ee((r=>r instanceof Error)(t)?{error:t,event:t.message}:{event:t},{syntheticException:s})),n))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Nh;return n!==Nh&&(n=Nh+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)===null||t===void 0?void 0:t.get_property(gl))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property(gl))==="identified"}_hasPersonProcessing(){var t,n,s,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Gh(this.getGroups())&&((t=this.persistence)===null||t===void 0||(n=t.props)===null||n===void 0||!n[bg])&&((s=this.persistence)===null||s===void 0||(r=s.props)===null||r===void 0||!r[cx]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(t){return this.config.person_profiles==="never"?(Rt.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(cx,!0),!0)}_sync_opt_out_with_persistence(){var t,n,s,r,i=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default,o=this.config.disable_persistence||i&&!!a;((t=this.persistence)===null||t===void 0?void 0:t.disabled)!==o&&((s=this.persistence)===null||s===void 0||s.set_disabled(o)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.disabled)!==o&&((r=this.sessionPersistence)===null||r===void 0||r.set_disabled(o))}opt_in_capturing(t){var n;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(wt(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((n=t?.captureEventName)!==null&&n!==void 0?n:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Oi?sj(Oi,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){_t&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:_t.title},{send_instantly:!0}))}debug(t){t===!1?(Be?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(Be?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(t){if(kn(this.config.before_send))return t;var n=cs(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var r of n){if(s=r(s),kn(s)){var i="Event '".concat(t.event,"' was rejected in beforeSend function");return tee(t.event)?Rt.warn("".concat(i,". This can cause unexpected behavior.")):Rt.info(i),null}s.properties&&!Gh(s.properties)||Rt.warn("Event '".concat(t.event,"' has no properties after beforeSend function, this is likely an error."))}return s}getPageViewId(){var t;return(t=this.pageViewManager._currentPageview)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,s){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(s)})}}(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=see(e.prototype[t[n]])})(cC,["identify"]);var aP,ju=(aP=Ug[Nh]=new cC,function(){function e(){e.done||(e.done=!0,rj=!1,Mn(Ug,function(t){t._dom_loaded()}))}_t!=null&&_t.addEventListener?_t.readyState==="complete"?e():ys(_t,"DOMContentLoaded",e,{capture:!1}):Be&&Rt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),aP),ST=g.createContext({client:ju});function ij(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(var i=0,a=s;i<a.length;i++){var o=a[i];if(!r.includes(o)||!ij(e[o],t[o],n))return!1}return!0}function ane(e){var t=e.children,n=e.client,s=e.apiKey,r=e.options,i=g.useRef(null),a=g.useMemo(function(){return n?(s&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),r&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n):(s||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),ju)},[n,s,JSON.stringify(r)]);return g.useEffect(function(){if(!n){var o=i.current;o?(s!==o.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),r&&!ij(r,o.options)&&ju.set_config(r),i.current={apiKey:s,options:r??{}}):(ju.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),ju.init(s,r),i.current={apiKey:s,options:r??{}})}},[n,s,JSON.stringify(r)]),$e.createElement(ST.Provider,{value:{client:a}},t)}var one=function(){var e=g.useContext(ST).client;return e};function Hy(e){var t=one(),n=g.useState(function(){return t.isFeatureEnabled(e)}),s=n[0],r=n[1];return g.useEffect(function(){return t.onFeatureFlags(function(){r(t.isFeatureEnabled(e))})},[t,e]),s}var US=function(e,t){return US=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(n[r]=s[r])},US(e,t)};function lne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");US(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Uy=function(e){return typeof e=="function"},cne={componentStack:null,error:null},une={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){lne(t,e);function t(n){var s=e.call(this,n)||this;return s.state=cne,s}return t.prototype.componentDidCatch=function(n,s){var r=s.componentStack,i=this.props.additionalProperties;this.setState({error:n,componentStack:r});var a;Uy(i)?a=i(n):typeof i=="object"&&(a=i);var o=this.context.client;o.captureException(n,a)},t.prototype.render=function(){var n=this.props,s=n.children,r=n.fallback,i=this.state;if(i.componentStack==null)return Uy(s)?s():s;var a=Uy(r)?$e.createElement(r,{error:i.error,componentStack:i.componentStack}):r;return $e.isValidElement(a)?a:(console.warn(une.INVALID_FALLBACK),$e.createElement($e.Fragment,null))},t.contextType=ST,t})($e.Component);/**
|
|
@@ -681,7 +681,7 @@ ${GV(r)}`)}const VV=YK;function mL(e){return e.artifact&&XK(e.path)?e.artifact:n
|
|
|
681
681
|
* LICENSE file in the root directory of this source tree.
|
|
682
682
|
*/var F3;function PKe(){if(F3)return gg;F3=1;var e=$e,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(o,l,u){var d,h={},f=null,p=null;u!==void 0&&(f=""+u),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)s.call(l,d)&&!i.hasOwnProperty(d)&&(h[d]=l[d]);if(o&&o.defaultProps)for(d in l=o.defaultProps,l)h[d]===void 0&&(h[d]=l[d]);return{$$typeof:t,type:o,key:f,ref:p,props:h,_owner:r.current}}return gg.Fragment=n,gg.jsx=a,gg.jsxs=a,gg}var D3;function IKe(){return D3||(D3=1,A3.exports=PKe()),A3.exports}var NKe=IKe();/*! shepherd.js 14.5.0 */function MKe(e){return e instanceof Element}function Jf(e){return e instanceof HTMLElement}function ru(e){return typeof e=="function"}function y0(e){return typeof e=="string"}function Fr(e){return e===void 0}class J2{on(t,n,s,r=!1){var i;return Fr(this.bindings)&&(this.bindings={}),Fr(this.bindings[t])&&(this.bindings[t]=[]),(i=this.bindings[t])==null||i.push({handler:n,ctx:s,once:r}),this}once(t,n,s){return this.on(t,n,s,!0)}off(t,n){if(Fr(this.bindings)||Fr(this.bindings[t]))return this;if(Fr(n))delete this.bindings[t];else{var s;(s=this.bindings[t])==null||s.forEach((r,i)=>{if(r.handler===n){var a;(a=this.bindings[t])==null||a.splice(i,1)}})}return this}trigger(t,...n){if(!Fr(this.bindings)&&this.bindings[t]){var s;(s=this.bindings[t])==null||s.forEach((r,i)=>{const{ctx:a,handler:o,once:l}=r,u=a||this;if(o.apply(u,n),l){var d;(d=this.bindings[t])==null||d.splice(i,1)}})}return this}}function wi(){return wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},wi.apply(null,arguments)}function Z2(e,t){if(e==null)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.includes(s))continue;n[s]=e[s]}return n}const gu={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};gu.defaultMerge;function OKe(e,t){return t}function LKe(e,t){return e.filter(n=>n!==void 0)}var P3;(function(e){e[e.NOT=0]="NOT",e[e.RECORD=1]="RECORD",e[e.ARRAY=2]="ARRAY",e[e.SET=3]="SET",e[e.MAP=4]="MAP",e[e.OTHER=5]="OTHER"})(P3||(P3={}));function I3(e){return typeof e!="object"||e===null?0:Array.isArray(e)?2:HKe(e)?1:e instanceof Set?3:e instanceof Map?4:5}function BKe(e){const t=new Set;for(const n of e)for(const s of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(s);return t}function jKe(e,t){return typeof e=="object"&&Object.prototype.propertyIsEnumerable.call(e,t)}function MW(e){return{*[Symbol.iterator](){for(const t of e)for(const n of t)yield n}}}const N3=new Set(["[object Object]","[object Module]"]);function HKe(e){if(!N3.has(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(t===void 0)return!0;const n=t.prototype;return!(n===null||typeof n!="object"||!N3.has(Object.prototype.toString.call(n))||!n.hasOwnProperty("isPrototypeOf"))}function UKe(e,t,n){const s={};for(const r of BKe(e)){const i=[];for(const l of e)jKe(l,r)&&i.push(l[r]);if(i.length===0)continue;const a=t.metaDataUpdater(n,{key:r,parents:e}),o=OW(i,t,a);o!==gu.skip&&(r==="__proto__"?Object.defineProperty(s,r,{value:o,configurable:!0,enumerable:!0,writable:!0}):s[r]=o)}return s}function GKe(e){return e.flat()}function VKe(e){return new Set(MW(e))}function WKe(e){return new Map(MW(e))}function $Ke(e){return e.at(-1)}const wb={mergeRecords:UKe,mergeArrays:GKe,mergeSets:VKe,mergeMaps:WKe,mergeOthers:$Ke};function eA(...e){return zKe({})(...e)}function zKe(e,t){const n=qKe(e,s);function s(...r){return OW(r,n,t)}return s}function qKe(e,t){var n,s,r;return{defaultMergeFunctions:wb,mergeFunctions:wi({},wb,Object.fromEntries(Object.entries(e).filter(([i,a])=>Object.hasOwn(wb,i)).map(([i,a])=>a===!1?[i,wb.mergeOthers]:[i,a]))),metaDataUpdater:(n=e.metaDataUpdater)!=null?n:OKe,deepmerge:t,useImplicitDefaultMerging:(s=e.enableImplicitDefaultMerging)!=null?s:!1,filterValues:e.filterValues===!1?void 0:(r=e.filterValues)!=null?r:LKe,actions:gu}}function OW(e,t,n){var s;const r=(s=t.filterValues==null?void 0:t.filterValues(e,n))!=null?s:e;if(r.length===0)return;if(r.length===1)return L1(r,t,n);const i=I3(r[0]);if(i!==0&&i!==5){for(let a=1;a<r.length;a++)if(I3(r[a])!==i)return L1(r,t,n)}switch(i){case 1:return KKe(r,t,n);case 2:return YKe(r,t,n);case 3:return XKe(r,t,n);case 4:return QKe(r,t,n);default:return L1(r,t,n)}}function KKe(e,t,n){const s=t.mergeFunctions.mergeRecords(e,t,n);return s===gu.defaultMerge||t.useImplicitDefaultMerging&&s===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):s}function YKe(e,t,n){const s=t.mergeFunctions.mergeArrays(e,t,n);return s===gu.defaultMerge||t.useImplicitDefaultMerging&&s===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):s}function XKe(e,t,n){const s=t.mergeFunctions.mergeSets(e,t,n);return s===gu.defaultMerge||t.useImplicitDefaultMerging&&s===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):s}function QKe(e,t,n){const s=t.mergeFunctions.mergeMaps(e,t,n);return s===gu.defaultMerge||t.useImplicitDefaultMerging&&s===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):s}function L1(e,t,n){const s=t.mergeFunctions.mergeOthers(e,t,n);return s===gu.defaultMerge||t.useImplicitDefaultMerging&&s===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):s}function tA(e){const t=Object.getOwnPropertyNames(e.constructor.prototype);for(let n=0;n<t.length;n++){const s=t[n],r=e[s];s!=="constructor"&&typeof r=="function"&&(e[s]=r.bind(e))}return e}function JKe(e,t){return n=>{if(e.isOpen()){const s=e.el&&n.currentTarget===e.el;(!Fr(t)&&n.currentTarget.matches(t)||s)&&e.tour.next()}}}function ZKe(e){const{event:t,selector:n}=e.options.advanceOn||{};if(t){const s=JKe(e,n);let r=null;if(!Fr(n)&&(r=document.querySelector(n),!r))return console.error(`No element was found for the selector supplied to advanceOn: ${n}`);r?(r.addEventListener(t,s),e.on("destroy",()=>r.removeEventListener(t,s))):(document.body.addEventListener(t,s,!0),e.on("destroy",()=>document.body.removeEventListener(t,s,!0)))}else return console.error("advanceOn was defined, but no event name was passed.")}class eYe{constructor(t){}}class tYe{constructor(t,n){}}function LW(e){return!y0(e)||e===""?"":e.charAt(e.length-1)!=="-"?`${e}-`:e}function nYe(e){const t=e.options.attachTo||{},n=Object.assign({},t);if(ru(n.element)&&(n.element=n.element.call(e)),y0(n.element)){try{n.element=document.querySelector(n.element)}catch{}n.element||console.error(`The element for this Shepherd step was not found ${t.element}`)}return n}function sYe(e){return e.options.extraHighlights?e.options.extraHighlights.flatMap(t=>Array.from(document.querySelectorAll(t))):[]}function BW(e){return e==null?!0:!e.element||!e.on}function jW(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t=="x"?n:n&3|8).toString(16)})}const rYe=["top","right","bottom","left"],M3=["start","end"],O3=rYe.reduce((e,t)=>e.concat(t,t+"-"+M3[0],t+"-"+M3[1]),[]),Zf=Math.min,pd=Math.max,Aw=Math.round,Cb=Math.floor,Lo=e=>({x:e,y:e}),iYe={left:"right",right:"left",bottom:"top",top:"bottom"},aYe={start:"end",end:"start"};function Ak(e,t,n){return pd(e,Zf(t,n))}function Bd(e,t){return typeof e=="function"?e(t):e}function $l(e){return e.split("-")[0]}function Ol(e){return e.split("-")[1]}function nA(e){return e==="x"?"y":"x"}function sA(e){return e==="y"?"height":"width"}function ep(e){return["top","bottom"].includes($l(e))?"y":"x"}function rA(e){return nA(ep(e))}function HW(e,t,n){n===void 0&&(n=!1);const s=Ol(e),r=rA(e),i=sA(r);let a=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Dw(a)),[a,Dw(a)]}function oYe(e){const t=Dw(e);return[Fw(e),t,Fw(t)]}function Fw(e){return e.replace(/start|end/g,t=>aYe[t])}function lYe(e,t,n){const s=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:s:t?s:r;case"left":case"right":return t?i:a;default:return[]}}function cYe(e,t,n,s){const r=Ol(e);let i=lYe($l(e),n==="start",s);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(Fw)))),i}function Dw(e){return e.replace(/left|right|bottom|top/g,t=>iYe[t])}function uYe(e){return wi({top:0,right:0,bottom:0,left:0},e)}function UW(e){return typeof e!="number"?uYe(e):{top:e,right:e,bottom:e,left:e}}function Pw(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}const dYe=["crossAxis","alignment","allowedPlacements","autoAlignment"],hYe=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],fYe=["mainAxis","crossAxis","limiter"];function L3(e,t,n){let{reference:s,floating:r}=e;const i=ep(t),a=rA(t),o=sA(a),l=$l(t),u=i==="y",d=s.x+s.width/2-r.width/2,h=s.y+s.height/2-r.height/2,f=s[o]/2-r[o]/2;let p;switch(l){case"top":p={x:d,y:s.y-r.height};break;case"bottom":p={x:d,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-r.width,y:h};break;default:p={x:s.x,y:s.y}}switch(Ol(t)){case"start":p[a]-=f*(n&&u?-1:1);break;case"end":p[a]+=f*(n&&u?-1:1);break}return p}const pYe=async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,o=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:h}=L3(u,s,l),f=s,p={},m=0;for(let v=0;v<o.length;v++){const{name:b,fn:w}=o[v],{x:C,y,data:k,reset:_}=await w({x:d,y:h,initialPlacement:s,placement:f,strategy:r,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});d=C??d,h=y??h,p=wi({},p,{[b]:wi({},p[b],k)}),_&&m<=50&&(m++,typeof _=="object"&&(_.placement&&(f=_.placement),_.rects&&(u=_.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):_.rects),{x:d,y:h}=L3(u,f,l)),v=-1)}return{x:d,y:h,placement:f,strategy:r,middlewareData:p}};async function iA(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:i,rects:a,elements:o,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:p=0}=Bd(t,e),m=UW(p),v=o[f?h==="floating"?"reference":"floating":h],b=Pw(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:l})),w=h==="floating"?{x:s,y:r,width:a.floating.width,height:a.floating.height}:a.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},k=Pw(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:w,offsetParent:C,strategy:l}):w);return{top:(b.top-k.top+m.top)/y.y,bottom:(k.bottom-b.bottom+m.bottom)/y.y,left:(b.left-k.left+m.left)/y.x,right:(k.right-b.right+m.right)/y.x}}const gYe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:r,rects:i,platform:a,elements:o,middlewareData:l}=t,{element:u,padding:d=0}=Bd(e,t)||{};if(u==null)return{};const h=UW(d),f={x:n,y:s},p=rA(r),m=sA(p),v=await a.getDimensions(u),b=p==="y",w=b?"top":"left",C=b?"bottom":"right",y=b?"clientHeight":"clientWidth",k=i.reference[m]+i.reference[p]-f[p]-i.floating[m],_=f[p]-i.reference[p],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let R=E?E[y]:0;(!R||!await(a.isElement==null?void 0:a.isElement(E)))&&(R=o.floating[y]||i.floating[m]);const F=k/2-_/2,A=R/2-v[m]/2-1,N=Zf(h[w],A),M=Zf(h[C],A),D=N,L=R-v[m]-M,V=R/2-v[m]/2+F,j=Ak(D,V,L),te=!l.arrow&&Ol(r)!=null&&V!==j&&i.reference[m]/2-(V<D?N:M)-v[m]/2<0,X=te?V<D?V-D:V-L:0;return{[p]:f[p]+X,data:wi({[p]:j,centerOffset:V-j-X},te&&{alignmentOffset:X}),reset:te}}});function mYe(e,t,n){return(e?[...n.filter(s=>Ol(s)===e),...n.filter(s=>Ol(s)!==e)]:n.filter(s=>$l(s)===s)).filter(s=>e?Ol(s)===e||(t?Fw(s)!==s:!1):!0)}const vYe=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,s,r;const{rects:i,middlewareData:a,placement:o,platform:l,elements:u}=t,d=Bd(e,t),{crossAxis:h=!1,alignment:f,allowedPlacements:p=O3,autoAlignment:m=!0}=d,v=Z2(d,dYe),b=f!==void 0||p===O3?mYe(f||null,m,p):p,w=await iA(t,v),C=((n=a.autoPlacement)==null?void 0:n.index)||0,y=b[C];if(y==null)return{};const k=HW(y,i,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(o!==y)return{reset:{placement:b[0]}};const _=[w[$l(y)],w[k[0]],w[k[1]]],E=[...((s=a.autoPlacement)==null?void 0:s.overflows)||[],{placement:y,overflows:_}],R=b[C+1];if(R)return{data:{index:C+1,overflows:E},reset:{placement:R}};const F=E.map(N=>{const M=Ol(N.placement);return[N.placement,M&&h?N.overflows.slice(0,2).reduce((D,L)=>D+L,0):N.overflows[0],N.overflows]}).sort((N,M)=>N[1]-M[1]),A=((r=F.filter(N=>N[2].slice(0,Ol(N[0])?2:3).every(M=>M<=0))[0])==null?void 0:r[0])||F[0][0];return A!==o?{data:{index:C+1,overflows:E},reset:{placement:A}}:{}}}},bYe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:u}=t,d=Bd(e,t),{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0}=d,w=Z2(d,hYe);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const C=$l(r),y=ep(o),k=$l(o)===o,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(k||!b?[Dw(o)]:oYe(o)),R=v!=="none";!p&&R&&E.push(...cYe(o,b,v,_));const F=[o,...E],A=await iA(t,w),N=[];let M=((s=i.flip)==null?void 0:s.overflows)||[];if(h&&N.push(A[C]),f){const j=HW(r,a,_);N.push(A[j[0]],A[j[1]])}if(M=[...M,{placement:r,overflows:N}],!N.every(j=>j<=0)){var D,L;const j=(((D=i.flip)==null?void 0:D.index)||0)+1,te=F[j];if(te)return{data:{index:j,overflows:M},reset:{placement:te}};let X=(L=M.filter(re=>re.overflows[0]<=0).sort((re,G)=>re.overflows[1]-G.overflows[1])[0])==null?void 0:L.placement;if(!X)switch(m){case"bestFit":{var V;const re=(V=M.filter(G=>{if(R){const J=ep(G.placement);return J===y||J==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(J=>J>0).reduce((J,ae)=>J+ae,0)]).sort((G,J)=>G[1]-J[1])[0])==null?void 0:V[0];re&&(X=re);break}case"initialPlacement":X=o;break}if(r!==X)return{reset:{placement:X}}}return{}}}},xYe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r}=t,i=Bd(e,t),{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:w=>{let{x:C,y}=w;return{x:C,y}}}}=i,u=Z2(i,fYe),d={x:n,y:s},h=await iA(t,u),f=ep($l(r)),p=nA(f);let m=d[p],v=d[f];if(a){const w=p==="y"?"top":"left",C=p==="y"?"bottom":"right",y=m+h[w],k=m-h[C];m=Ak(y,m,k)}if(o){const w=f==="y"?"top":"left",C=f==="y"?"bottom":"right",y=v+h[w],k=v-h[C];v=Ak(y,v,k)}const b=l.fn(wi({},t,{[p]:m,[f]:v}));return wi({},b,{data:{x:b.x-n,y:b.y-s}})}}},wYe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:r,rects:i,middlewareData:a}=t,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=Bd(e,t),d={x:n,y:s},h=ep(r),f=nA(h);let p=d[f],m=d[h];const v=Bd(o,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:wi({mainAxis:0,crossAxis:0},v);if(l){const y=f==="y"?"height":"width",k=i.reference[f]-i.floating[y]+b.mainAxis,_=i.reference[f]+i.reference[y]-b.mainAxis;p<k?p=k:p>_&&(p=_)}if(u){var w,C;const y=f==="y"?"width":"height",k=["top","left"].includes($l(r)),_=i.reference[h]-i.floating[y]+(k&&((w=a.offset)==null?void 0:w[h])||0)+(k?0:b.crossAxis),E=i.reference[h]+i.reference[y]+(k?0:((C=a.offset)==null?void 0:C[h])||0)-(k?b.crossAxis:0);m<_?m=_:m>E&&(m=E)}return{[f]:p,[h]:m}}}};function YC(){return typeof window<"u"}function kp(e){return GW(e)?(e.nodeName||"").toLowerCase():"#document"}function ji(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xo(e){var t;return(t=(GW(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function GW(e){return YC()?e instanceof Node||e instanceof ji(e).Node:!1}function to(e){return YC()?e instanceof Element||e instanceof ji(e).Element:!1}function Wo(e){return YC()?e instanceof HTMLElement||e instanceof ji(e).HTMLElement:!1}function B3(e){return!YC()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ji(e).ShadowRoot}function iv(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=no(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!["inline","contents"].includes(r)}function CYe(e){return["table","td","th"].includes(kp(e))}function XC(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function aA(e){const t=oA(),n=to(e)?no(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(n.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(n.contain||"").includes(s))}function yYe(e){let t=iu(e);for(;Wo(t)&&!tp(t);){if(aA(t))return t;if(XC(t))return null;t=iu(t)}return null}function oA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function tp(e){return["html","body","#document"].includes(kp(e))}function no(e){return ji(e).getComputedStyle(e)}function QC(e){return to(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function iu(e){if(kp(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B3(e)&&e.host||Xo(e);return B3(t)?t.host:t}function VW(e){const t=iu(e);return tp(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wo(t)&&iv(t)?t:VW(t)}function _0(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=VW(e),i=r===((s=e.ownerDocument)==null?void 0:s.body),a=ji(r);if(i){const o=Fk(a);return t.concat(a,a.visualViewport||[],iv(r)?r:[],o&&n?_0(o):[])}return t.concat(r,_0(r,[],n))}function Fk(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function WW(e){const t=no(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=Wo(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:s,o=Aw(n)!==i||Aw(s)!==a;return o&&(n=i,s=a),{width:n,height:s,$:o}}function lA(e){return to(e)?e:e.contextElement}function Ef(e){const t=lA(e);if(!Wo(t))return Lo(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:i}=WW(t);let a=(i?Aw(n.width):n.width)/s,o=(i?Aw(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const _Ye=Lo(0);function $W(e){const t=ji(e);return!oA()||!t.visualViewport?_Ye:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SYe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ji(e)?!1:t}function jd(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=lA(e);let a=Lo(1);t&&(s?to(s)&&(a=Ef(s)):a=Ef(e));const o=SYe(i,n,s)?$W(i):Lo(0);let l=(r.left+o.x)/a.x,u=(r.top+o.y)/a.y,d=r.width/a.x,h=r.height/a.y;if(i){const f=ji(i),p=s&&to(s)?ji(s):s;let m=f,v=Fk(m);for(;v&&s&&p!==m;){const b=Ef(v),w=v.getBoundingClientRect(),C=no(v),y=w.left+(v.clientLeft+parseFloat(C.paddingLeft))*b.x,k=w.top+(v.clientTop+parseFloat(C.paddingTop))*b.y;l*=b.x,u*=b.y,d*=b.x,h*=b.y,l+=y,u+=k,m=ji(v),v=Fk(m)}}return Pw({width:d,height:h,x:l,y:u})}function cA(e,t){const n=QC(e).scrollLeft;return t?t.left+n:jd(Xo(e)).left+n}function zW(e,t,n){n===void 0&&(n=!1);const s=e.getBoundingClientRect(),r=s.left+t.scrollLeft-(n?0:cA(e,s)),i=s.top+t.scrollTop;return{x:r,y:i}}function EYe(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const i=r==="fixed",a=Xo(s),o=t?XC(t.floating):!1;if(s===a||o&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Lo(1);const d=Lo(0),h=Wo(s);if((h||!h&&!i)&&((kp(s)!=="body"||iv(a))&&(l=QC(s)),Wo(s))){const p=jd(s);u=Ef(s),d.x=p.x+s.clientLeft,d.y=p.y+s.clientTop}const f=a&&!h&&!i?zW(a,l,!0):Lo(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+f.x,y:n.y*u.y-l.scrollTop*u.y+d.y+f.y}}function kYe(e){return Array.from(e.getClientRects())}function TYe(e){const t=Xo(e),n=QC(e),s=e.ownerDocument.body,r=pd(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=pd(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let a=-n.scrollLeft+cA(e);const o=-n.scrollTop;return no(s).direction==="rtl"&&(a+=pd(t.clientWidth,s.clientWidth)-r),{width:r,height:i,x:a,y:o}}function RYe(e,t){const n=ji(e),s=Xo(e),r=n.visualViewport;let i=s.clientWidth,a=s.clientHeight,o=0,l=0;if(r){i=r.width,a=r.height;const u=oA();(!u||u&&t==="fixed")&&(o=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:o,y:l}}function AYe(e,t){const n=jd(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,i=Wo(e)?Ef(e):Lo(1),a=e.clientWidth*i.x,o=e.clientHeight*i.y,l=r*i.x,u=s*i.y;return{width:a,height:o,x:l,y:u}}function j3(e,t,n){let s;if(t==="viewport")s=RYe(e,n);else if(t==="document")s=TYe(Xo(e));else if(to(t))s=AYe(t,n);else{const r=$W(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Pw(s)}function qW(e,t){const n=iu(e);return n===t||!to(n)||tp(n)?!1:no(n).position==="fixed"||qW(n,t)}function FYe(e,t){const n=t.get(e);if(n)return n;let s=_0(e,[],!1).filter(o=>to(o)&&kp(o)!=="body"),r=null;const i=no(e).position==="fixed";let a=i?iu(e):e;for(;to(a)&&!tp(a);){const o=no(a),l=aA(a);!l&&o.position==="fixed"&&(r=null),(i?!l&&!r:!l&&o.position==="static"&&r&&["absolute","fixed"].includes(r.position)||iv(a)&&!l&&qW(e,a))?s=s.filter(u=>u!==a):r=o,a=iu(a)}return t.set(e,s),s}function DYe(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const i=[...n==="clippingAncestors"?XC(t)?[]:FYe(t,this._c):[].concat(n),s],a=i[0],o=i.reduce((l,u)=>{const d=j3(t,u,r);return l.top=pd(d.top,l.top),l.right=Zf(d.right,l.right),l.bottom=Zf(d.bottom,l.bottom),l.left=pd(d.left,l.left),l},j3(t,a,r));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}}function PYe(e){const{width:t,height:n}=WW(e);return{width:t,height:n}}function IYe(e,t,n){const s=Wo(t),r=Xo(t),i=n==="fixed",a=jd(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const l=Lo(0);if(s||!s&&!i)if((kp(t)!=="body"||iv(r))&&(o=QC(t)),s){const f=jd(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else r&&(l.x=cA(r));const u=r&&!s&&!i?zW(r,o):Lo(0),d=a.left+o.scrollLeft-l.x-u.x,h=a.top+o.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function B1(e){return no(e).position==="static"}function H3(e,t){if(!Wo(e)||no(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xo(e)===n&&(n=n.ownerDocument.body),n}function KW(e,t){const n=ji(e);if(XC(e))return n;if(!Wo(e)){let r=iu(e);for(;r&&!tp(r);){if(to(r)&&!B1(r))return r;r=iu(r)}return n}let s=H3(e,t);for(;s&&CYe(s)&&B1(s);)s=H3(s,t);return s&&tp(s)&&B1(s)&&!aA(s)?n:s||yYe(e)||n}const NYe=async function(e){const t=this.getOffsetParent||KW,n=this.getDimensions,s=await n(e.floating);return{reference:IYe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function MYe(e){return no(e).direction==="rtl"}const OYe={convertOffsetParentRelativeRectToViewportRelativeRect:EYe,getDocumentElement:Xo,getClippingRect:DYe,getOffsetParent:KW,getElementRects:NYe,getClientRects:kYe,getDimensions:PYe,getScale:Ef,isElement:to,isRTL:MYe};function LYe(e,t){let n=null,s;const r=Xo(e);function i(){var o;clearTimeout(s),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:h,height:f}=e.getBoundingClientRect();if(o||t(),!h||!f)return;const p=Cb(d),m=Cb(r.clientWidth-(u+h)),v=Cb(r.clientHeight-(d+f)),b=Cb(u),w={rootMargin:-p+"px "+-m+"px "+-v+"px "+-b+"px",threshold:pd(0,Zf(1,l))||1};let C=!0;function y(k){const _=k[0].intersectionRatio;if(_!==l){if(!C)return a();_?a(!1,_):s=setTimeout(()=>{a(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(y,wi({},w,{root:r.ownerDocument}))}catch{n=new IntersectionObserver(y,w)}n.observe(e)}return a(!0),i}function BYe(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,u=lA(e),d=r||i?[...u?_0(u):[],..._0(t)]:[];d.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const h=u&&o?LYe(u,n):null;let f=-1,p=null;a&&(p=new ResizeObserver(w=>{let[C]=w;C&&C.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let m,v=l?jd(e):null;l&&b();function b(){const w=jd(e);v&&(w.x!==v.x||w.y!==v.y||w.width!==v.width||w.height!==v.height)&&n(),v=w,m=requestAnimationFrame(b)}return n(),()=>{var w;d.forEach(C=>{r&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),h?.(),(w=p)==null||w.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const jYe=vYe,HYe=xYe,UYe=bYe,GYe=gYe,VYe=wYe,WYe=(e,t,n)=>{const s=new Map,r=wi({platform:OYe},n),i=wi({},r.platform,{_c:s});return pYe(e,t,wi({},r,{platform:i}))};function $Ye(e){e.cleanup&&e.cleanup();const t=e._getResolvedAttachToOptions();let n=t.element;const s=QYe(t,e),r=BW(t);return r&&(n=document.body,e.shepherdElementComponent.getElement().classList.add("shepherd-centered")),e.cleanup=BYe(n,e.el,()=>{if(!e.el){e.cleanup==null||e.cleanup();return}KYe(n,e,s,r)}),e.target=t.element,s}function zYe(e,t){return{floatingUIOptions:eA(e.floatingUIOptions||{},t.floatingUIOptions||{})}}function qYe(e){e.cleanup&&e.cleanup(),e.cleanup=null}function KYe(e,t,n,s){return WYe(e,t.el,n).then(YYe(t,s)).then(r=>new Promise(i=>{setTimeout(()=>i(r),300)})).then(r=>{r!=null&&r.el&&r.el.focus({preventScroll:!0})})}function YYe(e,t){return({x:n,y:s,placement:r,middlewareData:i})=>(e.el&&(t?Object.assign(e.el.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}):Object.assign(e.el.style,{position:"absolute",left:`${n}px`,top:`${s}px`}),e.el.dataset.popperPlacement=r,XYe(e.el,i)),e)}function XYe(e,t){const n=e.querySelector(".shepherd-arrow");if(Jf(n)&&t.arrow){const{x:s,y:r}=t.arrow;Object.assign(n.style,{left:s!=null?`${s}px`:"",top:r!=null?`${r}px`:""})}}function QYe(e,t){var n,s,r;const i={strategy:"absolute"};i.middleware=[];const a=JYe(t),o=BW(e),l=(n=e.on)==null?void 0:n.includes("auto"),u=(e==null||(s=e.on)==null?void 0:s.includes("-start"))||(e==null||(r=e.on)==null?void 0:r.includes("-end"));if(!o){if(l){var d;i.middleware.push(jYe({crossAxis:!0,alignment:u?e==null||(d=e.on)==null?void 0:d.split("-").pop():null}))}else i.middleware.push(UYe());if(i.middleware.push(HYe({limiter:VYe(),crossAxis:!0})),a){const h=typeof t.options.arrow=="object"?t.options.arrow:{padding:4};i.middleware.push(GYe({element:a,padding:u?h.padding:0}))}l||(i.placement=e.on)}return eA(i,t.options.floatingUIOptions||{})}function JYe(e){return e.options.arrow&&e.el?e.el.querySelector(".shepherd-arrow"):!1}function Gi(){}function ZYe(e,t){for(const n in t)e[n]=t[n];return e}function YW(e){return e()}function U3(){return Object.create(null)}function av(e){e.forEach(YW)}function uA(e){return typeof e=="function"}function nc(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function eXe(e){return Object.keys(e).length===0}function np(e,t){e.appendChild(t)}function lo(e,t,n){e.insertBefore(t,n||null)}function Ea(e){e.parentNode&&e.parentNode.removeChild(e)}function tXe(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function $o(e){return document.createElement(e)}function G3(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function XW(e){return document.createTextNode(e)}function Iw(){return XW(" ")}function nXe(){return XW("")}function JC(e,t,n,s){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n,s)}function On(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const sXe=["width","height"];function V3(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const s in t)t[s]==null?e.removeAttribute(s):s==="style"?e.style.cssText=t[s]:s==="__value"?e.value=e[s]=t[s]:n[s]&&n[s].set&&sXe.indexOf(s)===-1?e[s]=t[s]:On(e,s,t[s])}function rXe(e){return Array.from(e.childNodes)}function Th(e,t,n){e.classList.toggle(t,!!n)}let S0;function xm(e){S0=e}function QW(){if(!S0)throw new Error("Function called outside component initialization");return S0}function iXe(e){QW().$$.on_mount.push(e)}function dA(e){QW().$$.after_update.push(e)}const jh=[],sp=[];let kf=[];const W3=[],aXe=Promise.resolve();let Dk=!1;function oXe(){Dk||(Dk=!0,aXe.then(JW))}function Pk(e){kf.push(e)}const j1=new Set;let Rh=0;function JW(){if(Rh!==0)return;const e=S0;do{try{for(;Rh<jh.length;){const t=jh[Rh];Rh++,xm(t),lXe(t.$$)}}catch(t){throw jh.length=0,Rh=0,t}for(xm(null),jh.length=0,Rh=0;sp.length;)sp.pop()();for(let t=0;t<kf.length;t+=1){const n=kf[t];j1.has(n)||(j1.add(n),n())}kf.length=0}while(jh.length);for(;W3.length;)W3.pop()();Dk=!1,j1.clear(),xm(e)}function lXe(e){if(e.fragment!==null){e.update(),av(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Pk)}}function cXe(e){const t=[],n=[];kf.forEach(s=>e.indexOf(s)===-1?t.push(s):n.push(s)),n.forEach(s=>s()),kf=t}const Jb=new Set;let Qu;function gd(){Qu={r:0,c:[],p:Qu}}function md(){Qu.r||av(Qu.c),Qu=Qu.p}function En(e,t){e&&e.i&&(Jb.delete(e),e.i(t))}function Cs(e,t,n,s){if(e&&e.o){if(Jb.has(e))return;Jb.add(e),Qu.c.push(()=>{Jb.delete(e),s&&(n&&e.d(1),s())}),e.o(t)}else s&&s()}function $3(e){return e?.length!==void 0?e:Array.from(e)}function uXe(e,t){const n={},s={},r={$$scope:1};let i=e.length;for(;i--;){const a=e[i],o=t[i];if(o){for(const l in a)l in o||(s[l]=1);for(const l in o)r[l]||(n[l]=o[l],r[l]=1);e[i]=o}else for(const l in a)r[l]=1}for(const a in s)a in n||(n[a]=void 0);return n}function eh(e){e&&e.c()}function mu(e,t,n){const{fragment:s,after_update:r}=e.$$;s&&s.m(t,n),Pk(()=>{const i=e.$$.on_mount.map(YW).filter(uA);e.$$.on_destroy?e.$$.on_destroy.push(...i):av(i),e.$$.on_mount=[]}),r.forEach(Pk)}function vu(e,t){const n=e.$$;n.fragment!==null&&(cXe(n.after_update),av(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function dXe(e,t){e.$$.dirty[0]===-1&&(jh.push(e),oXe(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function sc(e,t,n,s,r,i,a=null,o=[-1]){const l=S0;xm(e);const u=e.$$={fragment:null,ctx:[],props:i,update:Gi,not_equal:r,bound:U3(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:U3(),dirty:o,skip_bound:!1,root:t.target||l.$$.root};a&&a(u.root);let d=!1;if(u.ctx=n?n(e,t.props||{},(h,f,...p)=>{const m=p.length?p[0]:f;return u.ctx&&r(u.ctx[h],u.ctx[h]=m)&&(!u.skip_bound&&u.bound[h]&&u.bound[h](m),d&&dXe(e,h)),f}):[],u.update(),d=!0,av(u.before_update),u.fragment=s?s(u.ctx):!1,t.target){if(t.hydrate){const h=rXe(t.target);u.fragment&&u.fragment.l(h),h.forEach(Ea)}else u.fragment&&u.fragment.c();t.intro&&En(e.$$.fragment),mu(e,t.target,t.anchor),JW()}xm(l)}class rc{constructor(){this.$$=void 0,this.$$set=void 0}$destroy(){vu(this,1),this.$destroy=Gi}$on(t,n){if(!uA(n))return Gi;const s=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return s.push(n),()=>{const r=s.indexOf(n);r!==-1&&s.splice(r,1)}}$set(t){this.$$set&&!eXe(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const hXe="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(hXe);function fXe(e){let t,n,s,r,i;return{c(){t=$o("button"),On(t,"aria-label",n=e[3]?e[3]:null),On(t,"class",s=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`),t.disabled=e[2],On(t,"tabindex","0"),On(t,"type","button")},m(a,o){lo(a,t,o),t.innerHTML=e[5],r||(i=JC(t,"click",function(){uA(e[0])&&e[0].apply(this,arguments)}),r=!0)},p(a,[o]){e=a,o&32&&(t.innerHTML=e[5]),o&8&&n!==(n=e[3]?e[3]:null)&&On(t,"aria-label",n),o&18&&s!==(s=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`)&&On(t,"class",s),o&4&&(t.disabled=e[2])},i:Gi,o:Gi,d(a){a&&Ea(t),r=!1,i()}}}function pXe(e,t,n){let{config:s,step:r}=t,i,a,o,l,u,d;function h(f){return ru(f)?f=f.call(r):f}return e.$$set=f=>{"config"in f&&n(6,s=f.config),"step"in f&&n(7,r=f.step)},e.$$.update=()=>{e.$$.dirty&192&&(n(0,i=s.action?s.action.bind(r.tour):null),n(1,a=s.classes),n(2,o=s.disabled?h(s.disabled):!1),n(3,l=s.label?h(s.label):null),n(4,u=s.secondary),n(5,d=s.text?h(s.text):null))},[i,a,o,l,u,d,s,r]}class gXe extends rc{constructor(t){super(),sc(this,t,pXe,fXe,nc,{config:6,step:7})}}function z3(e,t,n){const s=e.slice();return s[2]=t[n],s}function q3(e){let t,n,s=$3(e[1]),r=[];for(let a=0;a<s.length;a+=1)r[a]=K3(z3(e,s,a));const i=a=>Cs(r[a],1,1,()=>{r[a]=null});return{c(){for(let a=0;a<r.length;a+=1)r[a].c();t=nXe()},m(a,o){for(let l=0;l<r.length;l+=1)r[l]&&r[l].m(a,o);lo(a,t,o),n=!0},p(a,o){if(o&3){s=$3(a[1]);let l;for(l=0;l<s.length;l+=1){const u=z3(a,s,l);r[l]?(r[l].p(u,o),En(r[l],1)):(r[l]=K3(u),r[l].c(),En(r[l],1),r[l].m(t.parentNode,t))}for(gd(),l=s.length;l<r.length;l+=1)i(l);md()}},i(a){if(!n){for(let o=0;o<s.length;o+=1)En(r[o]);n=!0}},o(a){r=r.filter(Boolean);for(let o=0;o<r.length;o+=1)Cs(r[o]);n=!1},d(a){a&&Ea(t),tXe(r,a)}}}function K3(e){let t,n;return t=new gXe({props:{config:e[2],step:e[0]}}),{c(){eh(t.$$.fragment)},m(s,r){mu(t,s,r),n=!0},p(s,r){const i={};r&2&&(i.config=s[2]),r&1&&(i.step=s[0]),t.$set(i)},i(s){n||(En(t.$$.fragment,s),n=!0)},o(s){Cs(t.$$.fragment,s),n=!1},d(s){vu(t,s)}}}function mXe(e){let t,n,s=e[1]&&q3(e);return{c(){t=$o("footer"),s&&s.c(),On(t,"class","shepherd-footer")},m(r,i){lo(r,t,i),s&&s.m(t,null),n=!0},p(r,[i]){r[1]?s?(s.p(r,i),i&2&&En(s,1)):(s=q3(r),s.c(),En(s,1),s.m(t,null)):s&&(gd(),Cs(s,1,1,()=>{s=null}),md())},i(r){n||(En(s),n=!0)},o(r){Cs(s),n=!1},d(r){r&&Ea(t),s&&s.d()}}}function vXe(e,t,n){let s,{step:r}=t;return e.$$set=i=>{"step"in i&&n(0,r=i.step)},e.$$.update=()=>{e.$$.dirty&1&&n(1,s=r.options.buttons)},[r,s]}class bXe extends rc{constructor(t){super(),sc(this,t,vXe,mXe,nc,{step:0})}}function xXe(e){let t,n,s,r,i;return{c(){t=$o("button"),n=$o("span"),n.textContent="×",On(n,"aria-hidden","true"),On(t,"aria-label",s=e[0].label?e[0].label:"Close Tour"),On(t,"class","shepherd-cancel-icon"),On(t,"type","button")},m(a,o){lo(a,t,o),np(t,n),r||(i=JC(t,"click",e[1]),r=!0)},p(a,[o]){o&1&&s!==(s=a[0].label?a[0].label:"Close Tour")&&On(t,"aria-label",s)},i:Gi,o:Gi,d(a){a&&Ea(t),r=!1,i()}}}function wXe(e,t,n){let{cancelIcon:s,step:r}=t;const i=a=>{a.preventDefault(),r.cancel()};return e.$$set=a=>{"cancelIcon"in a&&n(0,s=a.cancelIcon),"step"in a&&n(2,r=a.step)},[s,i,r]}class CXe extends rc{constructor(t){super(),sc(this,t,wXe,xXe,nc,{cancelIcon:0,step:2})}}function yXe(e){let t;return{c(){t=$o("h3"),On(t,"id",e[1]),On(t,"class","shepherd-title")},m(n,s){lo(n,t,s),e[3](t)},p(n,[s]){s&2&&On(t,"id",n[1])},i:Gi,o:Gi,d(n){n&&Ea(t),e[3](null)}}}function _Xe(e,t,n){let{labelId:s,element:r,title:i}=t;dA(()=>{ru(i)&&n(2,i=i()),n(0,r.innerHTML=i,r)});function a(o){sp[o?"unshift":"push"](()=>{r=o,n(0,r)})}return e.$$set=o=>{"labelId"in o&&n(1,s=o.labelId),"element"in o&&n(0,r=o.element),"title"in o&&n(2,i=o.title)},[r,s,i,a]}class SXe extends rc{constructor(t){super(),sc(this,t,_Xe,yXe,nc,{labelId:1,element:0,title:2})}}function Y3(e){let t,n;return t=new SXe({props:{labelId:e[0],title:e[2]}}),{c(){eh(t.$$.fragment)},m(s,r){mu(t,s,r),n=!0},p(s,r){const i={};r&1&&(i.labelId=s[0]),r&4&&(i.title=s[2]),t.$set(i)},i(s){n||(En(t.$$.fragment,s),n=!0)},o(s){Cs(t.$$.fragment,s),n=!1},d(s){vu(t,s)}}}function X3(e){let t,n;return t=new CXe({props:{cancelIcon:e[3],step:e[1]}}),{c(){eh(t.$$.fragment)},m(s,r){mu(t,s,r),n=!0},p(s,r){const i={};r&8&&(i.cancelIcon=s[3]),r&2&&(i.step=s[1]),t.$set(i)},i(s){n||(En(t.$$.fragment,s),n=!0)},o(s){Cs(t.$$.fragment,s),n=!1},d(s){vu(t,s)}}}function EXe(e){let t,n,s,r=e[2]&&Y3(e),i=e[3]&&e[3].enabled&&X3(e);return{c(){t=$o("header"),r&&r.c(),n=Iw(),i&&i.c(),On(t,"class","shepherd-header")},m(a,o){lo(a,t,o),r&&r.m(t,null),np(t,n),i&&i.m(t,null),s=!0},p(a,[o]){a[2]?r?(r.p(a,o),o&4&&En(r,1)):(r=Y3(a),r.c(),En(r,1),r.m(t,n)):r&&(gd(),Cs(r,1,1,()=>{r=null}),md()),a[3]&&a[3].enabled?i?(i.p(a,o),o&8&&En(i,1)):(i=X3(a),i.c(),En(i,1),i.m(t,null)):i&&(gd(),Cs(i,1,1,()=>{i=null}),md())},i(a){s||(En(r),En(i),s=!0)},o(a){Cs(r),Cs(i),s=!1},d(a){a&&Ea(t),r&&r.d(),i&&i.d()}}}function kXe(e,t,n){let{labelId:s,step:r}=t,i,a;return e.$$set=o=>{"labelId"in o&&n(0,s=o.labelId),"step"in o&&n(1,r=o.step)},e.$$.update=()=>{e.$$.dirty&2&&(n(2,i=r.options.title),n(3,a=r.options.cancelIcon))},[s,r,i,a]}class TXe extends rc{constructor(t){super(),sc(this,t,kXe,EXe,nc,{labelId:0,step:1})}}function RXe(e){let t;return{c(){t=$o("div"),On(t,"class","shepherd-text"),On(t,"id",e[1])},m(n,s){lo(n,t,s),e[3](t)},p(n,[s]){s&2&&On(t,"id",n[1])},i:Gi,o:Gi,d(n){n&&Ea(t),e[3](null)}}}function AXe(e,t,n){let{descriptionId:s,element:r,step:i}=t;dA(()=>{let{text:o}=i.options;ru(o)&&(o=o.call(i)),Jf(o)?r.appendChild(o):n(0,r.innerHTML=o,r)});function a(o){sp[o?"unshift":"push"](()=>{r=o,n(0,r)})}return e.$$set=o=>{"descriptionId"in o&&n(1,s=o.descriptionId),"element"in o&&n(0,r=o.element),"step"in o&&n(2,i=o.step)},[r,s,i,a]}class FXe extends rc{constructor(t){super(),sc(this,t,AXe,RXe,nc,{descriptionId:1,element:0,step:2})}}function Q3(e){let t,n;return t=new TXe({props:{labelId:e[1],step:e[2]}}),{c(){eh(t.$$.fragment)},m(s,r){mu(t,s,r),n=!0},p(s,r){const i={};r&2&&(i.labelId=s[1]),r&4&&(i.step=s[2]),t.$set(i)},i(s){n||(En(t.$$.fragment,s),n=!0)},o(s){Cs(t.$$.fragment,s),n=!1},d(s){vu(t,s)}}}function J3(e){let t,n;return t=new FXe({props:{descriptionId:e[0],step:e[2]}}),{c(){eh(t.$$.fragment)},m(s,r){mu(t,s,r),n=!0},p(s,r){const i={};r&1&&(i.descriptionId=s[0]),r&4&&(i.step=s[2]),t.$set(i)},i(s){n||(En(t.$$.fragment,s),n=!0)},o(s){Cs(t.$$.fragment,s),n=!1},d(s){vu(t,s)}}}function Z3(e){let t,n;return t=new bXe({props:{step:e[2]}}),{c(){eh(t.$$.fragment)},m(s,r){mu(t,s,r),n=!0},p(s,r){const i={};r&4&&(i.step=s[2]),t.$set(i)},i(s){n||(En(t.$$.fragment,s),n=!0)},o(s){Cs(t.$$.fragment,s),n=!1},d(s){vu(t,s)}}}function DXe(e){let t,n=!Fr(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled,s,r=!Fr(e[2].options.text),i,a=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length,o,l=n&&Q3(e),u=r&&J3(e),d=a&&Z3(e);return{c(){t=$o("div"),l&&l.c(),s=Iw(),u&&u.c(),i=Iw(),d&&d.c(),On(t,"class","shepherd-content")},m(h,f){lo(h,t,f),l&&l.m(t,null),np(t,s),u&&u.m(t,null),np(t,i),d&&d.m(t,null),o=!0},p(h,[f]){f&4&&(n=!Fr(h[2].options.title)||h[2].options.cancelIcon&&h[2].options.cancelIcon.enabled),n?l?(l.p(h,f),f&4&&En(l,1)):(l=Q3(h),l.c(),En(l,1),l.m(t,s)):l&&(gd(),Cs(l,1,1,()=>{l=null}),md()),f&4&&(r=!Fr(h[2].options.text)),r?u?(u.p(h,f),f&4&&En(u,1)):(u=J3(h),u.c(),En(u,1),u.m(t,i)):u&&(gd(),Cs(u,1,1,()=>{u=null}),md()),f&4&&(a=Array.isArray(h[2].options.buttons)&&h[2].options.buttons.length),a?d?(d.p(h,f),f&4&&En(d,1)):(d=Z3(h),d.c(),En(d,1),d.m(t,null)):d&&(gd(),Cs(d,1,1,()=>{d=null}),md())},i(h){o||(En(l),En(u),En(d),o=!0)},o(h){Cs(l),Cs(u),Cs(d),o=!1},d(h){h&&Ea(t),l&&l.d(),u&&u.d(),d&&d.d()}}}function PXe(e,t,n){let{descriptionId:s,labelId:r,step:i}=t;return e.$$set=a=>{"descriptionId"in a&&n(0,s=a.descriptionId),"labelId"in a&&n(1,r=a.labelId),"step"in a&&n(2,i=a.step)},[s,r,i]}class IXe extends rc{constructor(t){super(),sc(this,t,PXe,DXe,nc,{descriptionId:0,labelId:1,step:2})}}function e4(e){let t;return{c(){t=$o("div"),On(t,"class","shepherd-arrow"),On(t,"data-popper-arrow","")},m(n,s){lo(n,t,s)},d(n){n&&Ea(t)}}}function NXe(e){let t,n,s,r,i,a,o,l,u=e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on&&e4();s=new IXe({props:{descriptionId:e[2],labelId:e[3],step:e[4]}});let d=[{"aria-describedby":r=Fr(e[4].options.text)?null:e[2]},{"aria-labelledby":i=e[4].options.title?e[3]:null},e[1],{open:"true"}],h={};for(let f=0;f<d.length;f+=1)h=ZYe(h,d[f]);return{c(){t=$o("dialog"),u&&u.c(),n=Iw(),eh(s.$$.fragment),V3(t,h),Th(t,"shepherd-has-cancel-icon",e[5]),Th(t,"shepherd-has-title",e[6]),Th(t,"shepherd-element",!0)},m(f,p){lo(f,t,p),u&&u.m(t,null),np(t,n),mu(s,t,null),e[13](t),a=!0,o||(l=JC(t,"keydown",e[7]),o=!0)},p(f,[p]){f[4].options.arrow&&f[4].options.attachTo&&f[4].options.attachTo.element&&f[4].options.attachTo.on?u||(u=e4(),u.c(),u.m(t,n)):u&&(u.d(1),u=null);const m={};p&4&&(m.descriptionId=f[2]),p&8&&(m.labelId=f[3]),p&16&&(m.step=f[4]),s.$set(m),V3(t,h=uXe(d,[(!a||p&20&&r!==(r=Fr(f[4].options.text)?null:f[2]))&&{"aria-describedby":r},(!a||p&24&&i!==(i=f[4].options.title?f[3]:null))&&{"aria-labelledby":i},p&2&&f[1],{open:"true"}])),Th(t,"shepherd-has-cancel-icon",f[5]),Th(t,"shepherd-has-title",f[6]),Th(t,"shepherd-element",!0)},i(f){a||(En(s.$$.fragment,f),a=!0)},o(f){Cs(s.$$.fragment,f),a=!1},d(f){f&&Ea(t),u&&u.d(),vu(s),e[13](null),o=!1,l()}}}const MXe=9,OXe=27,LXe=37,BXe=39;function t4(e){return e.split(" ").filter(t=>!!t.length)}function jXe(e,t,n){let{classPrefix:s,element:r,descriptionId:i,firstFocusableElement:a,focusableElements:o,labelId:l,lastFocusableElement:u,step:d,dataStepId:h}=t,f,p,m;const v=()=>r;iXe(()=>{n(1,h={[`data-${s}shepherd-step-id`]:d.id}),n(9,o=r.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,a=o[0]),n(10,u=o[o.length-1])}),dA(()=>{m!==d.options.classes&&b()});function b(){w(m),m=d.options.classes,C(m)}function w(_){if(y0(_)){const E=t4(_);E.length&&r.classList.remove(...E)}}function C(_){if(y0(_)){const E=t4(_);E.length&&r.classList.add(...E)}}const y=_=>{const{tour:E}=d;switch(_.keyCode){case MXe:if(o.length===0){_.preventDefault();break}_.shiftKey?(document.activeElement===a||document.activeElement.classList.contains("shepherd-element"))&&(_.preventDefault(),u.focus()):document.activeElement===u&&(_.preventDefault(),a.focus());break;case OXe:E.options.exitOnEsc&&(_.preventDefault(),_.stopPropagation(),d.cancel());break;case LXe:E.options.keyboardNavigation&&(_.preventDefault(),_.stopPropagation(),E.back());break;case BXe:E.options.keyboardNavigation&&(_.preventDefault(),_.stopPropagation(),E.next());break}};function k(_){sp[_?"unshift":"push"](()=>{r=_,n(0,r)})}return e.$$set=_=>{"classPrefix"in _&&n(11,s=_.classPrefix),"element"in _&&n(0,r=_.element),"descriptionId"in _&&n(2,i=_.descriptionId),"firstFocusableElement"in _&&n(8,a=_.firstFocusableElement),"focusableElements"in _&&n(9,o=_.focusableElements),"labelId"in _&&n(3,l=_.labelId),"lastFocusableElement"in _&&n(10,u=_.lastFocusableElement),"step"in _&&n(4,d=_.step),"dataStepId"in _&&n(1,h=_.dataStepId)},e.$$.update=()=>{e.$$.dirty&16&&(n(5,f=d.options&&d.options.cancelIcon&&d.options.cancelIcon.enabled),n(6,p=d.options&&d.options.title))},[r,h,i,l,d,f,p,y,a,o,u,s,v,k]}class HXe extends rc{constructor(t){super(),sc(this,t,jXe,NXe,nc,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}class Ik extends J2{constructor(t,n={}){return super(),this._resolvedAttachTo=void 0,this._resolvedExtraHighlightElements=void 0,this.classPrefix=void 0,this.el=void 0,this.target=void 0,this.tour=void 0,this.tour=t,this.classPrefix=this.tour.options?LW(this.tour.options.classPrefix):"",this.styles=t.styles,this._resolvedAttachTo=null,tA(this),this._setOptions(n),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){qYe(this),Jf(this.el)&&(this.el.remove(),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){var t;(t=this.tour.modal)==null||t.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveExtraHiglightElements(){return this._resolvedExtraHighlightElements=sYe(this),this._resolvedExtraHighlightElements}_resolveAttachToOptions(){return this._resolvedAttachTo=nYe(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return this._resolvedAttachTo===null?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return!!(this.el&&!this.el.hidden)}show(){return ru(this.options.beforeShowPromise)?Promise.resolve(this.options.beforeShowPromise()).then(()=>this._show()):Promise.resolve(this._show())}updateStepOptions(t){Object.assign(this.options,t),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const t=`${this.id}-description`,n=`${this.id}-label`;return this.shepherdElementComponent=new HXe({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:t,labelId:n,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(t){const{element:n}=this._getResolvedAttachToOptions();ru(this.options.scrollToHandler)?this.options.scrollToHandler(n):MKe(n)&&typeof n.scrollIntoView=="function"&&n.scrollIntoView(t)}_getClassOptions(t){const n=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,s=t.classes?t.classes:"",r=n&&n.classes?n.classes:"",i=[...s.split(" "),...r.split(" ")],a=new Set(i);return Array.from(a).join(" ").trim()}_setOptions(t={}){let n=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;n=eA({},n||{}),this.options=Object.assign({arrow:!0},n,t,zYe(n,t));const{when:s}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||`step-${jW()}`,s&&Object.keys(s).forEach(r=>{this.on(r,s[r],this)})}_setupElements(){Fr(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&ZKe(this),$Ye(this)}_show(){var t;this.trigger("before-show"),this._resolveAttachToOptions(),this._resolveExtraHiglightElements(),this._setupElements(),this.tour.modal||this.tour.setupModal(),(t=this.tour.modal)==null||t.setupForStep(this),this._styleTargetElementForStep(this),this.el&&(this.el.hidden=!1),this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el&&(this.el.hidden=!1);const n=this.shepherdElementComponent.getElement(),s=this.target||document.body,r=this._resolvedExtraHighlightElements;s.classList.add(`${this.classPrefix}shepherd-enabled`),s.classList.add(`${this.classPrefix}shepherd-target`),n.classList.add("shepherd-enabled"),r?.forEach(i=>{i.classList.add(`${this.classPrefix}shepherd-enabled`),i.classList.add(`${this.classPrefix}shepherd-target`)}),this.trigger("show")}_styleTargetElementForStep(t){const n=t.target,s=t._resolvedExtraHighlightElements;if(!n)return;const r=t.options.highlightClass;r&&(n.classList.add(r),s?.forEach(i=>i.classList.add(r))),n.classList.remove("shepherd-target-click-disabled"),s?.forEach(i=>i.classList.remove("shepherd-target-click-disabled")),t.options.canClickTarget===!1&&(n.classList.add("shepherd-target-click-disabled"),s?.forEach(i=>i.classList.add("shepherd-target-click-disabled")))}_updateStepTargetOnHide(){const t=this.target||document.body,n=this._resolvedExtraHighlightElements,s=this.options.highlightClass;s&&(t.classList.remove(s),n?.forEach(r=>r.classList.remove(s))),t.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`),n?.forEach(r=>{r.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)})}}function UXe(e){if(e){const{steps:t}=e;t.forEach(n=>{n.options&&n.options.canClickTarget===!1&&n.options.attachTo&&(Jf(n.target)&&n.target.classList.remove("shepherd-target-click-disabled"),n._resolvedExtraHighlightElements&&n._resolvedExtraHighlightElements.forEach(s=>{Jf(s)&&s.classList.remove("shepherd-target-click-disabled")}))})}}function GXe(e){let t="";const{innerWidth:n,innerHeight:s}=window;return e.forEach(r=>{const{width:i,height:a,x:o=0,y:l=0,r:u=0}=r,{topLeft:d=0,topRight:h=0,bottomRight:f=0,bottomLeft:p=0}=typeof u=="number"?{topLeft:u,topRight:u,bottomRight:u,bottomLeft:u}:u;t+=`M${o+d},${l} a${d},${d},0,0,0-${d},${d} V${a+l-p} a${p},${p},0,0,0,${p},${p} H${i+o-f} a${f},${f},0,0,0,${f}-${f} V${l+h} a${h},${h},0,0,0-${h}-${h} Z`}),`M${n},${s} H0 V0 H${n} V${s} Z ${t}`.replace(/\s/g,"")}function VXe(e){let t,n,s,r,i;return{c(){t=G3("svg"),n=G3("path"),On(n,"d",e[2]),On(t,"class",s=`${e[1]?"shepherd-modal-is-visible":""} shepherd-modal-overlay-container`)},m(a,o){lo(a,t,o),np(t,n),e[11](t),r||(i=JC(t,"touchmove",e[3]),r=!0)},p(a,[o]){o&4&&On(n,"d",a[2]),o&2&&s!==(s=`${a[1]?"shepherd-modal-is-visible":""} shepherd-modal-overlay-container`)&&On(t,"class",s)},i:Gi,o:Gi,d(a){a&&Ea(t),e[11](null),r=!1,i()}}}function ZW(e){if(!e)return null;const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return t!=="hidden"&&t!=="visible"&&e.scrollHeight>=e.clientHeight?e:ZW(e.parentElement)}function WXe(e){let t={top:0,left:0};if(!e)return t;let n=e.ownerDocument.defaultView;for(;n!==window.top;){var s;const a=(s=n)==null?void 0:s.frameElement;if(a){var r,i;const o=a.getBoundingClientRect();t.top+=o.top+((r=o.scrollTop)!=null?r:0),t.left+=o.left+((i=o.scrollLeft)!=null?i:0)}n=n.parent}return t}function $Xe(e,t){const n=e.getBoundingClientRect();let s=n.y||n.top,r=n.bottom||s+n.height;if(t){const a=t.getBoundingClientRect(),o=a.y||a.top,l=a.bottom||o+a.height;s=Math.max(s,o),r=Math.min(r,l)}const i=Math.max(r-s,0);return{y:s,height:i}}function zXe(e,t,n){let{element:s,openingProperties:r}=t,i=!1,a,o;u();const l=()=>s;function u(){n(4,r=[{width:0,height:0,x:0,y:0,r:0}])}function d(){n(1,i=!1),w()}function h(k=0,_=0,E=0,R=0,F,A,N){if(A){const M=[A,...N||[]];n(4,r=[]);for(const D of M){if(!D||M.indexOf(D)!==M.lastIndexOf(D))continue;const{y:L,height:V}=$Xe(D,F),{x:j,width:te,left:X}=D.getBoundingClientRect();M.some(re=>{if(re===D)return!1;const G=re.getBoundingClientRect();return j>=G.left&&j+te<=G.right&&L>=G.top&&L+V<=G.bottom})||r.push({width:te+k*2,height:V+k*2,x:(j||X)+E-k,y:L+R-k,r:_})}}else u()}function f(k){w(),k.tour.options.useModalOverlay?(C(k),p()):d()}function p(){n(1,i=!0)}const m=k=>{k.preventDefault()},v=k=>{k.stopPropagation()};function b(){window.addEventListener("touchmove",m,{passive:!1})}function w(){a&&(cancelAnimationFrame(a),a=void 0),window.removeEventListener("touchmove",m,{passive:!1})}function C(k){const{modalOverlayOpeningPadding:_,modalOverlayOpeningRadius:E,modalOverlayOpeningXOffset:R=0,modalOverlayOpeningYOffset:F=0}=k.options,A=WXe(k.target),N=ZW(k.target),M=()=>{a=void 0,h(_,E,R+A.left,F+A.top,N,k.target,k._resolvedExtraHighlightElements),a=requestAnimationFrame(M)};M(),b()}function y(k){sp[k?"unshift":"push"](()=>{s=k,n(0,s)})}return e.$$set=k=>{"element"in k&&n(0,s=k.element),"openingProperties"in k&&n(4,r=k.openingProperties)},e.$$.update=()=>{e.$$.dirty&16&&n(2,o=GXe(r))},[s,i,o,v,r,l,u,d,h,f,p,y]}class qXe extends rc{constructor(t){super(),sc(this,t,zXe,VXe,nc,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}class KXe extends J2{constructor(){super(),this.activeTour=void 0,tA(this)}}class YXe extends J2{constructor(t={}){super(),this.trackedEvents=["active","cancel","complete","show"],this.classPrefix=void 0,this.currentStep=void 0,this.focusedElBeforeOpen=void 0,this.id=void 0,this.modal=void 0,this.options=void 0,this.steps=void 0,tA(this);const n={exitOnEsc:!0,keyboardNavigation:!0};return this.options=Object.assign({},n,t),this.classPrefix=LW(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),["active","cancel","complete","inactive","show","start"].map(s=>{(r=>{this.on(r,i=>{i=i||{},i.tour=this,Ju.trigger(r,i)})})(s)}),this._setTourID(t.id),this}addStep(t,n){let s=t;return s instanceof Ik?s.tour=this:s=new Ik(this,s),Fr(n)?this.steps.push(s):this.steps.splice(n,0,s),s}addSteps(t){return Array.isArray(t)&&t.forEach(n=>{this.addStep(n)}),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}async cancel(){if(this.options.confirmCancel){const t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";let n;ru(this.options.confirmCancel)?n=await this.options.confirmCancel():n=window.confirm(t),n&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find(n=>n.id===t)}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return Ju.activeTour===this}next(){const t=this.steps.indexOf(this.currentStep);t===this.steps.length-1?this.complete():this.show(t+1,!0)}removeStep(t){const n=this.getCurrentStep();this.steps.some((s,r)=>{if(s.id===t)return s.isOpen()&&s.hide(),s.destroy(),this.steps.splice(r,1),!0}),n&&n.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t=0,n=!0){const s=y0(t)?this.getById(t):this.steps[t];s&&(this._updateStateBeforeShow(),ru(s.options.showOn)&&!s.options.showOn()?this._skipStep(s,n):(this.currentStep=s,this.trigger("show",{step:s,previous:this.currentStep}),s.show()))}async start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this.setupModal(),this._setupActiveTour(),this.next()}_done(t){const n=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(s=>s.destroy()),UXe(this),this.trigger(t,{index:n}),Ju.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),(t==="cancel"||t==="complete")&&this.modal){const s=document.querySelector(".shepherd-modal-overlay-container");s&&(s.remove(),this.modal=null)}Jf(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),Ju.activeTour=this}setupModal(){this.modal=new qXe({target:this.options.modalContainer||document.body,props:{styles:this.styles}})}_skipStep(t,n){const s=this.steps.indexOf(t);if(s===this.steps.length-1)this.complete();else{const r=n?s+1:s-1;this.show(r,n)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(t){const n=this.options.tourName||"tour",s=t||jW();this.id=`${n}--${s}`}}const Ju=new KXe,e$=typeof window>"u";Ju.Step=e$?eYe:Ik;Ju.Tour=e$?tYe:YXe;const ZC=g.createContext(void 0);ZC.Consumer;const XXe=({children:e})=>NKe.jsx(ZC.Provider,{value:{Shepherd:Ju},children:e}),QXe=""+new URL("agentic-sequence-CExfswgi.png",import.meta.url).href,JXe=""+new URL("canvas-code-inline-edit-DLji9b0m.png",import.meta.url).href,ZXe=""+new URL("canvas-overview-CruGEIRC.png",import.meta.url).href,eQe=""+new URL("canvas-variables-view-DrA20zqs.png",import.meta.url).href,tQe=""+new URL("chat-attachments-_3cRrONU.png",import.meta.url).href,nQe=""+new URL("chat-full-view-e-eJPzrw.png",import.meta.url).href,sQe=""+new URL("chat-input-CU-CA7Se.png",import.meta.url).href,rQe=""+new URL("inline-edit-canvas-O9conTkE.png",import.meta.url).href,iQe=e=>{const t=Array.from(document.querySelectorAll(`[data-tour-tag="${e}"]`));return t.find(n=>n.offsetParent!==null)??t[0]??null},n4=e=>{document.querySelector(`[data-tour-action="${e}"]`)?.click()},s4=[{id:"welcome",title:"Welcome to Local Operator",text:`Local Operator is an AI agents platform that allows you to create a team of proactive AI agents that support you and help to reduce your daily workload.<br/><img src="${nQe}" alt="Chat full view" style="width: 100%; height: 350px; object-fit: contain; border-radius: 8px;"/><br />These agents are different from simple chatbots because they can actually do things for you on your computer like create files, run code and analytics, edit images, videos, and PDFs, organize your system, and much more.<br/><br/>In this walkthrough we'll cover:<ul><li>Creating agents</li><li>Making agents do things</li><li>The canvas workspace</li><li>Customizing agents</li><li>Agent hub for sharing and collaborating</li><li>Schedules for proactive agents</li><li>Settings for customization</li></ul>Let's explore how it works.`,buttons:[{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"agent-list",attachTo:{element:'[data-tour-tag="agent-list-panel"]',on:"right"},title:"Your agents",text:"On the left, you'll see a list of your available AI agents. You can select an agent to start a conversation or manage its settings. Think of this as your messenger contacts list, but for AI agents. There are no limits to how many agents you can have, so create as many as you need to handle all your daily tasks.<br/><br/>Use the create agents button at the top of the toolbar to create a new agent at any time. You can also import agents from the Agent hub, which we will cover later in this tour.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"select-agent",attachTo:{element:'[data-tour-tag="agent-list-item-button-0"]',on:"right"},title:"Select an agent",text:"Click on an agent to open the chat window to pull up your conversation with it. This will show the messages that you have sent them and the responses and actions that they have taken.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="agent-list-item-button-0"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"chat-input",attachTo:{element:'[data-tour-tag="chat-input-textarea"]',on:"top"},title:"Ask your agent anything",text:`Type your request here. Agents can answer questions, perform tasks, search the web, and much more. When you create a new agent, you'll see suggested prompts for ideas.<br /><br />Some powerful requests that you can try:<br /><br /><ul><li>"Create a spreadsheet in my Documents folder with all the major cities in Canada."</li><li>"Search the web for the latest news on AI and make a thorough report."</li><li>Select an attachment and then "translate this document to French."</li></ul><br /><img src="${sQe}" alt="Chat input" style="width: 100%; height: 200px; object-fit: contain; border-radius: 8px;"/><br />You can also attach files to your message by clicking the paperclip button, which we will cover in the next step.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"attachments",attachTo:{element:'button[data-tour-tag="chat-input-attach-file-button"]',on:"top"},title:"Attach files to your message",text:`You can attach any files, images, or documents to your message by clicking this paperclip button, there are no limitations on the file types. Your agent can process, analyze, or translate these attachments as part of your request.<br /><br />Try attaching a PDF, image, or text file and then ask your agent to summarize, translate, or extract information from it.<br /><img src="${tQe}" alt="Chat attachments" style="width: 100%; height: 200px; object-fit: contain; border-radius: 8px;"/><br />Images like PNGs, JPGs, and PDFs are natively streamed into the model context window, so they can understand them directly without needing to run any code. Other files like Excel, Word, and CSV files are included as file paths on your device to direct the model's attention to work with them using code. You can attach massive files like million line CSVs and have the agent work with them using code.<br /><br />You can also paste images into the chat input, and attach multiple files at once to achieve more complex tasks. Try taking a screenshot of a website and then asking your agent to try to code it.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"agent-capabilities",attachTo:{element:'[data-tour-tag="chat-header"]',on:"top"},title:"More than just chat",text:`Local Operator agents are different from simple chatbots. They can perform actions on your computer, like creating files, running code, or browsing the web, based on your instructions. You'll see them use "tools" like reading, writing, and executing code to get things done. Agents have memory of the conversation, previous steps, learnings, and even store the execution variables of previous steps in code to be able to use them later in the conversation.<br /><img src="${QXe}" alt="Agentic sequence" style="width: 100%; height: 350px; object-fit: contain; border-radius: 8px;"/><br />Local Operator agents are extremely flexible, so they can bounce back and forth with you for simple chatting, and know when they need to embark on a work journey to get things done in multiple steps with tool use.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){const{openCommandPalette:e}=Ke.getState();e(),setTimeout(()=>{this.next()},500)}}]},{id:"pre-command-palette-open-canvas",title:"Command palette",attachTo:{element:'[data-tour-tag="command-palette-dialog"]',on:"right"},text:`Let's quickly look at another powerful feature: the Command Palette. You can open it anywhere in the app by pressing <code>${ko("everything",!0)}</code> on Mac and <code>${ko("everything",!1)}</code> on Windows or Linux. This is a helpful window that you can open from anywhere in the app to be able to access your chats, agents, settings, pages and actions, and much more, using your keyboard. It can often be faster to access sections in the app this way instead of clicking through menus. Type a word to search everything at once, or start with a prefix to narrow it: <code>#</code> for chats, <code>@</code> for agents and teams, <code>,</code> for settings, and <code>></code> for commands and pages.<br /><br />In a hurry for a conversation? Press <code>${ko("chats",!0)}</code> on Mac and <code>${ko("chats",!1)}</code> on Windows or Linux and the palette opens already searching your chats, so you can jump straight to one — and <code>${ko("commands",!0)}</code> on Mac and <code>${ko("commands",!1)}</code> on Windows or Linux opens it on the app's own commands and pages when that is what you are after. You can also just click Search in the sidebar to open it.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const{closeCommandPalette:e}=Ke.getState();e(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const{closeCommandPalette:e}=Ke.getState();e(),setTimeout(()=>{this.next()},500)}}]},{id:"canvas-open-button",attachTo:{element:'button[data-tour-tag="open-canvas-button"]',on:"left"},title:"Open the canvas",text:"Click here to open the Canvas, a workspace for files and dynamic visualizations where you can organize, plan, and interact with your agents in a more flexible way.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const{openCommandPalette:e}=Ke.getState();e(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('button[data-tour-tag="open-canvas-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"canvas-feature",attachTo:{element:'[data-tour-tag="canvas-container"]',on:"left"},title:"The canvas: your visual workspace",text:`This is the Canvas, your workspace for files and dynamic visualizations where you can organize, plan, and interact with your agents in a more flexible way. Any files that your agents create on your device can be opened here by clicking on the file icons that you see as they work.<br/><br/>Agents can make dynamic visualizations like games, charts, maps, and more in HTML files. Any HTML files you open will be rendered dynamically in an iframe. Any markdown files that you open will be rendered in full markdown viewer with support for code blocks, tables, mermaid diagrams, and more.<br/><img src="${ZXe}" alt="Canvas overview" style="width: 100%; height: 300px; object-fit: contain; border-radius: 8px;"/>`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="close-canvas-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('button[data-tour-tag="canvas-documents-view-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"canvas-documents-view",attachTo:{element:'button[data-tour-tag="canvas-documents-view-button"]',on:"top"},title:"Documents view",text:`The Documents view shows all your open notes, blog articles, code, and visualizations as tabs. You can switch between documents to edit them and see dynamic visualizations in HTML created by your agents. Use this view to work with your notes, reports, and agent-generated content.<br /><br />This is where you can get more precise around your agents' work.<br/><img src="${rQe}" alt="Inline edit canvas" style="width: 100%; height: 200px; object-fit: contain; border-radius: 8px;"/><br />In your documents, highlight any text that you want your agent to improve and press Cmd/Ctrl+K to bring up the inline AI editor.
|
|
683
683
|
<br /><img src="${JXe}" alt="Canvas code inline edit" style="width: 100%; height: 200px; object-fit: cover; object-position: top; border-radius: 8px;"/><br />You can be as precise as you want and the agent will edit the document for you in place, using its memories and context so you don't have to re-explain things.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('button[data-tour-tag="canvas-files-view-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"canvas-files-view",attachTo:{element:'button[data-tour-tag="canvas-files-view-button"]',on:"top"},title:"Files view",text:"The Files view lets you browse and open files that your agents have created or that are relevant to your current conversation. Use this to quickly access, preview, and open files in the Canvas workspace.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('button[data-tour-tag="canvas-documents-view-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('button[data-tour-tag="canvas-variables-view-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"canvas-variables-view",attachTo:{element:'button[data-tour-tag="canvas-variables-view-button"]',on:"top"},title:"Variables view",text:`The Variables view displays the "code memory" that agents have stored during their work. These are technical variables that include results, intermediate values, and other data that agents use to perform tasks. You can inspect and manage these variables here.<br /><br />This section will be most helpful for more technical users who want to understand how agents are working and what they are doing.<br/><img src="${eQe}" alt="Canvas variables" style="width: 100%; height: 350px; object-fit: contain; border-radius: 8px;"/>`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('button[data-tour-tag="canvas-files-view-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('button[data-tour-tag="close-canvas-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"agent-options",attachTo:{element:'button[data-tour-tag="agent-options-button"]',on:"right"},title:"Agent options",text:"Click here to see options for the currently selected agent, like viewing its settings, exporting it, or deleting it.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('button[data-tour-tag="open-canvas-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="agent-options-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"click-view-settings-from-chat",attachTo:{element:'[role="menuitem"][data-tour-tag="view-agent-settings-menu-item"]',on:"right"},title:"View configuration",text:'Click "View agent settings" to see and change how this agent works and change things like its name, description, hosting provider, and AI model.',buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[role="menuitem"][data-tour-tag="view-agent-settings-menu-item"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"view-agent-settings",attachTo:{element:'div[data-tour-tag="agent-settings-details-paper"]',on:"left"},title:"Agent configuration",text:"This is where you can customize and configure your agent. You can change its name, description, the AI model it uses, its temperature for creativity, and other chat settings.<br /><br />The agents will already have default settings that work well for most use cases, but if you want to roll up your sleeves and customize, you can do so here.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-chat"]');e&&e.click(),setTimeout(()=>{const t=document.querySelector('button[data-tour-tag="agent-options-button"]');t&&t.click()},500),setTimeout(()=>{this.back()},1e3)}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"select-provider",attachTo:{element:'[data-tour-tag="agent-settings-hosting-select"]',on:"left"},title:"Select hosting provider",text:`Choose an AI provider for your agent. If you don't pick one here, then the default provider from the settings page will be used. Providers offer different AI models and pricing. Radient is recommended for Local Operator as its "Automatic" mode is optimized for the lowest cost and best performance.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"select-model",attachTo:{element:'[data-tour-tag="agent-settings-model-select"]',on:"left"},title:"Select AI model",text:"After selecting a provider, choose an AI model. Models marked as 'Recommended' are known to work well with Local Operator. Other models might have inconsistent performance. If a model you expect to be recommended isn't listed, please let us know if it works well for you in Local Operator via GitHub Issues or email.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"modify-security-prompt",attachTo:{element:'[data-tour-tag="agent-settings-security"]',on:"left"},title:"Customize security behaviors",text:"This prompt provides separate instructions to the security agent that reviews this agent's work. You can explicitly allow certain actions that would normally be blocked. If you encounter frequent security interventions, consider adding a note here for the security agent.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"modify-agent-prompt",attachTo:{element:'[data-tour-tag="agent-settings-system-prompt"]',on:"left"},title:"Customize the agent's behavior",text:"This prompt allows you to customize the baseline behavior of the agent. While most customization can happen by talking to the agent (it records learnings in its notebook), you can provide specific workflow instructions here that will be followed separately.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"create-new-agent",attachTo:{element:'button[data-tour-tag="create-new-agent-button"]',on:"bottom"},title:"Create a new agent",text:'Click the "+" button to create a brand new agent from scratch. You can then customize its behavior and capabilities.',buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="agent-list-item-button-0"]');e&&e.click(),setTimeout(()=>{const t=document.querySelector('button[data-tour-tag="agent-options-button"]');t&&t.click()},500),setTimeout(()=>{const t=document.querySelector('[role="menuitem"][data-tour-tag="view-agent-settings-menu-item"]');t&&t.click()},1e3),setTimeout(()=>{this.back()},1500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="create-new-agent-button"]');e&&e.click(),setTimeout(()=>{this.next()},1e3)}}]},{id:"agent-naming-guidelines",attachTo:{element:'[data-tour-tag="create-agent-dialog"]',on:"right"},title:"Naming and describing your agent",text:`Give your agent a clear, descriptive name that reflects its purpose (e.g., "File Organizer" or "Web Researcher").
|
|
684
|
-
A good description helps you and others understand what the agent does and any special instructions. The descriptions are also used by other agents to help them understand how to tag each other in for certain tasks.<br /><br />If you want this agent to be part of the agent-to-agent communication network, it will need to have a description that captures its purpose and capabilities. Be concise and specific.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="create-agent-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="create-agent-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"navigate-agent-hub",attachTo:{element:'[data-tour-tag="nav-item-agent-hub"]',on:"right"},title:"Discover more agents",text:`Let's visit the Agent hub to find community-created agents. Click on the "Agent hub" icon in the navigation bar.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agents"]');e&&e.click(),setTimeout(()=>{const t=document.querySelector('[data-tour-tag="create-new-agent-button"]');t&&t.click()},500),setTimeout(()=>{this.back()},1e3)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agent-hub"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"agent-hub-view",attachTo:{element:'[data-tour-tag="agent-hub-sidebar-container"]',on:"right"},title:"The Agent hub",text:"Here you can browse agents by category or search for specific ones. These agents are shared by the community and can perform various specialized tasks.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"download-agent",attachTo:{element:'button[data-tour-tag="agent-hub-download-button"]',on:"bottom"},title:"Download an agent",text:'Find an agent that interests you and click the "Get" button to add it to your local agent list.',buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agents"]');e&&e.click(),setTimeout(()=>{this.next()},1e3)}}]},{id:"upload-agent-hub",attachTo:{element:()=>iQe("upload-to-hub-header-button"),on:"bottom"},title:"Share your agents",text:"If you create a useful agent, you can also share it with the community by uploading it to the Agent hub from the agent options menu.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agent-hub"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){n4("open-upload-dialog"),setTimeout(()=>{this.next()},500)}}]},{id:"upload-agent-hub-dialog",attachTo:{element:'[data-tour-tag="upload-agent-dialog"]',on:"right"},title:"Upload agent to hub",text:"This dialog publishes your agent's instruction set to the community. You need a Radient account to publish, which is free to create and costs nothing per agent. You can review the details before confirming. What is published is what describes the agent - its name, description, instructions and tool surface; no conversation, execution history, memory, plan or machine-specific configuration leaves your computer. Make sure your agent meets the required criteria before submitting.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('button[data-tour-tag="upload-agent-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('button[data-tour-tag="upload-agent-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"navigate-schedules",attachTo:{element:'[data-tour-tag="nav-item-schedules"]',on:"right"},title:"Automate tasks with schedules",text:"Local Operator can run tasks for you on a regular basis. Let's check out the Schedules section.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agents"]');e&&e.click(),setTimeout(()=>{n4("open-upload-dialog")},500),setTimeout(()=>{this.back()},1e3)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-schedules"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"schedules-overview",title:"Proactive agents with schedules",text:"A powerful feature of Local Operator is the ability to ask agents to perform tasks on their own on a recurring basis. This turns them from reactive agent bots to proactive agents that work on their own in the background to support you without you needing to continually ask them to do things.<br /><br />You can simply ask any agent to do something at some point in the future, or to handle some daily task at a certain time, and it will create a prompt for itself that will be executed at the specified times.<br /><br />Here, you can view, create, and manage all your scheduled tasks in one place to streamline your workflow and ensure important actions happen automatically.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"create-schedule",attachTo:{element:'button[data-tour-tag="create-schedule-button"]',on:"bottom"},title:"Set up a recurring task",text:'Click "Create schedule" to ask an agent to perform a task for you regularly, like sending a daily report or checking for news updates.<br /><br />You can also create one-off tasks that only run once at some point in the future.',buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('button[data-tour-tag="create-schedule-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"create-schedule-dialog",attachTo:{element:'[data-tour-tag="create-schedule-dialog"]',on:"right"},title:"Configure your schedule",text:"While it is often much easier to simply ask the agent to do a task on a recurring basis for you, you can also manually set up a schedule for a task here or update existing tasks.<br /><br />The prompt is the message that will be sent to the agent at the predefined schedule. You can update the time of day in your local timezone, the frequency of the task, and even specify a specific date or time that the task should stop running at.<br /><br />You can also schedule one-off tasks that only run once at some point in the future.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="create-schedule-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="create-schedule-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"navigate-settings",attachTo:{element:'[data-tour-tag="nav-item-settings"]',on:"right"},title:"Personalize your experience",text:"Now, let's explore the Settings menu to customize Local Operator to your liking.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-schedules"]');e&&e.click(),setTimeout(()=>{const t=document.querySelector('button[data-tour-tag="create-schedule-button"]');t&&t.click()},500),setTimeout(()=>{this.back()},1e3)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-settings"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"general-settings",attachTo:{element:'div[data-tour-tag="settings-general-section"]',on:"right"},title:"General settings",text:"Here you can update your user profile and configure model settings (like default hosting provider and model).",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"appearance-settings",attachTo:{element:'[data-tour-tag="settings-appearance-section"]',on:"right"},title:"Customize appearance",text:"Choose from various themes to change the look and feel of Local Operator. Find one that suits your style.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"radient-account-settings",attachTo:{element:'[data-tour-tag="settings-radient-account-section"]',on:"right"},title:"Radient account",text:"Connect your Radient account to access your Radient Pass details, credits, and unlock unified access to models and tools. Radient is the best way to use Local Operator since it powers the AI models, web search, image generation, and much more with a single integration. You get free credits when you sign up to try it out and bonus credits when you top up.<br /><br />When you sign in for the first time, it will automatically create a Radient Pass for you and save it securely to your computer. This will power your Local Operator agents with Radient Automatic, which mixes and matches AI models to get you the best balance of speed, accuracy, and cost in every step of your agents' workflows.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"integrations-settings",attachTo:{element:'[data-tour-tag="settings-integrations-section"]',on:"right"},title:"Connect your services",text:"Enhance your agents' capabilities by connecting your Google services like Gmail, Calendar, and Drive. This allows agents to access and manage your information with your permission.<br /><br />You need to be logged in to a Radient account to use this feature, however it is free to use and doesn't cost any additional Radient credits per action.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"application-updates-settings",attachTo:{element:'[data-tour-tag="settings-app-updates-section"]',on:"right"},title:"Stay up to date",text:"Check for updates to Local Operator here to ensure you have the latest features and improvements. You can see your current version information below.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"tour-complete",title:"Tour complete",text:"You've now seen the main features of Local Operator. Feel free to explore further and discover all the ways your AI agents can assist you. Happy automating.",buttons:[{text:"Finish",classes:"shepherd-button-primary",action:function(){this.complete()}}]}],aQe=()=>{const e=ti(),{completeTourOnboarding:t}=ym(),n=g.useContext(ZC),s={cancelIcon:{enabled:!0},scrollTo:{behavior:"smooth",block:"center"}},r=!0;return{startTour:a=>{if(n?.tour?.isActive()&&!a?.forceModalCompleted){console.log("Onboarding tour is already active (from context.tour). Not starting another.");return}const o=ym.getState();if(!a?.forceModalCompleted&&!o.isModalComplete){console.log("Onboarding modal not completed (checked via store). Tour will not start.");return}if(o.isTourComplete&&!a?.forceModalCompleted){console.log("Onboarding tour already completed in store and not forced. Not starting again.");return}let l=n?.tour;const u=n?.Shepherd;if(!l&&u&&(l=u.activeTour,!l&&u.Tour&&(console.log("No active Shepherd tour found from context or global. Creating a new one."),l=new u.Tour({useModalOverlay:r,defaultStepOptions:s}))),!l){console.warn("Failed to get or create a Shepherd tour instance.",n);return}if(l.isActive()){console.log("Tour is already active. Not starting again.");return}if(l.options.defaultStepOptions={...l.options.defaultStepOptions||{},...s},l.options.useModalOverlay=r,a?.firstAgentId&&(l.options.firstAgentId=a.firstAgentId),l.off("complete",t),l.on("complete",t),l.off("cancel",t),l.on("cancel",t),a?.forceModalCompleted||!l.isActive()){const d=[...l.steps];for(const h of d)h.id&&l.removeStep(h.id);l.addSteps(s4)}else l.steps.length===0&&l.addSteps(s4);typeof l.start=="function"?(e("/"),l.start()):console.warn("Shepherd tour instance does not have a start method.",l)}}},oQe=()=>{const{isModalComplete:e,isTourComplete:t}=ym(),{startTour:n}=aQe(),s=$e.useContext(ZC),{data:r}=$S(1,1);return g.useEffect(()=>{if(e&&!t&&s){const i=setTimeout(()=>{const a=r?.agents?.[0]?.id;n({firstAgentId:a})},500);return()=>clearTimeout(i)}},[e,t,s,n,r]),null},lQe=({children:e})=>c.jsxs(XXe,{children:[e,c.jsx(oQe,{})]}),cQe=()=>{Et();const{open:e,focusGroup:t,providerId:n,closeConnect:s}=_B(),r=g.useRef(null);g.useEffect(()=>{e&&(r.current=document.activeElement instanceof HTMLElement?document.activeElement:null)},[e]);const i=ti();return c.jsx(Kl,{open:e,onOpenChange:a=>{a||s()},children:c.jsxs(Yl,{className:"max-h-[calc(100vh-4rem)] max-w-[min(40rem,calc(100vw-4rem))] gap-4 overflow-y-auto","data-connect-provider-dialog":"",onCloseAutoFocus:a=>{const o=r.current;r.current=null,o?.isConnected&&(a.preventDefault(),o.focus())},children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx(jo,{className:"text-title",children:x("ui.providers.connect_provider_dialog.connect_a_model_provider")}),c.jsx(ou,{className:"text-body-sm text-ink-muted",children:x("ui.providers.connect_provider_dialog.your_agents_need_a_model_to_think")})]}),e?c.jsx(IW,{context:"dialog",featuredOnly:!0,focusGroup:t,initialProviderId:n,onDone:s,onChangeModel:()=>{s(),i("/settings")}}):null]})})},uQe=({title:e,description:t,icon:n,children:s,titleComponent:r,sectionRef:i,dataTourTag:a,className:o,id:l})=>c.jsxs("div",{ref:i,id:l,tabIndex:l?-1:void 0,"data-tour-tag":a,className:T("w-full",o),children:[r??c.jsxs("h2",{className:"flex items-center gap-2 text-heading text-ink",children:[n&&c.jsx(n,{size:16,className:"shrink-0 text-ink-dim"}),e]}),t&&c.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:t}),c.jsx("div",{className:"mt-4",children:s})]}),QZe=({label:e,value:t,className:n,valueClassName:s})=>c.jsxs("div",{className:T("min-w-0",n),children:[c.jsx("div",{className:"flex items-center gap-1.5 text-meta text-ink-dim",children:e}),c.jsx("div",{className:T("mt-0.5 break-words text-body-sm",s??"text-ink"),children:t})]}),JZe=({children:e,className:t})=>c.jsx("div",{className:T("grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))] gap-x-6 gap-y-4",t),children:e});async function t$(e){await xt({op:"settings.edit",key:Ro,value:e.value}),VQ(e.queryClient)}async function dQe(e){await t$(e),e.queryClient.setQueryData(rx.all,t=>t&&{...t,settings:t.settings.map(n=>n.key===Ro?{...n,value:e.value,is_default:e.value===n.default}:n)});try{return await e.queryClient.fetchQuery({queryKey:rx.all,queryFn:()=>xt({op:"settings.list"}),staleTime:0,retry:!1}),"confirmed"}catch{return"readback-unknown"}}const ZZe=({focus:e=!1})=>{Et();const t=nn(),n=jn(),s=yt(n.data,"settings"),r=fs({queryKey:rx.all,queryFn:()=>xt({op:"settings.list"}),enabled:s,retry:!1,refetchOnReconnect:!0}),i=r.data?.settings.find(F=>F.key===Ro),[a,o]=g.useState(!1),[l,u]=g.useState(null),[d,h]=g.useState(!1),[f,p]=g.useState(!1),m=g.useRef(!1),v=g.useRef(null),b=g.useRef(!1);g.useEffect(()=>{if(!e){b.current=!1;return}!i||b.current||(v.current?.querySelector("[role=combobox]")?.focus(),b.current=!0)},[e,i]),g.useEffect(()=>{r.isSuccess&&!r.isFetching&&h(!1)},[r.isFetching,r.isSuccess]);const w=async F=>{if(!(!i||m.current||d||!i.choices.some(A=>A.value===F))){m.current=!0,o(!0),u(null),p(!1);try{const A=await dQe({value:F,queryClient:t});h(A==="readback-unknown"),p(A==="confirmed")}catch(A){u({value:F,message:A instanceof Error?A.message:""})}finally{m.current=!1,o(!1)}}},C=async()=>{const[F,A]=await Promise.all([r.refetch(),n.refetch()]);!F.isError&&!A.isError&&h(!1)},y=!r.data&&r.error||!n.data&&n.error,k=n.data&&(!s||r.data&&!i),_=!y&&!k&&!i,E=n.data?.features?.i18n?n.data.language:void 0,R=typeof E=="string"&&E!==""?E:void 0;return c.jsx(uQe,{title:x("ui.settings.language.dialog.title"),icon:uj,description:x("ui.settings.language.general.description"),children:c.jsxs("div",{ref:v,"data-setting-key":Ro,className:"flex flex-col gap-3","aria-busy":a,children:[_&&c.jsx("output",{className:"text-meta text-ink-dim",children:x("ui.settings.language.dialog.loading")}),k&&c.jsx("p",{className:"text-meta text-ink-dim",children:x("ui.settings.language.dialog.unavailable")}),i&&c.jsx(FB,{setting:{...oT(i),label:x("ui.settings.language.dialog.title")},value:String(i.value),onValueChange:F=>{w(F)},disabled:a||d,suppressEffectiveNote:!0}),c.jsx("output",{id:UQ(Ro),"aria-live":"polite",className:"text-meta text-ink-dim",children:a?x("ui.settings.language.general.pending"):f?x("ui.settings.language.general.saved"):R?x(d||n.error?"ui.settings.language.general.last_known":"ui.settings.language.general.effective",{locale:GQ(R)?.name??R}):x("ui.settings.language.general.no_resolution")}),(y||l||d)&&c.jsx(Qr,{variant:"danger",children:c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("p",{role:"alert",children:l?x("ui.settings.language.general.write_error",{message:l.message}):d?x("ui.settings.language.general.readback_error"):x("ui.settings.language.dialog.unavailable")}),c.jsx(ce,{variant:"outline",size:"sm",disabled:a||r.isFetching||n.isFetching,onClick:()=>{l?w(l.value):C()},children:x("ui.settings.language.dialog.retry")})]})})]})})},hQe=()=>{Et();const e=Tk(te=>te.open),t=Tk(te=>te.closeLanguage),n=nn(),s=jn(),r=yt(s.data,"settings"),i=fs({queryKey:rx.all,queryFn:()=>xt({op:"settings.list"}),enabled:e&&r,staleTime:1e4}),a=g.useRef(null),o=fB(),l=(i.data?.settings??[]).find(te=>te.key===Ro),u=l?oT(l):void 0,[d,h]=g.useState(null),[f,p]=g.useState(!1),[m,v]=g.useState(!1),[b,w]=g.useState(null),C=g.useRef(null);g.useEffect(()=>{e&&h(null)},[e]),g.useEffect(()=>{if(!e||!u)return;const te=String(u.value??"");(d===null||d===C.current)&&h(te),C.current=te},[e,u,d]),g.useEffect(()=>{e&&(v(!1),w(null))},[e]);const y=d??String(u?.value??""),k=!!u&&y!==String(u?.value??""),_=!u||!k||f,E=async()=>{if(!(!u||!k)){p(!0),w(null);try{await t$({value:y,queryClient:n}),v(!0),h(null),await i.refetch()}catch(te){w(te instanceof Error?te.message:x("ui.settings.configuration.language_dialog.the_language_could_not_be_saved"))}finally{p(!1)}}},R=!!s.data,F=R&&!r,A=s.error&&!s.data?s.error:null,N=A??i.error,M=!R&&!N,{sentence:D,remedy:L}=WQ(o??null,x("ui.settings.configuration.language_dialog.your_settings_could_not_be_loaded"),N),V=s.isFetching||i.isFetching,j=u?"combo":N?"retry":"none";return g.useEffect(()=>{!e||j==="none"||requestAnimationFrame(()=>{a.current?.querySelector(j==="combo"?'[role="combobox"]':"[data-language-retry]")?.focus()})},[e,j]),c.jsx(Kl,{open:e,onOpenChange:te=>!te&&t(),children:c.jsxs(Yl,{ref:a,onOpenAutoFocus:te=>te.preventDefault(),className:"max-w-[min(28rem,calc(100vw-4rem))] gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx(jo,{className:"text-title",children:x("ui.settings.language.dialog.title")}),c.jsx(ou,{className:"text-body-sm text-ink-muted",children:x("ui.settings.language.dialog.description")})]}),M?c.jsxs("div",{className:"flex items-center gap-2 text-body-sm text-ink-muted",children:[c.jsx(pn,{}),x("ui.settings.language.dialog.loading")]}):F?c.jsx(Qr,{variant:"warning",children:c.jsx("span",{children:x("ui.settings.language.dialog.unavailable")})}):N?c.jsx(Qr,{variant:"warning",children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{children:D}),L&&c.jsx(ce,{variant:"secondary",size:"sm",className:"shrink-0","data-language-retry":"",onClick:()=>{A?s.refetch():i.refetch()},disabled:V,children:V?x("ui.settings.language.dialog.retrying"):x("ui.settings.language.dialog.retry")})]})}):i.isPending?c.jsxs("div",{className:"flex items-center gap-2 text-body-sm text-ink-muted",children:[c.jsx(pn,{}),x("ui.settings.language.dialog.loading")]}):u?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{id:vF(Ro),className:"text-meta text-ink-dim",children:u.help}),c.jsx(FB,{setting:u,value:y,disabled:f,helpId:vF(Ro),effectiveNoteId:$Q(Ro,zQ),onValueChange:te=>{v(!1),h(te)}})]}),b&&c.jsx("p",{className:"text-meta text-danger",children:b}),c.jsx("div",{className:"flex min-h-8 items-center justify-end",children:m&&!k?c.jsxs("output",{"data-language-save":"",className:"inline-flex items-center gap-1.5 text-body-sm text-ink",children:[c.jsx(js,{"aria-hidden":"true",className:"size-3.5"}),x("ui.settings.language.dialog.saved")]}):c.jsx(ce,{onClick:E,disabled:_,"data-language-save":"",children:f?`${x("ui.settings.language.dialog.save")}...`:x("ui.settings.language.dialog.save")})})]}):c.jsx(Qr,{variant:"warning",children:c.jsx("span",{children:x("ui.settings.language.dialog.unavailable")})})]})})};function fQe(){const{data:e}=jn();g.useEffect(()=>{e&&M$(e)},[e]);const t=sT(),n=nn(),s=g.useRef(null);g.useEffect(()=>{const r=t.configChange;if(!r)return;const i=`${r.epoch}:${r.seq}`;s.current!==i&&r.changedKeys.includes(Ro)&&(s.current=i,n.invalidateQueries({queryKey:Bo.capabilities}),n.invalidateQueries({queryKey:Bo.settings}),!qQ()&&Ya(x("ui.settings.language.external_notice",{language:r.language}),{id:"i18n-language-external"}))},[t.configChange,n])}function pQe(e,t){if(e.defaultPrevented||e.repeat||e.isComposing||!(e.metaKey||e.ctrlKey))return null;const n=KQ(e);if(n===null)return null;const s=MZ(t.bindings).get(n);return s===void 0||rT(e.target)||!lue(n$(s),t.route)?null:s}const n$=e=>e.slice(6);function gQe(e){const t=Ce.getState(),n=t.activeDraftKey?t.drafts[t.activeDraftKey]:void 0,s=op(t.activeDraftKey,n?.sessionId,t.activeSessionId)??null;Uu(n$(e),{sessionId:s,askScope:s===null?"fleet":"session",via:"chord"})}function mQe(){g.useEffect(()=>{const e=t=>{const n=Ke.getState(),s=pQe(t,{bindings:n.shortcutBindings,route:n.rightSlotRoute});s!==null&&(t.preventDefault(),gQe(s))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[])}const vQe=""+new URL("radient-icon-1024x1024-D_JJedvo.png",import.meta.url).href,s$=cp()(VB(e=>({hasBeenNotified:!1,setHasBeenNotified:t=>{e({hasBeenNotified:t})}}),{name:"low-credits-storage"})),bQe=({open:e,onClose:t,onGoToConsole:n})=>{Et();const{setHasBeenNotified:s}=s$(),{prices:r,isLoading:i,error:a}=YQ(),o=d=>typeof d!="number"?"$...":x("ui.common.account.low_credits_dialog.detail",{detail:String(d.toFixed(2))}),l=()=>{s(!0),t()},u=()=>{s(!0),n()};return c.jsx(au,{open:e,onClose:l,title:c.jsxs(c.Fragment,{children:[c.jsx("img",{src:vQe,alt:x("ui.common.account.low_credits_dialog.radient_icon"),className:"size-7"}),x("ui.common.account.low_credits_dialog.running_low_on_radient_credits")]}),maxWidth:"sm",fullWidth:!1,actions:c.jsxs(c.Fragment,{children:[c.jsx(k0,{onClick:l,children:x("ui.common.account.low_credits_dialog.maybe_later")}),c.jsx(T0,{onClick:u,startIcon:c.jsx(_l,{size:18}),className:"min-w-55",children:x("ui.common.account.low_credits_dialog.get_more_credits")})]}),children:c.jsxs("div",{className:"flex flex-col items-center gap-4 py-2 text-center",children:[c.jsxs("p",{className:"text-body-sm text-ink-muted",children:[x("ui.common.account.low_credits_dialog.unlock_the_full_power_of_local_operator_with")," ",c.jsx("span",{className:"font-bold text-accent",children:x("ui.common.account.low_credits_dialog.radient_pass")}),"."]}),c.jsx("p",{className:"text-body-sm text-ink-muted",children:x("ui.common.account.low_credits_dialog.radient_automatic_is_often_cheaper_than_bringing_your_own_key_its")}),c.jsx("p",{className:"text-body-sm text-ink-muted",children:x("ui.common.account.low_credits_dialog.it_s_pay_as_you_go_with_no_commitments_load_up_what_you_need_star")}),c.jsxs("p",{className:"text-body-sm text-ink-muted",children:[x("ui.common.account.low_credits_dialog.plus_get")," ",c.jsx("span",{className:"font-medium text-ink",children:i?c.jsx(pn,{size:"sm",className:"mr-0.5 align-middle"}):o(r?.default_registration_credits)})," ",x("ui.common.account.low_credits_dialog.in_bonus_credits_with_your_first_purchase"),a&&c.jsx("span",{className:"mt-1 block text-meta text-danger",children:x("ui.common.account.low_credits_dialog.could_not_load_bonus_credit_information")})]}),c.jsx("p",{className:"text-meta text-ink-dim",children:x("ui.common.account.low_credits_dialog.you_can_also_reach_the_radient_console_from_settings_at_any_time")})]})})},xQe=(e,t)=>t?U1(e.filter(n=>n.session_id===t)).length:0;function wQe(e){return Ce(t=>xQe(t.sessions,e))}const CQe=(e,t)=>t?e.some(n=>n.session_id===t&&n.status?.code==="busy"):!1;function yQe(e){return Ce(t=>CQe(t.sessions,e))}const _Qe=[];function SQe(){const{state:e}=gC(),t=e?.pendingConsent??_Qe,n=n5(s=>GP(t,s));return g.useEffect(()=>{t.length>0&&HT()},[t]),GP(t,n)}const r$={approvals:["desktop","mesh","approvals"]},EQe=15e3,kQe=new Set(["requested","approved","connecting","failed"]);function TQe(e){return kQe.has(e)}function RQe(e){return e==="requested"}function AQe(e){return e.filter(t=>RQe(t.state)).length}function eet(e){return e.state==="requested"&&e.canApproveHere!==!1&&(e.kind==="device"||e.kind==="machine")}function tet(e){return TQe(e)}function net(e){switch(e){case"requested":return x("ui.mesh.mesh_approvals.waiting_for_you");case"approved":return x("ui.mesh.mesh_approvals.approved");case"connecting":return x("ui.mesh.mesh_approvals.connecting");case"connected":return x("ui.mesh.mesh_approvals.connected");case"denied":return x("ui.mesh.mesh_approvals.denied");case"expired":return x("ui.mesh.mesh_approvals.expired");case"failed":return x("ui.mesh.mesh_approvals.failed");default:return e}}function Dc(e){return typeof e=="object"&&e!==null}function FQe(e){const t=Dc(e)?e:{};return{deviceId:Ft(t.device_id),name:Ft(t.name),host:Ft(t.host),user:Ft(t.user),transport:Ft(t.transport),hostKeyFp:Ft(t.host_key_fp)}}function DQe(e){const t=Dc(e)?e:{};return{connect:Mo(t.connect,!1),install:Mo(t.install,!1),anchor:Dc(t.anchor),networkId:Ft(t.network_id),role:Ft(t.role),unattended:Mo(t.unattended,!1),grants:jf(t.grant)}}function PQe(e){const t=Array.isArray(e)?e:e?.approvals??[];if(!Array.isArray(t))return[];const n=[];for(const s of t){if(!Dc(s))continue;const r=Ft(s.approval_id),i=Ft(s.state);if(!r||!i)continue;const a=Dc(s.what)&&Object.prototype.hasOwnProperty.call(s.what,"credential_inheritance"),o=Object.prototype.hasOwnProperty.call(s,"kind")?Ft(s.kind):void 0,l=a||o==="credential_inheritance"?"credential":o!==void 0&&!["device_onboard","local_authority"].includes(o)?"unknown":!Dc(s.device)&&Dc(s.machine)?"machine":"device",u=Dc(s.requested_by)?s.requested_by:{};n.push({approvalId:r,state:i,kind:l,summary:Ft(s.summary)||void 0,details:Array.isArray(s.details)&&s.details.every(d=>typeof d=="string")?s.details.slice():void 0,canApproveHere:Object.prototype.hasOwnProperty.call(s,"can_approve_here")?s.can_approve_here===!0:void 0,approveRemedy:Ft(s.approve_remedy)||void 0,where:FQe(l==="machine"?s.machine:s.device),what:DQe(s.what),requestedBy:{surface:Ft(u.surface),sessionId:Ft(u.session_id),deviceId:Ft(u.device_id)},expiresAt:Oc(s.expires_at)})}return n}function IQe(e){return e.kind==="machine"?x("ui.mesh.mesh_approvals.this_machine"):S5({device_id:e.where.deviceId,name:e.where.name})}function set(e,t){if(e.kind==="credential"||e.kind==="unknown"||e.canApproveHere===!1){if(e.summary)return e.summary;if(e.kind==="credential"||e.kind==="unknown")return r4(e)}const n=r4(e),s=MQe(e,t).map(r=>r.clause);return s.length?x("ui.mesh.mesh_approvals.approval_title_with_clauses",{head:n,clauses:NQe(s)}):x("ui.mesh.mesh_approvals.approval_title",{head:n})}function r4(e){return e.kind==="credential"?e.summary||x("ui.mesh.approval.credential_title"):e.kind==="unknown"?e.summary||x("ui.mesh.approval.unknown_title"):e.canApproveHere===!1&&e.summary?e.summary:e.kind==="machine"?x("ui.mesh.mesh_approvals.set_up_operator_authority_on_this_machine"):x("ui.mesh.mesh_approvals.onboard_subject",{subject:IQe(e)})}function NQe(e){return e.length===1?e[0]:x("ui.mesh.mesh_approvals.join_clauses",{clauses:e.slice(0,-1).join(", "),last:e[e.length-1]})}function ret(e){if(e.kind==="credential"||e.kind==="unknown")return null;const{user:t,host:n,transport:s,name:r}=e.where,i=[n?t?`${t}@${n}`:n:"",s?x("ui.mesh.mesh_approvals.via_transport",{transport:s}):"",r&&r!==n?`(${r})`:""].filter(Boolean);return i.length?i.join(" "):null}function iet(e){return e.kind==="credential"||e.kind==="unknown"?null:e.where.hostKeyFp||null}function aet(e){const{surface:t,sessionId:n}=e.requestedBy,s=[t||"",n?x("ui.mesh.mesh_approvals.session_suffix",{suffix:n.slice(-6)}):""].filter(Boolean);return s.length?x("ui.mesh.mesh_approvals.asked_by",{requester:s.join(" · ")}):null}function MQe(e,t){if(e.kind==="credential"||e.kind==="unknown")return[];const{connect:n,install:s,anchor:r,networkId:i,role:a,unattended:o,grants:l}=e.what,u=[];if(n&&u.push({term:"connect",clause:e.where.transport?x("ui.mesh.mesh_approvals.connect_over",{transport:e.where.transport}):x("ui.mesh.mesh_approvals.connect_to_it"),consequence:e.where.transport?x("ui.mesh.mesh_approvals.may_connect_over",{transport:e.where.transport}):x("ui.mesh.mesh_approvals.this_machine_may_connect_to_it")}),s&&u.push({term:"install",clause:e.kind==="machine"?x("ui.mesh.mesh_approvals.install_local_operator"):x("ui.mesh.mesh_approvals.install_local_operator_there"),consequence:e.kind==="machine"?x("ui.mesh.mesh_approvals.local_operator_is_installed_on_this_machine"):x("ui.mesh.mesh_approvals.local_operator_is_installed_on_it")}),r&&u.push({term:x("ui.mesh.mesh_approvals.install_operator_anchor"),clause:x("ui.mesh.mesh_approvals.check_approvals_signed_on_your_machines"),consequence:x("ui.mesh.mesh_approvals.that_device_can_check_approvals_signed_on")}),i){const d=t?.get(i),h=x("ui.mesh.mesh_approvals.join_network",{network:d||i,role:a||"?"});u.push({term:h,clause:h,consequence:x("ui.mesh.mesh_approvals.joins_network",{network:d||i,role:a||"?"})})}o&&u.push({term:x("ui.mesh.mesh_approvals.trust_unattended_sessions"),clause:x("ui.mesh.mesh_approvals.run_sessions_there_without_an_approval_prompt"),consequence:x("ui.mesh.mesh_approvals.sessions_you_start_on_that_device_run")});for(const d of OQe(l,o)){const h=LQe()[d];u.push({term:h?.term??x("ui.mesh.mesh_approvals.grant_capability",{grant:d}),clause:BQe()[d]??x("ui.mesh.mesh_approvals.use_capability",{grant:d}),consequence:h?.gloss??x("ui.mesh.mesh_approvals.may_use_capability",{grant:d})})}return u}function OQe(e,t){const n=new Set;for(const s of e){const r=String(s??"").trim();r&&(t&&r==="unattended"||n.add(r))}return[...n]}const LQe=()=>({unattended:{term:x("ui.mesh.mesh_approvals.trust_unattended_sessions"),gloss:x("ui.mesh.mesh_approvals.sessions_you_start_on_that_device_run")},broker_credential:{term:x("ui.mesh.mesh_approvals.borrow_logins_there"),gloss:x("ui.mesh.mesh_approvals.your_sessions_may_use_the_logins_stored")}}),BQe=()=>({list:x("ui.mesh.mesh_approvals.see_its_sessions"),view:x("ui.mesh.mesh_approvals.watch_a_session_there"),prompt:x("ui.mesh.mesh_approvals.send_prompts_to_a_session_there"),steer:x("ui.mesh.mesh_approvals.steer_a_running_turn_there"),stop:x("ui.mesh.mesh_approvals.stop_a_session_there"),slash:x("ui.mesh.mesh_approvals.run_slash_commands_there"),delete:x("ui.mesh.mesh_approvals.archive_or_delete_a_session_there"),move:x("ui.mesh.mesh_approvals.move_sessions_to_or_from_there"),broker_credential:x("ui.mesh.mesh_approvals.borrow_the_logins_stored_there"),approve:x("ui.mesh.mesh_approvals.answer_approval_prompts_there"),unattended:x("ui.mesh.mesh_approvals.run_sessions_there_without_an_approval_prompt")});function oet(e,t){if(e===null||e<=0)return null;const n=e-t;if(n<=0)return null;if(n<60)return x("ui.mesh.mesh_approvals.expires_in_under_a_minute");const s=Math.ceil(n/60);if(s<90)return x("ui.mesh.mesh_approvals.expires_minutes",{count:s});const r=Math.ceil(s/60);return x("ui.mesh.mesh_approvals.expires_hours",{count:r})}function jQe(e,{poll:t=!0}={}){return fs({queryKey:r$.approvals,enabled:e,queryFn:async()=>PQe(await xt({op:"approvals.list"})),retry:!1,staleTime:t?1e4:Number.POSITIVE_INFINITY,refetchInterval:e&&t?EQe:!1,refetchOnWindowFocus:t})}function cet(){const e=nn();return Kn({mutationFn:async t=>{const n=t.decision==="approve"?{op:"approvals.approve",approvalId:t.approvalId}:{op:"approvals.deny",approvalId:t.approvalId};await xt(n)},onSettled:()=>{e.invalidateQueries({queryKey:r$.approvals}),e.invalidateQueries({queryKey:Hl.networks}),e.invalidateQueries({queryKey:Hl.peers})}})}function uet(e){const t=e?.message;return typeof t=="string"&&t.trim()?t.trim():x("ui.mesh.mesh_approvals.the_approvals_could_not_be_read")}function det(e){const t=e;return{code:Ft(t?.code)||"approval_refused",sentence:Ft(t?.message)||x("ui.mesh.mesh_approvals.decision_could_not_be_answered")}}const i4=e=>{const t=JQ(e.type),n=typeof e.percent=="number"?`, ${Math.round(e.percent)}%`:"";return`${t} in progress${n}.`},i$=e=>QQ({type:e.type,version:e.offer.version}),HQe=e=>`${e.map(s=>i$(s)).map((s,r)=>r===0?s:`${s.charAt(0).toLowerCase()}${s.slice(1)}`).join(" and ")} available. Show the update notice.`,UQe=({surfaces:e,inflight:t,onShow:n,onDismiss:s})=>{if(Et(),t===null&&e.length===0)return null;if(t!==null)return c.jsx(Ze,{side:"top",collisionPadding:8,content:i4(t),children:c.jsx("output",{"data-update-foot-icon":"","data-update-foot-icon-state":"inflight","aria-label":i4(t),className:"flex size-8 shrink-0 items-center justify-center text-accent",children:c.jsx(Wi,{className:"size-4 shrink-0 motion-safe:animate-spin","aria-hidden":"true"})})});const r=e.find(i=>(i.offer.summary??"").trim()!=="");return c.jsx(Ze,{side:"top",collisionPadding:8,content:c.jsxs("div",{className:"flex max-w-64 flex-col gap-0.5",children:[e.map(i=>c.jsxs("span",{className:"truncate text-ink",children:[i$(i)," ",x("ui.common.updates.update_foot_icon.available")]},i.type)),r?c.jsx("span",{className:"truncate text-ink-muted",children:(r.offer.summary??"").trim()}):null,c.jsx("span",{className:"whitespace-nowrap text-ink-muted",children:x("ui.common.updates.update_foot_icon.show_the_update_notice")})]}),children:c.jsx("button",{type:"button","data-update-foot-icon":"","data-update-foot-icon-state":"available","aria-label":HQe(e),onClick:n,onKeyDown:i=>{i.key!=="Escape"||!s||(i.stopPropagation(),s())},className:T("flex size-8 shrink-0 items-center justify-center rounded-sm text-accent","transition-colors duration-fast ease-out-quart","hover:bg-row-hover hover:text-ink"),children:c.jsx(tT,{className:"size-4 shrink-0","aria-hidden":"true"})})})},a4=()=>{const e=Ys(p=>p.followed),t=Ys(p=>p.running),n=Ys(p=>p.offers),s=Ys(p=>p.detailOpen),r=Ys(p=>p.inflight),i=Ys(p=>p.downloadPercent),a=Ys(p=>p.openNotice),o=Ys(p=>p.noticeOpen),l=Ys(p=>p.dismissNotice),u=g.useMemo(()=>{const p={followed:e,running:t,offers:n,detailOpen:s};return v4.filter(m=>XQ(p,m)).map(m=>{const v=n[m];return v?{type:m,offer:v}:null}).filter(m=>m!==null)},[e,t,n,s]),d=g.useMemo(()=>r[ln.BACKEND]?{type:ln.BACKEND,percent:null}:r[ln.UI]?{type:ln.UI,percent:i[ln.UI]}:null,[r,i]),h=g.useCallback(()=>a(),[a]),f=g.useCallback(()=>l(),[l]);return c.jsx(UQe,{surfaces:u,inflight:d,onShow:h,onDismiss:o?f:void 0})},o4=({expanded:e})=>(Et(),c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(F4,{className:"size-6",label:e?void 0:x("ui.shell.collapsible_app_logo.local_operator")}),e&&c.jsx("span",{className:"truncate font-semibold text-body text-ink",children:x("ui.shell.collapsible_app_logo.local_operator")})]})),Nk=$e.memo(({expanded:e,useAuth:t=!1})=>{Et();const n=ti(),{user:s,isAuthenticated:r,accountRead:i,signOut:a}=DB(),o=i==="checking"?x("ui.shell.user_profile_sidebar.checking_account"):bF(i)?x("ui.shell.user_profile_sidebar.account_unavailable"):null,l=s?.name??o??x("ui.shell.user_profile_sidebar.user"),u=bF(i),d=s?.email??"",h=u?x("ui.shell.user_profile_sidebar.reconnect_radient"):d,f=u?"/settings?section=providers&provider=radient":"/settings",p=u?x("ui.shell.user_profile_sidebar.reconnect_radient"):x("ui.shell.user_profile_sidebar.account_settings"),m=g.useCallback(async()=>{r&&(await a(),window.location.reload())},[r,a]),v=g.useMemo(()=>{const C=s?.name;return C?C.split(" ").map(y=>y.charAt(0)).join("").toUpperCase().substring(0,2):null},[s?.name]),b=c.jsxs("button",{type:"button",onClick:t?void 0:()=>n(f),"aria-label":e?void 0:p,className:T("flex w-full min-w-0 items-center gap-2 rounded-sm transition-colors duration-fast ease-out-quart hover:bg-row-hover",e?"px-2 py-1.5":"justify-center py-1.5"),children:[c.jsx(HB,{className:"size-7 shrink-0",children:c.jsx(UB,{className:"border border-control bg-elevated text-ink",children:v??c.jsx(Mre,{size:14,"aria-hidden":"true"})})}),e&&l&&c.jsxs("span",{className:"min-w-0 text-left",children:[c.jsx("span",{className:"block truncate text-body-sm text-ink",children:l}),h&&c.jsx("span",{className:T("block truncate text-meta",u?"text-accent":"text-ink-dim"),children:h})]})]}),w=e?b:c.jsx(Ze,{content:p,side:"right",children:b});return t?c.jsxs(Ll,{children:[e?c.jsx(Ho,{asChild:!0,children:b}):c.jsx(Ze,{content:p,side:"right",children:c.jsx(Ho,{asChild:!0,children:b})}),c.jsxs(Bl,{align:"end",side:"top",className:"min-w-50",children:[u?c.jsxs(Gt,{onSelect:()=>n(f),children:[c.jsx(OB,{size:16,"aria-hidden":"true"}),x("ui.shell.user_profile_sidebar.reconnect_radient")]}):null,c.jsxs(Gt,{onSelect:()=>n("/settings"),children:[c.jsx(Mc,{size:16,"aria-hidden":"true"}),x("ui.shell.user_profile_sidebar.settings")]}),c.jsxs(Gt,{children:[c.jsx(sre,{size:16,"aria-hidden":"true"}),x("ui.shell.user_profile_sidebar.privacy_and_security")]}),c.jsx(Jr,{}),c.jsxs(Gt,{onSelect:m,className:"text-danger focus:bg-danger-wash focus:text-danger",children:[c.jsx(Ese,{size:16,"aria-hidden":"true"}),x("ui.shell.user_profile_sidebar.sign_out")]})]})]}):w});Nk.displayName="UserProfileSidebar";const GQe=()=>{const e=sT(),t=jn(),n=Ce(u=>u.setCataloguePageable),s=Ce(u=>u.setCatalogueActivityHead),r=Ce(u=>u.fetchSessions),i=yt(t.data,"session_catalogue_page"),a=yt(t.data,"session_catalogue_sort");g.useEffect(()=>{n(i)},[i,n]),g.useEffect(()=>{s(a)},[a,s]);const o=va(t.data,"session_catalogue",2)==="enabled",l=g.useCallback(()=>r(i?rB:Hw,i),[r,i]);return g.useEffect(()=>{o&&l()},[o,l,e.catalogueRevision]),null},VQe="flex h-[30px] w-full items-center gap-2 rounded-md px-2 text-body-sm transition-colors duration-fast ease-out-quart",WQe=()=>{Et();const e=ti(),t=Nae(),{expanded:n,mode:s,onCollapse:r}=ZQ(),i=Ke(le=>le.openCommandPalette),a=jn(),o=Ce(le=>le.activeSessionId),l=SQe(),u=va(a.data,"peers")==="enabled",d=YT(u),h=va(a.data,"approvals")==="enabled",f=jQe(d==="member"&&h,{poll:!0}),p=AQe(f.data??[]),m=yt(a.data,"projects",1),v=yt(a.data,"aida",1),b=B0(v),w=v&&b.data?.enabled===!0,C=b.data?.name??"Aida",y=ile(),k=wQe(b.data?.session_id),_=yQe(b.data?.session_id),E=()=>{y(e,b.data).catch(le=>zt(Ph(le)))},R=[...w?[{icon:Nne,label:C,path:"/chat",isActive:t==="chat"&&!!b.data?.session_id&&o===b.data?.session_id,tourTag:"nav-item-aida",onSelect:E,attention:k,attentionTag:"nav-aida-badge",attentionName:le=>x("ui.shell.sidebar_navigation.aida_missed",{name:C,count:le}),working:_,workingName:x("ui.shell.sidebar_navigation.aida_working",{name:C})}]:[],{icon:Uo,label:x("ui.shell.sidebar_navigation.agents"),path:"/agents",isActive:t==="agents",tourTag:"nav-item-agents"},...m?[{icon:cj,label:x("ui.shell.sidebar_navigation.projects"),path:"/projects",isActive:t==="projects",tourTag:"nav-item-projects"}]:[],{icon:oj,label:x("ui.shell.sidebar_navigation.schedules"),path:"/schedules",isActive:t==="schedules",tourTag:"nav-item-schedules"},{icon:Xc,label:x("ui.shell.sidebar_navigation.browser"),path:"/browser",isActive:t==="browser",tourTag:"nav-item-browser",attention:l,attentionTag:"nav-browser-badge",attentionName:le=>x("ui.shell.sidebar_navigation.browser_waiting",{count:le,countText:String(le)})},{icon:vj,label:x("ui.shell.sidebar_navigation.agent_hub"),path:"/agent-hub",isActive:t==="agent-hub",tourTag:"nav-item-agent-hub"},...d==="member"?[{icon:yB,label:x("ui.shell.sidebar_navigation.mesh"),path:"/mesh",isActive:t==="mesh",tourTag:"nav-item-mesh",attention:p,attentionTag:"nav-mesh-badge",attentionName:le=>x("ui.shell.sidebar_navigation.mesh_waiting",{count:le,countText:String(le)})}]:[]],F=c.jsx(l$e,{selectedConversation:o??void 0,onSelectConversation:le=>void dp(e,le),onStageDraft:(le,q)=>{Ce.getState().stageDraft(le,q),e("/chat")}}),A=le=>{const q=le.attention??0,we=q>0&&le.attentionName?le.attentionName(q):le.label;return le.working&&le.workingName?le.workingName:we},N=le=>{const q=le.attention??0,we=A(le),B=le.isActive?yo:"text-ink-muted hover:bg-row-hover hover:text-ink",be=c.jsx(le.icon,{size:16,"aria-hidden":"true",className:T("shrink-0",le.isActive&&"text-accent")});return c.jsx("li",{className:T("flex h-[30px] w-full items-center rounded-md","transition-colors duration-fast ease-out-quart",B),children:c.jsxs("button",{type:"button",onClick:()=>le.onSelect?le.onSelect():e(le.path),"data-tour-tag":le.tourTag,"aria-current":le.isActive?"page":void 0,"aria-label":n&&we===le.label?void 0:we,className:T("flex h-full min-w-0 flex-1 items-center gap-2 rounded-md",n?"px-2":"justify-center px-0"),children:[n?be:c.jsxs("span",{className:"relative flex size-7 shrink-0 items-center justify-center",children:[be,q>0&&c.jsx("span",{className:"pointer-events-none absolute -top-0.5 -right-0.5 flex",children:c.jsx(jl,{variant:"attentionQuiet",shape:"pill",size:"count",className:"h-3.5 min-w-3.5 px-0.75 leading-none","data-tour-tag":le.attentionTag,children:q})})]}),n&&c.jsx("span",{className:"truncate",children:le.label}),n&&q>0&&c.jsx("span",{className:"ml-auto inline-flex",children:c.jsx(jl,{variant:"attentionQuiet",shape:"pill",size:"count","data-tour-tag":le.attentionTag,children:q})}),le.working&&c.jsx("span",{className:T(n&&"ml-auto","inline-flex"),children:c.jsx(Wi,{size:16,"aria-hidden":"true",className:"text-accent motion-safe:animate-spin"})})]})},le.tourTag)},M=le=>n?N(le):c.jsx("li",{children:c.jsx(Ze,{content:A(le),side:"right",children:N(le)})},le.tourTag),D=s==="overlay"?x("ui.shell.sidebar_navigation.close_sidebar"):n?x("ui.shell.sidebar_navigation.collapse_sidebar"):x("ui.shell.sidebar_navigation.expand_sidebar"),L=s==="overlay"?Pn:n?vd:ba,V=navigator.platform.toUpperCase().indexOf("MAC")>=0,j=yt(a.data,"session_catalogue",2),te=Ce(le=>le.activeDraftKey),X=Ce(le=>le.drafts),re=!!te&&!(te?X[te]:void 0)?.target,G=()=>{Ce.getState().stageDraft(void 0,!0),e("/chat")},J=x("ui.shell.sidebar_navigation.new_chat_shortcut",{shortcut:v3(V).replace("+","")}),ae=x("ui.shell.sidebar_navigation.search_accessible",{everything:ko("everything",V),chats:ko("chats",V)}),O=x("ui.shell.sidebar_navigation.search_tooltip",{everything:ko("everything",V),chats:ko("chats",V)}),U=(le,q,we,B)=>{const be=le;return c.jsxs("button",{type:"button",...B.attrs,onClick:B.onClick,disabled:B.disabled,"aria-label":B.ariaLabel,"aria-current":B.current?"page":void 0,className:T(VQe,B.current?yo:"text-ink-muted hover:bg-row-hover hover:text-ink","disabled:text-ink-disabled disabled:hover:bg-transparent"),children:[c.jsx(be,{size:16,"aria-hidden":"true",className:"shrink-0"}),c.jsx("span",{className:"truncate",children:q}),c.jsx("span",{"aria-hidden":"true",className:"ml-auto",children:c.jsx(Sr,{shortcut:we,joined:!0})})]})},P=U(WS,x("ui.shell.sidebar_navigation.new_chat"),v3(V),{onClick:G,ariaLabel:J,current:re,disabled:!j,attrs:{"data-tour-tag":"nav-item-chat","data-new-chat-row":""}}),z=U(bd,x("ui.shell.sidebar_navigation.search"),fqe("everything",V),{onClick:i,ariaLabel:ae,attrs:{"data-command-palette-trigger":"",title:O}}),ne=(le,q,we)=>{const B=le;return c.jsx(Ze,{content:q,side:"right",children:c.jsx("button",{type:"button",...we.attrs,onClick:we.onClick,disabled:we.disabled,"aria-label":q,className:T("flex size-8 items-center justify-center rounded-sm text-ink-muted","transition-colors duration-fast ease-out-quart","hover:bg-row-hover hover:text-ink","disabled:text-ink-disabled disabled:hover:bg-transparent"),children:c.jsx(B,{size:16,"aria-hidden":"true"})})})},fe=c.jsx("div",{className:T(s!=="overlay"&&T("pointer-events-none opacity-0 transition-opacity duration-fast ease-out-quart","group-hover/sidebar:pointer-events-auto group-hover/sidebar:opacity-100","group-focus-within/sidebar:pointer-events-auto group-focus-within/sidebar:opacity-100")),children:c.jsx(Ze,{content:D,side:"right",children:c.jsx(ce,{variant:"ghost",size:"icon-sm",onClick:r,"aria-label":D,"aria-expanded":s==="overlay"?void 0:n,"aria-keyshortcuts":VF(V),children:c.jsx(L,{"aria-hidden":"true"})})})}),ue=c.jsx(Ze,{content:x("ui.shell.sidebar_navigation.settings"),side:"top",children:c.jsx("button",{type:"button","data-tour-tag":"nav-item-settings",onClick:()=>e("/settings"),"aria-current":t==="settings"?"page":void 0,"aria-label":x("ui.shell.sidebar_navigation.settings"),className:T("flex size-8 shrink-0 items-center justify-center rounded-sm text-ink-muted","transition-colors duration-fast ease-out-quart","hover:bg-row-hover hover:text-ink",t==="settings"&&"text-ink"),children:c.jsx(Mc,{size:16,"aria-hidden":"true"})})});return n?c.jsxs("div",{"data-sidebar-shell":"","data-glass-region":"sidebar",className:"group/sidebar flex h-full min-h-0 flex-col overflow-hidden bg-surface",children:[c.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 pr-2 pl-4",children:[c.jsx(o4,{expanded:!0}),c.jsx("span",{className:"ml-auto",children:fe})]}),c.jsxs("div",{className:"flex shrink-0 flex-col gap-2 px-2 pb-2",children:[c.jsxs("div",{className:"flex flex-col gap-0.5",children:[P,z]}),c.jsx("ul",{className:"flex flex-col gap-0.5",children:R.map(M)})]}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:F}),c.jsxs("div",{className:"flex min-h-10 shrink-0 items-center justify-between gap-1 px-2 pb-2",children:[c.jsx(Nk,{expanded:!0}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(a4,{}),ue]})]})]}):c.jsxs("div",{"data-sidebar-strip":"","data-glass-region":"sidebar",className:"group/sidebar flex h-full min-h-0 flex-col items-center bg-surface",children:[c.jsx(GQe,{}),c.jsx("div",{className:"flex h-10 shrink-0 items-center justify-center",children:c.jsx(o4,{expanded:!1})}),c.jsxs("ul",{className:"flex flex-col items-center gap-1",children:[c.jsx("li",{children:ne(ba,D,{onClick:r,attrs:{"aria-expanded":!1,"aria-keyshortcuts":VF(V)}})}),c.jsx("li",{children:ne(WS,J,{onClick:G,disabled:!j,attrs:{"data-tour-tag":"nav-item-chat"}})}),c.jsx("li",{children:ne(bd,ae,{onClick:i,attrs:{"data-command-palette-trigger":""}})})]}),c.jsx("ul",{className:"mt-4 flex flex-col items-center gap-1",children:R.map(M)}),c.jsxs("div",{className:"mt-auto flex flex-col items-center gap-1 pb-2",children:[c.jsx(a4,{}),ue,c.jsx(Nk,{expanded:!1})]})]})},$Qe=1,zQe=()=>{const{isAuthenticated:e,user:t}=DB(),{hasBeenNotified:n,setHasBeenNotified:s}=s$(),[r,i]=g.useState(!1),[a,o]=g.useState(null),l=g.useCallback(async()=>{if(!(!e||!t?.radientUser?.account?.tenant_id))try{const f=await eJ({operation:"credits",tenantId:t.radientUser.account.tenant_id});if(!f||typeof f.balance!="number")throw new Error("Invalid credit balance response format");o(f.balance)}catch(f){console.error("Failed to fetch Radient credits:",f),o(null)}},[e,t?.radientUser?.account?.tenant_id]);return g.useEffect(()=>{e&&l()},[e,l]),g.useEffect(()=>{e&&a!==null?a<$Qe?n||i(!0):(i(!1),n&&s(!1)):i(!1)},[e,n,a,s]),{isLowCreditsDialogOpen:r,openRadientConsole:()=>{window.api?.openExternal?window.api.openExternal("https://console.radienthq.com"):window.open("https://console.radienthq.com","_blank"),s(!0),i(!1)},closeLowCreditsDialog:()=>{i(!1)},onLowCreditsDialogClose:()=>{s(!0),i(!1)},currentCredits:a}};function qQe(){const e=ti();g.useEffect(()=>{const t=r=>{e(r==="back"?-1:1)},n=r=>{const i=$he(r);i&&(r.preventDefault(),t(i))},s=r=>{const i=zhe(r);i&&(r.preventDefault(),t(i))};return window.addEventListener("keydown",n),window.addEventListener("mouseup",s),()=>{window.removeEventListener("keydown",n),window.removeEventListener("mouseup",s)}},[e])}function KQe(){const e=navigator.windowControlsOverlay;if(!e?.getTitlebarAreaRect)return null;try{const t=e.getTitlebarAreaRect();return t.width<=0&&t.height<=0?null:{x:t.x,y:t.y,width:t.width,height:t.height}}catch{return null}}function YQe(e,t,n){const s=document.documentElement;if(t==="mac"){s.dataset.chromeLeading="true",s.dataset.chromeTrailing="false";return}if(e===null){s.dataset.chromeLeading="false",s.dataset.chromeTrailing="false";return}s.dataset.chromeLeading=e.x<=1?"true":"false",s.dataset.chromeTrailing=Math.abs(e.x+e.width-n)<=1?"true":"false"}function XQe(e){const t=window.api?.windowChrome;if(!t)return;const n=getComputedStyle(document.documentElement),s=n.getPropertyValue("--lo-canvas").trim(),r=n.getPropertyValue("--lo-ink-muted").trim(),i=n.getPropertyValue("--lo-ink-dim").trim();!s||!r||!i||t.report({themeId:e,colors:{ground:s,symbol:r,symbolInactive:i}})}function QQe(){g.useLayoutEffect(()=>{if(!window.api?.windowChrome)return;const t=document.documentElement.dataset.chromePlatform??"linux",n=()=>YQe(KQe(),t,window.innerWidth);n();const s=navigator.windowControlsOverlay;return s?.addEventListener?.("geometrychange",n),window.addEventListener("resize",n),()=>{s?.removeEventListener?.("geometrychange",n),window.removeEventListener("resize",n)}},[]),g.useEffect(()=>{const e=window.api?.windowChrome;if(e)return e.onState(t=>{document.documentElement.dataset.chromeFullscreen=t.fullScreen?"true":"false"})},[])}const JQe=g.lazy(()=>ql(()=>import("./agent-details-page-CLbcLEwm.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url).then(e=>({default:e.AgentDetailsPage}))),ZQe=g.lazy(()=>ql(()=>import("./agent-hub-page-Bf5Aw-Jn.js"),__vite__mapDeps([14,1,2,4,5,6,7,15,3,8,9,10,11,16,17,18,19,12,13]),import.meta.url).then(e=>({default:e.AgentHubPage}))),l4=g.lazy(()=>ql(()=>import("./agents-page-BpaQBOFJ.js"),__vite__mapDeps([20,4,1,2,5,6,7,8,16,12,13]),import.meta.url).then(e=>({default:e.AgentsPage}))),eJe=g.lazy(()=>ql(()=>import("./schedules-page-BMY6s4UJ.js"),__vite__mapDeps([21,1,2,4,5,6,7,15,18,10,22,12,13]),import.meta.url).then(e=>({default:e.SchedulesPage}))),c4=g.lazy(()=>ql(()=>import("./projects-page-CV3ap9Ch.js"),__vite__mapDeps([23,1,2,4,5,6,7,15,24,12,13]),import.meta.url).then(e=>({default:e.ProjectsPage}))),tJe=g.lazy(()=>ql(()=>import("./browser-page-CKyYrwF0.js"),__vite__mapDeps([25,1,2,4,5,6,7,12,13]),import.meta.url).then(e=>({default:e.BrowserPage}))),nJe=g.lazy(()=>ql(()=>import("./mesh-page-BhfRHXQS.js"),__vite__mapDeps([26,1,2,4,5,6,7,15,12,13]),import.meta.url).then(e=>({default:e.MeshPage}))),sJe=g.lazy(()=>ql(()=>import("./settings-page-CVUD4U35.js"),__vite__mapDeps([27,1,2,4,5,6,7,15,17,28,11,22,10,18,12,13]),import.meta.url).then(e=>({default:e.SettingsPage}))),rJe=g.lazy(()=>ql(()=>import("./browser-webauthn-prompt-CJ6FJJMN.js"),__vite__mapDeps([29,1,2,5,6,4,7,12,13]),import.meta.url).then(e=>({default:e.BrowserWebauthnPrompt}))),iJe=()=>{Et(),QQe(),fQe();const{pathname:e}=nT(),t=e.startsWith("/chat")||e.startsWith("/browser"),{isOnboardingActive:n}=Pae(),{isLowCreditsDialogOpen:s,openRadientConsole:r,onLowCreditsDialogClose:i}=zQe(),{isCommandPaletteOpen:a,isCreateAgentDialogOpen:o,isSidebarCollapsed:l,closeCreateAgentDialog:u}=Ke();Sl(a,"command-palette"),Sl(o,"create-agent-dialog"),Sl(n,"onboarding"),Sl(s,"low-credits");const d=ti(),h=jn(),f=yt(h.data,"session_catalogue",2),p=yt(h.data,"session_archive");g.useEffect(()=>{Ce.getState().requestArchiveConfirm(null)},[e]);const m=va(h.data,"peers"),v=E=>{Ce.getState().stageDraft({kind:"agent",name:E.name}),d("/chat"),u()};Oqe(),mQe(),wqe(),qQe(),Ffe();const b=Ce(E=>E.setActiveSession),w=Ce(E=>{const R=E.activeDraftKey?E.drafts[E.activeDraftKey]:void 0;return op(E.activeDraftKey,R?.sessionId,E.activeSessionId)}),C=boe({displayedSessionId:w,archiveEnabled:p}),y=Ke(E=>E.setConsolePaneOpen),k=Ke(E=>E.setBrowserPaneOpen),_=Ke(E=>E.setConsoleActiveSurface);return g.useEffect(()=>{const E=window.api?.desktop?.onOpenConversation?.((R,F)=>{R!==null&&performance.mark("lop:open:requested"),b(R),F!==void 0&&R!==null&&(_(F),y(!0)),d("/chat")});return()=>E?.()},[d,b,y,_]),g.useEffect(()=>{const E=window.api?.console?.onReveal?.(R=>{R.mode!=="none"&&(R.mode==="session"&&R.session_id!==w||(R.mode==="open"&&b(R.session_id),_(R.surface),y(!0)))});return()=>E?.()},[w,b,y,_]),Qoe(),aqe(),g.useEffect(()=>{const E=window.api?.browser?.onConsentAttention?.(R=>{const F=yoe(R.requesterSessionId,Ce.getState().sessions);if(xoe(R.entryId),F.kind==="browser"){d("/browser");return}b(F.sessionId),k(!0),d("/chat")});return()=>E?.()},[d,b,k]),g.useEffect(()=>{const E=R=>{n||f&&lqe(R)&&(R.preventDefault(),Ce.getState().stageDraft(void 0,!0),d("/chat"))};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[f,n,d]),c.jsx(lQe,{children:c.jsx("div",{className:"relative flex h-screen flex-col overflow-hidden","data-titlebar-sidebar-collapsed":l?"true":"false",children:c.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[a&&c.jsx(Pqe,{}),c.jsx(cqe,{}),c.jsx(tJ,{}),c.jsx(Lqe,{enabled:m==="enabled"}),c.jsx(DKe,{open:n}),c.jsx(cQe,{}),c.jsx(hQe,{}),p&&c.jsx(tle,{}),c.jsx(soe,{}),c.jsx(g.Suspense,{fallback:null,children:c.jsx(rJe,{})}),c.jsx(hoe,{blocked:n||s||a||o||C,sessionId:e.startsWith("/chat")?w??null:null}),c.jsx(bQe,{open:s,onClose:i,onGoToConsole:r}),c.jsx(Lae,{open:o,onClose:u,onAgentCreated:v}),c.jsx(nJ,{sidebar:c.jsx(WQe,{}),content:c.jsxs("main",{"data-glass-region":"canvas-backing",className:"flex grow flex-col overflow-hidden",children:[t?null:c.jsx("div",{"data-chrome-route-band":""}),c.jsx(g.Suspense,{fallback:c.jsx("div",{className:"flex grow items-center justify-center",children:c.jsx(pn,{size:"lg",label:x("ui.common.loading.page")})}),children:c.jsxs(sJ,{children:[c.jsx(oi,{path:"/",element:c.jsx(xF,{to:"/chat",replace:!0})}),c.jsx(oi,{path:"/chat",element:c.jsx(g3,{})}),c.jsx(oi,{path:"/chat/:agentId",element:c.jsx(g3,{})}),c.jsx(oi,{path:"/agents",element:c.jsx(l4,{})}),c.jsx(oi,{path:"/agents/:agentId",element:c.jsx(l4,{})}),c.jsx(oi,{path:"/settings",element:c.jsx(sJe,{})}),c.jsx(oi,{path:"/agent-hub",element:c.jsx(ZQe,{})}),c.jsx(oi,{path:"/agent-hub/:agentId",element:c.jsx(JQe,{})}),c.jsx(oi,{path:"/schedules",element:c.jsx(eJe,{})}),c.jsx(oi,{path:"/projects",element:c.jsx(c4,{})}),c.jsx(oi,{path:"/projects/:projectId",element:c.jsx(c4,{})}),c.jsx(oi,{path:"/browser",element:c.jsx(tJe,{})}),m==="enabled"&&c.jsx(oi,{path:"/mesh",element:c.jsx(nJe,{})}),c.jsx(oi,{path:"*",element:c.jsx(xF,{to:"/chat",replace:!0})})]})})]})})]})})})};function zu(){return new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}const aJe=3,oJe=3e3;function lJe(e){return e instanceof CSSTransition&&e.playState==="running"}function cJe(e){const t=e.effect,n=t instanceof KeyframeEffect?t.target:null,s=e.transitionProperty,i=/^[a-z-]+$/.test(s)&&n instanceof Element?getComputedStyle(n).getPropertyValue(s).trim()||"(empty)":"(unreadable)";return`${s||"(unnamed property)"} on ${E0(n)??"an element no longer in the document"} = ${i}`}async function uJe(e=oJe){const t=performance.now();let n=0;for(;;){await zu();const s=Math.round(performance.now()-t),r=document.getAnimations().filter(lJe);if(n=r.length===0?n+1:0,n>=aJe)return{waitedMs:s,timedOut:!1,pending:[]};if(s>e)return{waitedMs:s,timedOut:!0,pending:r.map(cJe)}}}const dJe=/^#/;function wm(){const e=window.location.hash.replace(dJe,"");return e===""?"/":e}function E0(e){if(!e)return null;const t=e.getAttribute("aria-label")??e.textContent??"";return`${e.tagName.toLowerCase()}${e.id?`#${e.id}`:""} "${t.trim().slice(0,60)}"`}function hJe(e){const t=e.getBoundingClientRect(),n=t.left+t.width/2,s=t.top+t.height/2,r=document.elementFromPoint(n,s),i=r!==null&&(r===e||e.contains(r)),a=document.elementsFromPoint(n,s).slice(0,4).map(l=>E0(l)),o={bubbles:!0,cancelable:!0,composed:!0,button:0,buttons:1,clientX:n,clientY:s,view:window};return e.dispatchEvent(new PointerEvent("pointerdown",{...o,pointerId:1,isPrimary:!0})),e.dispatchEvent(new MouseEvent("mousedown",o)),e.dispatchEvent(new PointerEvent("pointerup",{...o,buttons:0,pointerId:1,isPrimary:!0})),e.dispatchEvent(new MouseEvent("mouseup",{...o,buttons:0})),e.dispatchEvent(new MouseEvent("click",{...o,buttons:0})),{hitTest:i,hit:E0(r),stack:a,disabled:e instanceof HTMLButtonElement?e.disabled:null,rect:{x:t.x,y:t.y,width:t.width,height:t.height}}}function mg(e,t){if(typeof e!="string"||e==="")throw new Error(`${t} must be a non-empty string`);return e}async function fJe(e,t=1e4){const n=Date.now();for(;wm()!==e;){if(Date.now()-n>t)throw new Error(`route did not become ${e} (it is ${wm()})`);await new Promise(s=>setTimeout(s,50))}return await zu(),wm()}const Mk=["dev-driver","query-fetch-probe"];let Cm=null;function pJe(){if(Cm)return Cm;const e=[],t=wF.prototype.fetch;return wF.prototype.fetch=function(...s){return e.push({at:Date.now(),key:JSON.stringify(this.queryKey),stack:(new Error().stack??"").split(`
|
|
684
|
+
A good description helps you and others understand what the agent does and any special instructions. The descriptions are also used by other agents to help them understand how to tag each other in for certain tasks.<br /><br />If you want this agent to be part of the agent-to-agent communication network, it will need to have a description that captures its purpose and capabilities. Be concise and specific.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="create-agent-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="create-agent-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"navigate-agent-hub",attachTo:{element:'[data-tour-tag="nav-item-agent-hub"]',on:"right"},title:"Discover more agents",text:`Let's visit the Agent hub to find community-created agents. Click on the "Agent hub" icon in the navigation bar.`,buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agents"]');e&&e.click(),setTimeout(()=>{const t=document.querySelector('[data-tour-tag="create-new-agent-button"]');t&&t.click()},500),setTimeout(()=>{this.back()},1e3)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agent-hub"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"agent-hub-view",attachTo:{element:'[data-tour-tag="agent-hub-sidebar-container"]',on:"right"},title:"The Agent hub",text:"Here you can browse agents by category or search for specific ones. These agents are shared by the community and can perform various specialized tasks.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"download-agent",attachTo:{element:'button[data-tour-tag="agent-hub-download-button"]',on:"bottom"},title:"Download an agent",text:'Find an agent that interests you and click the "Get" button to add it to your local agent list.',buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agents"]');e&&e.click(),setTimeout(()=>{this.next()},1e3)}}]},{id:"upload-agent-hub",attachTo:{element:()=>iQe("upload-to-hub-header-button"),on:"bottom"},title:"Share your agents",text:"If you create a useful agent, you can also share it with the community by uploading it to the Agent hub from the agent options menu.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agent-hub"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){n4("open-upload-dialog"),setTimeout(()=>{this.next()},500)}}]},{id:"upload-agent-hub-dialog",attachTo:{element:'[data-tour-tag="upload-agent-dialog"]',on:"right"},title:"Upload agent to hub",text:"This dialog publishes your agent's instruction set to the community. You need a Radient account to publish, which is free to create and costs nothing per agent. You can review the details before confirming. What is published is what describes the agent - its name, description, instructions and tool surface; no conversation, execution history, memory, plan or machine-specific configuration leaves your computer. Make sure your agent meets the required criteria before submitting.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('button[data-tour-tag="upload-agent-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('button[data-tour-tag="upload-agent-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"navigate-schedules",attachTo:{element:'[data-tour-tag="nav-item-schedules"]',on:"right"},title:"Automate tasks with schedules",text:"Local Operator can run tasks for you on a regular basis. Let's check out the Schedules section.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-agents"]');e&&e.click(),setTimeout(()=>{n4("open-upload-dialog")},500),setTimeout(()=>{this.back()},1e3)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-schedules"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"schedules-overview",title:"Proactive agents with schedules",text:"A powerful feature of Local Operator is the ability to ask agents to perform tasks on their own on a recurring basis. This turns them from reactive agent bots to proactive agents that work on their own in the background to support you without you needing to continually ask them to do things.<br /><br />You can simply ask any agent to do something at some point in the future, or to handle some daily task at a certain time, and it will create a prompt for itself that will be executed at the specified times.<br /><br />Here, you can view, create, and manage all your scheduled tasks in one place to streamline your workflow and ensure important actions happen automatically.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"create-schedule",attachTo:{element:'button[data-tour-tag="create-schedule-button"]',on:"bottom"},title:"Set up a recurring task",text:'Click "Create schedule" to ask an agent to perform a task for you regularly, like sending a daily report or checking for news updates.<br /><br />You can also create one-off tasks that only run once at some point in the future.',buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('button[data-tour-tag="create-schedule-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"create-schedule-dialog",attachTo:{element:'[data-tour-tag="create-schedule-dialog"]',on:"right"},title:"Configure your schedule",text:"While it is often much easier to simply ask the agent to do a task on a recurring basis for you, you can also manually set up a schedule for a task here or update existing tasks.<br /><br />The prompt is the message that will be sent to the agent at the predefined schedule. You can update the time of day in your local timezone, the frequency of the task, and even specify a specific date or time that the task should stop running at.<br /><br />You can also schedule one-off tasks that only run once at some point in the future.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="create-schedule-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.back()},500)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="create-schedule-dialog-cancel-button"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"navigate-settings",attachTo:{element:'[data-tour-tag="nav-item-settings"]',on:"right"},title:"Personalize your experience",text:"Now, let's explore the Settings menu to customize Local Operator to your liking.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-schedules"]');e&&e.click(),setTimeout(()=>{const t=document.querySelector('button[data-tour-tag="create-schedule-button"]');t&&t.click()},500),setTimeout(()=>{this.back()},1e3)}},{text:"Next",classes:"shepherd-button-primary",action:function(){const e=document.querySelector('[data-tour-tag="nav-item-settings"]');e&&e.click(),setTimeout(()=>{this.next()},500)}}]},{id:"general-settings",attachTo:{element:'div[data-tour-tag="settings-general-section"]',on:"right"},title:"General settings",text:"Here you can update your user profile and configure model settings (like default hosting provider and model).",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"appearance-settings",attachTo:{element:'[data-tour-tag="settings-appearance-section"]',on:"right"},title:"Customize appearance",text:"Choose from various themes to change the look and feel of Local Operator. Find one that suits your style.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"radient-account-settings",attachTo:{element:'[data-tour-tag="settings-radient-account-section"]',on:"right"},title:"Radient account",text:"Connect your Radient account to access your Radient Pass details, credits, and unlock unified access to models and tools. Radient is the best way to use Local Operator since it powers the AI models, web search, image generation, and much more with a single integration. You get free credits when you sign up to try it out and bonus credits when you top up.<br /><br />When you sign in for the first time, it will automatically create a Radient Pass for you and save it securely to your computer. This will power your Local Operator agents with Radient Automatic, which mixes and matches AI models to get you the best balance of speed, accuracy, and cost in every step of your agents' workflows.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"integrations-settings",attachTo:{element:'[data-tour-tag="settings-integrations-section"]',on:"right"},title:"Connect your services",text:"Enhance your agents' capabilities by connecting your Google services like Gmail, Calendar, and Drive. This allows agents to access and manage your information with your permission.<br /><br />You need to be logged in to a Radient account to use this feature, however it is free to use and doesn't cost any additional Radient credits per action.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"application-updates-settings",attachTo:{element:'[data-tour-tag="settings-app-updates-section"]',on:"right"},title:"Stay up to date",text:"Check for updates to Local Operator here to ensure you have the latest features and improvements. You can see your current version information below.",buttons:[{text:"Back",classes:"shepherd-button-secondary",action:function(){this.back()}},{text:"Next",classes:"shepherd-button-primary",action:function(){this.next()}}]},{id:"tour-complete",title:"Tour complete",text:"You've now seen the main features of Local Operator. Feel free to explore further and discover all the ways your AI agents can assist you. Happy automating.",buttons:[{text:"Finish",classes:"shepherd-button-primary",action:function(){this.complete()}}]}],aQe=()=>{const e=ti(),{completeTourOnboarding:t}=ym(),n=g.useContext(ZC),s={cancelIcon:{enabled:!0},scrollTo:{behavior:"smooth",block:"center"}},r=!0;return{startTour:a=>{if(n?.tour?.isActive()&&!a?.forceModalCompleted){console.log("Onboarding tour is already active (from context.tour). Not starting another.");return}const o=ym.getState();if(!a?.forceModalCompleted&&!o.isModalComplete){console.log("Onboarding modal not completed (checked via store). Tour will not start.");return}if(o.isTourComplete&&!a?.forceModalCompleted){console.log("Onboarding tour already completed in store and not forced. Not starting again.");return}let l=n?.tour;const u=n?.Shepherd;if(!l&&u&&(l=u.activeTour,!l&&u.Tour&&(console.log("No active Shepherd tour found from context or global. Creating a new one."),l=new u.Tour({useModalOverlay:r,defaultStepOptions:s}))),!l){console.warn("Failed to get or create a Shepherd tour instance.",n);return}if(l.isActive()){console.log("Tour is already active. Not starting again.");return}if(l.options.defaultStepOptions={...l.options.defaultStepOptions||{},...s},l.options.useModalOverlay=r,a?.firstAgentId&&(l.options.firstAgentId=a.firstAgentId),l.off("complete",t),l.on("complete",t),l.off("cancel",t),l.on("cancel",t),a?.forceModalCompleted||!l.isActive()){const d=[...l.steps];for(const h of d)h.id&&l.removeStep(h.id);l.addSteps(s4)}else l.steps.length===0&&l.addSteps(s4);typeof l.start=="function"?(e("/"),l.start()):console.warn("Shepherd tour instance does not have a start method.",l)}}},oQe=()=>{const{isModalComplete:e,isTourComplete:t}=ym(),{startTour:n}=aQe(),s=$e.useContext(ZC),{data:r}=$S(1,1);return g.useEffect(()=>{if(e&&!t&&s){const i=setTimeout(()=>{const a=r?.agents?.[0]?.id;n({firstAgentId:a})},500);return()=>clearTimeout(i)}},[e,t,s,n,r]),null},lQe=({children:e})=>c.jsxs(XXe,{children:[e,c.jsx(oQe,{})]}),cQe=()=>{Et();const{open:e,focusGroup:t,providerId:n,closeConnect:s}=_B(),r=g.useRef(null);g.useEffect(()=>{e&&(r.current=document.activeElement instanceof HTMLElement?document.activeElement:null)},[e]);const i=ti();return c.jsx(Kl,{open:e,onOpenChange:a=>{a||s()},children:c.jsxs(Yl,{className:"max-h-[calc(100vh-4rem)] max-w-[min(40rem,calc(100vw-4rem))] gap-4 overflow-y-auto","data-connect-provider-dialog":"",onCloseAutoFocus:a=>{const o=r.current;r.current=null,o?.isConnected&&(a.preventDefault(),o.focus())},children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx(jo,{className:"text-title",children:x("ui.providers.connect_provider_dialog.connect_a_model_provider")}),c.jsx(ou,{className:"text-body-sm text-ink-muted",children:x("ui.providers.connect_provider_dialog.your_agents_need_a_model_to_think")})]}),e?c.jsx(IW,{context:"dialog",featuredOnly:!0,focusGroup:t,initialProviderId:n,onDone:s,onChangeModel:()=>{s(),i("/settings")}}):null]})})},uQe=({title:e,description:t,icon:n,children:s,titleComponent:r,sectionRef:i,dataTourTag:a,className:o,id:l})=>c.jsxs("div",{ref:i,id:l,tabIndex:l?-1:void 0,"data-tour-tag":a,className:T("w-full",o),children:[r??c.jsxs("h2",{className:"flex items-center gap-2 text-heading text-ink",children:[n&&c.jsx(n,{size:16,className:"shrink-0 text-ink-dim"}),e]}),t&&c.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:t}),c.jsx("div",{className:"mt-4",children:s})]}),QZe=({label:e,value:t,className:n,valueClassName:s})=>c.jsxs("div",{className:T("min-w-0",n),children:[c.jsx("div",{className:"flex items-center gap-1.5 text-meta text-ink-dim",children:e}),c.jsx("div",{className:T("mt-0.5 break-words text-body-sm",s??"text-ink"),children:t})]}),JZe=({children:e,className:t})=>c.jsx("div",{className:T("grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))] gap-x-6 gap-y-4",t),children:e});async function t$(e){await xt({op:"settings.edit",key:Ro,value:e.value}),VQ(e.queryClient)}async function dQe(e){await t$(e),e.queryClient.setQueryData(rx.all,t=>t&&{...t,settings:t.settings.map(n=>n.key===Ro?{...n,value:e.value,is_default:e.value===n.default}:n)});try{return await e.queryClient.fetchQuery({queryKey:rx.all,queryFn:()=>xt({op:"settings.list"}),staleTime:0,retry:!1}),"confirmed"}catch{return"readback-unknown"}}const ZZe=({focus:e=!1})=>{Et();const t=nn(),n=jn(),s=yt(n.data,"settings"),r=fs({queryKey:rx.all,queryFn:()=>xt({op:"settings.list"}),enabled:s,retry:!1,refetchOnReconnect:!0}),i=r.data?.settings.find(F=>F.key===Ro),[a,o]=g.useState(!1),[l,u]=g.useState(null),[d,h]=g.useState(!1),[f,p]=g.useState(!1),m=g.useRef(!1),v=g.useRef(null),b=g.useRef(!1);g.useEffect(()=>{if(!e){b.current=!1;return}!i||b.current||(v.current?.querySelector("[role=combobox]")?.focus(),b.current=!0)},[e,i]),g.useEffect(()=>{r.isSuccess&&!r.isFetching&&h(!1)},[r.isFetching,r.isSuccess]);const w=async F=>{if(!(!i||m.current||d||!i.choices.some(A=>A.value===F))){m.current=!0,o(!0),u(null),p(!1);try{const A=await dQe({value:F,queryClient:t});h(A==="readback-unknown"),p(A==="confirmed")}catch(A){u({value:F,message:A instanceof Error?A.message:""})}finally{m.current=!1,o(!1)}}},C=async()=>{const[F,A]=await Promise.all([r.refetch(),n.refetch()]);!F.isError&&!A.isError&&h(!1)},y=!r.data&&r.error||!n.data&&n.error,k=n.data&&(!s||r.data&&!i),_=!y&&!k&&!i,E=n.data?.features?.i18n?n.data.language:void 0,R=typeof E=="string"&&E!==""?E:void 0;return c.jsx(uQe,{title:x("ui.settings.language.dialog.title"),icon:uj,description:x("ui.settings.language.general.description"),children:c.jsxs("div",{ref:v,"data-setting-key":Ro,className:"flex flex-col gap-3","aria-busy":a,children:[_&&c.jsx("output",{className:"text-meta text-ink-dim",children:x("ui.settings.language.dialog.loading")}),k&&c.jsx("p",{className:"text-meta text-ink-dim",children:x("ui.settings.language.dialog.unavailable")}),i&&c.jsx(FB,{setting:{...oT(i),label:x("ui.settings.language.dialog.title")},value:String(i.value),onValueChange:F=>{w(F)},disabled:a||d,suppressEffectiveNote:!0}),c.jsx("output",{id:UQ(Ro),"aria-live":"polite",className:"text-meta text-ink-dim",children:a?x("ui.settings.language.general.pending"):f?x("ui.settings.language.general.saved"):R?x(d||n.error?"ui.settings.language.general.last_known":"ui.settings.language.general.effective",{locale:GQ(R)?.name??R}):x("ui.settings.language.general.no_resolution")}),(y||l||d)&&c.jsx(Qr,{variant:"danger",children:c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("p",{role:"alert",children:l?x("ui.settings.language.general.write_error",{message:l.message}):d?x("ui.settings.language.general.readback_error"):x("ui.settings.language.dialog.unavailable")}),c.jsx(ce,{variant:"outline",size:"sm",disabled:a||r.isFetching||n.isFetching,onClick:()=>{l?w(l.value):C()},children:x("ui.settings.language.dialog.retry")})]})})]})})},hQe=()=>{Et();const e=Tk(te=>te.open),t=Tk(te=>te.closeLanguage),n=nn(),s=jn(),r=yt(s.data,"settings"),i=fs({queryKey:rx.all,queryFn:()=>xt({op:"settings.list"}),enabled:e&&r,staleTime:1e4}),a=g.useRef(null),o=fB(),l=(i.data?.settings??[]).find(te=>te.key===Ro),u=l?oT(l):void 0,[d,h]=g.useState(null),[f,p]=g.useState(!1),[m,v]=g.useState(!1),[b,w]=g.useState(null),C=g.useRef(null);g.useEffect(()=>{e&&h(null)},[e]),g.useEffect(()=>{if(!e||!u)return;const te=String(u.value??"");(d===null||d===C.current)&&h(te),C.current=te},[e,u,d]),g.useEffect(()=>{e&&(v(!1),w(null))},[e]);const y=d??String(u?.value??""),k=!!u&&y!==String(u?.value??""),_=!u||!k||f,E=async()=>{if(!(!u||!k)){p(!0),w(null);try{await t$({value:y,queryClient:n}),v(!0),h(null),await i.refetch()}catch(te){w(te instanceof Error?te.message:x("ui.settings.configuration.language_dialog.the_language_could_not_be_saved"))}finally{p(!1)}}},R=!!s.data,F=R&&!r,A=s.error&&!s.data?s.error:null,N=A??i.error,M=!R&&!N,{sentence:D,remedy:L}=WQ(o??null,x("ui.settings.configuration.language_dialog.your_settings_could_not_be_loaded"),N),V=s.isFetching||i.isFetching,j=u?"combo":N?"retry":"none";return g.useEffect(()=>{!e||j==="none"||requestAnimationFrame(()=>{a.current?.querySelector(j==="combo"?'[role="combobox"]':"[data-language-retry]")?.focus()})},[e,j]),c.jsx(Kl,{open:e,onOpenChange:te=>!te&&t(),children:c.jsxs(Yl,{ref:a,onOpenAutoFocus:te=>te.preventDefault(),className:"max-w-[min(28rem,calc(100vw-4rem))] gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx(jo,{className:"text-title",children:x("ui.settings.language.dialog.title")}),c.jsx(ou,{className:"text-body-sm text-ink-muted",children:x("ui.settings.language.dialog.description")})]}),M?c.jsxs("div",{className:"flex items-center gap-2 text-body-sm text-ink-muted",children:[c.jsx(pn,{}),x("ui.settings.language.dialog.loading")]}):F?c.jsx(Qr,{variant:"warning",children:c.jsx("span",{children:x("ui.settings.language.dialog.unavailable")})}):N?c.jsx(Qr,{variant:"warning",children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{children:D}),L&&c.jsx(ce,{variant:"secondary",size:"sm",className:"shrink-0","data-language-retry":"",onClick:()=>{A?s.refetch():i.refetch()},disabled:V,children:V?x("ui.settings.language.dialog.retrying"):x("ui.settings.language.dialog.retry")})]})}):i.isPending?c.jsxs("div",{className:"flex items-center gap-2 text-body-sm text-ink-muted",children:[c.jsx(pn,{}),x("ui.settings.language.dialog.loading")]}):u?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{id:vF(Ro),className:"text-meta text-ink-dim",children:u.help}),c.jsx(FB,{setting:u,value:y,disabled:f,helpId:vF(Ro),effectiveNoteId:$Q(Ro,zQ),onValueChange:te=>{v(!1),h(te)}})]}),b&&c.jsx("p",{className:"text-meta text-danger",children:b}),c.jsx("div",{className:"flex min-h-8 items-center justify-end",children:m&&!k?c.jsxs("output",{"data-language-save":"",className:"inline-flex items-center gap-1.5 text-body-sm text-ink",children:[c.jsx(js,{"aria-hidden":"true",className:"size-3.5"}),x("ui.settings.language.dialog.saved")]}):c.jsx(ce,{onClick:E,disabled:_,"data-language-save":"",children:f?`${x("ui.settings.language.dialog.save")}...`:x("ui.settings.language.dialog.save")})})]}):c.jsx(Qr,{variant:"warning",children:c.jsx("span",{children:x("ui.settings.language.dialog.unavailable")})})]})})};function fQe(){const{data:e}=jn();g.useEffect(()=>{e&&M$(e)},[e]);const t=sT(),n=nn(),s=g.useRef(null);g.useEffect(()=>{const r=t.configChange;if(!r)return;const i=`${r.epoch}:${r.seq}`;s.current!==i&&r.changedKeys.includes(Ro)&&(s.current=i,n.invalidateQueries({queryKey:Bo.capabilities}),n.invalidateQueries({queryKey:Bo.settings}),!qQ()&&Ya(x("ui.settings.language.external_notice",{language:r.language}),{id:"i18n-language-external"}))},[t.configChange,n])}function pQe(e,t){if(e.defaultPrevented||e.repeat||e.isComposing||!(e.metaKey||e.ctrlKey))return null;const n=KQ(e);if(n===null)return null;const s=MZ(t.bindings).get(n);return s===void 0||rT(e.target)||!lue(n$(s),t.route)?null:s}const n$=e=>e.slice(6);function gQe(e){const t=Ce.getState(),n=t.activeDraftKey?t.drafts[t.activeDraftKey]:void 0,s=op(t.activeDraftKey,n?.sessionId,t.activeSessionId)??null;Uu(n$(e),{sessionId:s,askScope:s===null?"fleet":"session",via:"chord"})}function mQe(){g.useEffect(()=>{const e=t=>{const n=Ke.getState(),s=pQe(t,{bindings:n.shortcutBindings,route:n.rightSlotRoute});s!==null&&(t.preventDefault(),gQe(s))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[])}const vQe=""+new URL("radient-icon-1024x1024-D_JJedvo.png",import.meta.url).href,s$=cp()(VB(e=>({hasBeenNotified:!1,setHasBeenNotified:t=>{e({hasBeenNotified:t})}}),{name:"low-credits-storage"})),bQe=({open:e,onClose:t,onGoToConsole:n})=>{Et();const{setHasBeenNotified:s}=s$(),{prices:r,isLoading:i,error:a}=YQ(),o=d=>typeof d!="number"?"$...":x("ui.common.account.low_credits_dialog.detail",{detail:String(d.toFixed(2))}),l=()=>{s(!0),t()},u=()=>{s(!0),n()};return c.jsx(au,{open:e,onClose:l,title:c.jsxs(c.Fragment,{children:[c.jsx("img",{src:vQe,alt:x("ui.common.account.low_credits_dialog.radient_icon"),className:"size-7"}),x("ui.common.account.low_credits_dialog.running_low_on_radient_credits")]}),maxWidth:"sm",fullWidth:!1,actions:c.jsxs(c.Fragment,{children:[c.jsx(k0,{onClick:l,children:x("ui.common.account.low_credits_dialog.maybe_later")}),c.jsx(T0,{onClick:u,startIcon:c.jsx(_l,{size:18}),className:"min-w-55",children:x("ui.common.account.low_credits_dialog.get_more_credits")})]}),children:c.jsxs("div",{className:"flex flex-col items-center gap-4 py-2 text-center",children:[c.jsxs("p",{className:"text-body-sm text-ink-muted",children:[x("ui.common.account.low_credits_dialog.unlock_the_full_power_of_local_operator_with")," ",c.jsx("span",{className:"font-bold text-accent",children:x("ui.common.account.low_credits_dialog.radient_pass")}),"."]}),c.jsx("p",{className:"text-body-sm text-ink-muted",children:x("ui.common.account.low_credits_dialog.radient_automatic_is_often_cheaper_than_bringing_your_own_key_its")}),c.jsx("p",{className:"text-body-sm text-ink-muted",children:x("ui.common.account.low_credits_dialog.it_s_pay_as_you_go_with_no_commitments_load_up_what_you_need_star")}),c.jsxs("p",{className:"text-body-sm text-ink-muted",children:[x("ui.common.account.low_credits_dialog.plus_get")," ",c.jsx("span",{className:"font-medium text-ink",children:i?c.jsx(pn,{size:"sm",className:"mr-0.5 align-middle"}):o(r?.default_registration_credits)})," ",x("ui.common.account.low_credits_dialog.in_bonus_credits_with_your_first_purchase"),a&&c.jsx("span",{className:"mt-1 block text-meta text-danger",children:x("ui.common.account.low_credits_dialog.could_not_load_bonus_credit_information")})]}),c.jsx("p",{className:"text-meta text-ink-dim",children:x("ui.common.account.low_credits_dialog.you_can_also_reach_the_radient_console_from_settings_at_any_time")})]})})},xQe=(e,t)=>t?U1(e.filter(n=>n.session_id===t)).length:0;function wQe(e){return Ce(t=>xQe(t.sessions,e))}const CQe=(e,t)=>t?e.some(n=>n.session_id===t&&n.status?.code==="busy"):!1;function yQe(e){return Ce(t=>CQe(t.sessions,e))}const _Qe=[];function SQe(){const{state:e}=gC(),t=e?.pendingConsent??_Qe,n=n5(s=>GP(t,s));return g.useEffect(()=>{t.length>0&&HT()},[t]),GP(t,n)}const r$={approvals:["desktop","mesh","approvals"]},EQe=15e3,kQe=new Set(["requested","approved","connecting","failed"]);function TQe(e){return kQe.has(e)}function RQe(e){return e==="requested"}function AQe(e){return e.filter(t=>RQe(t.state)).length}function eet(e){return e.state==="requested"&&e.canApproveHere!==!1&&(e.kind==="device"||e.kind==="machine")}function tet(e){return TQe(e)}function net(e){switch(e){case"requested":return x("ui.mesh.mesh_approvals.waiting_for_you");case"approved":return x("ui.mesh.mesh_approvals.approved");case"connecting":return x("ui.mesh.mesh_approvals.connecting");case"connected":return x("ui.mesh.mesh_approvals.connected");case"denied":return x("ui.mesh.mesh_approvals.denied");case"expired":return x("ui.mesh.mesh_approvals.expired");case"failed":return x("ui.mesh.mesh_approvals.failed");default:return e}}function Dc(e){return typeof e=="object"&&e!==null}function FQe(e){const t=Dc(e)?e:{};return{deviceId:Ft(t.device_id),name:Ft(t.name),host:Ft(t.host),user:Ft(t.user),transport:Ft(t.transport),hostKeyFp:Ft(t.host_key_fp)}}function DQe(e){const t=Dc(e)?e:{};return{connect:Mo(t.connect,!1),install:Mo(t.install,!1),anchor:Dc(t.anchor),networkId:Ft(t.network_id),role:Ft(t.role),unattended:Mo(t.unattended,!1),grants:jf(t.grant)}}function PQe(e){const t=Array.isArray(e)?e:e?.approvals??[];if(!Array.isArray(t))return[];const n=[];for(const s of t){if(!Dc(s))continue;const r=Ft(s.approval_id),i=Ft(s.state);if(!r||!i)continue;const a=Dc(s.what)&&Object.prototype.hasOwnProperty.call(s.what,"credential_inheritance"),o=Object.prototype.hasOwnProperty.call(s,"kind")?Ft(s.kind):void 0,l=a||o==="credential_inheritance"?"credential":o!==void 0&&!["device_onboard","local_authority"].includes(o)?"unknown":!Dc(s.device)&&Dc(s.machine)?"machine":"device",u=Dc(s.requested_by)?s.requested_by:{};n.push({approvalId:r,state:i,kind:l,summary:Ft(s.summary)||void 0,details:Array.isArray(s.details)&&s.details.every(d=>typeof d=="string")?s.details.slice():void 0,canApproveHere:Object.prototype.hasOwnProperty.call(s,"can_approve_here")?s.can_approve_here===!0:void 0,approveRemedy:Ft(s.approve_remedy)||void 0,where:FQe(l==="machine"?s.machine:s.device),what:DQe(s.what),requestedBy:{surface:Ft(u.surface),sessionId:Ft(u.session_id),deviceId:Ft(u.device_id)},expiresAt:Oc(s.expires_at)})}return n}function IQe(e){return e.kind==="machine"?x("ui.mesh.mesh_approvals.this_machine"):S5({device_id:e.where.deviceId,name:e.where.name})}function set(e,t){if(e.kind==="credential"||e.kind==="unknown"||e.canApproveHere===!1){if(e.summary)return e.summary;if(e.kind==="credential"||e.kind==="unknown")return r4(e)}const n=r4(e),s=MQe(e,t).map(r=>r.clause);return s.length?x("ui.mesh.mesh_approvals.approval_title_with_clauses",{head:n,clauses:NQe(s)}):x("ui.mesh.mesh_approvals.approval_title",{head:n})}function r4(e){return e.kind==="credential"?e.summary||x("ui.mesh.approval.credential_title"):e.kind==="unknown"?e.summary||x("ui.mesh.approval.unknown_title"):e.canApproveHere===!1&&e.summary?e.summary:e.kind==="machine"?x("ui.mesh.mesh_approvals.set_up_operator_authority_on_this_machine"):x("ui.mesh.mesh_approvals.onboard_subject",{subject:IQe(e)})}function NQe(e){return e.length===1?e[0]:x("ui.mesh.mesh_approvals.join_clauses",{clauses:e.slice(0,-1).join(", "),last:e[e.length-1]})}function ret(e){if(e.kind==="credential"||e.kind==="unknown")return null;const{user:t,host:n,transport:s,name:r}=e.where,i=[n?t?`${t}@${n}`:n:"",s?x("ui.mesh.mesh_approvals.via_transport",{transport:s}):"",r&&r!==n?`(${r})`:""].filter(Boolean);return i.length?i.join(" "):null}function iet(e){return e.kind==="credential"||e.kind==="unknown"?null:e.where.hostKeyFp||null}function aet(e){const{surface:t,sessionId:n}=e.requestedBy,s=[t||"",n?x("ui.mesh.mesh_approvals.session_suffix",{suffix:n.slice(-6)}):""].filter(Boolean);return s.length?x("ui.mesh.mesh_approvals.asked_by",{requester:s.join(" · ")}):null}function MQe(e,t){if(e.kind==="credential"||e.kind==="unknown")return[];const{connect:n,install:s,anchor:r,networkId:i,role:a,unattended:o,grants:l}=e.what,u=[];if(n&&u.push({term:"connect",clause:e.where.transport?x("ui.mesh.mesh_approvals.connect_over",{transport:e.where.transport}):x("ui.mesh.mesh_approvals.connect_to_it"),consequence:e.where.transport?x("ui.mesh.mesh_approvals.may_connect_over",{transport:e.where.transport}):x("ui.mesh.mesh_approvals.this_machine_may_connect_to_it")}),s&&u.push({term:"install",clause:e.kind==="machine"?x("ui.mesh.mesh_approvals.install_local_operator"):x("ui.mesh.mesh_approvals.install_local_operator_there"),consequence:e.kind==="machine"?x("ui.mesh.mesh_approvals.local_operator_is_installed_on_this_machine"):x("ui.mesh.mesh_approvals.local_operator_is_installed_on_it")}),r&&u.push({term:x("ui.mesh.mesh_approvals.install_operator_anchor"),clause:x("ui.mesh.mesh_approvals.check_approvals_signed_on_your_machines"),consequence:x("ui.mesh.mesh_approvals.that_device_can_check_approvals_signed_on")}),i){const d=t?.get(i),h=x("ui.mesh.mesh_approvals.join_network",{network:d||i,role:a||"?"});u.push({term:h,clause:h,consequence:x("ui.mesh.mesh_approvals.joins_network",{network:d||i,role:a||"?"})})}o&&u.push({term:x("ui.mesh.mesh_approvals.trust_unattended_sessions"),clause:x("ui.mesh.mesh_approvals.run_sessions_there_without_an_approval_prompt"),consequence:x("ui.mesh.mesh_approvals.sessions_you_start_on_that_device_run")});for(const d of OQe(l,o)){const h=LQe()[d];u.push({term:h?.term??x("ui.mesh.mesh_approvals.grant_capability",{grant:d}),clause:BQe()[d]??x("ui.mesh.mesh_approvals.use_capability",{grant:d}),consequence:h?.gloss??x("ui.mesh.mesh_approvals.may_use_capability",{grant:d})})}return u}function OQe(e,t){const n=new Set;for(const s of e){const r=String(s??"").trim();r&&(t&&r==="unattended"||n.add(r))}return[...n]}const LQe=()=>({unattended:{term:x("ui.mesh.mesh_approvals.trust_unattended_sessions"),gloss:x("ui.mesh.mesh_approvals.sessions_you_start_on_that_device_run")},broker_credential:{term:x("ui.mesh.mesh_approvals.borrow_logins_there"),gloss:x("ui.mesh.mesh_approvals.your_sessions_may_use_the_logins_stored")}}),BQe=()=>({list:x("ui.mesh.mesh_approvals.see_its_sessions"),view:x("ui.mesh.mesh_approvals.watch_a_session_there"),prompt:x("ui.mesh.mesh_approvals.send_prompts_to_a_session_there"),steer:x("ui.mesh.mesh_approvals.steer_a_running_turn_there"),stop:x("ui.mesh.mesh_approvals.stop_a_session_there"),slash:x("ui.mesh.mesh_approvals.run_slash_commands_there"),delete:x("ui.mesh.mesh_approvals.archive_or_delete_a_session_there"),move:x("ui.mesh.mesh_approvals.move_sessions_to_or_from_there"),broker_credential:x("ui.mesh.mesh_approvals.borrow_the_logins_stored_there"),approve:x("ui.mesh.mesh_approvals.answer_approval_prompts_there"),unattended:x("ui.mesh.mesh_approvals.run_sessions_there_without_an_approval_prompt")});function oet(e,t){if(e===null||e<=0)return null;const n=e-t;if(n<=0)return null;if(n<60)return x("ui.mesh.mesh_approvals.expires_in_under_a_minute");const s=Math.ceil(n/60);if(s<90)return x("ui.mesh.mesh_approvals.expires_minutes",{count:s});const r=Math.ceil(s/60);return x("ui.mesh.mesh_approvals.expires_hours",{count:r})}function jQe(e,{poll:t=!0}={}){return fs({queryKey:r$.approvals,enabled:e,queryFn:async()=>PQe(await xt({op:"approvals.list"})),retry:!1,staleTime:t?1e4:Number.POSITIVE_INFINITY,refetchInterval:e&&t?EQe:!1,refetchOnWindowFocus:t})}function cet(){const e=nn();return Kn({mutationFn:async t=>{const n=t.decision==="approve"?{op:"approvals.approve",approvalId:t.approvalId}:{op:"approvals.deny",approvalId:t.approvalId};await xt(n)},onSettled:()=>{e.invalidateQueries({queryKey:r$.approvals}),e.invalidateQueries({queryKey:Hl.networks}),e.invalidateQueries({queryKey:Hl.peers})}})}function uet(e){const t=e?.message;return typeof t=="string"&&t.trim()?t.trim():x("ui.mesh.mesh_approvals.the_approvals_could_not_be_read")}function det(e){const t=e;return{code:Ft(t?.code)||"approval_refused",sentence:Ft(t?.message)||x("ui.mesh.mesh_approvals.decision_could_not_be_answered")}}const i4=e=>{const t=JQ(e.type),n=typeof e.percent=="number"?`, ${Math.round(e.percent)}%`:"";return`${t} in progress${n}.`},i$=e=>QQ({type:e.type,version:e.offer.version}),HQe=e=>`${e.map(s=>i$(s)).map((s,r)=>r===0?s:`${s.charAt(0).toLowerCase()}${s.slice(1)}`).join(" and ")} available. Show the update notice.`,UQe=({surfaces:e,inflight:t,onShow:n,onDismiss:s})=>{if(Et(),t===null&&e.length===0)return null;if(t!==null)return c.jsx(Ze,{side:"top",collisionPadding:8,content:i4(t),children:c.jsx("output",{"data-update-foot-icon":"","data-update-foot-icon-state":"inflight","aria-label":i4(t),className:"flex size-8 shrink-0 items-center justify-center text-accent",children:c.jsx(Wi,{className:"size-4 shrink-0 motion-safe:animate-spin","aria-hidden":"true"})})});const r=e.find(i=>(i.offer.summary??"").trim()!=="");return c.jsx(Ze,{side:"top",collisionPadding:8,content:c.jsxs("div",{className:"flex max-w-64 flex-col gap-0.5",children:[e.map(i=>c.jsxs("span",{className:"truncate text-ink",children:[i$(i)," ",x("ui.common.updates.update_foot_icon.available")]},i.type)),r?c.jsx("span",{className:"truncate text-ink-muted",children:(r.offer.summary??"").trim()}):null,c.jsx("span",{className:"whitespace-nowrap text-ink-muted",children:x("ui.common.updates.update_foot_icon.show_the_update_notice")})]}),children:c.jsx("button",{type:"button","data-update-foot-icon":"","data-update-foot-icon-state":"available","aria-label":HQe(e),onClick:n,onKeyDown:i=>{i.key!=="Escape"||!s||(i.stopPropagation(),s())},className:T("flex size-8 shrink-0 items-center justify-center rounded-sm text-accent","transition-colors duration-fast ease-out-quart","hover:bg-row-hover hover:text-ink"),children:c.jsx(tT,{className:"size-4 shrink-0","aria-hidden":"true"})})})},a4=()=>{const e=Ys(p=>p.followed),t=Ys(p=>p.running),n=Ys(p=>p.offers),s=Ys(p=>p.detailOpen),r=Ys(p=>p.inflight),i=Ys(p=>p.downloadPercent),a=Ys(p=>p.openNotice),o=Ys(p=>p.noticeOpen),l=Ys(p=>p.dismissNotice),u=g.useMemo(()=>{const p={followed:e,running:t,offers:n,detailOpen:s};return v4.filter(m=>XQ(p,m)).map(m=>{const v=n[m];return v?{type:m,offer:v}:null}).filter(m=>m!==null)},[e,t,n,s]),d=g.useMemo(()=>r[ln.BACKEND]?{type:ln.BACKEND,percent:null}:r[ln.UI]?{type:ln.UI,percent:i[ln.UI]}:null,[r,i]),h=g.useCallback(()=>a(),[a]),f=g.useCallback(()=>l(),[l]);return c.jsx(UQe,{surfaces:u,inflight:d,onShow:h,onDismiss:o?f:void 0})},o4=({expanded:e})=>(Et(),c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(F4,{className:"size-6",label:e?void 0:x("ui.shell.collapsible_app_logo.local_operator")}),e&&c.jsx("span",{className:"truncate font-semibold text-body text-ink",children:x("ui.shell.collapsible_app_logo.local_operator")})]})),Nk=$e.memo(({expanded:e,useAuth:t=!1})=>{Et();const n=ti(),{user:s,isAuthenticated:r,accountRead:i,signOut:a}=DB(),o=i==="checking"?x("ui.shell.user_profile_sidebar.checking_account"):bF(i)?x("ui.shell.user_profile_sidebar.account_unavailable"):null,l=s?.name??o??x("ui.shell.user_profile_sidebar.user"),u=bF(i),d=s?.email??"",h=u?x("ui.shell.user_profile_sidebar.reconnect_radient"):d,f=u?"/settings?section=providers&provider=radient":"/settings",p=u?x("ui.shell.user_profile_sidebar.reconnect_radient"):x("ui.shell.user_profile_sidebar.account_settings"),m=g.useCallback(async()=>{r&&(await a(),window.location.reload())},[r,a]),v=g.useMemo(()=>{const C=s?.name;return C?C.split(" ").map(y=>y.charAt(0)).join("").toUpperCase().substring(0,2):null},[s?.name]),b=c.jsxs("button",{type:"button",onClick:t?void 0:()=>n(f),"aria-label":e?void 0:p,className:T("flex w-full min-w-0 items-center gap-2 rounded-sm transition-colors duration-fast ease-out-quart hover:bg-row-hover",e?"px-2 py-1.5":"justify-center py-1.5"),children:[c.jsx(HB,{className:"size-7 shrink-0",children:c.jsx(UB,{className:"border border-control bg-elevated text-ink",children:v??c.jsx(Mre,{size:14,"aria-hidden":"true"})})}),e&&l&&c.jsxs("span",{className:"min-w-0 text-left",children:[c.jsx("span",{className:"block truncate text-body-sm text-ink",children:l}),h&&c.jsx("span",{className:T("block truncate text-meta",u?"text-accent":"text-ink-dim"),children:h})]})]}),w=e?b:c.jsx(Ze,{content:p,side:"right",children:b});return t?c.jsxs(Ll,{children:[e?c.jsx(Ho,{asChild:!0,children:b}):c.jsx(Ze,{content:p,side:"right",children:c.jsx(Ho,{asChild:!0,children:b})}),c.jsxs(Bl,{align:"end",side:"top",className:"min-w-50",children:[u?c.jsxs(Gt,{onSelect:()=>n(f),children:[c.jsx(OB,{size:16,"aria-hidden":"true"}),x("ui.shell.user_profile_sidebar.reconnect_radient")]}):null,c.jsxs(Gt,{onSelect:()=>n("/settings"),children:[c.jsx(Mc,{size:16,"aria-hidden":"true"}),x("ui.shell.user_profile_sidebar.settings")]}),c.jsxs(Gt,{children:[c.jsx(sre,{size:16,"aria-hidden":"true"}),x("ui.shell.user_profile_sidebar.privacy_and_security")]}),c.jsx(Jr,{}),c.jsxs(Gt,{onSelect:m,className:"text-danger focus:bg-danger-wash focus:text-danger",children:[c.jsx(Ese,{size:16,"aria-hidden":"true"}),x("ui.shell.user_profile_sidebar.sign_out")]})]})]}):w});Nk.displayName="UserProfileSidebar";const GQe=()=>{const e=sT(),t=jn(),n=Ce(u=>u.setCataloguePageable),s=Ce(u=>u.setCatalogueActivityHead),r=Ce(u=>u.fetchSessions),i=yt(t.data,"session_catalogue_page"),a=yt(t.data,"session_catalogue_sort");g.useEffect(()=>{n(i)},[i,n]),g.useEffect(()=>{s(a)},[a,s]);const o=va(t.data,"session_catalogue",2)==="enabled",l=g.useCallback(()=>r(i?rB:Hw,i),[r,i]);return g.useEffect(()=>{o&&l()},[o,l,e.catalogueRevision]),null},VQe="flex h-[30px] w-full items-center gap-2 rounded-md px-2 text-body-sm transition-colors duration-fast ease-out-quart",WQe=()=>{Et();const e=ti(),t=Nae(),{expanded:n,mode:s,onCollapse:r}=ZQ(),i=Ke(le=>le.openCommandPalette),a=jn(),o=Ce(le=>le.activeSessionId),l=SQe(),u=va(a.data,"peers")==="enabled",d=YT(u),h=va(a.data,"approvals")==="enabled",f=jQe(d==="member"&&h,{poll:!0}),p=AQe(f.data??[]),m=yt(a.data,"projects",1),v=yt(a.data,"aida",1),b=B0(v),w=v&&b.data?.enabled===!0,C=b.data?.name??"Aida",y=ile(),k=wQe(b.data?.session_id),_=yQe(b.data?.session_id),E=()=>{y(e,b.data).catch(le=>zt(Ph(le)))},R=[...w?[{icon:Nne,label:C,path:"/chat",isActive:t==="chat"&&!!b.data?.session_id&&o===b.data?.session_id,tourTag:"nav-item-aida",onSelect:E,attention:k,attentionTag:"nav-aida-badge",attentionName:le=>x("ui.shell.sidebar_navigation.aida_missed",{name:C,count:le}),working:_,workingName:x("ui.shell.sidebar_navigation.aida_working",{name:C})}]:[],{icon:Uo,label:x("ui.shell.sidebar_navigation.agents"),path:"/agents",isActive:t==="agents",tourTag:"nav-item-agents"},...m?[{icon:cj,label:x("ui.shell.sidebar_navigation.projects"),path:"/projects",isActive:t==="projects",tourTag:"nav-item-projects"}]:[],{icon:oj,label:x("ui.shell.sidebar_navigation.schedules"),path:"/schedules",isActive:t==="schedules",tourTag:"nav-item-schedules"},{icon:Xc,label:x("ui.shell.sidebar_navigation.browser"),path:"/browser",isActive:t==="browser",tourTag:"nav-item-browser",attention:l,attentionTag:"nav-browser-badge",attentionName:le=>x("ui.shell.sidebar_navigation.browser_waiting",{count:le,countText:String(le)})},{icon:vj,label:x("ui.shell.sidebar_navigation.agent_hub"),path:"/agent-hub",isActive:t==="agent-hub",tourTag:"nav-item-agent-hub"},...d==="member"?[{icon:yB,label:x("ui.shell.sidebar_navigation.mesh"),path:"/mesh",isActive:t==="mesh",tourTag:"nav-item-mesh",attention:p,attentionTag:"nav-mesh-badge",attentionName:le=>x("ui.shell.sidebar_navigation.mesh_waiting",{count:le,countText:String(le)})}]:[]],F=c.jsx(l$e,{selectedConversation:o??void 0,onSelectConversation:le=>void dp(e,le),onStageDraft:(le,q)=>{Ce.getState().stageDraft(le,q),e("/chat")}}),A=le=>{const q=le.attention??0,we=q>0&&le.attentionName?le.attentionName(q):le.label;return le.working&&le.workingName?le.workingName:we},N=le=>{const q=le.attention??0,we=A(le),B=le.isActive?yo:"text-ink-muted hover:bg-row-hover hover:text-ink",be=c.jsx(le.icon,{size:16,"aria-hidden":"true",className:T("shrink-0",le.isActive&&"text-accent")});return c.jsx("li",{className:T("flex h-[30px] w-full items-center rounded-md","transition-colors duration-fast ease-out-quart",B),children:c.jsxs("button",{type:"button",onClick:()=>le.onSelect?le.onSelect():e(le.path),"data-tour-tag":le.tourTag,"aria-current":le.isActive?"page":void 0,"aria-label":n&&we===le.label?void 0:we,className:T("flex h-full min-w-0 flex-1 items-center gap-2 rounded-md",n?"px-2":"justify-center px-0"),children:[n?be:c.jsxs("span",{className:"relative flex size-7 shrink-0 items-center justify-center",children:[be,q>0&&c.jsx("span",{className:"pointer-events-none absolute -top-0.5 -right-0.5 flex",children:c.jsx(jl,{variant:"attentionQuiet",shape:"pill",size:"count",className:"h-3.5 min-w-3.5 px-0.75 leading-none","data-tour-tag":le.attentionTag,children:q})})]}),n&&c.jsx("span",{className:"truncate",children:le.label}),n&&q>0&&c.jsx("span",{className:"ml-auto inline-flex",children:c.jsx(jl,{variant:"attentionQuiet",shape:"pill",size:"count","data-tour-tag":le.attentionTag,children:q})}),le.working&&c.jsx("span",{className:T(n&&"ml-auto","inline-flex"),children:c.jsx(Wi,{size:16,"aria-hidden":"true",className:"text-accent motion-safe:animate-spin"})})]})},le.tourTag)},M=le=>n?N(le):c.jsx("li",{children:c.jsx(Ze,{content:A(le),side:"right",children:N(le)})},le.tourTag),D=s==="overlay"?x("ui.shell.sidebar_navigation.close_sidebar"):n?x("ui.shell.sidebar_navigation.collapse_sidebar"):x("ui.shell.sidebar_navigation.expand_sidebar"),L=s==="overlay"?Pn:n?vd:ba,V=navigator.platform.toUpperCase().indexOf("MAC")>=0,j=yt(a.data,"session_catalogue",2),te=Ce(le=>le.activeDraftKey),X=Ce(le=>le.drafts),re=!!te&&!(te?X[te]:void 0)?.target,G=()=>{Ce.getState().stageDraft(void 0,!0),e("/chat")},J=x("ui.shell.sidebar_navigation.new_chat_shortcut",{shortcut:v3(V).replace("+","")}),ae=x("ui.shell.sidebar_navigation.search_accessible",{everything:ko("everything",V),chats:ko("chats",V)}),O=x("ui.shell.sidebar_navigation.search_tooltip",{everything:ko("everything",V),chats:ko("chats",V)}),U=(le,q,we,B)=>{const be=le;return c.jsxs("button",{type:"button",...B.attrs,onClick:B.onClick,disabled:B.disabled,"aria-label":B.ariaLabel,"aria-current":B.current?"page":void 0,className:T(VQe,B.current?yo:"text-ink-muted hover:bg-row-hover hover:text-ink","disabled:text-ink-disabled disabled:hover:bg-transparent"),children:[c.jsx(be,{size:16,"aria-hidden":"true",className:"shrink-0"}),c.jsx("span",{className:"truncate",children:q}),c.jsx("span",{"aria-hidden":"true",className:"ml-auto",children:c.jsx(Sr,{shortcut:we,joined:!0})})]})},P=U(WS,x("ui.shell.sidebar_navigation.new_chat"),v3(V),{onClick:G,ariaLabel:J,current:re,disabled:!j,attrs:{"data-tour-tag":"nav-item-chat","data-new-chat-row":""}}),z=U(bd,x("ui.shell.sidebar_navigation.search"),fqe("everything",V),{onClick:i,ariaLabel:ae,attrs:{"data-command-palette-trigger":"",title:O}}),ne=(le,q,we)=>{const B=le;return c.jsx(Ze,{content:q,side:"right",children:c.jsx("button",{type:"button",...we.attrs,onClick:we.onClick,disabled:we.disabled,"aria-label":q,className:T("flex size-8 items-center justify-center rounded-sm text-ink-muted","transition-colors duration-fast ease-out-quart","hover:bg-row-hover hover:text-ink","disabled:text-ink-disabled disabled:hover:bg-transparent"),children:c.jsx(B,{size:16,"aria-hidden":"true"})})})},fe=c.jsx("div",{className:T(s!=="overlay"&&T("pointer-events-none opacity-0 transition-opacity duration-fast ease-out-quart","group-hover/sidebar:pointer-events-auto group-hover/sidebar:opacity-100","group-focus-within/sidebar:pointer-events-auto group-focus-within/sidebar:opacity-100")),children:c.jsx(Ze,{content:D,side:"right",children:c.jsx(ce,{variant:"ghost",size:"icon-sm",onClick:r,"aria-label":D,"aria-expanded":s==="overlay"?void 0:n,"aria-keyshortcuts":VF(V),children:c.jsx(L,{"aria-hidden":"true"})})})}),ue=c.jsx(Ze,{content:x("ui.shell.sidebar_navigation.settings"),side:"top",children:c.jsx("button",{type:"button","data-tour-tag":"nav-item-settings",onClick:()=>e("/settings"),"aria-current":t==="settings"?"page":void 0,"aria-label":x("ui.shell.sidebar_navigation.settings"),className:T("flex size-8 shrink-0 items-center justify-center rounded-sm text-ink-muted","transition-colors duration-fast ease-out-quart","hover:bg-row-hover hover:text-ink",t==="settings"&&"text-ink"),children:c.jsx(Mc,{size:16,"aria-hidden":"true"})})});return n?c.jsxs("div",{"data-sidebar-shell":"","data-glass-region":"sidebar",className:"group/sidebar flex h-full min-h-0 flex-col overflow-hidden bg-surface",children:[c.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 pr-2 pl-4",children:[c.jsx(o4,{expanded:!0}),c.jsx("span",{className:"ml-auto",children:fe})]}),c.jsxs("div",{className:"flex shrink-0 flex-col gap-2 px-2 pb-2",children:[c.jsxs("div",{className:"flex flex-col gap-0.5",children:[P,z]}),c.jsx("ul",{className:"flex flex-col gap-0.5",children:R.map(M)})]}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:F}),c.jsxs("div",{className:"flex min-h-10 shrink-0 items-center justify-between gap-1 px-2 pb-2",children:[c.jsx(Nk,{expanded:!0}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(a4,{}),ue]})]})]}):c.jsxs("div",{"data-sidebar-strip":"","data-glass-region":"sidebar",className:"group/sidebar flex h-full min-h-0 flex-col items-center bg-surface",children:[c.jsx(GQe,{}),c.jsx("div",{className:"flex h-10 shrink-0 items-center justify-center",children:c.jsx(o4,{expanded:!1})}),c.jsxs("ul",{className:"flex flex-col items-center gap-1",children:[c.jsx("li",{children:ne(ba,D,{onClick:r,attrs:{"aria-expanded":!1,"aria-keyshortcuts":VF(V)}})}),c.jsx("li",{children:ne(WS,J,{onClick:G,disabled:!j,attrs:{"data-tour-tag":"nav-item-chat"}})}),c.jsx("li",{children:ne(bd,ae,{onClick:i,attrs:{"data-command-palette-trigger":""}})})]}),c.jsx("ul",{className:"mt-4 flex flex-col items-center gap-1",children:R.map(M)}),c.jsxs("div",{className:"mt-auto flex flex-col items-center gap-1 pb-2",children:[c.jsx(a4,{}),ue,c.jsx(Nk,{expanded:!1})]})]})},$Qe=1,zQe=()=>{const{isAuthenticated:e,user:t}=DB(),{hasBeenNotified:n,setHasBeenNotified:s}=s$(),[r,i]=g.useState(!1),[a,o]=g.useState(null),l=g.useCallback(async()=>{if(!(!e||!t?.radientUser?.account?.tenant_id))try{const f=await eJ({operation:"credits",tenantId:t.radientUser.account.tenant_id});if(!f||typeof f.balance!="number")throw new Error("Invalid credit balance response format");o(f.balance)}catch(f){console.error("Failed to fetch Radient credits:",f),o(null)}},[e,t?.radientUser?.account?.tenant_id]);return g.useEffect(()=>{e&&l()},[e,l]),g.useEffect(()=>{e&&a!==null?a<$Qe?n||i(!0):(i(!1),n&&s(!1)):i(!1)},[e,n,a,s]),{isLowCreditsDialogOpen:r,openRadientConsole:()=>{window.api?.openExternal?window.api.openExternal("https://console.radienthq.com"):window.open("https://console.radienthq.com","_blank"),s(!0),i(!1)},closeLowCreditsDialog:()=>{i(!1)},onLowCreditsDialogClose:()=>{s(!0),i(!1)},currentCredits:a}};function qQe(){const e=ti();g.useEffect(()=>{const t=r=>{e(r==="back"?-1:1)},n=r=>{const i=$he(r);i&&(r.preventDefault(),t(i))},s=r=>{const i=zhe(r);i&&(r.preventDefault(),t(i))};return window.addEventListener("keydown",n),window.addEventListener("mouseup",s),()=>{window.removeEventListener("keydown",n),window.removeEventListener("mouseup",s)}},[e])}function KQe(){const e=navigator.windowControlsOverlay;if(!e?.getTitlebarAreaRect)return null;try{const t=e.getTitlebarAreaRect();return t.width<=0&&t.height<=0?null:{x:t.x,y:t.y,width:t.width,height:t.height}}catch{return null}}function YQe(e,t,n){const s=document.documentElement;if(t==="mac"){s.dataset.chromeLeading="true",s.dataset.chromeTrailing="false";return}if(e===null){s.dataset.chromeLeading="false",s.dataset.chromeTrailing="false";return}s.dataset.chromeLeading=e.x<=1?"true":"false",s.dataset.chromeTrailing=Math.abs(e.x+e.width-n)<=1?"true":"false"}function XQe(e){const t=window.api?.windowChrome;if(!t)return;const n=getComputedStyle(document.documentElement),s=n.getPropertyValue("--lo-canvas").trim(),r=n.getPropertyValue("--lo-ink-muted").trim(),i=n.getPropertyValue("--lo-ink-dim").trim();!s||!r||!i||t.report({themeId:e,colors:{ground:s,symbol:r,symbolInactive:i}})}function QQe(){g.useLayoutEffect(()=>{if(!window.api?.windowChrome)return;const t=document.documentElement.dataset.chromePlatform??"linux",n=()=>YQe(KQe(),t,window.innerWidth);n();const s=navigator.windowControlsOverlay;return s?.addEventListener?.("geometrychange",n),window.addEventListener("resize",n),()=>{s?.removeEventListener?.("geometrychange",n),window.removeEventListener("resize",n)}},[]),g.useEffect(()=>{const e=window.api?.windowChrome;if(e)return e.onState(t=>{document.documentElement.dataset.chromeFullscreen=t.fullScreen?"true":"false"})},[])}const JQe=g.lazy(()=>ql(()=>import("./agent-details-page-BEoctGwH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url).then(e=>({default:e.AgentDetailsPage}))),ZQe=g.lazy(()=>ql(()=>import("./agent-hub-page-DVtEYZne.js"),__vite__mapDeps([14,1,2,4,5,6,7,15,3,8,9,10,11,16,17,18,19,12,13]),import.meta.url).then(e=>({default:e.AgentHubPage}))),l4=g.lazy(()=>ql(()=>import("./agents-page-CqlFD0Ps.js"),__vite__mapDeps([20,4,1,2,5,6,7,8,16,12,13]),import.meta.url).then(e=>({default:e.AgentsPage}))),eJe=g.lazy(()=>ql(()=>import("./schedules-page-CR7bLqQt.js"),__vite__mapDeps([21,1,2,4,5,6,7,15,18,10,22,12,13]),import.meta.url).then(e=>({default:e.SchedulesPage}))),c4=g.lazy(()=>ql(()=>import("./projects-page-T2Yw-kRf.js"),__vite__mapDeps([23,1,2,4,5,6,7,15,24,12,13]),import.meta.url).then(e=>({default:e.ProjectsPage}))),tJe=g.lazy(()=>ql(()=>import("./browser-page-jc3r193W.js"),__vite__mapDeps([25,1,2,4,5,6,7,12,13]),import.meta.url).then(e=>({default:e.BrowserPage}))),nJe=g.lazy(()=>ql(()=>import("./mesh-page-DCCummN5.js"),__vite__mapDeps([26,1,2,4,5,6,7,15,12,13]),import.meta.url).then(e=>({default:e.MeshPage}))),sJe=g.lazy(()=>ql(()=>import("./settings-page-B_D-wGm4.js"),__vite__mapDeps([27,1,2,4,5,6,7,15,17,28,11,22,10,18,12,13]),import.meta.url).then(e=>({default:e.SettingsPage}))),rJe=g.lazy(()=>ql(()=>import("./browser-webauthn-prompt-PeVRs-qh.js"),__vite__mapDeps([29,1,2,5,6,4,7,12,13]),import.meta.url).then(e=>({default:e.BrowserWebauthnPrompt}))),iJe=()=>{Et(),QQe(),fQe();const{pathname:e}=nT(),t=e.startsWith("/chat")||e.startsWith("/browser"),{isOnboardingActive:n}=Pae(),{isLowCreditsDialogOpen:s,openRadientConsole:r,onLowCreditsDialogClose:i}=zQe(),{isCommandPaletteOpen:a,isCreateAgentDialogOpen:o,isSidebarCollapsed:l,closeCreateAgentDialog:u}=Ke();Sl(a,"command-palette"),Sl(o,"create-agent-dialog"),Sl(n,"onboarding"),Sl(s,"low-credits");const d=ti(),h=jn(),f=yt(h.data,"session_catalogue",2),p=yt(h.data,"session_archive");g.useEffect(()=>{Ce.getState().requestArchiveConfirm(null)},[e]);const m=va(h.data,"peers"),v=E=>{Ce.getState().stageDraft({kind:"agent",name:E.name}),d("/chat"),u()};Oqe(),mQe(),wqe(),qQe(),Ffe();const b=Ce(E=>E.setActiveSession),w=Ce(E=>{const R=E.activeDraftKey?E.drafts[E.activeDraftKey]:void 0;return op(E.activeDraftKey,R?.sessionId,E.activeSessionId)}),C=boe({displayedSessionId:w,archiveEnabled:p}),y=Ke(E=>E.setConsolePaneOpen),k=Ke(E=>E.setBrowserPaneOpen),_=Ke(E=>E.setConsoleActiveSurface);return g.useEffect(()=>{const E=window.api?.desktop?.onOpenConversation?.((R,F)=>{R!==null&&performance.mark("lop:open:requested"),b(R),F!==void 0&&R!==null&&(_(F),y(!0)),d("/chat")});return()=>E?.()},[d,b,y,_]),g.useEffect(()=>{const E=window.api?.console?.onReveal?.(R=>{R.mode!=="none"&&(R.mode==="session"&&R.session_id!==w||(R.mode==="open"&&b(R.session_id),_(R.surface),y(!0)))});return()=>E?.()},[w,b,y,_]),Qoe(),aqe(),g.useEffect(()=>{const E=window.api?.browser?.onConsentAttention?.(R=>{const F=yoe(R.requesterSessionId,Ce.getState().sessions);if(xoe(R.entryId),F.kind==="browser"){d("/browser");return}b(F.sessionId),k(!0),d("/chat")});return()=>E?.()},[d,b,k]),g.useEffect(()=>{const E=R=>{n||f&&lqe(R)&&(R.preventDefault(),Ce.getState().stageDraft(void 0,!0),d("/chat"))};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[f,n,d]),c.jsx(lQe,{children:c.jsx("div",{className:"relative flex h-screen flex-col overflow-hidden","data-titlebar-sidebar-collapsed":l?"true":"false",children:c.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[a&&c.jsx(Pqe,{}),c.jsx(cqe,{}),c.jsx(tJ,{}),c.jsx(Lqe,{enabled:m==="enabled"}),c.jsx(DKe,{open:n}),c.jsx(cQe,{}),c.jsx(hQe,{}),p&&c.jsx(tle,{}),c.jsx(soe,{}),c.jsx(g.Suspense,{fallback:null,children:c.jsx(rJe,{})}),c.jsx(hoe,{blocked:n||s||a||o||C,sessionId:e.startsWith("/chat")?w??null:null}),c.jsx(bQe,{open:s,onClose:i,onGoToConsole:r}),c.jsx(Lae,{open:o,onClose:u,onAgentCreated:v}),c.jsx(nJ,{sidebar:c.jsx(WQe,{}),content:c.jsxs("main",{"data-glass-region":"canvas-backing",className:"flex grow flex-col overflow-hidden",children:[t?null:c.jsx("div",{"data-chrome-route-band":""}),c.jsx(g.Suspense,{fallback:c.jsx("div",{className:"flex grow items-center justify-center",children:c.jsx(pn,{size:"lg",label:x("ui.common.loading.page")})}),children:c.jsxs(sJ,{children:[c.jsx(oi,{path:"/",element:c.jsx(xF,{to:"/chat",replace:!0})}),c.jsx(oi,{path:"/chat",element:c.jsx(g3,{})}),c.jsx(oi,{path:"/chat/:agentId",element:c.jsx(g3,{})}),c.jsx(oi,{path:"/agents",element:c.jsx(l4,{})}),c.jsx(oi,{path:"/agents/:agentId",element:c.jsx(l4,{})}),c.jsx(oi,{path:"/settings",element:c.jsx(sJe,{})}),c.jsx(oi,{path:"/agent-hub",element:c.jsx(ZQe,{})}),c.jsx(oi,{path:"/agent-hub/:agentId",element:c.jsx(JQe,{})}),c.jsx(oi,{path:"/schedules",element:c.jsx(eJe,{})}),c.jsx(oi,{path:"/projects",element:c.jsx(c4,{})}),c.jsx(oi,{path:"/projects/:projectId",element:c.jsx(c4,{})}),c.jsx(oi,{path:"/browser",element:c.jsx(tJe,{})}),m==="enabled"&&c.jsx(oi,{path:"/mesh",element:c.jsx(nJe,{})}),c.jsx(oi,{path:"*",element:c.jsx(xF,{to:"/chat",replace:!0})})]})})]})})]})})})};function zu(){return new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}const aJe=3,oJe=3e3;function lJe(e){return e instanceof CSSTransition&&e.playState==="running"}function cJe(e){const t=e.effect,n=t instanceof KeyframeEffect?t.target:null,s=e.transitionProperty,i=/^[a-z-]+$/.test(s)&&n instanceof Element?getComputedStyle(n).getPropertyValue(s).trim()||"(empty)":"(unreadable)";return`${s||"(unnamed property)"} on ${E0(n)??"an element no longer in the document"} = ${i}`}async function uJe(e=oJe){const t=performance.now();let n=0;for(;;){await zu();const s=Math.round(performance.now()-t),r=document.getAnimations().filter(lJe);if(n=r.length===0?n+1:0,n>=aJe)return{waitedMs:s,timedOut:!1,pending:[]};if(s>e)return{waitedMs:s,timedOut:!0,pending:r.map(cJe)}}}const dJe=/^#/;function wm(){const e=window.location.hash.replace(dJe,"");return e===""?"/":e}function E0(e){if(!e)return null;const t=e.getAttribute("aria-label")??e.textContent??"";return`${e.tagName.toLowerCase()}${e.id?`#${e.id}`:""} "${t.trim().slice(0,60)}"`}function hJe(e){const t=e.getBoundingClientRect(),n=t.left+t.width/2,s=t.top+t.height/2,r=document.elementFromPoint(n,s),i=r!==null&&(r===e||e.contains(r)),a=document.elementsFromPoint(n,s).slice(0,4).map(l=>E0(l)),o={bubbles:!0,cancelable:!0,composed:!0,button:0,buttons:1,clientX:n,clientY:s,view:window};return e.dispatchEvent(new PointerEvent("pointerdown",{...o,pointerId:1,isPrimary:!0})),e.dispatchEvent(new MouseEvent("mousedown",o)),e.dispatchEvent(new PointerEvent("pointerup",{...o,buttons:0,pointerId:1,isPrimary:!0})),e.dispatchEvent(new MouseEvent("mouseup",{...o,buttons:0})),e.dispatchEvent(new MouseEvent("click",{...o,buttons:0})),{hitTest:i,hit:E0(r),stack:a,disabled:e instanceof HTMLButtonElement?e.disabled:null,rect:{x:t.x,y:t.y,width:t.width,height:t.height}}}function mg(e,t){if(typeof e!="string"||e==="")throw new Error(`${t} must be a non-empty string`);return e}async function fJe(e,t=1e4){const n=Date.now();for(;wm()!==e;){if(Date.now()-n>t)throw new Error(`route did not become ${e} (it is ${wm()})`);await new Promise(s=>setTimeout(s,50))}return await zu(),wm()}const Mk=["dev-driver","query-fetch-probe"];let Cm=null;function pJe(){if(Cm)return Cm;const e=[],t=wF.prototype.fetch;return wF.prototype.fetch=function(...s){return e.push({at:Date.now(),key:JSON.stringify(this.queryKey),stack:(new Error().stack??"").split(`
|
|
685
685
|
`).slice(2).join(" | ")}),t.apply(this,s)},Cm=e,e}function gJe(e){const t=Cm??[],n=JSON.stringify(Mk),s=t.filter(i=>i.key!==n&&(e===void 0||i.key.includes(e))),r=new Map;for(const i of s){const a=r.get(i.stack)??{key:i.key,count:0,firstAt:i.at,lastAt:i.at};a.count+=1,a.lastAt=i.at,r.set(i.stack,a)}return{armed:Cm!==null,total:s.length,probeRecords:t.filter(i=>i.key===n).length,callers:[...r.entries()].map(([i,a])=>({stack:i,...a})).sort((i,a)=>i.firstAt-a.firstAt)}}function mJe(){const e=window.__loDevDriver;return e?.armed?e.install({hello:()=>({armed:!0,outDir:e.outDir,title:document.title,route:wm(),href:window.location.href,theme:Ke.getState().themeName,viewport:{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio},visibilityState:document.visibilityState,hasFocus:document.hasFocus(),apiBaseUrl:Es.baseUrl,userAgent:navigator.userAgent}),filesFacts:()=>rJ(),state:()=>{const t=Ke.getState(),n=Ce.getState();return{route:wm(),theme:t.themeName,commandPaletteOpen:t.isCommandPaletteOpen,canvasOpen:t.isCanvasOpen,runPanelOpen:t.isRunPanelOpen,browserPaneOpen:t.isBrowserPaneOpen,rightSlotWidth:t.rightSlotWidth,rightSlotKey:t.rightSlotKey??null,rightSlotMemory:t.rightSlotMemory.map(([s,r])=>[s,r]),activeSessionId:n.activeSessionId,activeDraftKey:n.activeDraftKey,drafts:Object.fromEntries(Object.entries(n.drafts).map(([s,r])=>[s,{sessionId:r.sessionId??null,error:r.error!==void 0,undelivered:r.undelivered!==void 0,submitted:r.submittedText!==void 0,admissionAttempted:r.admissionAttempted===!0}])),sessionCount:n.sessions.length,cataloguePinnedCount:n.sessions.filter(s=>s.pinned===!0).length,cataloguePageable:n.cataloguePageable,catalogueActivityHead:n.catalogueActivityHead,scopes:Object.fromEntries(Object.entries(n.scopes).map(([s,r])=>[s,{ids:r.ids.length,nextCursor:r.nextCursor,loading:r.loading,error:r.error}])),countsTotal:n.counts?.total??null,archiveAttempts:n.answerSeq,archiveFailure:n.archiveFailure?{sessionId:n.archiveFailure.sessionId,archived:n.archiveFailure.archived}:null,onboardingVisible:!!document.querySelector("[data-onboarding-modal]")}},queries:()=>ix.getQueryCache().getAll().map(t=>({key:JSON.stringify(t.queryKey),status:t.state.status,fetchStatus:t.state.fetchStatus,isLoading:t.state.status==="pending"&&t.state.fetchStatus==="fetching",error:t.state.error instanceof Error?t.state.error.message:null,hasData:t.state.data!==void 0,updatedAt:t.state.dataUpdatedAt,failureCount:t.state.fetchFailureCount,observers:t.getObserversCount()})),queryFetches:async t=>{const n=t??{};if(!n.arm)return gJe(n.key);const s=pJe(),r=JSON.stringify(Mk),i=s.length;return await ix.fetchQuery({queryKey:Mk,queryFn:()=>null,retry:!1,staleTime:0}),{armed:!0,validated:s.slice(i).some(a=>a.key===r)}},navigate:async t=>{const n=mg(t,"navigate path");if(!n.startsWith("/"))throw new Error(`navigate path must start with "/" (got "${n}")`);return window.location.hash=`#${n}`,{route:await fJe(n)}},setTheme:async t=>{const n=mg(t,"theme name");Ke.getState().setTheme(n),await zu();const s=document.documentElement.getAttribute("data-theme"),r=await uJe();return{theme:Ke.getState().themeName,dataTheme:s,settledAfterMs:r.waitedMs,settleTimedOut:r.timedOut,settlePending:r.pending}},setSidebarWidth:async t=>{const n=Number(t?.width);if(!Number.isFinite(n))throw new Error("sidebar width must be a number");const s=OZ(n);return Ke.getState().setChatSidebarWidth(s),await zu(),{width:Ke.getState().chatSidebarWidth,clamped:s!==n}},measure:async t=>{const n=typeof t=="string"?{selector:t}:t,s=mg(n?.selector,"measure selector"),r=typeof n?.timeoutMs=="number"?n.timeoutMs:1e4,i=Date.now();let a=null;for(;a===null&&(a=document.querySelector(s),a===null);){if(Date.now()-i>r)throw new Error(`nothing matches ${s} after ${r}ms of waiting`);await new Promise(d=>setTimeout(d,100))}const o=a.getBoundingClientRect(),l={x:Math.round(o.left+o.width/2),y:Math.round(o.top+o.height/2)},u=document.elementFromPoint(l.x,l.y);return{selector:s,target:E0(a),centre:l,rect:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(o.width),height:Math.round(o.height)},hitTest:u!==null&&(u===a||a.contains(u)),focused:a===document.activeElement,inViewport:o.top>=0&&o.left>=0&&o.bottom<=window.innerHeight&&o.right<=window.innerWidth}},press:async t=>{const n=typeof t=="string"?{selector:t}:t,s=mg(n?.selector,"press selector"),r=typeof n?.timeoutMs=="number"?n.timeoutMs:1e4,i=Date.now();let a=null;for(;a===null&&(a=document.querySelector(s),a===null);){if(Date.now()-i>r)throw new Error(`nothing matches ${s} after ${r}ms of waiting`);await new Promise(l=>setTimeout(l,100))}const o=hJe(a);return await zu(),{selector:s,target:E0(a),...o}},openCanvasDocument:async t=>{const n=t,s=mg(n?.path,"canvas document path"),r=typeof n?.title=="string"?n.title:void 0,[i]=await window.api.probeFiles([s]);if(!i||!i.exists||!i.isFile)throw new Error(`no file at ${i?.resolved??s}`);const a=i.resolved??s,o=Pc(a,{title:r,type:Tf(a),availability:"present",sizeBytes:i.sizeBytes??void 0,lastAgentModified:i.mtimeMs??void 0,readMtimeMs:i.mtimeMs??void 0}),l=Yw[ap(a,o.type)??"code"];if(l==="utf-8"||l==="base64"){const h=await window.api.readFile(o.path,l);if(!h.success)throw new Error(`could not read ${o.path}`);o.content=h.data}const u=Ce.getState(),d=aT(u.activeDraftKey,u.activeSessionId)??u.stageDraft();return Ke.getState().setCanvasOpen(!0),ls.getState().addFileAndSelect(d,o),n?.mention===!0&&ls.getState().addMentionedFile(d,o),await zu(),{conversationId:d,documentId:o.id,readMtimeMs:o.readMtimeMs??null,contentLength:o.content.length,encoding:l}},stageLiveConsents:async t=>{const s=t?.count;if(typeof s!="number"||!Number.isInteger(s)||s<0)throw new Error(`stageLiveConsents count must be a non-negative integer (got ${JSON.stringify(s)})`);const r=Date.now();return Ooe({tabs:[],activeTabId:null,url:"",title:"",loading:!1,canGoBack:!1,canGoForward:!1,pendingConsent:Array.from({length:s},(i,a)=>({entryId:`dev-driver-probe-${a+1}`,origin:`https://dev-driver-probe-${a+1}.example.com`,authority:`dev-driver-probe-${a+1}.example.com`,broad:null,expiresAt:r+10*6e4,requesterSessionId:null})),approvals:[],navFailure:null}),await zu(),{count:s}}}):[]}function vJe(){const e=g.useMemo(Uk,[]),t=g.useRef(null);return g.useEffect(()=>{const n=window.api?.miniView;if(!n?.onRegistration)return;let s=!1;const r=a=>{if(s)return;const o=t.current;if(t.current=a.status,o===null||a.status===o||a.status==="registered")return;const l=LZ(a.value,e);zt(iJ(a.status,l))};n.getRegistration?.()?.then(r)?.catch(()=>{});const i=n.onRegistration(r);return()=>{s=!0,i?.()}},[e]),null}const bJe=`
|
|
686
686
|
/*
|
|
687
687
|
* A transition declared on ::-webkit-scrollbar-thumb does not animate in
|