signetai 0.73.2 → 0.73.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dashboard/_app/immutable/chunks/{DUpxYGVo.js → -uImM-8U.js} +1 -1
  2. package/dashboard/_app/immutable/chunks/{D61JQVK1.js → 1QTZj3bv.js} +1 -1
  3. package/dashboard/_app/immutable/chunks/{me8jRBYr.js → 7Q_C6gvh.js} +1 -1
  4. package/dashboard/_app/immutable/chunks/{buEMgybe.js → B1ZcIj42.js} +1 -1
  5. package/dashboard/_app/immutable/chunks/{CRbytjRW.js → B6-eEBp1.js} +1 -1
  6. package/dashboard/_app/immutable/chunks/{CcO8dYb2.js → BFTMSpfE.js} +1 -1
  7. package/dashboard/_app/immutable/chunks/BHV7P7T-.js +1 -0
  8. package/dashboard/_app/immutable/chunks/{DNKJG9q5.js → BPoUmBUy.js} +1 -1
  9. package/dashboard/_app/immutable/chunks/{DxJFCgXp.js → BaomC9q2.js} +1 -1
  10. package/dashboard/_app/immutable/chunks/{CSe07v3c.js → BdoGcXR4.js} +2 -2
  11. package/dashboard/_app/immutable/chunks/{C6w56HCt.js → BqpZn81C.js} +1 -1
  12. package/dashboard/_app/immutable/chunks/{Csq6elBl.js → Bt9KBDR8.js} +1 -1
  13. package/dashboard/_app/immutable/chunks/{BRa-uGRw.js → BuALgIqw.js} +1 -1
  14. package/dashboard/_app/immutable/chunks/{CZUqoxIS.js → C0sflh33.js} +1 -1
  15. package/dashboard/_app/immutable/chunks/{DXo19Exm.js → C3zUiSZU.js} +3 -3
  16. package/dashboard/_app/immutable/chunks/{DfsR2GqT.js → C5YNpTrM.js} +1 -1
  17. package/dashboard/_app/immutable/chunks/{DTq5LiAT.js → C9VSkeLv.js} +1 -1
  18. package/dashboard/_app/immutable/chunks/{zKF2OWBu.js → CFEQUCGu.js} +1 -1
  19. package/dashboard/_app/immutable/chunks/{Yz5sqdvK.js → CLIZCmp8.js} +1 -1
  20. package/dashboard/_app/immutable/chunks/{C_iFxPxX.js → CQCF_qzx.js} +1 -1
  21. package/dashboard/_app/immutable/chunks/{BIYQK7bN.js → CV2ihHne.js} +1 -1
  22. package/dashboard/_app/immutable/chunks/{CFwv8DMK.js → CYPHnQ9h.js} +1 -1
  23. package/dashboard/_app/immutable/chunks/{zMfDj94V.js → C_zQyOv4.js} +1 -1
  24. package/dashboard/_app/immutable/chunks/{Bn0cv5C1.js → ChyJ2fSd.js} +1 -1
  25. package/dashboard/_app/immutable/chunks/{DWpU5B8s.js → CikQpvf3.js} +1 -1
  26. package/dashboard/_app/immutable/chunks/{Cb29leJc.js → CnHFq4KX.js} +1 -1
  27. package/dashboard/_app/immutable/chunks/{RgpZTMe7.js → CwrtuNt6.js} +1 -1
  28. package/dashboard/_app/immutable/chunks/{C3lI9M0p.js → D1yyTBif.js} +1 -1
  29. package/dashboard/_app/immutable/chunks/{C2drP4re.js → DAIj_Qqc.js} +1 -1
  30. package/dashboard/_app/immutable/chunks/{rscnw561.js → DB8PVkNi.js} +1 -1
  31. package/dashboard/_app/immutable/chunks/{I4Y-Rn6F.js → DEkVUhSO.js} +1 -1
  32. package/dashboard/_app/immutable/chunks/{BrFlUssm.js → DPhV9oNQ.js} +1 -1
  33. package/dashboard/_app/immutable/chunks/{Dz-cmMxq.js → DSHI0evG.js} +1 -1
  34. package/dashboard/_app/immutable/chunks/{DDPwl12u.js → DU-bJ5Y1.js} +1 -1
  35. package/dashboard/_app/immutable/chunks/{DsEJj0Hk.js → DhFCOPia.js} +1 -1
  36. package/dashboard/_app/immutable/chunks/{BLU4yB8e.js → DkQ7ZX67.js} +1 -1
  37. package/dashboard/_app/immutable/chunks/{ChIBU7RT.js → Hu2LMkJF.js} +1 -1
  38. package/dashboard/_app/immutable/chunks/{Ba2qyBcu.js → NAwz-tsj.js} +1 -1
  39. package/dashboard/_app/immutable/chunks/{wQBHoGgi.js → SIfFy-CI.js} +1 -1
  40. package/dashboard/_app/immutable/chunks/{C-UZlY30.js → TgUPrsuv.js} +1 -1
  41. package/dashboard/_app/immutable/chunks/{Cp6sRmGU.js → UJiH7_04.js} +1 -1
  42. package/dashboard/_app/immutable/chunks/{8UB6PvJ0.js → VrOhbAOk.js} +1 -1
  43. package/dashboard/_app/immutable/chunks/{DCm3EV9D.js → XDZP_w0l.js} +1 -1
  44. package/dashboard/_app/immutable/chunks/{CVYI3FMH.js → ZDfM8s2l.js} +1 -1
  45. package/dashboard/_app/immutable/chunks/{BQr-igtN.js → bSFN1gip.js} +1 -1
  46. package/dashboard/_app/immutable/chunks/{B1cXTonF.js → o-riJesN.js} +1 -1
  47. package/dashboard/_app/immutable/chunks/{BMLXvxJc.js → pKKSLy8H.js} +1 -1
  48. package/dashboard/_app/immutable/entry/{app.DStE1tPW.js → app.DzWLyhrd.js} +2 -2
  49. package/dashboard/_app/immutable/entry/start.B739zVdO.js +1 -0
  50. package/dashboard/_app/immutable/nodes/{1.DB_LXc7j.js → 1.D4F7hGvh.js} +1 -1
  51. package/dashboard/_app/immutable/nodes/2.pbJkOu1P.js +1 -0
  52. package/dashboard/_app/version.json +1 -1
  53. package/dashboard/index.html +6 -6
  54. package/dist/daemon.js +11 -3
  55. package/package.json +1 -1
  56. package/dashboard/_app/immutable/chunks/C6F49qT1.js +0 -1
  57. package/dashboard/_app/immutable/entry/start.CcsxGtiQ.js +0 -1
  58. package/dashboard/_app/immutable/nodes/2.z_6lwbCR.js +0 -1
@@ -1,4 +1,4 @@
1
- import{p as Le,g as Je,E as Ke,j as v,a as Qe,n as Xe,l as s,F as Ye,b as t,d as Ne,r as Ze,m as c,q as ea,t as e,k as I,i as a,O as te,o as Y,v as z,y as p,z as y,u as ze,f as P,A as ce,G as fe,w as G,x as H,D as ue,c as pe,a6 as me,B as ge,P as aa}from"./Bh3nIh1p.js";import{c as ra,a8 as ta,a9 as sa,aa as oa,ab as x,ac as _e,ad as he}from"./DXo19Exm.js";import{C as xe,a as be}from"./DsEJj0Hk.js";import{C as $e}from"./B1cXTonF.js";import{C as we,a as ye}from"./Cb29leJc.js";import{P as la}from"./Bfse3fCo.js";import{R as ia}from"./DxJFCgXp.js";var da=c("<div><!></div>");function Pe(Ae,q){Le(q,!0);let M=Je(q,"ref",15,null),O=Ze(q,["$$slots","$$events","$$legacy","ref","class","children"]);var k=da();Ke(k,V=>({"data-slot":"card-action",class:V,...O}),[()=>ra("col-start-2 row-span-2 row-start-1 self-start justify-self-end",q.class)]);var _=v(k);Qe(_,()=>q.children??Xe),s(k),Ye(k,V=>M(V),()=>M()),t(Ae,k),Ne()}var na=c('<span class="sig-meta whitespace-nowrap text-[var(--sig-text-muted)]"> </span>'),va=c('<div class="hidden h-full min-h-0 gap-4 2xl:flex"><div class="w-[21rem] min-w-[21rem] border border-[var(--sig-border)] bg-[var(--sig-surface)] p-4"><!> <!> <!> <div class="space-y-2"></div></div> <div class="min-w-0 flex-1 border border-[var(--sig-border)] bg-[var(--sig-surface)] p-4"><!> <!> <!> <div class="space-y-2"></div></div> <div class="min-w-0 flex-1 border border-[var(--sig-border)] bg-[var(--sig-surface)] p-4"><!> <!> <!> <div class="space-y-2"></div></div></div> <div class="flex h-full min-h-0 flex-col gap-3 2xl:hidden"><div class="flex gap-2 border-b border-[var(--sig-border)] pb-3"><!> <!> <!></div> <div class="border border-[var(--sig-border)] bg-[var(--sig-surface)] p-4"><!> <!> <!> <div class="space-y-2"></div></div></div>',1),ca=c(`<div class="flex h-full min-h-0 items-center justify-center"><div class="border border-[var(--sig-border-strong)] bg-[var(--sig-surface)]
1
+ import{p as Le,g as Je,E as Ke,j as v,a as Qe,n as Xe,l as s,F as Ye,b as t,d as Ne,r as Ze,m as c,q as ea,t as e,k as I,i as a,O as te,o as Y,v as z,y as p,z as y,u as ze,f as P,A as ce,G as fe,w as G,x as H,D as ue,c as pe,a6 as me,B as ge,P as aa}from"./Bh3nIh1p.js";import{c as ra,a8 as ta,a9 as sa,aa as oa,ab as x,ac as _e,ad as he}from"./C3zUiSZU.js";import{C as xe,a as be}from"./DhFCOPia.js";import{C as $e}from"./o-riJesN.js";import{C as we,a as ye}from"./CnHFq4KX.js";import{P as la}from"./Bfse3fCo.js";import{R as ia}from"./BaomC9q2.js";var da=c("<div><!></div>");function Pe(Ae,q){Le(q,!0);let M=Je(q,"ref",15,null),O=Ze(q,["$$slots","$$events","$$legacy","ref","class","children"]);var k=da();Ke(k,V=>({"data-slot":"card-action",class:V,...O}),[()=>ra("col-start-2 row-span-2 row-start-1 self-start justify-self-end",q.class)]);var _=v(k);Qe(_,()=>q.children??Xe),s(k),Ye(k,V=>M(V),()=>M()),t(Ae,k),Ne()}var na=c('<span class="sig-meta whitespace-nowrap text-[var(--sig-text-muted)]"> </span>'),va=c('<div class="hidden h-full min-h-0 gap-4 2xl:flex"><div class="w-[21rem] min-w-[21rem] border border-[var(--sig-border)] bg-[var(--sig-surface)] p-4"><!> <!> <!> <div class="space-y-2"></div></div> <div class="min-w-0 flex-1 border border-[var(--sig-border)] bg-[var(--sig-surface)] p-4"><!> <!> <!> <div class="space-y-2"></div></div> <div class="min-w-0 flex-1 border border-[var(--sig-border)] bg-[var(--sig-surface)] p-4"><!> <!> <!> <div class="space-y-2"></div></div></div> <div class="flex h-full min-h-0 flex-col gap-3 2xl:hidden"><div class="flex gap-2 border-b border-[var(--sig-border)] pb-3"><!> <!> <!></div> <div class="border border-[var(--sig-border)] bg-[var(--sig-surface)] p-4"><!> <!> <!> <div class="space-y-2"></div></div></div>',1),ca=c(`<div class="flex h-full min-h-0 items-center justify-center"><div class="border border-[var(--sig-border-strong)] bg-[var(--sig-surface)]
2
2
  px-6 py-5 text-center"><div class="sig-heading text-[var(--sig-text-bright)]">Project Unavailable</div> <p class="mt-2 max-w-md font-[family-name:var(--font-mono)] text-[11px]
3
3
  leading-5 text-[var(--sig-text-muted)]">Couldn&apos;t load README, roadmap, or changelog.</p> <button class="mt-4 text-[11px] uppercase tracking-[0.08em]
4
4
  font-[family-name:var(--font-mono)] text-[var(--sig-accent)]
@@ -1 +1 @@
1
- import{p as i,g as c,c as u,f,h as m,L as g,s as b,i as v,b as L,d as _,r as h,u as x}from"./Bh3nIh1p.js";import{c as y}from"./DXo19Exm.js";function P(t,e){i(e,!0);let a=c(e,"ref",15,null),r=h(e,["$$slots","$$events","$$legacy","ref","class"]);var s=u(),o=f(s);{let n=x(()=>y("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));m(o,()=>g,(l,d)=>{d(l,b({"data-slot":"label",get class(){return v(n)}},()=>r,{get ref(){return a()},set ref(p){a(p)}}))})}L(t,s),_()}export{P as L};
1
+ import{p as i,g as c,c as u,f,h as m,L as g,s as b,i as v,b as L,d as _,r as h,u as x}from"./Bh3nIh1p.js";import{c as y}from"./C3zUiSZU.js";function P(t,e){i(e,!0);let a=c(e,"ref",15,null),r=h(e,["$$slots","$$events","$$legacy","ref","class"]);var s=u(),o=f(s);{let n=x(()=>y("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));m(o,()=>g,(l,d)=>{d(l,b({"data-slot":"label",get class(){return v(n)}},()=>r,{get ref(){return a()},set ref(p){a(p)}}))})}L(t,s),_()}export{P as L};
@@ -1 +1 @@
1
- import{p as w,g as h,c as b,f as u,h as m,au as lt,s as I,i as y,b as n,d as F,r as P,u as M,t as V,A as H,w as st,x as fe,y as A,z as E,k as ve,a as te,av as ot,m as z,aw as dt,ax as ct,ay as ut,az as ft,E as ae,j as B,n as ie,l as N,F as Ie,aA as vt,aB as it,aC as gt,aD as mt,aE as ht,aF as _t,aG as yt,U as He,B as Je,aH as Te,aI as bt,a2 as Ee,aJ as Ue}from"./Bh3nIh1p.js";import{c as k,aX as Le,I as xt}from"./DXo19Exm.js";import{C as Ct}from"./DTq5LiAT.js";import{C as wt}from"./8UB6PvJ0.js";import{C as We}from"./C2drP4re.js";var Ft=z("<!> <!>",1),Pt=z("<!> <!>",1),zt=z("<!> <!>",1),kt=z("<!> <!>",1);function ca(l,e){w(e,!0);let a=h(e,"ref",15,null),s=h(e,"value",15),t=h(e,"placeholder",15),d=h(e,"weekdayFormat",3,"short"),r=h(e,"buttonVariant",3,"ghost"),c=h(e,"captionLayout",3,"label"),o=h(e,"locale",3,"en-US"),f=h(e,"yearFormat",3,"numeric"),L=h(e,"disableDaysOutsideMonth",3,!1),j=P(e,["$$slots","$$events","$$legacy","ref","value","placeholder","class","weekdayFormat","buttonVariant","captionLayout","locale","months","years","monthFormat","yearFormat","day","disableDaysOutsideMonth"]);const S=M(()=>e.monthFormat?e.monthFormat:c().startsWith("dropdown")?"short":"long");var D=b(),g=u(D);{const _=(v,x)=>{let i=()=>x?.().months,Y=()=>x?.().weekdays;var O=b(),Xe=u(O);m(Xe,()=>Ot,(qe,Ke)=>{Ke(qe,{children:(Qe,aa)=>{var je=kt(),Oe=u(je);m(Oe,()=>Zt,(J,U)=>{U(J,{children:(ge,me)=>{var re=Ft(),ne=u(re);m(ne,()=>Et,(T,le)=>{le(T,{get variant(){return r()}})});var he=V(ne,2);m(he,()=>At,(T,le)=>{le(T,{get variant(){return r()}})}),n(ge,re)},$$slots:{default:!0}})});var Re=V(Oe,2);H(Re,18,i,J=>J,(J,U,ge)=>{var me=b(),re=u(me);m(re,()=>Qt,(ne,he)=>{he(ne,{children:(T,le)=>{var Ye=zt(),Ve=u(Ye);m(Ve,()=>Lt,(_e,ye)=>{ye(_e,{children:(be,$e)=>{var W=b(),se=u(W);m(se,()=>ta,(xe,X)=>{X(xe,{get captionLayout(){return c()},get months(){return e.months},get monthFormat(){return y(S)},get years(){return e.years},get yearFormat(){return f()},get month(){return U.value},get locale(){return o()},get monthIndex(){return y(ge)},get placeholder(){return t()},set placeholder(q){t(q)}})}),n(be,W)},$$slots:{default:!0}})});var Ze=V(Ve,2);m(Ze,()=>It,(_e,ye)=>{ye(_e,{children:(be,$e)=>{var W=Pt(),se=u(W);m(se,()=>Vt,(X,q)=>{q(X,{children:(Ce,pe)=>{var K=b(),we=u(K);m(we,()=>Ge,(Q,Fe)=>{Fe(Q,{class:"select-none",children:(oe,Ne)=>{var de=b(),Pe=u(de);H(Pe,16,Y,R=>R,(R,Se)=>{var Z=b(),ze=u(Z);m(ze,()=>Nt,($,p)=>{p($,{children:(ce,Ae)=>{st();var ue=fe();A(ke=>E(ue,ke),[()=>Se.slice(0,2)]),n(ce,ue)},$$slots:{default:!0}})}),n(R,Z)}),n(oe,de)},$$slots:{default:!0}})}),n(Ce,K)},$$slots:{default:!0}})});var xe=V(se,2);m(xe,()=>Yt,(X,q)=>{q(X,{children:(Ce,pe)=>{var K=b(),we=u(K);H(we,16,()=>U.weeks,Q=>Q,(Q,Fe)=>{var oe=b(),Ne=u(oe);m(Ne,()=>Ge,(de,Pe)=>{Pe(de,{class:"mt-2 w-full",children:(R,Se)=>{var Z=b(),ze=u(Z);H(ze,16,()=>Fe,$=>$,($,p)=>{var ce=b(),Ae=u(ce);m(Ae,()=>Mt,(ue,ke)=>{ke(ue,{get date(){return p},get month(){return U.value},children:(et,ra)=>{var Be=b(),tt=u(Be);{var at=G=>{var ee=b(),Me=u(ee);{let De=M(()=>({day:p,outsideMonth:!ot(p,U.value)}));te(Me,()=>e.day,()=>y(De))}n(G,ee)},rt=G=>{var ee=b(),Me=u(ee);m(Me,()=>Dt,(De,nt)=>{nt(De,{})}),n(G,ee)};ve(tt,G=>{e.day?G(at):G(rt,-1)})}n(et,Be)},$$slots:{default:!0}})}),n($,ce)}),n(R,Z)},$$slots:{default:!0}})}),n(Q,oe)}),n(Ce,K)},$$slots:{default:!0}})}),n(be,W)},$$slots:{default:!0}})}),n(T,Ye)},$$slots:{default:!0}})}),n(J,me)}),n(Qe,je)},$$slots:{default:!0}})}),n(v,O)};let C=M(()=>k("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",e.class));m(g,()=>lt,(v,x)=>{x(v,I({get weekdayFormat(){return d()},get disableDaysOutsideMonth(){return L()},get class(){return y(C)},get locale(){return o()},get monthFormat(){return y(S)},get yearFormat(){return f()}},()=>j,{get value(){return s()},set value(i){s(i)},get ref(){return a()},set ref(i){a(i)},get placeholder(){return t()},set placeholder(i){t(i)},children:_,$$slots:{default:!0}}))})}n(l,D),F()}function Mt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("relative size-(--cell-size) p-0 text-center text-sm focus-within:z-20 [&:first-child[data-selected]_[data-bits-day]]:rounded-s-md [&:last-child[data-selected]_[data-bits-day]]:rounded-e-md",e.class));m(d,()=>dt,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Dt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k(Le({variant:"ghost"}),"flex size-(--cell-size) flex-col items-center justify-center gap-1 p-0 leading-none font-normal whitespace-nowrap select-none","[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground [&[data-today][data-disabled]]:text-muted-foreground","data-[selected]:bg-primary dark:data-[selected]:hover:bg-accent/50 data-[selected]:text-primary-foreground","[&[data-outside-month]:not([data-selected])]:text-muted-foreground [&[data-outside-month]:not([data-selected])]:hover:text-accent-foreground","data-[disabled]:text-muted-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50","data-[unavailable]:text-muted-foreground data-[unavailable]:line-through","dark:hover:text-accent-foreground","focus:border-ring focus:ring-ring/50 focus:relative","[&>span]:text-xs [&>span]:opacity-70",e.class));m(d,()=>ct,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function It(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("mt-4 flex w-full border-collapse flex-col gap-1",e.class));m(d,()=>ut,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Lt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",e.class));m(d,()=>ft,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}var jt=z("<div><!></div>");function Ot(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","children"]);var t=jt();ae(t,r=>({class:r,...s}),[()=>k("relative flex flex-col gap-4 md:flex-row",e.class)]);var d=B(t);te(d,()=>e.children??ie),N(t),Ie(t,r=>a(r),()=>a()),n(l,t),F()}function Ge(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("flex",e.class));m(d,()=>vt,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Yt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k(e.class));m(d,()=>it,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Vt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k(e.class));m(d,()=>gt,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Nt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("text-muted-foreground w-(--cell-size) rounded-md text-[0.8rem] font-normal",e.class));m(d,()=>mt,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}const St=l=>{Ct(l,{class:"size-4"})};function At(l,e){w(e,!0);let a=h(e,"ref",15,null),s=h(e,"variant",3,"ghost"),t=P(e,["$$slots","$$events","$$legacy","ref","class","children","variant"]);var d=b(),r=u(d);{let c=M(()=>k(Le({variant:s()}),"size-(--cell-size) bg-transparent p-0 select-none disabled:opacity-50 rtl:rotate-180",e.class)),o=M(()=>e.children||St);m(r,()=>ht,(f,L)=>{L(f,I({get class(){return y(c)},get children(){return y(o)}},()=>t,{get ref(){return a()},set ref(j){a(j)}}))})}n(l,d),F()}const Bt=l=>{wt(l,{class:"size-4"})};function Et(l,e){w(e,!0);let a=h(e,"ref",15,null),s=h(e,"variant",3,"ghost"),t=P(e,["$$slots","$$events","$$legacy","ref","class","children","variant"]);var d=b(),r=u(d);{let c=M(()=>k(Le({variant:s()}),"size-(--cell-size) bg-transparent p-0 select-none disabled:opacity-50 rtl:rotate-180",e.class)),o=M(()=>e.children||Bt);m(r,()=>_t,(f,L)=>{L(f,I({get class(){return y(c)},get children(){return y(o)}},()=>t,{get ref(){return a()},set ref(j){a(j)}}))})}n(l,d),F()}var Ut=z("<option> </option>"),Gt=z('<select></select> <span class="[&amp;>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md ps-2 pe-1 text-sm font-medium select-none [&amp;>svg]:size-3.5" aria-hidden="true"> <!></span>',1),Ht=z("<span><!></span>");function Jt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","value","onchange"]);var t=Ht(),d=B(t);{const r=(c,o)=>{let f=()=>o?.().props,L=()=>o?.().monthItems,j=()=>o?.().selectedMonthItem;var S=Gt(),D=u(S);ae(D,()=>({...f(),value:e.value,onchange:e.onchange})),H(D,21,L,v=>v.value,(v,x)=>{var i=Ut(),Y=B(i,!0);N(i);var O={};A(()=>{Te(i,e.value!==void 0?y(x).value===e.value:y(x).value===j().value),E(Y,y(x).label),O!==(O=y(x).value)&&(i.value=(i.__value=y(x).value)??"")}),n(v,i)}),N(D);var g=V(D,2),_=B(g),C=V(_);We(C,{class:"size-4"}),N(g),A(v=>E(_,`${v??""} `),[()=>L().find(v=>v.value===e.value)?.label||j().label]),n(c,S)};m(d,()=>yt,(c,o)=>{o(c,I({class:"dark:bg-popover dark:text-popover-foreground absolute inset-0 opacity-0"},()=>s,{get ref(){return a()},set ref(f){a(f)},child:r,$$slots:{child:!0}}))})}N(t),A(r=>Je(t,1,r),[()=>He(k("has-focus:border-ring border-input has-focus:ring-ring/50 relative flex rounded-md border shadow-xs has-focus:ring-[3px]",e.class))]),n(l,t),F()}var Tt=z("<option> </option>"),Wt=z('<select></select> <span class="[&amp;>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md ps-2 pe-1 text-sm font-medium select-none [&amp;>svg]:size-3.5" aria-hidden="true"> <!></span>',1),Xt=z("<span><!></span>");function qt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","value"]);var t=Xt(),d=B(t);{const r=(c,o)=>{let f=()=>o?.().props,L=()=>o?.().yearItems,j=()=>o?.().selectedYearItem;var S=Wt(),D=u(S);ae(D,()=>({...f(),value:e.value})),H(D,21,L,v=>v.value,(v,x)=>{var i=Tt(),Y=B(i,!0);N(i);var O={};A(()=>{Te(i,e.value!==void 0?y(x).value===e.value:y(x).value===j().value),E(Y,y(x).label),O!==(O=y(x).value)&&(i.value=(i.__value=y(x).value)??"")}),n(v,i)}),N(D);var g=V(D,2),_=B(g),C=V(_);We(C,{class:"size-4"}),N(g),A(v=>E(_,`${v??""} `),[()=>L().find(v=>v.value===e.value)?.label||j().label]),n(c,S)};m(d,()=>bt,(c,o)=>{o(c,I({class:"dark:bg-popover dark:text-popover-foreground absolute inset-0 opacity-0"},()=>s,{get ref(){return a()},set ref(f){a(f)},child:r,$$slots:{child:!0}}))})}N(t),A(r=>Je(t,1,r),[()=>He(k("has-focus:border-ring border-input has-focus:ring-ring/50 relative flex rounded-md border shadow-xs has-focus:ring-[3px]",e.class))]),n(l,t),F()}var Kt=z("<div><!></div>");function Qt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","children"]);var t=Kt();ae(t,r=>({...s,class:r}),[()=>k("flex flex-col",e.class)]);var d=B(t);te(d,()=>e.children??ie),N(t),Ie(t,r=>a(r),()=>a()),n(l,t),F()}var Rt=z("<nav><!></nav>");function Zt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","children"]);var t=Rt();ae(t,r=>({...s,class:r}),[()=>k("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",e.class)]);var d=B(t);te(d,()=>e.children??ie),N(t),Ie(t,r=>a(r),()=>a()),n(l,t),F()}var $t=z("<!> <!>",1),pt=z("<!> <!>",1),ea=z("<!> <!>",1);function ta(l,e){w(e,!0);const a=g=>{Jt(g,{get months(){return e.months},get monthFormat(){return e.monthFormat},get value(){return e.month.month},onchange:_=>{if(!t())return;const C=Number.parseInt(_.currentTarget.value),v=t().set({month:C});t(v.subtract({months:d()}))}})},s=g=>{qt(g,{get years(){return e.years},get yearFormat(){return e.yearFormat},get value(){return e.month.year}})};let t=h(e,"placeholder",15),d=h(e,"monthIndex",3,0);function r(g){const _=g.toDate(Ee());return typeof e.yearFormat=="function"?e.yearFormat(_.getFullYear()):new Ue(e.locale,{year:e.yearFormat}).format(_)}function c(g){const _=g.toDate(Ee());return typeof e.monthFormat=="function"?e.monthFormat(_.getMonth()+1):new Ue(e.locale,{month:e.monthFormat}).format(_)}var o=b(),f=u(o);{var L=g=>{var _=$t(),C=u(_);a(C);var v=V(C,2);s(v),n(g,_)},j=g=>{var _=pt(),C=u(_);a(C);var v=V(C,2);{var x=i=>{var Y=fe();A(O=>E(Y,O),[()=>r(t())]),n(i,Y)};ve(v,i=>{t()&&i(x)})}n(g,_)},S=g=>{var _=ea(),C=u(_);{var v=i=>{var Y=fe();A(O=>E(Y,O),[()=>c(t())]),n(i,Y)};ve(C,i=>{t()&&i(v)})}var x=V(C,2);s(x),n(g,_)},D=g=>{var _=fe();A((C,v)=>E(_,`${C??""} ${v??""}`),[()=>c(e.month),()=>r(e.month)]),n(g,_)};ve(f,g=>{e.captionLayout==="dropdown"?g(L):e.captionLayout==="dropdown-months"?g(j,1):e.captionLayout==="dropdown-years"?g(S,2):g(D,-1)})}n(l,o),F()}function ua(l,e){w(e,!0);let a=P(e,["$$slots","$$events","$$legacy"]);const s=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];xt(l,I({name:"calendar"},()=>a,{get iconNode(){return s},children:(t,d)=>{var r=b(),c=u(r);te(c,()=>e.children??ie),n(t,r)},$$slots:{default:!0}})),F()}export{ca as C,ua as a};
1
+ import{p as w,g as h,c as b,f as u,h as m,au as lt,s as I,i as y,b as n,d as F,r as P,u as M,t as V,A as H,w as st,x as fe,y as A,z as E,k as ve,a as te,av as ot,m as z,aw as dt,ax as ct,ay as ut,az as ft,E as ae,j as B,n as ie,l as N,F as Ie,aA as vt,aB as it,aC as gt,aD as mt,aE as ht,aF as _t,aG as yt,U as He,B as Je,aH as Te,aI as bt,a2 as Ee,aJ as Ue}from"./Bh3nIh1p.js";import{c as k,aX as Le,I as xt}from"./C3zUiSZU.js";import{C as Ct}from"./C9VSkeLv.js";import{C as wt}from"./VrOhbAOk.js";import{C as We}from"./DAIj_Qqc.js";var Ft=z("<!> <!>",1),Pt=z("<!> <!>",1),zt=z("<!> <!>",1),kt=z("<!> <!>",1);function ca(l,e){w(e,!0);let a=h(e,"ref",15,null),s=h(e,"value",15),t=h(e,"placeholder",15),d=h(e,"weekdayFormat",3,"short"),r=h(e,"buttonVariant",3,"ghost"),c=h(e,"captionLayout",3,"label"),o=h(e,"locale",3,"en-US"),f=h(e,"yearFormat",3,"numeric"),L=h(e,"disableDaysOutsideMonth",3,!1),j=P(e,["$$slots","$$events","$$legacy","ref","value","placeholder","class","weekdayFormat","buttonVariant","captionLayout","locale","months","years","monthFormat","yearFormat","day","disableDaysOutsideMonth"]);const S=M(()=>e.monthFormat?e.monthFormat:c().startsWith("dropdown")?"short":"long");var D=b(),g=u(D);{const _=(v,x)=>{let i=()=>x?.().months,Y=()=>x?.().weekdays;var O=b(),Xe=u(O);m(Xe,()=>Ot,(qe,Ke)=>{Ke(qe,{children:(Qe,aa)=>{var je=kt(),Oe=u(je);m(Oe,()=>Zt,(J,U)=>{U(J,{children:(ge,me)=>{var re=Ft(),ne=u(re);m(ne,()=>Et,(T,le)=>{le(T,{get variant(){return r()}})});var he=V(ne,2);m(he,()=>At,(T,le)=>{le(T,{get variant(){return r()}})}),n(ge,re)},$$slots:{default:!0}})});var Re=V(Oe,2);H(Re,18,i,J=>J,(J,U,ge)=>{var me=b(),re=u(me);m(re,()=>Qt,(ne,he)=>{he(ne,{children:(T,le)=>{var Ye=zt(),Ve=u(Ye);m(Ve,()=>Lt,(_e,ye)=>{ye(_e,{children:(be,$e)=>{var W=b(),se=u(W);m(se,()=>ta,(xe,X)=>{X(xe,{get captionLayout(){return c()},get months(){return e.months},get monthFormat(){return y(S)},get years(){return e.years},get yearFormat(){return f()},get month(){return U.value},get locale(){return o()},get monthIndex(){return y(ge)},get placeholder(){return t()},set placeholder(q){t(q)}})}),n(be,W)},$$slots:{default:!0}})});var Ze=V(Ve,2);m(Ze,()=>It,(_e,ye)=>{ye(_e,{children:(be,$e)=>{var W=Pt(),se=u(W);m(se,()=>Vt,(X,q)=>{q(X,{children:(Ce,pe)=>{var K=b(),we=u(K);m(we,()=>Ge,(Q,Fe)=>{Fe(Q,{class:"select-none",children:(oe,Ne)=>{var de=b(),Pe=u(de);H(Pe,16,Y,R=>R,(R,Se)=>{var Z=b(),ze=u(Z);m(ze,()=>Nt,($,p)=>{p($,{children:(ce,Ae)=>{st();var ue=fe();A(ke=>E(ue,ke),[()=>Se.slice(0,2)]),n(ce,ue)},$$slots:{default:!0}})}),n(R,Z)}),n(oe,de)},$$slots:{default:!0}})}),n(Ce,K)},$$slots:{default:!0}})});var xe=V(se,2);m(xe,()=>Yt,(X,q)=>{q(X,{children:(Ce,pe)=>{var K=b(),we=u(K);H(we,16,()=>U.weeks,Q=>Q,(Q,Fe)=>{var oe=b(),Ne=u(oe);m(Ne,()=>Ge,(de,Pe)=>{Pe(de,{class:"mt-2 w-full",children:(R,Se)=>{var Z=b(),ze=u(Z);H(ze,16,()=>Fe,$=>$,($,p)=>{var ce=b(),Ae=u(ce);m(Ae,()=>Mt,(ue,ke)=>{ke(ue,{get date(){return p},get month(){return U.value},children:(et,ra)=>{var Be=b(),tt=u(Be);{var at=G=>{var ee=b(),Me=u(ee);{let De=M(()=>({day:p,outsideMonth:!ot(p,U.value)}));te(Me,()=>e.day,()=>y(De))}n(G,ee)},rt=G=>{var ee=b(),Me=u(ee);m(Me,()=>Dt,(De,nt)=>{nt(De,{})}),n(G,ee)};ve(tt,G=>{e.day?G(at):G(rt,-1)})}n(et,Be)},$$slots:{default:!0}})}),n($,ce)}),n(R,Z)},$$slots:{default:!0}})}),n(Q,oe)}),n(Ce,K)},$$slots:{default:!0}})}),n(be,W)},$$slots:{default:!0}})}),n(T,Ye)},$$slots:{default:!0}})}),n(J,me)}),n(Qe,je)},$$slots:{default:!0}})}),n(v,O)};let C=M(()=>k("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",e.class));m(g,()=>lt,(v,x)=>{x(v,I({get weekdayFormat(){return d()},get disableDaysOutsideMonth(){return L()},get class(){return y(C)},get locale(){return o()},get monthFormat(){return y(S)},get yearFormat(){return f()}},()=>j,{get value(){return s()},set value(i){s(i)},get ref(){return a()},set ref(i){a(i)},get placeholder(){return t()},set placeholder(i){t(i)},children:_,$$slots:{default:!0}}))})}n(l,D),F()}function Mt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("relative size-(--cell-size) p-0 text-center text-sm focus-within:z-20 [&:first-child[data-selected]_[data-bits-day]]:rounded-s-md [&:last-child[data-selected]_[data-bits-day]]:rounded-e-md",e.class));m(d,()=>dt,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Dt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k(Le({variant:"ghost"}),"flex size-(--cell-size) flex-col items-center justify-center gap-1 p-0 leading-none font-normal whitespace-nowrap select-none","[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground [&[data-today][data-disabled]]:text-muted-foreground","data-[selected]:bg-primary dark:data-[selected]:hover:bg-accent/50 data-[selected]:text-primary-foreground","[&[data-outside-month]:not([data-selected])]:text-muted-foreground [&[data-outside-month]:not([data-selected])]:hover:text-accent-foreground","data-[disabled]:text-muted-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50","data-[unavailable]:text-muted-foreground data-[unavailable]:line-through","dark:hover:text-accent-foreground","focus:border-ring focus:ring-ring/50 focus:relative","[&>span]:text-xs [&>span]:opacity-70",e.class));m(d,()=>ct,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function It(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("mt-4 flex w-full border-collapse flex-col gap-1",e.class));m(d,()=>ut,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Lt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",e.class));m(d,()=>ft,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}var jt=z("<div><!></div>");function Ot(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","children"]);var t=jt();ae(t,r=>({class:r,...s}),[()=>k("relative flex flex-col gap-4 md:flex-row",e.class)]);var d=B(t);te(d,()=>e.children??ie),N(t),Ie(t,r=>a(r),()=>a()),n(l,t),F()}function Ge(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("flex",e.class));m(d,()=>vt,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Yt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k(e.class));m(d,()=>it,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Vt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k(e.class));m(d,()=>gt,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}function Nt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class"]);var t=b(),d=u(t);{let r=M(()=>k("text-muted-foreground w-(--cell-size) rounded-md text-[0.8rem] font-normal",e.class));m(d,()=>mt,(c,o)=>{o(c,I({get class(){return y(r)}},()=>s,{get ref(){return a()},set ref(f){a(f)}}))})}n(l,t),F()}const St=l=>{Ct(l,{class:"size-4"})};function At(l,e){w(e,!0);let a=h(e,"ref",15,null),s=h(e,"variant",3,"ghost"),t=P(e,["$$slots","$$events","$$legacy","ref","class","children","variant"]);var d=b(),r=u(d);{let c=M(()=>k(Le({variant:s()}),"size-(--cell-size) bg-transparent p-0 select-none disabled:opacity-50 rtl:rotate-180",e.class)),o=M(()=>e.children||St);m(r,()=>ht,(f,L)=>{L(f,I({get class(){return y(c)},get children(){return y(o)}},()=>t,{get ref(){return a()},set ref(j){a(j)}}))})}n(l,d),F()}const Bt=l=>{wt(l,{class:"size-4"})};function Et(l,e){w(e,!0);let a=h(e,"ref",15,null),s=h(e,"variant",3,"ghost"),t=P(e,["$$slots","$$events","$$legacy","ref","class","children","variant"]);var d=b(),r=u(d);{let c=M(()=>k(Le({variant:s()}),"size-(--cell-size) bg-transparent p-0 select-none disabled:opacity-50 rtl:rotate-180",e.class)),o=M(()=>e.children||Bt);m(r,()=>_t,(f,L)=>{L(f,I({get class(){return y(c)},get children(){return y(o)}},()=>t,{get ref(){return a()},set ref(j){a(j)}}))})}n(l,d),F()}var Ut=z("<option> </option>"),Gt=z('<select></select> <span class="[&amp;>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md ps-2 pe-1 text-sm font-medium select-none [&amp;>svg]:size-3.5" aria-hidden="true"> <!></span>',1),Ht=z("<span><!></span>");function Jt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","value","onchange"]);var t=Ht(),d=B(t);{const r=(c,o)=>{let f=()=>o?.().props,L=()=>o?.().monthItems,j=()=>o?.().selectedMonthItem;var S=Gt(),D=u(S);ae(D,()=>({...f(),value:e.value,onchange:e.onchange})),H(D,21,L,v=>v.value,(v,x)=>{var i=Ut(),Y=B(i,!0);N(i);var O={};A(()=>{Te(i,e.value!==void 0?y(x).value===e.value:y(x).value===j().value),E(Y,y(x).label),O!==(O=y(x).value)&&(i.value=(i.__value=y(x).value)??"")}),n(v,i)}),N(D);var g=V(D,2),_=B(g),C=V(_);We(C,{class:"size-4"}),N(g),A(v=>E(_,`${v??""} `),[()=>L().find(v=>v.value===e.value)?.label||j().label]),n(c,S)};m(d,()=>yt,(c,o)=>{o(c,I({class:"dark:bg-popover dark:text-popover-foreground absolute inset-0 opacity-0"},()=>s,{get ref(){return a()},set ref(f){a(f)},child:r,$$slots:{child:!0}}))})}N(t),A(r=>Je(t,1,r),[()=>He(k("has-focus:border-ring border-input has-focus:ring-ring/50 relative flex rounded-md border shadow-xs has-focus:ring-[3px]",e.class))]),n(l,t),F()}var Tt=z("<option> </option>"),Wt=z('<select></select> <span class="[&amp;>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md ps-2 pe-1 text-sm font-medium select-none [&amp;>svg]:size-3.5" aria-hidden="true"> <!></span>',1),Xt=z("<span><!></span>");function qt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","value"]);var t=Xt(),d=B(t);{const r=(c,o)=>{let f=()=>o?.().props,L=()=>o?.().yearItems,j=()=>o?.().selectedYearItem;var S=Wt(),D=u(S);ae(D,()=>({...f(),value:e.value})),H(D,21,L,v=>v.value,(v,x)=>{var i=Tt(),Y=B(i,!0);N(i);var O={};A(()=>{Te(i,e.value!==void 0?y(x).value===e.value:y(x).value===j().value),E(Y,y(x).label),O!==(O=y(x).value)&&(i.value=(i.__value=y(x).value)??"")}),n(v,i)}),N(D);var g=V(D,2),_=B(g),C=V(_);We(C,{class:"size-4"}),N(g),A(v=>E(_,`${v??""} `),[()=>L().find(v=>v.value===e.value)?.label||j().label]),n(c,S)};m(d,()=>bt,(c,o)=>{o(c,I({class:"dark:bg-popover dark:text-popover-foreground absolute inset-0 opacity-0"},()=>s,{get ref(){return a()},set ref(f){a(f)},child:r,$$slots:{child:!0}}))})}N(t),A(r=>Je(t,1,r),[()=>He(k("has-focus:border-ring border-input has-focus:ring-ring/50 relative flex rounded-md border shadow-xs has-focus:ring-[3px]",e.class))]),n(l,t),F()}var Kt=z("<div><!></div>");function Qt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","children"]);var t=Kt();ae(t,r=>({...s,class:r}),[()=>k("flex flex-col",e.class)]);var d=B(t);te(d,()=>e.children??ie),N(t),Ie(t,r=>a(r),()=>a()),n(l,t),F()}var Rt=z("<nav><!></nav>");function Zt(l,e){w(e,!0);let a=h(e,"ref",15,null),s=P(e,["$$slots","$$events","$$legacy","ref","class","children"]);var t=Rt();ae(t,r=>({...s,class:r}),[()=>k("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",e.class)]);var d=B(t);te(d,()=>e.children??ie),N(t),Ie(t,r=>a(r),()=>a()),n(l,t),F()}var $t=z("<!> <!>",1),pt=z("<!> <!>",1),ea=z("<!> <!>",1);function ta(l,e){w(e,!0);const a=g=>{Jt(g,{get months(){return e.months},get monthFormat(){return e.monthFormat},get value(){return e.month.month},onchange:_=>{if(!t())return;const C=Number.parseInt(_.currentTarget.value),v=t().set({month:C});t(v.subtract({months:d()}))}})},s=g=>{qt(g,{get years(){return e.years},get yearFormat(){return e.yearFormat},get value(){return e.month.year}})};let t=h(e,"placeholder",15),d=h(e,"monthIndex",3,0);function r(g){const _=g.toDate(Ee());return typeof e.yearFormat=="function"?e.yearFormat(_.getFullYear()):new Ue(e.locale,{year:e.yearFormat}).format(_)}function c(g){const _=g.toDate(Ee());return typeof e.monthFormat=="function"?e.monthFormat(_.getMonth()+1):new Ue(e.locale,{month:e.monthFormat}).format(_)}var o=b(),f=u(o);{var L=g=>{var _=$t(),C=u(_);a(C);var v=V(C,2);s(v),n(g,_)},j=g=>{var _=pt(),C=u(_);a(C);var v=V(C,2);{var x=i=>{var Y=fe();A(O=>E(Y,O),[()=>r(t())]),n(i,Y)};ve(v,i=>{t()&&i(x)})}n(g,_)},S=g=>{var _=ea(),C=u(_);{var v=i=>{var Y=fe();A(O=>E(Y,O),[()=>c(t())]),n(i,Y)};ve(C,i=>{t()&&i(v)})}var x=V(C,2);s(x),n(g,_)},D=g=>{var _=fe();A((C,v)=>E(_,`${C??""} ${v??""}`),[()=>c(e.month),()=>r(e.month)]),n(g,_)};ve(f,g=>{e.captionLayout==="dropdown"?g(L):e.captionLayout==="dropdown-months"?g(j,1):e.captionLayout==="dropdown-years"?g(S,2):g(D,-1)})}n(l,o),F()}function ua(l,e){w(e,!0);let a=P(e,["$$slots","$$events","$$legacy"]);const s=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];xt(l,I({name:"calendar"},()=>a,{get iconNode(){return s},children:(t,d)=>{var r=b(),c=u(r);te(c,()=>e.children??ie),n(t,r)},$$slots:{default:!0}})),F()}export{ca as C,ua as a};
@@ -1 +1 @@
1
- import{p as d,s as p,c,f as l,a as h,n as i,b as m,d as $,r as u}from"./Bh3nIh1p.js";import{I as f}from"./DXo19Exm.js";function _(t,a){d(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const s=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"}]];f(t,p({name:"wrench"},()=>o,{get iconNode(){return s},children:(r,v)=>{var e=c(),n=l(e);h(n,()=>a.children??i),m(r,e)},$$slots:{default:!0}})),$()}function N(t,a){d(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const s=[["path",{d:"M12 2v4"}],["path",{d:"m16.2 7.8 2.9-2.9"}],["path",{d:"M18 12h4"}],["path",{d:"m16.2 16.2 2.9 2.9"}],["path",{d:"M12 18v4"}],["path",{d:"m4.9 19.1 2.9-2.9"}],["path",{d:"M2 12h4"}],["path",{d:"m4.9 4.9 2.9 2.9"}]];f(t,p({name:"loader"},()=>o,{get iconNode(){return s},children:(r,v)=>{var e=c(),n=l(e);h(n,()=>a.children??i),m(r,e)},$$slots:{default:!0}})),$()}export{N as L,_ as W};
1
+ import{p as d,s as p,c,f as l,a as h,n as i,b as m,d as $,r as u}from"./Bh3nIh1p.js";import{I as f}from"./C3zUiSZU.js";function _(t,a){d(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const s=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"}]];f(t,p({name:"wrench"},()=>o,{get iconNode(){return s},children:(r,v)=>{var e=c(),n=l(e);h(n,()=>a.children??i),m(r,e)},$$slots:{default:!0}})),$()}function N(t,a){d(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const s=[["path",{d:"M12 2v4"}],["path",{d:"m16.2 7.8 2.9-2.9"}],["path",{d:"M18 12h4"}],["path",{d:"m16.2 16.2 2.9 2.9"}],["path",{d:"M12 18v4"}],["path",{d:"m4.9 19.1 2.9-2.9"}],["path",{d:"M2 12h4"}],["path",{d:"m4.9 4.9 2.9 2.9"}]];f(t,p({name:"loader"},()=>o,{get iconNode(){return s},children:(r,v)=>{var e=c(),n=l(e);h(n,()=>a.children??i),m(r,e)},$$slots:{default:!0}})),$()}export{N as L,_ as W};
@@ -1 +1 @@
1
- import{p as n,s as d,c as h,f as c,a as i,n as l,b as m,d as f,r as v}from"./Bh3nIh1p.js";import{I as u}from"./DXo19Exm.js";function g(t,a){n(a,!0);let e=v(a,["$$slots","$$events","$$legacy"]);const o=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];u(t,d({name:"trash-2"},()=>e,{get iconNode(){return o},children:(r,$)=>{var s=h(),p=c(s);i(p,()=>a.children??l),m(r,s)},$$slots:{default:!0}})),f()}export{g as T};
1
+ import{p as n,s as d,c as h,f as c,a as i,n as l,b as m,d as f,r as v}from"./Bh3nIh1p.js";import{I as u}from"./C3zUiSZU.js";function g(t,a){n(a,!0);let e=v(a,["$$slots","$$events","$$legacy"]);const o=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];u(t,d({name:"trash-2"},()=>e,{get iconNode(){return o},children:(r,$)=>{var s=h(),p=c(s);i(p,()=>a.children??l),m(r,s)},$$slots:{default:!0}})),f()}export{g as T};
@@ -1,4 +1,4 @@
1
- import{e as We,p as re,s as he,c as de,f as se,a as fe,n as ve,b as w,d as ie,r as we,j as c,k as J,t as _,l as s,y as ee,z as ae,D as ge,A as Te,i as t,m as N,v as m,o as Y,g as ft,Q as Ze,q as ze,aT as Ve,F as Je,B as xe,u as pe,O as G,P as Se,ad as et,N as Ee,af as Ie,w as ke,J as Me,x as vt,G as wt,R as yt}from"./Bh3nIh1p.js";import{H as me,I as ye,aN as bt,be as xt,bf as _t,ac as Et}from"./DXo19Exm.js";import{W as at,L as Tt}from"./buEMgybe.js";import{R as st}from"./DxJFCgXp.js";import{P as qe}from"./BRa-uGRw.js";import{P as kt}from"./Cp6sRmGU.js";import{T as St}from"./CRbytjRW.js";const k=We({entries:[],loading:!1,error:null,groups:[],activeGroup:null,draggingId:null,focusedId:null,widgetCacheVersion:0}),be=new Map,He=new Set;function Ct(){return k.entries.filter(n=>n.state==="tray")}function Nt(){const n=k.entries.filter(e=>e.state==="grid");if(k.activeGroup){const e=k.groups.find(r=>r.id===k.activeGroup);if(e)return n.filter(r=>e.items.includes(r.id))}return n}function It(){return k.entries.filter(n=>n.state==="dock")}const tt=12;function Qe(n,e,r){const a=r?.x??0,d=r?.y??0;function p(L,P,D,H){for(const A of n)if(L<A.x+A.w&&L+D>A.x&&P<A.y+A.h&&P+H>A.y)return!0;return!1}const o=Math.max(0,Math.min(tt-e.w,a)),y=Math.max(0,d);if(!p(o,y,e.w,e.h))return{x:o,y,w:e.w,h:e.h};for(let L=1;L<=20;L++)for(let P=-L;P<=L;P++)for(let D=-L;D<=L;D++){if(Math.abs(D)!==L&&Math.abs(P)!==L)continue;const H=Math.max(0,Math.min(tt-e.w,a+D)),A=Math.max(0,d+P);if(!p(H,A,e.w,e.h))return{x:H,y:A,w:e.w,h:e.h}}return{x:0,y:n.reduce((L,P)=>Math.max(L,P.y+P.h),0),w:e.w,h:e.h}}async function Oe(){k.loading=!0,k.error=null;try{const n=await fetch(`${me}/api/os/tray`);if(!n.ok)throw new Error(`HTTP ${n.status}`);const e=await n.json();k.entries=e.entries??[]}catch(n){k.error=n instanceof Error?n.message:String(n)}finally{k.loading=!1}}async function Ae(n,e,r){try{const a={state:e};r&&(a.gridPosition=r);const d=await fetch(`${me}/api/os/tray/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!d.ok)return!1;const p=await d.json();if(p.success&&p.entry){const o=k.entries.findIndex(y=>y.id===n);o>=0&&(k.entries[o]=p.entry)}return!0}catch{return!1}}async function nt(n,e){return Ae(n,"grid",e)}async function Xe(n,e){const r=k.entries.find(o=>o.id===n);if(!r)return!1;if(e)return Ae(n,"grid",e);const a=r.manifest?.defaultSize??{w:4,h:3},d=k.entries.flatMap(o=>o.id!==n&&o.state==="grid"&&o.gridPosition?[o.gridPosition]:[]),p=Qe(d,a);return Ae(n,"grid",p)}async function Mt(n){return Ae(n,"dock")}async function lt(n){return Ae(n,"tray")}const ct="signet-os-sidebar-groups";function At(){try{const n=localStorage.getItem(ct);n&&(k.groups=JSON.parse(n))}catch{k.groups=[]}}function Fe(){localStorage.setItem(ct,JSON.stringify(k.groups))}function Dt(n){const e={id:`group_${Date.now()}`,name:n,items:[]};return k.groups=[...k.groups,e],Fe(),e}function Rt(n){k.groups=k.groups.filter(e=>e.id!==n),k.activeGroup===n&&(k.activeGroup=null),Fe()}function Lt(n,e){k.groups=k.groups.map(r=>r.id===n?{...r,name:e}:r),Fe()}function Ht(n,e){k.groups=k.groups.map(r=>r.id!==n||r.items.includes(e)?r:{...r,items:[...r.items,e]}),Fe()}function Ge(n){k.activeGroup=n}let Pe=We(new Map),rt=0;function it(n,e,r){Pe.set(n,{action:e,data:r,_seq:++rt}),setTimeout(()=>{const a=Pe.get(n);a&&a._seq===rt&&Pe.delete(n)},500)}function Pt(n){return Pe.get(n)}function Ot(n){k.focusedId=n}function Re(){k.focusedId=null}async function $e(n){if(be.has(n))return be.get(n)??null;try{const e=await fetch(`${me}/api/os/widget/${encodeURIComponent(n)}`);if(!e.ok)return null;const r=await e.json();return r.html?(be.set(n,r.html),k.widgetCacheVersion++,r.html):null}catch{return null}}async function dt(n){if(!He.has(n)){He.add(n),k.widgetCacheVersion++;try{const r=await(await fetch(`${me}/api/os/widget/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:n,force:!1})})).json();r.status==="cached"&&r.html&&be.set(n,r.html)}catch{}finally{be.has(n)&&He.delete(n),k.widgetCacheVersion++}}}const Ke=new Map;function $t(n,e){Ke.set(n,e)}function Wt(n){Ke.delete(n)}function Le(n){return Ke.get(n)}const zt=We({current:null});function _e(n){zt.current=n}function Ye(n,e){re(e,!0);let r=we(e,["$$slots","$$events","$$legacy"]);const a=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];ye(n,he({name:"box"},()=>r,{get iconNode(){return a},children:(d,p)=>{var o=de(),y=se(o);fe(y,()=>e.children??ve),w(d,o)},$$slots:{default:!0}})),ie()}var Vt=N('<img class="auto-card-icon svelte-1y09vim" referrerpolicy="no-referrer"/>'),Ft=N('<div class="auto-card-icon-placeholder svelte-1y09vim"><!></div>'),jt=N('<button class="auto-card-tool-btn sig-switch svelte-1y09vim" disabled=""><!> <span class="truncate"> </span></button>'),Bt=N('<div class="auto-card-tools svelte-1y09vim"></div>'),Gt=N('<div class="auto-card-empty svelte-1y09vim"><span class="sig-label">No tools exposed</span></div>'),Ut=N('<div class="auto-card svelte-1y09vim"><div class="auto-card-header svelte-1y09vim"><!> <span class="auto-card-name svelte-1y09vim"> </span> <span class="sig-meta ml-auto"> </span></div> <!></div>');function qt(n,e){re(e,!0);var r=Ut(),a=c(r),d=c(a);{var p=O=>{var S=Vt();ee(()=>{ge(S,"src",e.icon),ge(S,"alt",e.name)}),w(O,S)},o=O=>{var S=Ft(),$=c(S);Ye($,{class:"size-4"}),s(S),w(O,S)};J(d,O=>{e.icon?O(p):O(o,-1)})}var y=_(d,2),U=c(y,!0);s(y);var L=_(y,2),P=c(L);s(L),s(a);var D=_(a,2);{var H=O=>{var S=Bt();Te(S,21,()=>e.autoCard.tools,$=>$.name,($,W)=>{var j=jt(),F=c(j);at(F,{class:"size-3 shrink-0 opacity-50"});var te=_(F,2),I=c(te,!0);s(te),s(j),ee(()=>{ge(j,"title",t(W).description||t(W).name),ae(I,t(W).name)}),w($,j)}),s(S),w(O,S)},A=O=>{var S=Gt();w(O,S)};J(D,O=>{e.autoCard.tools.length>0?O(H):O(A,-1)})}s(r),ee(()=>{ae(U,e.name),ae(P,`${e.autoCard.tools.length??""} tools`)}),w(n,r),ie()}const Xt='// Signet Page Agent bundle - PageController + lightweight cursor mask\n// Auto-generated from @page-agent/page-controller v1.6.0\n\n\n(function(){\n // Lightweight SimulatorMask - cursor + overlay, no ai-motion dependency\n var CSS_TEXT = \'.__pa_mask{position:fixed;inset:0;z-index:2147483641;cursor:wait;overflow:hidden;display:none;background:rgba(0,0,0,0.02)}.__pa_mask.__pa_vis{display:block}.__pa_cur{position:absolute;width:40px;height:40px;pointer-events:none;z-index:10000;transition:none}.__pa_cur_fill{position:absolute;width:100%;height:100%;background:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' fill=\\\'%23ffffff\\\' stroke=\\\'%23333\\\' stroke-width=\\\'4\\\'/%3e%3c/svg%3e");background-size:100% 100%;transform-origin:center;transform:rotate(-135deg) scale(1.1);margin-left:-8px;margin-top:-14px}.__pa_cur_border{position:absolute;width:100%;height:100%;background:linear-gradient(45deg,rgb(57,182,255),rgb(189,69,251));mask-image:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\' fill=\\\'none\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' stroke=\\\'%23000\\\' stroke-width=\\\'6\\\'/%3e%3c/svg%3e");mask-size:100% 100%;mask-repeat:no-repeat;transform-origin:center;transform:rotate(-135deg) scale(1.2);margin-left:-10px;margin-top:-18px}.__pa_ripple{position:absolute;width:100%;height:100%;pointer-events:none;margin-left:-50%;margin-top:-50%}.__pa_ripple::after{content:\\\'\\\';opacity:0;position:absolute;inset:0;border:3px solid rgba(57,182,255,1);border-radius:50%}.__pa_cur.__pa_click .__pa_ripple::after{animation:__pa_rip 300ms ease-out forwards}@keyframes __pa_rip{0%{transform:scale(0);opacity:1}100%{transform:scale(2);opacity:0}}\';\n \n try{\n var s=document.createElement(\'style\');\n s.appendChild(document.createTextNode(CSS_TEXT));\n document.head.appendChild(s);\n }catch(e){}\n\n function LiteMask(){\n this.shown=false;\n this.wrapper=document.createElement(\'div\');\n this.wrapper.className=\'__pa_mask\';\n this.wrapper.setAttribute(\'data-page-agent-ignore\',\'true\');\n \n this._cursor=document.createElement(\'div\');\n this._cursor.className=\'__pa_cur\';\n var ripple=document.createElement(\'div\');ripple.className=\'__pa_ripple\';this._cursor.appendChild(ripple);\n var fill=document.createElement(\'div\');fill.className=\'__pa_cur_fill\';this._cursor.appendChild(fill);\n var border=document.createElement(\'div\');border.className=\'__pa_cur_border\';this._cursor.appendChild(border);\n this.wrapper.appendChild(this._cursor);\n \n this._cx=0;this._cy=0;this._tx=0;this._ty=0;\n \n // Block interactions on mask\n [\'click\',\'mousedown\',\'mouseup\',\'mousemove\',\'wheel\',\'keydown\',\'keyup\'].forEach(function(evt){\n this.wrapper.addEventListener(evt,function(e){e.stopPropagation();e.preventDefault();});\n }.bind(this));\n \n document.body.appendChild(this.wrapper);\n this._animate();\n \n var self=this;\n window.addEventListener(\'PageAgent::MovePointerTo\',function(e){\n var d=e.detail;self._tx=d.x;self._ty=d.y;\n });\n window.addEventListener(\'PageAgent::ClickPointer\',function(){\n self._cursor.classList.remove(\'__pa_click\');\n void self._cursor.offsetHeight;\n self._cursor.classList.add(\'__pa_click\');\n });\n }\n \n LiteMask.prototype._animate=function(){\n var nx=this._cx+(this._tx-this._cx)*0.2;\n var ny=this._cy+(this._ty-this._cy)*0.2;\n if(Math.abs(nx-this._tx)>0){this._cx=Math.abs(nx-this._tx)<2?this._tx:nx;this._cursor.style.left=this._cx+\'px\';}\n if(Math.abs(ny-this._ty)>0){this._cy=Math.abs(ny-this._ty)<2?this._ty:ny;this._cursor.style.top=this._cy+\'px\';}\n requestAnimationFrame(this._animate.bind(this));\n };\n \n LiteMask.prototype.show=function(){\n if(this.shown)return;this.shown=true;\n this.wrapper.classList.add(\'__pa_vis\');\n this._cx=window.innerWidth/2;this._cy=window.innerHeight/2;\n this._tx=this._cx;this._ty=this._cy;\n this._cursor.style.left=this._cx+\'px\';this._cursor.style.top=this._cy+\'px\';\n };\n \n LiteMask.prototype.hide=function(){\n if(!this.shown)return;this.shown=false;\n this._cursor.classList.remove(\'__pa_click\');\n var w=this.wrapper;\n setTimeout(function(){w.classList.remove(\'__pa_vis\');},300);\n };\n \n LiteMask.prototype.dispose=function(){this.wrapper.remove();};\n \n window.__LiteMask=LiteMask;\n})();\n\n// --- PageController (modified: SimulatorMask replaced with LiteMask) ---\n(function(){\n(function(){var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function isHTMLElement(el){return!!el&&el.nodeType===1}__name(isHTMLElement,"isHTMLElement");function isInputElement(el){return el?.nodeType===1&&el.tagName==="INPUT"}__name(isInputElement,"isInputElement");function isTextAreaElement(el){return el?.nodeType===1&&el.tagName==="TEXTAREA"}__name(isTextAreaElement,"isTextAreaElement");function isSelectElement(el){return el?.nodeType===1&&el.tagName==="SELECT"}__name(isSelectElement,"isSelectElement");function isAnchorElement(el){return el?.nodeType===1&&el.tagName==="A"}__name(isAnchorElement,"isAnchorElement");function getIframeOffset(element){const frame=element.ownerDocument.defaultView?.frameElement;if(!frame)return{x:0,y:0};const rect=frame.getBoundingClientRect();return{x:rect.left,y:rect.top}}__name(getIframeOffset,"getIframeOffset");function getNativeValueSetter(element){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element),"value").set}__name(getNativeValueSetter,"getNativeValueSetter");async function waitFor(seconds){await new Promise((resolve)=>setTimeout(resolve,seconds*1000))}__name(waitFor,"waitFor");async function movePointerToElement(element){const rect=element.getBoundingClientRect();const offset=getIframeOffset(element);const x=rect.left+rect.width/2+offset.x;const y=rect.top+rect.height/2+offset.y;window.dispatchEvent(new CustomEvent("PageAgent::MovePointerTo",{detail:{x,y}}));await waitFor(0.3)}__name(movePointerToElement,"movePointerToElement");function getElementByIndex(selectorMap,index){const interactiveNode=selectorMap.get(index);if(!interactiveNode){throw new Error(`No interactive element found at index ${index}`)}const element=interactiveNode.ref;if(!element){throw new Error(`Element at index ${index} does not have a reference`)}if(!isHTMLElement(element)){throw new Error(`Element at index ${index} is not an HTMLElement`)}return element}__name(getElementByIndex,"getElementByIndex");let lastClickedElement=null;function blurLastClickedElement(){if(lastClickedElement){lastClickedElement.blur();lastClickedElement.dispatchEvent(new MouseEvent("mouseout",{bubbles:true,cancelable:true}));lastClickedElement.dispatchEvent(new MouseEvent("mouseleave",{bubbles:false,cancelable:true}));lastClickedElement=null}}__name(blurLastClickedElement,"blurLastClickedElement");async function clickElement(element){blurLastClickedElement();lastClickedElement=element;await scrollIntoViewIfNeeded(element);const frame=element.ownerDocument.defaultView?.frameElement;if(frame)await scrollIntoViewIfNeeded(frame);await movePointerToElement(element);window.dispatchEvent(new CustomEvent("PageAgent::ClickPointer"));await waitFor(0.1);element.dispatchEvent(new MouseEvent("mouseenter",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mouseover",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mousedown",{bubbles:true,cancelable:true}));element.focus();element.dispatchEvent(new MouseEvent("mouseup",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("click",{bubbles:true,cancelable:true}));await waitFor(0.2)}__name(clickElement,"clickElement");async function inputTextElement(element,text){const isContentEditable=element.isContentEditable;if(!isInputElement(element)&&!isTextAreaElement(element)&&!isContentEditable){throw new Error("Element is not an input, textarea, or contenteditable")}await clickElement(element);if(isContentEditable){if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"deleteContent"}))){element.innerText="";element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"deleteContent"}))}if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"insertText",data:text}))){element.innerText=text;element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:text}))}const planASucceeded=element.innerText.trim()===text.trim();if(!planASucceeded){element.focus();const doc=element.ownerDocument;const selection=(doc.defaultView||window).getSelection();const range=doc.createRange();range.selectNodeContents(element);selection?.removeAllRanges();selection?.addRange(range);doc.execCommand("delete",false);doc.execCommand("insertText",false,text)}element.dispatchEvent(new Event("change",{bubbles:true}));element.blur()}else{getNativeValueSetter(element).call(element,text)}if(!isContentEditable){element.dispatchEvent(new Event("input",{bubbles:true}))}await waitFor(0.1);blurLastClickedElement()}__name(inputTextElement,"inputTextElement");async function selectOptionElement(selectElement,optionText){if(!isSelectElement(selectElement)){throw new Error("Element is not a select element")}const options=Array.from(selectElement.options);const option=options.find((opt)=>opt.textContent?.trim()===optionText.trim());if(!option){throw new Error(`Option with text "${optionText}" not found in select element`)}selectElement.value=option.value;selectElement.dispatchEvent(new Event("change",{bubbles:true}));await waitFor(0.1)}__name(selectOptionElement,"selectOptionElement");async function scrollIntoViewIfNeeded(element){const el=element;if(typeof el.scrollIntoViewIfNeeded==="function"){el.scrollIntoViewIfNeeded()}else{element.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})}}__name(scrollIntoViewIfNeeded,"scrollIntoViewIfNeeded");async function scrollVertically(down,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dy2=scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableY=/(auto|scroll|overlay)/.test(computedStyle.overflowY);const canScrollVertically=currentElement.scrollHeight>currentElement.clientHeight;if(hasScrollableY&&canScrollVertically){const beforeScroll=currentElement.scrollTop;const maxScroll=currentElement.scrollHeight-currentElement.clientHeight;let scrollAmount=dy2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollTop=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollTop;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) by ${scrollDelta}px`}else{return`No scrollable container found for element (${targetElement.tagName})`}}const dy=scroll_amount;const bigEnough=__name((el2)=>el2.clientHeight>=window.innerHeight*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowY)&&el2.scrollHeight>el2.clientHeight&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollY;const scrollMax=document.documentElement.scrollHeight-window.innerHeight;window.scrollBy(0,dy);const scrollAfter=window.scrollY;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of the page, cannot scroll down further.`:`⚠️ Already at the top of the page, cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled page by ${scrolled}px. Reached the bottom of the page.`;if(reachedTop)return`✅ Scrolled page by ${scrolled}px. Reached the top of the page.`;return`✅ Scrolled page by ${scrolled}px.`}else{const scrollBefore=el.scrollTop;const scrollMax=el.scrollHeight-el.clientHeight;el.scrollBy({top:dy,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollTop;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of container (${el.tagName}), cannot scroll down further.`:`⚠️ Already at the top of container (${el.tagName}), cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the bottom.`;if(reachedTop)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the top.`;return`✅ Scrolled container (${el.tagName}) by ${scrolled}px.`}}__name(scrollVertically,"scrollVertically");async function scrollHorizontally(right,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dx2=right?scroll_amount:-scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableX=/(auto|scroll|overlay)/.test(computedStyle.overflowX);const canScrollHorizontally=currentElement.scrollWidth>currentElement.clientWidth;if(hasScrollableX&&canScrollHorizontally){const beforeScroll=currentElement.scrollLeft;const maxScroll=currentElement.scrollWidth-currentElement.clientWidth;let scrollAmount=dx2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollLeft=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollLeft;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) horizontally by ${scrollDelta}px`}else{return`No horizontally scrollable container found for element (${targetElement.tagName})`}}const dx=right?scroll_amount:-scroll_amount;const bigEnough=__name((el2)=>el2.clientWidth>=window.innerWidth*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowX)&&el2.scrollWidth>el2.clientWidth&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollX;const scrollMax=document.documentElement.scrollWidth-window.innerWidth;window.scrollBy(dx,0);const scrollAfter=window.scrollX;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of the page, cannot scroll right further.`:`⚠️ Already at the left edge of the page, cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled page by ${scrolled}px. Reached the right edge of the page.`;if(reachedLeft)return`✅ Scrolled page by ${scrolled}px. Reached the left edge of the page.`;return`✅ Scrolled page horizontally by ${scrolled}px.`}else{const scrollBefore=el.scrollLeft;const scrollMax=el.scrollWidth-el.clientWidth;el.scrollBy({left:dx,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollLeft;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of container (${el.tagName}), cannot scroll right further.`:`⚠️ Already at the left edge of container (${el.tagName}), cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the right edge.`;if(reachedLeft)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the left edge.`;return`✅ Scrolled container (${el.tagName}) horizontally by ${scrolled}px.`}}__name(scrollHorizontally,"scrollHorizontally");const domTree=__name((args={doHighlightElements:true,focusHighlightIndex:-1,viewportExpansion:0,debugMode:false,interactiveBlacklist:[],interactiveWhitelist:[],highlightOpacity:0.1,highlightLabelOpacity:0.5})=>{const{interactiveBlacklist,interactiveWhitelist,highlightOpacity,highlightLabelOpacity}=args;const{doHighlightElements,focusHighlightIndex,viewportExpansion,debugMode}=args;let highlightIndex=0;const extraData=new WeakMap;function addExtraData(element,data){if(!element||element.nodeType!==Node.ELEMENT_NODE)return;extraData.set(element,{...extraData.get(element),...data})}__name(addExtraData,"addExtraData");const DOM_CACHE={boundingRects:new WeakMap,clientRects:new WeakMap,computedStyles:new WeakMap,clearCache:__name(()=>{DOM_CACHE.boundingRects=new WeakMap;DOM_CACHE.clientRects=new WeakMap;DOM_CACHE.computedStyles=new WeakMap},"clearCache")};function getCachedBoundingRect(element){if(!element)return null;if(DOM_CACHE.boundingRects.has(element)){return DOM_CACHE.boundingRects.get(element)}const rect=element.getBoundingClientRect();if(rect){DOM_CACHE.boundingRects.set(element,rect)}return rect}__name(getCachedBoundingRect,"getCachedBoundingRect");function getCachedComputedStyle(element){if(!element)return null;if(DOM_CACHE.computedStyles.has(element)){return DOM_CACHE.computedStyles.get(element)}const style=window.getComputedStyle(element);if(style){DOM_CACHE.computedStyles.set(element,style)}return style}__name(getCachedComputedStyle,"getCachedComputedStyle");function getCachedClientRects(element){if(!element)return null;if(DOM_CACHE.clientRects.has(element)){return DOM_CACHE.clientRects.get(element)}const rects=element.getClientRects();if(rects){DOM_CACHE.clientRects.set(element,rects)}return rects}__name(getCachedClientRects,"getCachedClientRects");const DOM_HASH_MAP={};const ID={current:0};const HIGHLIGHT_CONTAINER_ID="playwright-highlight-container";function highlightElement(element,index,parentIframe=null){if(!element)return index;const overlays=[];let label=null;let labelWidth=20;let labelHeight=16;let cleanupFn=null;try{let container=document.getElementById(HIGHLIGHT_CONTAINER_ID);if(!container){container=document.createElement("div");container.id=HIGHLIGHT_CONTAINER_ID;container.style.position="fixed";container.style.pointerEvents="none";container.style.top="0";container.style.left="0";container.style.width="100%";container.style.height="100%";container.style.zIndex="2147483640";container.style.backgroundColor="transparent";document.body.appendChild(container)}const rects=element.getClientRects();if(!rects||rects.length===0)return index;const colors=["#FF0000","#00FF00","#0000FF","#FFA500","#800080","#008080","#FF69B4","#4B0082","#FF4500","#2E8B57","#DC143C","#4682B4"];const colorIndex=index%colors.length;let baseColor=colors[colorIndex];const backgroundColor=baseColor+Math.floor(highlightOpacity*255).toString(16).padStart(2,"0");baseColor=baseColor+Math.floor(highlightLabelOpacity*255).toString(16).padStart(2,"0");let iframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();iframeOffset.x=iframeRect.left;iframeOffset.y=iframeRect.top}const fragment=document.createDocumentFragment();for(const rect of rects){if(rect.width===0||rect.height===0)continue;const overlay=document.createElement("div");overlay.style.position="fixed";overlay.style.border=`2px solid ${baseColor}`;overlay.style.backgroundColor=backgroundColor;overlay.style.pointerEvents="none";overlay.style.boxSizing="border-box";const top=rect.top+iframeOffset.y;const left=rect.left+iframeOffset.x;overlay.style.top=`${top}px`;overlay.style.left=`${left}px`;overlay.style.width=`${rect.width}px`;overlay.style.height=`${rect.height}px`;fragment.appendChild(overlay);overlays.push({element:overlay,initialRect:rect})}const firstRect=rects[0];label=document.createElement("div");label.className="playwright-highlight-label";label.style.position="fixed";label.style.background=baseColor;label.style.color="white";label.style.padding="1px 4px";label.style.borderRadius="4px";label.style.fontSize=`${Math.min(12,Math.max(8,firstRect.height/2))}px`;label.textContent=index.toString();labelWidth=label.offsetWidth>0?label.offsetWidth:labelWidth;labelHeight=label.offsetHeight>0?label.offsetHeight:labelHeight;const firstRectTop=firstRect.top+iframeOffset.y;const firstRectLeft=firstRect.left+iframeOffset.x;let labelTop=firstRectTop+2;let labelLeft=firstRectLeft+firstRect.width-labelWidth-2;if(firstRect.width<labelWidth+4||firstRect.height<labelHeight+4){labelTop=firstRectTop-labelHeight-2;labelLeft=firstRectLeft+firstRect.width-labelWidth;if(labelLeft<iframeOffset.x)labelLeft=firstRectLeft}labelTop=Math.max(0,Math.min(labelTop,window.innerHeight-labelHeight));labelLeft=Math.max(0,Math.min(labelLeft,window.innerWidth-labelWidth));label.style.top=`${labelTop}px`;label.style.left=`${labelLeft}px`;fragment.appendChild(label);const updatePositions=__name(()=>{const newRects=element.getClientRects();let newIframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();newIframeOffset.x=iframeRect.left;newIframeOffset.y=iframeRect.top}overlays.forEach((overlayData,i)=>{if(i<newRects.length){const newRect=newRects[i];const newTop=newRect.top+newIframeOffset.y;const newLeft=newRect.left+newIframeOffset.x;overlayData.element.style.top=`${newTop}px`;overlayData.element.style.left=`${newLeft}px`;overlayData.element.style.width=`${newRect.width}px`;overlayData.element.style.height=`${newRect.height}px`;overlayData.element.style.display=newRect.width===0||newRect.height===0?"none":"block"}else{overlayData.element.style.display="none"}});if(newRects.length<overlays.length){for(let i=newRects.length;i<overlays.length;i++){overlays[i].element.style.display="none"}}if(label&&newRects.length>0){const firstNewRect=newRects[0];const firstNewRectTop=firstNewRect.top+newIframeOffset.y;const firstNewRectLeft=firstNewRect.left+newIframeOffset.x;let newLabelTop=firstNewRectTop+2;let newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth-2;if(firstNewRect.width<labelWidth+4||firstNewRect.height<labelHeight+4){newLabelTop=firstNewRectTop-labelHeight-2;newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth;if(newLabelLeft<newIframeOffset.x)newLabelLeft=firstNewRectLeft}newLabelTop=Math.max(0,Math.min(newLabelTop,window.innerHeight-labelHeight));newLabelLeft=Math.max(0,Math.min(newLabelLeft,window.innerWidth-labelWidth));label.style.top=`${newLabelTop}px`;label.style.left=`${newLabelLeft}px`;label.style.display="block"}else if(label){label.style.display="none"}},"updatePositions");const throttleFunction=__name((func,delay)=>{let lastCall=0;return(...args2)=>{const now=performance.now();if(now-lastCall<delay)return;lastCall=now;return func(...args2)}},"throttleFunction");const throttledUpdatePositions=throttleFunction(updatePositions,16);window.addEventListener("scroll",throttledUpdatePositions,true);window.addEventListener("resize",throttledUpdatePositions);cleanupFn=__name(()=>{window.removeEventListener("scroll",throttledUpdatePositions,true);window.removeEventListener("resize",throttledUpdatePositions);overlays.forEach((overlay)=>overlay.element.remove());if(label)label.remove()},"cleanupFn");container.appendChild(fragment);return index+1}finally{if(cleanupFn){(window._highlightCleanupFunctions=window._highlightCleanupFunctions||[]).push(cleanupFn)}}}__name(highlightElement,"highlightElement");function isScrollableElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return null}const style=getCachedComputedStyle(element);if(!style)return null;const display=style.display;if(display==="inline"||display==="inline-block"){return null}const overflowX=style.overflowX;const overflowY=style.overflowY;const scrollableX=overflowX==="auto"||overflowX==="scroll";const scrollableY=overflowY==="auto"||overflowY==="scroll";if(!scrollableX&&!scrollableY){return null}const scrollWidth=element.scrollWidth-element.clientWidth;const scrollHeight=element.scrollHeight-element.clientHeight;const threshold=4;if(scrollWidth<threshold&&scrollHeight<threshold){return null}if(!scrollableY&&scrollWidth<threshold){return null}if(!scrollableX&&scrollHeight<threshold){return null}const distanceToTop=element.scrollTop;const distanceToLeft=element.scrollLeft;const distanceToRight=element.scrollWidth-element.clientWidth-element.scrollLeft;const distanceToBottom=element.scrollHeight-element.clientHeight-element.scrollTop;const scrollData={top:distanceToTop,right:distanceToRight,bottom:distanceToBottom,left:distanceToLeft};addExtraData(element,{scrollable:true,scrollData});return scrollData}__name(isScrollableElement,"isScrollableElement");function isTextNodeVisible(textNode){try{if(viewportExpansion===-1){const parentElement2=textNode.parentElement;if(!parentElement2)return false;try{return parentElement2.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement2);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}const range=document.createRange();range.selectNodeContents(textNode);const rects=range.getClientRects();if(!rects||rects.length===0){return false}let isAnyRectVisible=false;let isAnyRectInViewport=false;for(const rect of rects){if(rect.width>0&&rect.height>0){isAnyRectVisible=true;if(!(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}}if(!isAnyRectVisible||!isAnyRectInViewport){return false}const parentElement=textNode.parentElement;if(!parentElement)return false;try{return parentElement.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}catch(e){console.warn("Error checking text node visibility:",e);return false}}__name(isTextNodeVisible,"isTextNodeVisible");function isElementAccepted(element){if(!element||!element.tagName)return false;const alwaysAccept=new Set(["body","div","main","article","section","nav","header","footer"]);const tagName=element.tagName.toLowerCase();if(alwaysAccept.has(tagName))return true;const leafElementDenyList=new Set(["svg","script","style","link","meta","noscript","template"]);return!leafElementDenyList.has(tagName)}__name(isElementAccepted,"isElementAccepted");function isElementVisible(element){const style=getCachedComputedStyle(element);return element.offsetWidth>0&&element.offsetHeight>0&&style?.visibility!=="hidden"&&style?.display!=="none"}__name(isElementVisible,"isElementVisible");function isInteractiveElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}if(interactiveBlacklist.includes(element)){return false}if(interactiveWhitelist.includes(element)){return true}const tagName=element.tagName.toLowerCase();const style=getCachedComputedStyle(element);const interactiveCursors=new Set(["pointer","move","text","grab","grabbing","cell","copy","alias","all-scroll","col-resize","context-menu","crosshair","e-resize","ew-resize","help","n-resize","ne-resize","nesw-resize","ns-resize","nw-resize","nwse-resize","row-resize","s-resize","se-resize","sw-resize","vertical-text","w-resize","zoom-in","zoom-out"]);const nonInteractiveCursors=new Set(["not-allowed","no-drop","wait","progress","initial","inherit"]);function doesElementHaveInteractivePointer(element2){if(element2.tagName.toLowerCase()==="html")return false;if(style?.cursor&&interactiveCursors.has(style.cursor))return true;return false}__name(doesElementHaveInteractivePointer,"doesElementHaveInteractivePointer");let isInteractiveCursor=doesElementHaveInteractivePointer(element);if(isInteractiveCursor){return true}const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label","option","optgroup","fieldset","legend"]);const explicitDisableTags=new Set(["disabled","readonly"]);if(interactiveElements.has(tagName)){if(style?.cursor&&nonInteractiveCursors.has(style.cursor)){return false}for(const disableTag of explicitDisableTags){if(element.hasAttribute(disableTag)||element.getAttribute(disableTag)==="true"||element.getAttribute(disableTag)===""){return false}}if(element.disabled){return false}if(element.readOnly){return false}if(element.inert){return false}return true}const role=element.getAttribute("role");const ariaRole=element.getAttribute("aria-role");if(element.getAttribute("contenteditable")==="true"||element.isContentEditable){return true}if(element.classList&&(element.classList.contains("button")||element.classList.contains("dropdown-toggle")||element.getAttribute("data-index")||element.getAttribute("data-toggle")==="dropdown"||element.getAttribute("aria-haspopup")==="true")){return true}const interactiveRoles=new Set(["button","menu","menubar","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);const hasInteractiveRole=interactiveElements.has(tagName)||role&&interactiveRoles.has(role)||ariaRole&&interactiveRoles.has(ariaRole);if(hasInteractiveRole)return true;try{if(typeof getEventListeners==="function"){const listeners=getEventListeners(element);const mouseEvents=["click","mousedown","mouseup","dblclick"];for(const eventType of mouseEvents){if(listeners[eventType]&&listeners[eventType].length>0){return true}}}const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonMouseAttrs=["onclick","onmousedown","onmouseup","ondblclick"];for(const attr of commonMouseAttrs){if(element.hasAttribute(attr)||typeof element[attr]==="function"){return true}}}catch(e){}if(isScrollableElement(element)){return true}return false}__name(isInteractiveElement,"isInteractiveElement");function isTopElement(element){if(viewportExpansion===-1){return true}const rects=getCachedClientRects(element);if(!rects||rects.length===0){return false}let isAnyRectInViewport=false;for(const rect2 of rects){if(rect2.width>0&&rect2.height>0&&!(rect2.bottom<-viewportExpansion||rect2.top>window.innerHeight+viewportExpansion||rect2.right<-viewportExpansion||rect2.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}if(!isAnyRectInViewport){return false}let doc=element.ownerDocument;if(doc!==window.document){return true}let rect=Array.from(rects).find((r)=>r.width>0&&r.height>0);if(!rect){return false}const shadowRoot=element.getRootNode();if(shadowRoot instanceof ShadowRoot){const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;try{const topEl=shadowRoot.elementFromPoint(centerX,centerY);if(!topEl)return false;let current=topEl;while(current&&current!==shadowRoot){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}}const margin=5;const checkPoints=[{x:rect.left+rect.width/2,y:rect.top+rect.height/2},{x:rect.left+margin,y:rect.top+margin},{x:rect.right-margin,y:rect.bottom-margin}];return checkPoints.some(({x,y})=>{try{const topEl=document.elementFromPoint(x,y);if(!topEl)return false;let current=topEl;while(current&&current!==document.documentElement){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}})}__name(isTopElement,"isTopElement");function isInExpandedViewport(element,viewportExpansion2){if(viewportExpansion2===-1){return true}const rects=element.getClientRects();if(!rects||rects.length===0){const boundingRect=getCachedBoundingRect(element);if(!boundingRect||boundingRect.width===0||boundingRect.height===0){return false}return!(boundingRect.bottom<-viewportExpansion2||boundingRect.top>window.innerHeight+viewportExpansion2||boundingRect.right<-viewportExpansion2||boundingRect.left>window.innerWidth+viewportExpansion2)}for(const rect of rects){if(rect.width===0||rect.height===0)continue;if(!(rect.bottom<-viewportExpansion2||rect.top>window.innerHeight+viewportExpansion2||rect.right<-viewportExpansion2||rect.left>window.innerWidth+viewportExpansion2)){return true}}return false}__name(isInExpandedViewport,"isInExpandedViewport");function isInteractiveCandidate(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;const tagName=element.tagName.toLowerCase();const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label"]);if(interactiveElements.has(tagName))return true;const hasQuickInteractiveAttr=element.hasAttribute("onclick")||element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("aria-")||element.hasAttribute("data-action")||element.getAttribute("contenteditable")==="true";return hasQuickInteractiveAttr}__name(isInteractiveCandidate,"isInteractiveCandidate");const DISTINCT_INTERACTIVE_TAGS=new Set(["a","button","input","select","textarea","summary","details","label","option"]);const INTERACTIVE_ROLES=new Set(["button","link","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);function isHeuristicallyInteractive(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;if(!isElementVisible(element))return false;const hasInteractiveAttributes=element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("onclick")||typeof element.onclick==="function";const hasInteractiveClass=/\\b(btn|clickable|menu|item|entry|link)\\b/i.test(element.className||"");const isInKnownContainer=Boolean(element.closest(\'button,a,[role="button"],.menu,.dropdown,.list,.toolbar\'));const hasVisibleChildren=[...element.children].some(isElementVisible);const isParentBody=element.parentElement&&element.parentElement.isSameNode(document.body);return(isInteractiveElement(element)||hasInteractiveAttributes||hasInteractiveClass)&&hasVisibleChildren&&isInKnownContainer&&!isParentBody}__name(isHeuristicallyInteractive,"isHeuristicallyInteractive");function isElementDistinctInteraction(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}const tagName=element.tagName.toLowerCase();const role=element.getAttribute("role");if(tagName==="iframe"){return true}if(DISTINCT_INTERACTIVE_TAGS.has(tagName)){return true}if(role&&INTERACTIVE_ROLES.has(role)){return true}if(element.isContentEditable||element.getAttribute("contenteditable")==="true"){return true}if(element.hasAttribute("data-testid")||element.hasAttribute("data-cy")||element.hasAttribute("data-test")){return true}if(element.hasAttribute("onclick")||typeof element.onclick==="function"){return true}try{const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonEventAttrs=["onmousedown","onmouseup","onkeydown","onkeyup","onsubmit","onchange","oninput","onfocus","onblur"];if(commonEventAttrs.some((attr)=>element.hasAttribute(attr))){return true}}catch(e){}if(isHeuristicallyInteractive(element)){return true}return false}__name(isElementDistinctInteraction,"isElementDistinctInteraction");function handleHighlighting(nodeData,node,parentIframe,isParentHighlighted){if(!nodeData.isInteractive)return false;let shouldHighlight=false;if(!isParentHighlighted){shouldHighlight=true}else{if(isElementDistinctInteraction(node)){shouldHighlight=true}else{shouldHighlight=false}}if(shouldHighlight){nodeData.isInViewport=isInExpandedViewport(node,viewportExpansion);if(nodeData.isInViewport||viewportExpansion===-1){nodeData.highlightIndex=highlightIndex++;if(doHighlightElements){if(focusHighlightIndex>=0){if(focusHighlightIndex===nodeData.highlightIndex){highlightElement(node,nodeData.highlightIndex,parentIframe)}}else{highlightElement(node,nodeData.highlightIndex,parentIframe)}return true}}}return false}__name(handleHighlighting,"handleHighlighting");function buildDomTree(node,parentIframe=null,isParentHighlighted=false){if(!node||node.id===HIGHLIGHT_CONTAINER_ID||node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(!node||node.id===HIGHLIGHT_CONTAINER_ID){return null}if(node.dataset?.browserUseIgnore==="true"||node.dataset?.pageAgentIgnore==="true"){return null}if(node.getAttribute&&node.getAttribute("aria-hidden")==="true"){return null}if(node===document.body){const nodeData2={tagName:"body",attributes:{},xpath:"/body",children:[]};for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,false);if(domElement)nodeData2.children.push(domElement)}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]=nodeData2;return id2}if(node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(node.nodeType===Node.TEXT_NODE){const textContent=node.textContent?.trim();if(!textContent){return null}const parentElement=node.parentElement;if(!parentElement||parentElement.tagName.toLowerCase()==="script"){return null}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]={type:"TEXT_NODE",text:textContent,isVisible:isTextNodeVisible(node)};return id2}if(node.nodeType===Node.ELEMENT_NODE&&!isElementAccepted(node)){return null}if(viewportExpansion!==-1&&!node.shadowRoot){const rect=getCachedBoundingRect(node);const style=getCachedComputedStyle(node);const isFixedOrSticky=style&&(style.position==="fixed"||style.position==="sticky");const hasSize=node.offsetWidth>0||node.offsetHeight>0;if(!rect||!isFixedOrSticky&&!hasSize&&(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){return null}}const nodeData={tagName:node.tagName.toLowerCase(),attributes:{},children:[]};if(isInteractiveCandidate(node)||node.tagName.toLowerCase()==="iframe"||node.tagName.toLowerCase()==="body"){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}if(node.tagName.toLowerCase()==="input"&&(node.type==="checkbox"||node.type==="radio")){nodeData.attributes.checked=node.checked?"true":"false"}}let nodeWasHighlighted=false;if(node.nodeType===Node.ELEMENT_NODE){nodeData.isVisible=isElementVisible(node);if(nodeData.isVisible){nodeData.isTopElement=isTopElement(node);const role=node.getAttribute("role");const isMenuContainer=role==="menu"||role==="menubar"||role==="listbox";if(nodeData.isTopElement||isMenuContainer){nodeData.isInteractive=isInteractiveElement(node);nodeWasHighlighted=handleHighlighting(nodeData,node,parentIframe,isParentHighlighted);nodeData.ref=node;if(nodeData.isInteractive&&Object.keys(nodeData.attributes).length===0){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}}}}}if(node.tagName){const tagName=node.tagName.toLowerCase();if(tagName==="iframe"){try{const iframeDoc=node.contentDocument||node.contentWindow?.document;if(iframeDoc){for(const child of iframeDoc.childNodes){const domElement=buildDomTree(child,node,false);if(domElement)nodeData.children.push(domElement)}}}catch(e){console.warn("Unable to access iframe:",e)}}else if(node.isContentEditable||node.getAttribute("contenteditable")==="true"||node.id==="tinymce"||node.classList.contains("mce-content-body")||tagName==="body"&&node.getAttribute("data-id")?.startsWith("mce_")){for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}else{if(node.shadowRoot){nodeData.shadowRoot=true;for(const child of node.shadowRoot.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}for(const child of node.childNodes){const passHighlightStatusToChild=nodeWasHighlighted||isParentHighlighted;const domElement=buildDomTree(child,parentIframe,passHighlightStatusToChild);if(domElement)nodeData.children.push(domElement)}}}if(nodeData.tagName==="a"&&nodeData.children.length===0&&!nodeData.attributes.href){const rect=getCachedBoundingRect(node);const hasSize=rect&&rect.width>0&&rect.height>0||node.offsetWidth>0||node.offsetHeight>0;if(!hasSize){return null}}nodeData.extra=extraData.get(node)||null;const id=`${ID.current++}`;DOM_HASH_MAP[id]=nodeData;return id}__name(buildDomTree,"buildDomTree");const rootId=buildDomTree(document.body);DOM_CACHE.clearCache();return{rootId,map:DOM_HASH_MAP}},"domTree");const DEFAULT_VIEWPORT_EXPANSION=-1;function resolveViewportExpansion(viewportExpansion){return viewportExpansion??DEFAULT_VIEWPORT_EXPANSION}__name(resolveViewportExpansion,"resolveViewportExpansion");const newElementsCache=new WeakMap;function getFlatTree(config){const viewportExpansion=resolveViewportExpansion(config.viewportExpansion);const interactiveBlacklist=[];for(const item of config.interactiveBlacklist||[]){if(typeof item==="function"){interactiveBlacklist.push(item())}else{interactiveBlacklist.push(item)}}const interactiveWhitelist=[];for(const item of config.interactiveWhitelist||[]){if(typeof item==="function"){interactiveWhitelist.push(item())}else{interactiveWhitelist.push(item)}}const elements=domTree({doHighlightElements:true,debugMode:true,focusHighlightIndex:-1,viewportExpansion,interactiveBlacklist,interactiveWhitelist,highlightOpacity:config.highlightOpacity??0,highlightLabelOpacity:config.highlightLabelOpacity??0.1});const currentUrl=window.location.href;for(const nodeId in elements.map){const node=elements.map[nodeId];if(node.isInteractive&&node.ref){const ref=node.ref;if(!newElementsCache.has(ref)){newElementsCache.set(ref,currentUrl);node.isNew=true}}}return elements}__name(getFlatTree,"getFlatTree");const globRegexCache=new Map;function globToRegex(pattern){let regex=globRegexCache.get(pattern);if(!regex){const escaped=pattern.replace(/[.+^${}()|[\\]\\\\]/g,"\\\\$&");regex=new RegExp(`^${escaped.replace(/\\*/g,".*")}$`);globRegexCache.set(pattern,regex)}return regex}__name(globToRegex,"globToRegex");function matchAttributes(attrs,patterns){const result2={};for(const pattern of patterns){if(pattern.includes("*")){const regex=globToRegex(pattern);for(const key of Object.keys(attrs)){if(regex.test(key)&&attrs[key].trim()){result2[key]=attrs[key].trim()}}}else{const value=attrs[pattern];if(value&&value.trim()){result2[pattern]=value.trim()}}}return result2}__name(matchAttributes,"matchAttributes");function flatTreeToString(flatTree,includeAttributes){const DEFAULT_INCLUDE_ATTRIBUTES=["title","type","checked","name","role","value","placeholder","data-date-format","alt","aria-label","aria-expanded","data-state","aria-checked","id","for","target","aria-haspopup","aria-controls","aria-owns","contenteditable"];const includeAttrs=[...includeAttributes||[],...DEFAULT_INCLUDE_ATTRIBUTES];const capTextLength=__name((text,maxLength)=>{if(text.length>maxLength){return text.substring(0,maxLength)+"..."}return text},"capTextLength");const buildTreeNode=__name((nodeId)=>{const node=flatTree.map[nodeId];if(!node)return null;if(node.type==="TEXT_NODE"){const textNode=node;return{type:"text",text:textNode.text,isVisible:textNode.isVisible,parent:null,children:[]}}else{const elementNode=node;const children=[];if(elementNode.children){for(const childId of elementNode.children){const child=buildTreeNode(childId);if(child){child.parent=null;children.push(child)}}}return{type:"element",tagName:elementNode.tagName,attributes:elementNode.attributes??{},isVisible:elementNode.isVisible??false,isInteractive:elementNode.isInteractive??false,isTopElement:elementNode.isTopElement??false,isNew:elementNode.isNew??false,highlightIndex:elementNode.highlightIndex,parent:null,children,extra:elementNode.extra??{}}}},"buildTreeNode");const setParentReferences=__name((node,parent=null)=>{node.parent=parent;for(const child of node.children){setParentReferences(child,node)}},"setParentReferences");const rootNode=buildTreeNode(flatTree.rootId);if(!rootNode)return"";setParentReferences(rootNode);const hasParentWithHighlightIndex=__name((node)=>{let current=node.parent;while(current){if(current.type==="element"&&current.highlightIndex!==undefined){return true}current=current.parent}return false},"hasParentWithHighlightIndex");const processNode=__name((node,depth,result22)=>{let nextDepth=depth;const depthStr="\\t".repeat(depth);if(node.type==="element"){if(node.highlightIndex!==undefined){nextDepth+=1;const text=getAllTextTillNextClickableElement(node);let attributesHtmlStr="";if(includeAttrs.length>0&&node.attributes){const attributesToInclude=matchAttributes(node.attributes,includeAttrs);const keys=Object.keys(attributesToInclude);if(keys.length>1){const keysToRemove=new Set;const seenValues={};for(const key of keys){const value=attributesToInclude[key];if(value.length>5){if(value in seenValues){keysToRemove.add(key)}else{seenValues[value]=key}}}for(const key of keysToRemove){delete attributesToInclude[key]}}if(attributesToInclude.role===node.tagName){delete attributesToInclude.role}const attrsToRemoveIfTextMatches=["aria-label","placeholder","title"];for(const attr of attrsToRemoveIfTextMatches){if(attributesToInclude[attr]&&attributesToInclude[attr].toLowerCase().trim()===text.toLowerCase().trim()){delete attributesToInclude[attr]}}if(Object.keys(attributesToInclude).length>0){attributesHtmlStr=Object.entries(attributesToInclude).map(([key,value])=>`${key}=${capTextLength(value,20)}`).join(" ")}}const highlightIndicator=node.isNew?`*[${node.highlightIndex}]`:`[${node.highlightIndex}]`;let line=`${depthStr}${highlightIndicator}<${node.tagName??""}`;if(attributesHtmlStr){line+=` ${attributesHtmlStr}`}if(node.extra){if(node.extra.scrollable){let scrollDataText="";if(node.extra.scrollData?.left)scrollDataText+=`left=${node.extra.scrollData.left}, `;if(node.extra.scrollData?.top)scrollDataText+=`top=${node.extra.scrollData.top}, `;if(node.extra.scrollData?.right)scrollDataText+=`right=${node.extra.scrollData.right}, `;if(node.extra.scrollData?.bottom)scrollDataText+=`bottom=${node.extra.scrollData.bottom}`;line+=` data-scrollable="${scrollDataText}"`}}if(text){const trimmedText=text.trim();if(!attributesHtmlStr){line+=" "}line+=`>${trimmedText}`}else if(!attributesHtmlStr){line+=" "}line+=" />";result22.push(line)}for(const child of node.children){processNode(child,nextDepth,result22)}}else if(node.type==="text"){if(hasParentWithHighlightIndex(node)){return}if(node.parent&&node.parent.type==="element"&&node.parent.isVisible&&node.parent.isTopElement){result22.push(`${depthStr}${node.text??""}`)}}},"processNode");const result2=[];processNode(rootNode,0,result2);return result2.join(`\n`)}__name(flatTreeToString,"flatTreeToString");const getAllTextTillNextClickableElement=__name((node,maxDepth=-1)=>{const textParts=[];const collectText=__name((currentNode,currentDepth)=>{if(maxDepth!==-1&&currentDepth>maxDepth){return}if(currentNode.type==="element"&&currentNode!==node&&currentNode.highlightIndex!==undefined){return}if(currentNode.type==="text"&&currentNode.text){textParts.push(currentNode.text)}else if(currentNode.type==="element"){for(const child of currentNode.children){collectText(child,currentDepth+1)}}},"collectText");collectText(node,0);return textParts.join(`\n`).trim()},"getAllTextTillNextClickableElement");function getSelectorMap(flatTree){const selectorMap=new Map;const keys=Object.keys(flatTree.map);for(const key of keys){const node=flatTree.map[key];if(node.isInteractive&&typeof node.highlightIndex==="number"){selectorMap.set(node.highlightIndex,node)}}return selectorMap}__name(getSelectorMap,"getSelectorMap");function getElementTextMap(simplifiedHTML){const lines=simplifiedHTML.split(`\n`).map((line)=>line.trim()).filter((line)=>line.length>0);const elementTextMap=new Map;for(const line of lines){const regex=/^\\[(\\d+)\\]<[^>]+>([^<]*)/;const match=regex.exec(line);if(match){const index=parseInt(match[1],10);elementTextMap.set(index,line)}}return elementTextMap}__name(getElementTextMap,"getElementTextMap");function cleanUpHighlights(){const cleanupFunctions=window._highlightCleanupFunctions||[];for(const cleanup of cleanupFunctions){if(typeof cleanup==="function"){cleanup()}}window._highlightCleanupFunctions=[]}__name(cleanUpHighlights,"cleanUpHighlights");window.addEventListener("popstate",()=>{cleanUpHighlights()});window.addEventListener("hashchange",()=>{cleanUpHighlights()});window.addEventListener("beforeunload",()=>{cleanUpHighlights()});const navigation=window.navigation;if(navigation&&typeof navigation.addEventListener==="function"){navigation.addEventListener("navigate",()=>{cleanUpHighlights()})}else{let currentUrl=window.location.href;setInterval(()=>{if(window.location.href!==currentUrl){currentUrl=window.location.href;cleanUpHighlights()}},500)}function getPageInfo(){const viewport_width=window.innerWidth;const viewport_height=window.innerHeight;const page_width=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth||0);const page_height=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight||0);const scroll_x=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0;const scroll_y=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;const pixels_below=Math.max(0,page_height-(window.innerHeight+scroll_y));const pixels_right=Math.max(0,page_width-(window.innerWidth+scroll_x));return{viewport_width,viewport_height,page_width,page_height,scroll_x,scroll_y,pixels_above:scroll_y,pixels_below,pages_above:viewport_height>0?scroll_y/viewport_height:0,pages_below:viewport_height>0?pixels_below/viewport_height:0,total_pages:viewport_height>0?page_height/viewport_height:0,current_page_position:scroll_y/Math.max(1,page_height-viewport_height),pixels_left:scroll_x,pixels_right}}__name(getPageInfo,"getPageInfo");function patchReact(pageController){const reactRootElements=document.querySelectorAll(\'[data-reactroot], [data-reactid], [data-react-checksum], #root, #app, [id^="root-"], [id^="app-"], #adex-wrapper, #adex-root\');for(const element of reactRootElements){element.setAttribute("data-page-agent-not-interactive","true")}}__name(patchReact,"patchReact");const _PageController=class _PageController extends EventTarget{config;flatTree=null;selectorMap=new Map;elementTextMap=new Map;simplifiedHTML="<EMPTY>";lastTimeUpdate=0;isIndexed=false;mask=null;maskReady=null;constructor(config={}){super();this.config=config;patchReact();if(config.enableMask)this.initMask()}initMask(){if(this.maskReady!==null)return;this.maskReady=(async()=>{var SimulatorMask = window.__LiteMask;this.mask=new SimulatorMask})()}async getCurrentUrl(){return window.location.href}async getLastUpdateTime(){return this.lastTimeUpdate}async getBrowserState(){const url=window.location.href;const title=document.title;const pi=getPageInfo();const viewportExpansion=resolveViewportExpansion(this.config.viewportExpansion);await this.updateTree();const content=this.simplifiedHTML;const titleLine=`Current Page: [${title}](${url})`;const pageInfoLine=`Page info: ${pi.viewport_width}x${pi.viewport_height}px viewport, ${pi.page_width}x${pi.page_height}px total page size, ${pi.pages_above.toFixed(1)} pages above, ${pi.pages_below.toFixed(1)} pages below, ${pi.total_pages.toFixed(1)} total pages, at ${(pi.current_page_position*100).toFixed(0)}% of page`;const elementsLabel=viewportExpansion===-1?"Interactive elements from top layer of the current page (full page):":"Interactive elements from top layer of the current page inside the viewport:";const hasContentAbove=pi.pixels_above>4;const scrollHintAbove=hasContentAbove&&viewportExpansion!==-1?`... ${pi.pixels_above} pixels above (${pi.pages_above.toFixed(1)} pages) - scroll to see more ...`:"[Start of page]";const header=`${titleLine}\n${pageInfoLine}\n\n${elementsLabel}\n\n${scrollHintAbove}`;const hasContentBelow=pi.pixels_below>4;const footer=hasContentBelow&&viewportExpansion!==-1?`... ${pi.pixels_below} pixels below (${pi.pages_below.toFixed(1)} pages) - scroll to see more ...`:"[End of page]";return{url,title,header,content,footer}}async updateTree(){this.dispatchEvent(new Event("beforeUpdate"));this.lastTimeUpdate=Date.now();if(this.mask){this.mask.wrapper.style.pointerEvents="none"}cleanUpHighlights();const blacklist=[...this.config.interactiveBlacklist||[],...document.querySelectorAll("[data-page-agent-not-interactive]").values()];this.flatTree=getFlatTree({...this.config,interactiveBlacklist:blacklist});this.simplifiedHTML=flatTreeToString(this.flatTree,this.config.includeAttributes);this.selectorMap.clear();this.selectorMap=getSelectorMap(this.flatTree);this.elementTextMap.clear();this.elementTextMap=getElementTextMap(this.simplifiedHTML);this.isIndexed=true;if(this.mask){this.mask.wrapper.style.pointerEvents="auto"}this.dispatchEvent(new Event("afterUpdate"));return this.simplifiedHTML}async cleanUpHighlights(){cleanUpHighlights()}assertIndexed(){if(!this.isIndexed){throw new Error("DOM tree not indexed yet. Can not perform actions on elements.")}}async clickElement(index){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await clickElement(element);if(isAnchorElement(element)&&element.target==="_blank"){return{success:true,message:`✅ Clicked element (${elemText??index}). ⚠️ Link opened in a new tab.`}}return{success:true,message:`✅ Clicked element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to click element: ${error}`}}}async inputText(index,text){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await inputTextElement(element,text);return{success:true,message:`✅ Input text (${text}) into element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to input text: ${error}`}}}async selectOption(index,optionText){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await selectOptionElement(element,optionText);return{success:true,message:`✅ Selected option (${optionText}) in element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to select option: ${error}`}}}async scroll(options){try{const{down,numPages,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels??numPages*(down?1:-1)*window.innerHeight;const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollVertically(down,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll: ${error}`}}}async scrollHorizontally(options){try{const{right,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels*(right?1:-1);const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollHorizontally(right,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll horizontally: ${error}`}}}async executeJavascript(script){try{const asyncFunction=eval(`(async () => { ${script} })`);const result=await asyncFunction();return{success:true,message:`✅ Executed JavaScript. Result: ${result}`}}catch(error){return{success:false,message:`❌ Error executing JavaScript: ${error}`}}}async showMask(){await this.maskReady;this.mask?.show()}async hideMask(){await this.maskReady;this.mask?.hide()}dispose(){cleanUpHighlights();this.flatTree=null;this.selectorMap.clear();this.elementTextMap.clear();this.simplifiedHTML="<EMPTY>";this.isIndexed=false;this.mask?.dispose();this.mask=null}};__name(_PageController,"PageController");let PageController=_PageController;window.__PageController=PageController})();\n})();\n\n// --- Signet Page Agent API ---\n(function(){\n var pc = new window.__PageController({ enableMask: false, highlightOpacity: 0, highlightLabelOpacity: 0 });\n \n window.signet = window.signet || {};\n window.signet.pageController = pc;\n \n window.signet.getDomState = async function(){\n try {\n var state = await pc.getBrowserState();\n return { success: true, state: state };\n } catch(e) {\n return { success: false, error: e.message || String(e) };\n }\n };\n \n window.signet.executeAction = async function(action){\n try {\n var result;\n switch(action.type){\n case \'click_element\':\n result = await pc.clickElement(action.index);\n break;\n case \'input_text\':\n result = await pc.inputText(action.index, action.text);\n break;\n case \'select_option\':\n result = await pc.selectOption(action.index, action.text);\n break;\n case \'scroll\':\n result = await pc.scroll({ down: action.direction === \'down\', numPages: action.amount || 1 });\n break;\n default:\n result = { success: false, message: \'Unknown action type: \' + action.type };\n }\n return result;\n } catch(e) {\n return { success: false, message: e.message || String(e) };\n }\n };\n \n window.signet.agentStart = async function(){\n pc.initMask();\n await pc.showMask();\n };\n \n window.signet.agentStop = async function(){\n await pc.hideMask();\n };\n})();',Yt=`
1
+ import{e as We,p as re,s as he,c as de,f as se,a as fe,n as ve,b as w,d as ie,r as we,j as c,k as J,t as _,l as s,y as ee,z as ae,D as ge,A as Te,i as t,m as N,v as m,o as Y,g as ft,Q as Ze,q as ze,aT as Ve,F as Je,B as xe,u as pe,O as G,P as Se,ad as et,N as Ee,af as Ie,w as ke,J as Me,x as vt,G as wt,R as yt}from"./Bh3nIh1p.js";import{H as me,I as ye,aN as bt,be as xt,bf as _t,ac as Et}from"./C3zUiSZU.js";import{W as at,L as Tt}from"./B1ZcIj42.js";import{R as st}from"./BaomC9q2.js";import{P as qe}from"./BuALgIqw.js";import{P as kt}from"./UJiH7_04.js";import{T as St}from"./B6-eEBp1.js";const k=We({entries:[],loading:!1,error:null,groups:[],activeGroup:null,draggingId:null,focusedId:null,widgetCacheVersion:0}),be=new Map,He=new Set;function Ct(){return k.entries.filter(n=>n.state==="tray")}function Nt(){const n=k.entries.filter(e=>e.state==="grid");if(k.activeGroup){const e=k.groups.find(r=>r.id===k.activeGroup);if(e)return n.filter(r=>e.items.includes(r.id))}return n}function It(){return k.entries.filter(n=>n.state==="dock")}const tt=12;function Qe(n,e,r){const a=r?.x??0,d=r?.y??0;function p(L,P,D,H){for(const A of n)if(L<A.x+A.w&&L+D>A.x&&P<A.y+A.h&&P+H>A.y)return!0;return!1}const o=Math.max(0,Math.min(tt-e.w,a)),y=Math.max(0,d);if(!p(o,y,e.w,e.h))return{x:o,y,w:e.w,h:e.h};for(let L=1;L<=20;L++)for(let P=-L;P<=L;P++)for(let D=-L;D<=L;D++){if(Math.abs(D)!==L&&Math.abs(P)!==L)continue;const H=Math.max(0,Math.min(tt-e.w,a+D)),A=Math.max(0,d+P);if(!p(H,A,e.w,e.h))return{x:H,y:A,w:e.w,h:e.h}}return{x:0,y:n.reduce((L,P)=>Math.max(L,P.y+P.h),0),w:e.w,h:e.h}}async function Oe(){k.loading=!0,k.error=null;try{const n=await fetch(`${me}/api/os/tray`);if(!n.ok)throw new Error(`HTTP ${n.status}`);const e=await n.json();k.entries=e.entries??[]}catch(n){k.error=n instanceof Error?n.message:String(n)}finally{k.loading=!1}}async function Ae(n,e,r){try{const a={state:e};r&&(a.gridPosition=r);const d=await fetch(`${me}/api/os/tray/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!d.ok)return!1;const p=await d.json();if(p.success&&p.entry){const o=k.entries.findIndex(y=>y.id===n);o>=0&&(k.entries[o]=p.entry)}return!0}catch{return!1}}async function nt(n,e){return Ae(n,"grid",e)}async function Xe(n,e){const r=k.entries.find(o=>o.id===n);if(!r)return!1;if(e)return Ae(n,"grid",e);const a=r.manifest?.defaultSize??{w:4,h:3},d=k.entries.flatMap(o=>o.id!==n&&o.state==="grid"&&o.gridPosition?[o.gridPosition]:[]),p=Qe(d,a);return Ae(n,"grid",p)}async function Mt(n){return Ae(n,"dock")}async function lt(n){return Ae(n,"tray")}const ct="signet-os-sidebar-groups";function At(){try{const n=localStorage.getItem(ct);n&&(k.groups=JSON.parse(n))}catch{k.groups=[]}}function Fe(){localStorage.setItem(ct,JSON.stringify(k.groups))}function Dt(n){const e={id:`group_${Date.now()}`,name:n,items:[]};return k.groups=[...k.groups,e],Fe(),e}function Rt(n){k.groups=k.groups.filter(e=>e.id!==n),k.activeGroup===n&&(k.activeGroup=null),Fe()}function Lt(n,e){k.groups=k.groups.map(r=>r.id===n?{...r,name:e}:r),Fe()}function Ht(n,e){k.groups=k.groups.map(r=>r.id!==n||r.items.includes(e)?r:{...r,items:[...r.items,e]}),Fe()}function Ge(n){k.activeGroup=n}let Pe=We(new Map),rt=0;function it(n,e,r){Pe.set(n,{action:e,data:r,_seq:++rt}),setTimeout(()=>{const a=Pe.get(n);a&&a._seq===rt&&Pe.delete(n)},500)}function Pt(n){return Pe.get(n)}function Ot(n){k.focusedId=n}function Re(){k.focusedId=null}async function $e(n){if(be.has(n))return be.get(n)??null;try{const e=await fetch(`${me}/api/os/widget/${encodeURIComponent(n)}`);if(!e.ok)return null;const r=await e.json();return r.html?(be.set(n,r.html),k.widgetCacheVersion++,r.html):null}catch{return null}}async function dt(n){if(!He.has(n)){He.add(n),k.widgetCacheVersion++;try{const r=await(await fetch(`${me}/api/os/widget/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:n,force:!1})})).json();r.status==="cached"&&r.html&&be.set(n,r.html)}catch{}finally{be.has(n)&&He.delete(n),k.widgetCacheVersion++}}}const Ke=new Map;function $t(n,e){Ke.set(n,e)}function Wt(n){Ke.delete(n)}function Le(n){return Ke.get(n)}const zt=We({current:null});function _e(n){zt.current=n}function Ye(n,e){re(e,!0);let r=we(e,["$$slots","$$events","$$legacy"]);const a=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];ye(n,he({name:"box"},()=>r,{get iconNode(){return a},children:(d,p)=>{var o=de(),y=se(o);fe(y,()=>e.children??ve),w(d,o)},$$slots:{default:!0}})),ie()}var Vt=N('<img class="auto-card-icon svelte-1y09vim" referrerpolicy="no-referrer"/>'),Ft=N('<div class="auto-card-icon-placeholder svelte-1y09vim"><!></div>'),jt=N('<button class="auto-card-tool-btn sig-switch svelte-1y09vim" disabled=""><!> <span class="truncate"> </span></button>'),Bt=N('<div class="auto-card-tools svelte-1y09vim"></div>'),Gt=N('<div class="auto-card-empty svelte-1y09vim"><span class="sig-label">No tools exposed</span></div>'),Ut=N('<div class="auto-card svelte-1y09vim"><div class="auto-card-header svelte-1y09vim"><!> <span class="auto-card-name svelte-1y09vim"> </span> <span class="sig-meta ml-auto"> </span></div> <!></div>');function qt(n,e){re(e,!0);var r=Ut(),a=c(r),d=c(a);{var p=O=>{var S=Vt();ee(()=>{ge(S,"src",e.icon),ge(S,"alt",e.name)}),w(O,S)},o=O=>{var S=Ft(),$=c(S);Ye($,{class:"size-4"}),s(S),w(O,S)};J(d,O=>{e.icon?O(p):O(o,-1)})}var y=_(d,2),U=c(y,!0);s(y);var L=_(y,2),P=c(L);s(L),s(a);var D=_(a,2);{var H=O=>{var S=Bt();Te(S,21,()=>e.autoCard.tools,$=>$.name,($,W)=>{var j=jt(),F=c(j);at(F,{class:"size-3 shrink-0 opacity-50"});var te=_(F,2),I=c(te,!0);s(te),s(j),ee(()=>{ge(j,"title",t(W).description||t(W).name),ae(I,t(W).name)}),w($,j)}),s(S),w(O,S)},A=O=>{var S=Gt();w(O,S)};J(D,O=>{e.autoCard.tools.length>0?O(H):O(A,-1)})}s(r),ee(()=>{ae(U,e.name),ae(P,`${e.autoCard.tools.length??""} tools`)}),w(n,r),ie()}const Xt='// Signet Page Agent bundle - PageController + lightweight cursor mask\n// Auto-generated from @page-agent/page-controller v1.6.0\n\n\n(function(){\n // Lightweight SimulatorMask - cursor + overlay, no ai-motion dependency\n var CSS_TEXT = \'.__pa_mask{position:fixed;inset:0;z-index:2147483641;cursor:wait;overflow:hidden;display:none;background:rgba(0,0,0,0.02)}.__pa_mask.__pa_vis{display:block}.__pa_cur{position:absolute;width:40px;height:40px;pointer-events:none;z-index:10000;transition:none}.__pa_cur_fill{position:absolute;width:100%;height:100%;background:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' fill=\\\'%23ffffff\\\' stroke=\\\'%23333\\\' stroke-width=\\\'4\\\'/%3e%3c/svg%3e");background-size:100% 100%;transform-origin:center;transform:rotate(-135deg) scale(1.1);margin-left:-8px;margin-top:-14px}.__pa_cur_border{position:absolute;width:100%;height:100%;background:linear-gradient(45deg,rgb(57,182,255),rgb(189,69,251));mask-image:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\' fill=\\\'none\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' stroke=\\\'%23000\\\' stroke-width=\\\'6\\\'/%3e%3c/svg%3e");mask-size:100% 100%;mask-repeat:no-repeat;transform-origin:center;transform:rotate(-135deg) scale(1.2);margin-left:-10px;margin-top:-18px}.__pa_ripple{position:absolute;width:100%;height:100%;pointer-events:none;margin-left:-50%;margin-top:-50%}.__pa_ripple::after{content:\\\'\\\';opacity:0;position:absolute;inset:0;border:3px solid rgba(57,182,255,1);border-radius:50%}.__pa_cur.__pa_click .__pa_ripple::after{animation:__pa_rip 300ms ease-out forwards}@keyframes __pa_rip{0%{transform:scale(0);opacity:1}100%{transform:scale(2);opacity:0}}\';\n \n try{\n var s=document.createElement(\'style\');\n s.appendChild(document.createTextNode(CSS_TEXT));\n document.head.appendChild(s);\n }catch(e){}\n\n function LiteMask(){\n this.shown=false;\n this.wrapper=document.createElement(\'div\');\n this.wrapper.className=\'__pa_mask\';\n this.wrapper.setAttribute(\'data-page-agent-ignore\',\'true\');\n \n this._cursor=document.createElement(\'div\');\n this._cursor.className=\'__pa_cur\';\n var ripple=document.createElement(\'div\');ripple.className=\'__pa_ripple\';this._cursor.appendChild(ripple);\n var fill=document.createElement(\'div\');fill.className=\'__pa_cur_fill\';this._cursor.appendChild(fill);\n var border=document.createElement(\'div\');border.className=\'__pa_cur_border\';this._cursor.appendChild(border);\n this.wrapper.appendChild(this._cursor);\n \n this._cx=0;this._cy=0;this._tx=0;this._ty=0;\n \n // Block interactions on mask\n [\'click\',\'mousedown\',\'mouseup\',\'mousemove\',\'wheel\',\'keydown\',\'keyup\'].forEach(function(evt){\n this.wrapper.addEventListener(evt,function(e){e.stopPropagation();e.preventDefault();});\n }.bind(this));\n \n document.body.appendChild(this.wrapper);\n this._animate();\n \n var self=this;\n window.addEventListener(\'PageAgent::MovePointerTo\',function(e){\n var d=e.detail;self._tx=d.x;self._ty=d.y;\n });\n window.addEventListener(\'PageAgent::ClickPointer\',function(){\n self._cursor.classList.remove(\'__pa_click\');\n void self._cursor.offsetHeight;\n self._cursor.classList.add(\'__pa_click\');\n });\n }\n \n LiteMask.prototype._animate=function(){\n var nx=this._cx+(this._tx-this._cx)*0.2;\n var ny=this._cy+(this._ty-this._cy)*0.2;\n if(Math.abs(nx-this._tx)>0){this._cx=Math.abs(nx-this._tx)<2?this._tx:nx;this._cursor.style.left=this._cx+\'px\';}\n if(Math.abs(ny-this._ty)>0){this._cy=Math.abs(ny-this._ty)<2?this._ty:ny;this._cursor.style.top=this._cy+\'px\';}\n requestAnimationFrame(this._animate.bind(this));\n };\n \n LiteMask.prototype.show=function(){\n if(this.shown)return;this.shown=true;\n this.wrapper.classList.add(\'__pa_vis\');\n this._cx=window.innerWidth/2;this._cy=window.innerHeight/2;\n this._tx=this._cx;this._ty=this._cy;\n this._cursor.style.left=this._cx+\'px\';this._cursor.style.top=this._cy+\'px\';\n };\n \n LiteMask.prototype.hide=function(){\n if(!this.shown)return;this.shown=false;\n this._cursor.classList.remove(\'__pa_click\');\n var w=this.wrapper;\n setTimeout(function(){w.classList.remove(\'__pa_vis\');},300);\n };\n \n LiteMask.prototype.dispose=function(){this.wrapper.remove();};\n \n window.__LiteMask=LiteMask;\n})();\n\n// --- PageController (modified: SimulatorMask replaced with LiteMask) ---\n(function(){\n(function(){var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function isHTMLElement(el){return!!el&&el.nodeType===1}__name(isHTMLElement,"isHTMLElement");function isInputElement(el){return el?.nodeType===1&&el.tagName==="INPUT"}__name(isInputElement,"isInputElement");function isTextAreaElement(el){return el?.nodeType===1&&el.tagName==="TEXTAREA"}__name(isTextAreaElement,"isTextAreaElement");function isSelectElement(el){return el?.nodeType===1&&el.tagName==="SELECT"}__name(isSelectElement,"isSelectElement");function isAnchorElement(el){return el?.nodeType===1&&el.tagName==="A"}__name(isAnchorElement,"isAnchorElement");function getIframeOffset(element){const frame=element.ownerDocument.defaultView?.frameElement;if(!frame)return{x:0,y:0};const rect=frame.getBoundingClientRect();return{x:rect.left,y:rect.top}}__name(getIframeOffset,"getIframeOffset");function getNativeValueSetter(element){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element),"value").set}__name(getNativeValueSetter,"getNativeValueSetter");async function waitFor(seconds){await new Promise((resolve)=>setTimeout(resolve,seconds*1000))}__name(waitFor,"waitFor");async function movePointerToElement(element){const rect=element.getBoundingClientRect();const offset=getIframeOffset(element);const x=rect.left+rect.width/2+offset.x;const y=rect.top+rect.height/2+offset.y;window.dispatchEvent(new CustomEvent("PageAgent::MovePointerTo",{detail:{x,y}}));await waitFor(0.3)}__name(movePointerToElement,"movePointerToElement");function getElementByIndex(selectorMap,index){const interactiveNode=selectorMap.get(index);if(!interactiveNode){throw new Error(`No interactive element found at index ${index}`)}const element=interactiveNode.ref;if(!element){throw new Error(`Element at index ${index} does not have a reference`)}if(!isHTMLElement(element)){throw new Error(`Element at index ${index} is not an HTMLElement`)}return element}__name(getElementByIndex,"getElementByIndex");let lastClickedElement=null;function blurLastClickedElement(){if(lastClickedElement){lastClickedElement.blur();lastClickedElement.dispatchEvent(new MouseEvent("mouseout",{bubbles:true,cancelable:true}));lastClickedElement.dispatchEvent(new MouseEvent("mouseleave",{bubbles:false,cancelable:true}));lastClickedElement=null}}__name(blurLastClickedElement,"blurLastClickedElement");async function clickElement(element){blurLastClickedElement();lastClickedElement=element;await scrollIntoViewIfNeeded(element);const frame=element.ownerDocument.defaultView?.frameElement;if(frame)await scrollIntoViewIfNeeded(frame);await movePointerToElement(element);window.dispatchEvent(new CustomEvent("PageAgent::ClickPointer"));await waitFor(0.1);element.dispatchEvent(new MouseEvent("mouseenter",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mouseover",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mousedown",{bubbles:true,cancelable:true}));element.focus();element.dispatchEvent(new MouseEvent("mouseup",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("click",{bubbles:true,cancelable:true}));await waitFor(0.2)}__name(clickElement,"clickElement");async function inputTextElement(element,text){const isContentEditable=element.isContentEditable;if(!isInputElement(element)&&!isTextAreaElement(element)&&!isContentEditable){throw new Error("Element is not an input, textarea, or contenteditable")}await clickElement(element);if(isContentEditable){if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"deleteContent"}))){element.innerText="";element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"deleteContent"}))}if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"insertText",data:text}))){element.innerText=text;element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:text}))}const planASucceeded=element.innerText.trim()===text.trim();if(!planASucceeded){element.focus();const doc=element.ownerDocument;const selection=(doc.defaultView||window).getSelection();const range=doc.createRange();range.selectNodeContents(element);selection?.removeAllRanges();selection?.addRange(range);doc.execCommand("delete",false);doc.execCommand("insertText",false,text)}element.dispatchEvent(new Event("change",{bubbles:true}));element.blur()}else{getNativeValueSetter(element).call(element,text)}if(!isContentEditable){element.dispatchEvent(new Event("input",{bubbles:true}))}await waitFor(0.1);blurLastClickedElement()}__name(inputTextElement,"inputTextElement");async function selectOptionElement(selectElement,optionText){if(!isSelectElement(selectElement)){throw new Error("Element is not a select element")}const options=Array.from(selectElement.options);const option=options.find((opt)=>opt.textContent?.trim()===optionText.trim());if(!option){throw new Error(`Option with text "${optionText}" not found in select element`)}selectElement.value=option.value;selectElement.dispatchEvent(new Event("change",{bubbles:true}));await waitFor(0.1)}__name(selectOptionElement,"selectOptionElement");async function scrollIntoViewIfNeeded(element){const el=element;if(typeof el.scrollIntoViewIfNeeded==="function"){el.scrollIntoViewIfNeeded()}else{element.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})}}__name(scrollIntoViewIfNeeded,"scrollIntoViewIfNeeded");async function scrollVertically(down,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dy2=scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableY=/(auto|scroll|overlay)/.test(computedStyle.overflowY);const canScrollVertically=currentElement.scrollHeight>currentElement.clientHeight;if(hasScrollableY&&canScrollVertically){const beforeScroll=currentElement.scrollTop;const maxScroll=currentElement.scrollHeight-currentElement.clientHeight;let scrollAmount=dy2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollTop=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollTop;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) by ${scrollDelta}px`}else{return`No scrollable container found for element (${targetElement.tagName})`}}const dy=scroll_amount;const bigEnough=__name((el2)=>el2.clientHeight>=window.innerHeight*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowY)&&el2.scrollHeight>el2.clientHeight&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollY;const scrollMax=document.documentElement.scrollHeight-window.innerHeight;window.scrollBy(0,dy);const scrollAfter=window.scrollY;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of the page, cannot scroll down further.`:`⚠️ Already at the top of the page, cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled page by ${scrolled}px. Reached the bottom of the page.`;if(reachedTop)return`✅ Scrolled page by ${scrolled}px. Reached the top of the page.`;return`✅ Scrolled page by ${scrolled}px.`}else{const scrollBefore=el.scrollTop;const scrollMax=el.scrollHeight-el.clientHeight;el.scrollBy({top:dy,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollTop;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of container (${el.tagName}), cannot scroll down further.`:`⚠️ Already at the top of container (${el.tagName}), cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the bottom.`;if(reachedTop)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the top.`;return`✅ Scrolled container (${el.tagName}) by ${scrolled}px.`}}__name(scrollVertically,"scrollVertically");async function scrollHorizontally(right,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dx2=right?scroll_amount:-scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableX=/(auto|scroll|overlay)/.test(computedStyle.overflowX);const canScrollHorizontally=currentElement.scrollWidth>currentElement.clientWidth;if(hasScrollableX&&canScrollHorizontally){const beforeScroll=currentElement.scrollLeft;const maxScroll=currentElement.scrollWidth-currentElement.clientWidth;let scrollAmount=dx2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollLeft=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollLeft;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) horizontally by ${scrollDelta}px`}else{return`No horizontally scrollable container found for element (${targetElement.tagName})`}}const dx=right?scroll_amount:-scroll_amount;const bigEnough=__name((el2)=>el2.clientWidth>=window.innerWidth*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowX)&&el2.scrollWidth>el2.clientWidth&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollX;const scrollMax=document.documentElement.scrollWidth-window.innerWidth;window.scrollBy(dx,0);const scrollAfter=window.scrollX;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of the page, cannot scroll right further.`:`⚠️ Already at the left edge of the page, cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled page by ${scrolled}px. Reached the right edge of the page.`;if(reachedLeft)return`✅ Scrolled page by ${scrolled}px. Reached the left edge of the page.`;return`✅ Scrolled page horizontally by ${scrolled}px.`}else{const scrollBefore=el.scrollLeft;const scrollMax=el.scrollWidth-el.clientWidth;el.scrollBy({left:dx,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollLeft;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of container (${el.tagName}), cannot scroll right further.`:`⚠️ Already at the left edge of container (${el.tagName}), cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the right edge.`;if(reachedLeft)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the left edge.`;return`✅ Scrolled container (${el.tagName}) horizontally by ${scrolled}px.`}}__name(scrollHorizontally,"scrollHorizontally");const domTree=__name((args={doHighlightElements:true,focusHighlightIndex:-1,viewportExpansion:0,debugMode:false,interactiveBlacklist:[],interactiveWhitelist:[],highlightOpacity:0.1,highlightLabelOpacity:0.5})=>{const{interactiveBlacklist,interactiveWhitelist,highlightOpacity,highlightLabelOpacity}=args;const{doHighlightElements,focusHighlightIndex,viewportExpansion,debugMode}=args;let highlightIndex=0;const extraData=new WeakMap;function addExtraData(element,data){if(!element||element.nodeType!==Node.ELEMENT_NODE)return;extraData.set(element,{...extraData.get(element),...data})}__name(addExtraData,"addExtraData");const DOM_CACHE={boundingRects:new WeakMap,clientRects:new WeakMap,computedStyles:new WeakMap,clearCache:__name(()=>{DOM_CACHE.boundingRects=new WeakMap;DOM_CACHE.clientRects=new WeakMap;DOM_CACHE.computedStyles=new WeakMap},"clearCache")};function getCachedBoundingRect(element){if(!element)return null;if(DOM_CACHE.boundingRects.has(element)){return DOM_CACHE.boundingRects.get(element)}const rect=element.getBoundingClientRect();if(rect){DOM_CACHE.boundingRects.set(element,rect)}return rect}__name(getCachedBoundingRect,"getCachedBoundingRect");function getCachedComputedStyle(element){if(!element)return null;if(DOM_CACHE.computedStyles.has(element)){return DOM_CACHE.computedStyles.get(element)}const style=window.getComputedStyle(element);if(style){DOM_CACHE.computedStyles.set(element,style)}return style}__name(getCachedComputedStyle,"getCachedComputedStyle");function getCachedClientRects(element){if(!element)return null;if(DOM_CACHE.clientRects.has(element)){return DOM_CACHE.clientRects.get(element)}const rects=element.getClientRects();if(rects){DOM_CACHE.clientRects.set(element,rects)}return rects}__name(getCachedClientRects,"getCachedClientRects");const DOM_HASH_MAP={};const ID={current:0};const HIGHLIGHT_CONTAINER_ID="playwright-highlight-container";function highlightElement(element,index,parentIframe=null){if(!element)return index;const overlays=[];let label=null;let labelWidth=20;let labelHeight=16;let cleanupFn=null;try{let container=document.getElementById(HIGHLIGHT_CONTAINER_ID);if(!container){container=document.createElement("div");container.id=HIGHLIGHT_CONTAINER_ID;container.style.position="fixed";container.style.pointerEvents="none";container.style.top="0";container.style.left="0";container.style.width="100%";container.style.height="100%";container.style.zIndex="2147483640";container.style.backgroundColor="transparent";document.body.appendChild(container)}const rects=element.getClientRects();if(!rects||rects.length===0)return index;const colors=["#FF0000","#00FF00","#0000FF","#FFA500","#800080","#008080","#FF69B4","#4B0082","#FF4500","#2E8B57","#DC143C","#4682B4"];const colorIndex=index%colors.length;let baseColor=colors[colorIndex];const backgroundColor=baseColor+Math.floor(highlightOpacity*255).toString(16).padStart(2,"0");baseColor=baseColor+Math.floor(highlightLabelOpacity*255).toString(16).padStart(2,"0");let iframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();iframeOffset.x=iframeRect.left;iframeOffset.y=iframeRect.top}const fragment=document.createDocumentFragment();for(const rect of rects){if(rect.width===0||rect.height===0)continue;const overlay=document.createElement("div");overlay.style.position="fixed";overlay.style.border=`2px solid ${baseColor}`;overlay.style.backgroundColor=backgroundColor;overlay.style.pointerEvents="none";overlay.style.boxSizing="border-box";const top=rect.top+iframeOffset.y;const left=rect.left+iframeOffset.x;overlay.style.top=`${top}px`;overlay.style.left=`${left}px`;overlay.style.width=`${rect.width}px`;overlay.style.height=`${rect.height}px`;fragment.appendChild(overlay);overlays.push({element:overlay,initialRect:rect})}const firstRect=rects[0];label=document.createElement("div");label.className="playwright-highlight-label";label.style.position="fixed";label.style.background=baseColor;label.style.color="white";label.style.padding="1px 4px";label.style.borderRadius="4px";label.style.fontSize=`${Math.min(12,Math.max(8,firstRect.height/2))}px`;label.textContent=index.toString();labelWidth=label.offsetWidth>0?label.offsetWidth:labelWidth;labelHeight=label.offsetHeight>0?label.offsetHeight:labelHeight;const firstRectTop=firstRect.top+iframeOffset.y;const firstRectLeft=firstRect.left+iframeOffset.x;let labelTop=firstRectTop+2;let labelLeft=firstRectLeft+firstRect.width-labelWidth-2;if(firstRect.width<labelWidth+4||firstRect.height<labelHeight+4){labelTop=firstRectTop-labelHeight-2;labelLeft=firstRectLeft+firstRect.width-labelWidth;if(labelLeft<iframeOffset.x)labelLeft=firstRectLeft}labelTop=Math.max(0,Math.min(labelTop,window.innerHeight-labelHeight));labelLeft=Math.max(0,Math.min(labelLeft,window.innerWidth-labelWidth));label.style.top=`${labelTop}px`;label.style.left=`${labelLeft}px`;fragment.appendChild(label);const updatePositions=__name(()=>{const newRects=element.getClientRects();let newIframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();newIframeOffset.x=iframeRect.left;newIframeOffset.y=iframeRect.top}overlays.forEach((overlayData,i)=>{if(i<newRects.length){const newRect=newRects[i];const newTop=newRect.top+newIframeOffset.y;const newLeft=newRect.left+newIframeOffset.x;overlayData.element.style.top=`${newTop}px`;overlayData.element.style.left=`${newLeft}px`;overlayData.element.style.width=`${newRect.width}px`;overlayData.element.style.height=`${newRect.height}px`;overlayData.element.style.display=newRect.width===0||newRect.height===0?"none":"block"}else{overlayData.element.style.display="none"}});if(newRects.length<overlays.length){for(let i=newRects.length;i<overlays.length;i++){overlays[i].element.style.display="none"}}if(label&&newRects.length>0){const firstNewRect=newRects[0];const firstNewRectTop=firstNewRect.top+newIframeOffset.y;const firstNewRectLeft=firstNewRect.left+newIframeOffset.x;let newLabelTop=firstNewRectTop+2;let newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth-2;if(firstNewRect.width<labelWidth+4||firstNewRect.height<labelHeight+4){newLabelTop=firstNewRectTop-labelHeight-2;newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth;if(newLabelLeft<newIframeOffset.x)newLabelLeft=firstNewRectLeft}newLabelTop=Math.max(0,Math.min(newLabelTop,window.innerHeight-labelHeight));newLabelLeft=Math.max(0,Math.min(newLabelLeft,window.innerWidth-labelWidth));label.style.top=`${newLabelTop}px`;label.style.left=`${newLabelLeft}px`;label.style.display="block"}else if(label){label.style.display="none"}},"updatePositions");const throttleFunction=__name((func,delay)=>{let lastCall=0;return(...args2)=>{const now=performance.now();if(now-lastCall<delay)return;lastCall=now;return func(...args2)}},"throttleFunction");const throttledUpdatePositions=throttleFunction(updatePositions,16);window.addEventListener("scroll",throttledUpdatePositions,true);window.addEventListener("resize",throttledUpdatePositions);cleanupFn=__name(()=>{window.removeEventListener("scroll",throttledUpdatePositions,true);window.removeEventListener("resize",throttledUpdatePositions);overlays.forEach((overlay)=>overlay.element.remove());if(label)label.remove()},"cleanupFn");container.appendChild(fragment);return index+1}finally{if(cleanupFn){(window._highlightCleanupFunctions=window._highlightCleanupFunctions||[]).push(cleanupFn)}}}__name(highlightElement,"highlightElement");function isScrollableElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return null}const style=getCachedComputedStyle(element);if(!style)return null;const display=style.display;if(display==="inline"||display==="inline-block"){return null}const overflowX=style.overflowX;const overflowY=style.overflowY;const scrollableX=overflowX==="auto"||overflowX==="scroll";const scrollableY=overflowY==="auto"||overflowY==="scroll";if(!scrollableX&&!scrollableY){return null}const scrollWidth=element.scrollWidth-element.clientWidth;const scrollHeight=element.scrollHeight-element.clientHeight;const threshold=4;if(scrollWidth<threshold&&scrollHeight<threshold){return null}if(!scrollableY&&scrollWidth<threshold){return null}if(!scrollableX&&scrollHeight<threshold){return null}const distanceToTop=element.scrollTop;const distanceToLeft=element.scrollLeft;const distanceToRight=element.scrollWidth-element.clientWidth-element.scrollLeft;const distanceToBottom=element.scrollHeight-element.clientHeight-element.scrollTop;const scrollData={top:distanceToTop,right:distanceToRight,bottom:distanceToBottom,left:distanceToLeft};addExtraData(element,{scrollable:true,scrollData});return scrollData}__name(isScrollableElement,"isScrollableElement");function isTextNodeVisible(textNode){try{if(viewportExpansion===-1){const parentElement2=textNode.parentElement;if(!parentElement2)return false;try{return parentElement2.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement2);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}const range=document.createRange();range.selectNodeContents(textNode);const rects=range.getClientRects();if(!rects||rects.length===0){return false}let isAnyRectVisible=false;let isAnyRectInViewport=false;for(const rect of rects){if(rect.width>0&&rect.height>0){isAnyRectVisible=true;if(!(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}}if(!isAnyRectVisible||!isAnyRectInViewport){return false}const parentElement=textNode.parentElement;if(!parentElement)return false;try{return parentElement.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}catch(e){console.warn("Error checking text node visibility:",e);return false}}__name(isTextNodeVisible,"isTextNodeVisible");function isElementAccepted(element){if(!element||!element.tagName)return false;const alwaysAccept=new Set(["body","div","main","article","section","nav","header","footer"]);const tagName=element.tagName.toLowerCase();if(alwaysAccept.has(tagName))return true;const leafElementDenyList=new Set(["svg","script","style","link","meta","noscript","template"]);return!leafElementDenyList.has(tagName)}__name(isElementAccepted,"isElementAccepted");function isElementVisible(element){const style=getCachedComputedStyle(element);return element.offsetWidth>0&&element.offsetHeight>0&&style?.visibility!=="hidden"&&style?.display!=="none"}__name(isElementVisible,"isElementVisible");function isInteractiveElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}if(interactiveBlacklist.includes(element)){return false}if(interactiveWhitelist.includes(element)){return true}const tagName=element.tagName.toLowerCase();const style=getCachedComputedStyle(element);const interactiveCursors=new Set(["pointer","move","text","grab","grabbing","cell","copy","alias","all-scroll","col-resize","context-menu","crosshair","e-resize","ew-resize","help","n-resize","ne-resize","nesw-resize","ns-resize","nw-resize","nwse-resize","row-resize","s-resize","se-resize","sw-resize","vertical-text","w-resize","zoom-in","zoom-out"]);const nonInteractiveCursors=new Set(["not-allowed","no-drop","wait","progress","initial","inherit"]);function doesElementHaveInteractivePointer(element2){if(element2.tagName.toLowerCase()==="html")return false;if(style?.cursor&&interactiveCursors.has(style.cursor))return true;return false}__name(doesElementHaveInteractivePointer,"doesElementHaveInteractivePointer");let isInteractiveCursor=doesElementHaveInteractivePointer(element);if(isInteractiveCursor){return true}const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label","option","optgroup","fieldset","legend"]);const explicitDisableTags=new Set(["disabled","readonly"]);if(interactiveElements.has(tagName)){if(style?.cursor&&nonInteractiveCursors.has(style.cursor)){return false}for(const disableTag of explicitDisableTags){if(element.hasAttribute(disableTag)||element.getAttribute(disableTag)==="true"||element.getAttribute(disableTag)===""){return false}}if(element.disabled){return false}if(element.readOnly){return false}if(element.inert){return false}return true}const role=element.getAttribute("role");const ariaRole=element.getAttribute("aria-role");if(element.getAttribute("contenteditable")==="true"||element.isContentEditable){return true}if(element.classList&&(element.classList.contains("button")||element.classList.contains("dropdown-toggle")||element.getAttribute("data-index")||element.getAttribute("data-toggle")==="dropdown"||element.getAttribute("aria-haspopup")==="true")){return true}const interactiveRoles=new Set(["button","menu","menubar","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);const hasInteractiveRole=interactiveElements.has(tagName)||role&&interactiveRoles.has(role)||ariaRole&&interactiveRoles.has(ariaRole);if(hasInteractiveRole)return true;try{if(typeof getEventListeners==="function"){const listeners=getEventListeners(element);const mouseEvents=["click","mousedown","mouseup","dblclick"];for(const eventType of mouseEvents){if(listeners[eventType]&&listeners[eventType].length>0){return true}}}const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonMouseAttrs=["onclick","onmousedown","onmouseup","ondblclick"];for(const attr of commonMouseAttrs){if(element.hasAttribute(attr)||typeof element[attr]==="function"){return true}}}catch(e){}if(isScrollableElement(element)){return true}return false}__name(isInteractiveElement,"isInteractiveElement");function isTopElement(element){if(viewportExpansion===-1){return true}const rects=getCachedClientRects(element);if(!rects||rects.length===0){return false}let isAnyRectInViewport=false;for(const rect2 of rects){if(rect2.width>0&&rect2.height>0&&!(rect2.bottom<-viewportExpansion||rect2.top>window.innerHeight+viewportExpansion||rect2.right<-viewportExpansion||rect2.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}if(!isAnyRectInViewport){return false}let doc=element.ownerDocument;if(doc!==window.document){return true}let rect=Array.from(rects).find((r)=>r.width>0&&r.height>0);if(!rect){return false}const shadowRoot=element.getRootNode();if(shadowRoot instanceof ShadowRoot){const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;try{const topEl=shadowRoot.elementFromPoint(centerX,centerY);if(!topEl)return false;let current=topEl;while(current&&current!==shadowRoot){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}}const margin=5;const checkPoints=[{x:rect.left+rect.width/2,y:rect.top+rect.height/2},{x:rect.left+margin,y:rect.top+margin},{x:rect.right-margin,y:rect.bottom-margin}];return checkPoints.some(({x,y})=>{try{const topEl=document.elementFromPoint(x,y);if(!topEl)return false;let current=topEl;while(current&&current!==document.documentElement){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}})}__name(isTopElement,"isTopElement");function isInExpandedViewport(element,viewportExpansion2){if(viewportExpansion2===-1){return true}const rects=element.getClientRects();if(!rects||rects.length===0){const boundingRect=getCachedBoundingRect(element);if(!boundingRect||boundingRect.width===0||boundingRect.height===0){return false}return!(boundingRect.bottom<-viewportExpansion2||boundingRect.top>window.innerHeight+viewportExpansion2||boundingRect.right<-viewportExpansion2||boundingRect.left>window.innerWidth+viewportExpansion2)}for(const rect of rects){if(rect.width===0||rect.height===0)continue;if(!(rect.bottom<-viewportExpansion2||rect.top>window.innerHeight+viewportExpansion2||rect.right<-viewportExpansion2||rect.left>window.innerWidth+viewportExpansion2)){return true}}return false}__name(isInExpandedViewport,"isInExpandedViewport");function isInteractiveCandidate(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;const tagName=element.tagName.toLowerCase();const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label"]);if(interactiveElements.has(tagName))return true;const hasQuickInteractiveAttr=element.hasAttribute("onclick")||element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("aria-")||element.hasAttribute("data-action")||element.getAttribute("contenteditable")==="true";return hasQuickInteractiveAttr}__name(isInteractiveCandidate,"isInteractiveCandidate");const DISTINCT_INTERACTIVE_TAGS=new Set(["a","button","input","select","textarea","summary","details","label","option"]);const INTERACTIVE_ROLES=new Set(["button","link","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);function isHeuristicallyInteractive(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;if(!isElementVisible(element))return false;const hasInteractiveAttributes=element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("onclick")||typeof element.onclick==="function";const hasInteractiveClass=/\\b(btn|clickable|menu|item|entry|link)\\b/i.test(element.className||"");const isInKnownContainer=Boolean(element.closest(\'button,a,[role="button"],.menu,.dropdown,.list,.toolbar\'));const hasVisibleChildren=[...element.children].some(isElementVisible);const isParentBody=element.parentElement&&element.parentElement.isSameNode(document.body);return(isInteractiveElement(element)||hasInteractiveAttributes||hasInteractiveClass)&&hasVisibleChildren&&isInKnownContainer&&!isParentBody}__name(isHeuristicallyInteractive,"isHeuristicallyInteractive");function isElementDistinctInteraction(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}const tagName=element.tagName.toLowerCase();const role=element.getAttribute("role");if(tagName==="iframe"){return true}if(DISTINCT_INTERACTIVE_TAGS.has(tagName)){return true}if(role&&INTERACTIVE_ROLES.has(role)){return true}if(element.isContentEditable||element.getAttribute("contenteditable")==="true"){return true}if(element.hasAttribute("data-testid")||element.hasAttribute("data-cy")||element.hasAttribute("data-test")){return true}if(element.hasAttribute("onclick")||typeof element.onclick==="function"){return true}try{const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonEventAttrs=["onmousedown","onmouseup","onkeydown","onkeyup","onsubmit","onchange","oninput","onfocus","onblur"];if(commonEventAttrs.some((attr)=>element.hasAttribute(attr))){return true}}catch(e){}if(isHeuristicallyInteractive(element)){return true}return false}__name(isElementDistinctInteraction,"isElementDistinctInteraction");function handleHighlighting(nodeData,node,parentIframe,isParentHighlighted){if(!nodeData.isInteractive)return false;let shouldHighlight=false;if(!isParentHighlighted){shouldHighlight=true}else{if(isElementDistinctInteraction(node)){shouldHighlight=true}else{shouldHighlight=false}}if(shouldHighlight){nodeData.isInViewport=isInExpandedViewport(node,viewportExpansion);if(nodeData.isInViewport||viewportExpansion===-1){nodeData.highlightIndex=highlightIndex++;if(doHighlightElements){if(focusHighlightIndex>=0){if(focusHighlightIndex===nodeData.highlightIndex){highlightElement(node,nodeData.highlightIndex,parentIframe)}}else{highlightElement(node,nodeData.highlightIndex,parentIframe)}return true}}}return false}__name(handleHighlighting,"handleHighlighting");function buildDomTree(node,parentIframe=null,isParentHighlighted=false){if(!node||node.id===HIGHLIGHT_CONTAINER_ID||node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(!node||node.id===HIGHLIGHT_CONTAINER_ID){return null}if(node.dataset?.browserUseIgnore==="true"||node.dataset?.pageAgentIgnore==="true"){return null}if(node.getAttribute&&node.getAttribute("aria-hidden")==="true"){return null}if(node===document.body){const nodeData2={tagName:"body",attributes:{},xpath:"/body",children:[]};for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,false);if(domElement)nodeData2.children.push(domElement)}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]=nodeData2;return id2}if(node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(node.nodeType===Node.TEXT_NODE){const textContent=node.textContent?.trim();if(!textContent){return null}const parentElement=node.parentElement;if(!parentElement||parentElement.tagName.toLowerCase()==="script"){return null}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]={type:"TEXT_NODE",text:textContent,isVisible:isTextNodeVisible(node)};return id2}if(node.nodeType===Node.ELEMENT_NODE&&!isElementAccepted(node)){return null}if(viewportExpansion!==-1&&!node.shadowRoot){const rect=getCachedBoundingRect(node);const style=getCachedComputedStyle(node);const isFixedOrSticky=style&&(style.position==="fixed"||style.position==="sticky");const hasSize=node.offsetWidth>0||node.offsetHeight>0;if(!rect||!isFixedOrSticky&&!hasSize&&(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){return null}}const nodeData={tagName:node.tagName.toLowerCase(),attributes:{},children:[]};if(isInteractiveCandidate(node)||node.tagName.toLowerCase()==="iframe"||node.tagName.toLowerCase()==="body"){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}if(node.tagName.toLowerCase()==="input"&&(node.type==="checkbox"||node.type==="radio")){nodeData.attributes.checked=node.checked?"true":"false"}}let nodeWasHighlighted=false;if(node.nodeType===Node.ELEMENT_NODE){nodeData.isVisible=isElementVisible(node);if(nodeData.isVisible){nodeData.isTopElement=isTopElement(node);const role=node.getAttribute("role");const isMenuContainer=role==="menu"||role==="menubar"||role==="listbox";if(nodeData.isTopElement||isMenuContainer){nodeData.isInteractive=isInteractiveElement(node);nodeWasHighlighted=handleHighlighting(nodeData,node,parentIframe,isParentHighlighted);nodeData.ref=node;if(nodeData.isInteractive&&Object.keys(nodeData.attributes).length===0){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}}}}}if(node.tagName){const tagName=node.tagName.toLowerCase();if(tagName==="iframe"){try{const iframeDoc=node.contentDocument||node.contentWindow?.document;if(iframeDoc){for(const child of iframeDoc.childNodes){const domElement=buildDomTree(child,node,false);if(domElement)nodeData.children.push(domElement)}}}catch(e){console.warn("Unable to access iframe:",e)}}else if(node.isContentEditable||node.getAttribute("contenteditable")==="true"||node.id==="tinymce"||node.classList.contains("mce-content-body")||tagName==="body"&&node.getAttribute("data-id")?.startsWith("mce_")){for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}else{if(node.shadowRoot){nodeData.shadowRoot=true;for(const child of node.shadowRoot.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}for(const child of node.childNodes){const passHighlightStatusToChild=nodeWasHighlighted||isParentHighlighted;const domElement=buildDomTree(child,parentIframe,passHighlightStatusToChild);if(domElement)nodeData.children.push(domElement)}}}if(nodeData.tagName==="a"&&nodeData.children.length===0&&!nodeData.attributes.href){const rect=getCachedBoundingRect(node);const hasSize=rect&&rect.width>0&&rect.height>0||node.offsetWidth>0||node.offsetHeight>0;if(!hasSize){return null}}nodeData.extra=extraData.get(node)||null;const id=`${ID.current++}`;DOM_HASH_MAP[id]=nodeData;return id}__name(buildDomTree,"buildDomTree");const rootId=buildDomTree(document.body);DOM_CACHE.clearCache();return{rootId,map:DOM_HASH_MAP}},"domTree");const DEFAULT_VIEWPORT_EXPANSION=-1;function resolveViewportExpansion(viewportExpansion){return viewportExpansion??DEFAULT_VIEWPORT_EXPANSION}__name(resolveViewportExpansion,"resolveViewportExpansion");const newElementsCache=new WeakMap;function getFlatTree(config){const viewportExpansion=resolveViewportExpansion(config.viewportExpansion);const interactiveBlacklist=[];for(const item of config.interactiveBlacklist||[]){if(typeof item==="function"){interactiveBlacklist.push(item())}else{interactiveBlacklist.push(item)}}const interactiveWhitelist=[];for(const item of config.interactiveWhitelist||[]){if(typeof item==="function"){interactiveWhitelist.push(item())}else{interactiveWhitelist.push(item)}}const elements=domTree({doHighlightElements:true,debugMode:true,focusHighlightIndex:-1,viewportExpansion,interactiveBlacklist,interactiveWhitelist,highlightOpacity:config.highlightOpacity??0,highlightLabelOpacity:config.highlightLabelOpacity??0.1});const currentUrl=window.location.href;for(const nodeId in elements.map){const node=elements.map[nodeId];if(node.isInteractive&&node.ref){const ref=node.ref;if(!newElementsCache.has(ref)){newElementsCache.set(ref,currentUrl);node.isNew=true}}}return elements}__name(getFlatTree,"getFlatTree");const globRegexCache=new Map;function globToRegex(pattern){let regex=globRegexCache.get(pattern);if(!regex){const escaped=pattern.replace(/[.+^${}()|[\\]\\\\]/g,"\\\\$&");regex=new RegExp(`^${escaped.replace(/\\*/g,".*")}$`);globRegexCache.set(pattern,regex)}return regex}__name(globToRegex,"globToRegex");function matchAttributes(attrs,patterns){const result2={};for(const pattern of patterns){if(pattern.includes("*")){const regex=globToRegex(pattern);for(const key of Object.keys(attrs)){if(regex.test(key)&&attrs[key].trim()){result2[key]=attrs[key].trim()}}}else{const value=attrs[pattern];if(value&&value.trim()){result2[pattern]=value.trim()}}}return result2}__name(matchAttributes,"matchAttributes");function flatTreeToString(flatTree,includeAttributes){const DEFAULT_INCLUDE_ATTRIBUTES=["title","type","checked","name","role","value","placeholder","data-date-format","alt","aria-label","aria-expanded","data-state","aria-checked","id","for","target","aria-haspopup","aria-controls","aria-owns","contenteditable"];const includeAttrs=[...includeAttributes||[],...DEFAULT_INCLUDE_ATTRIBUTES];const capTextLength=__name((text,maxLength)=>{if(text.length>maxLength){return text.substring(0,maxLength)+"..."}return text},"capTextLength");const buildTreeNode=__name((nodeId)=>{const node=flatTree.map[nodeId];if(!node)return null;if(node.type==="TEXT_NODE"){const textNode=node;return{type:"text",text:textNode.text,isVisible:textNode.isVisible,parent:null,children:[]}}else{const elementNode=node;const children=[];if(elementNode.children){for(const childId of elementNode.children){const child=buildTreeNode(childId);if(child){child.parent=null;children.push(child)}}}return{type:"element",tagName:elementNode.tagName,attributes:elementNode.attributes??{},isVisible:elementNode.isVisible??false,isInteractive:elementNode.isInteractive??false,isTopElement:elementNode.isTopElement??false,isNew:elementNode.isNew??false,highlightIndex:elementNode.highlightIndex,parent:null,children,extra:elementNode.extra??{}}}},"buildTreeNode");const setParentReferences=__name((node,parent=null)=>{node.parent=parent;for(const child of node.children){setParentReferences(child,node)}},"setParentReferences");const rootNode=buildTreeNode(flatTree.rootId);if(!rootNode)return"";setParentReferences(rootNode);const hasParentWithHighlightIndex=__name((node)=>{let current=node.parent;while(current){if(current.type==="element"&&current.highlightIndex!==undefined){return true}current=current.parent}return false},"hasParentWithHighlightIndex");const processNode=__name((node,depth,result22)=>{let nextDepth=depth;const depthStr="\\t".repeat(depth);if(node.type==="element"){if(node.highlightIndex!==undefined){nextDepth+=1;const text=getAllTextTillNextClickableElement(node);let attributesHtmlStr="";if(includeAttrs.length>0&&node.attributes){const attributesToInclude=matchAttributes(node.attributes,includeAttrs);const keys=Object.keys(attributesToInclude);if(keys.length>1){const keysToRemove=new Set;const seenValues={};for(const key of keys){const value=attributesToInclude[key];if(value.length>5){if(value in seenValues){keysToRemove.add(key)}else{seenValues[value]=key}}}for(const key of keysToRemove){delete attributesToInclude[key]}}if(attributesToInclude.role===node.tagName){delete attributesToInclude.role}const attrsToRemoveIfTextMatches=["aria-label","placeholder","title"];for(const attr of attrsToRemoveIfTextMatches){if(attributesToInclude[attr]&&attributesToInclude[attr].toLowerCase().trim()===text.toLowerCase().trim()){delete attributesToInclude[attr]}}if(Object.keys(attributesToInclude).length>0){attributesHtmlStr=Object.entries(attributesToInclude).map(([key,value])=>`${key}=${capTextLength(value,20)}`).join(" ")}}const highlightIndicator=node.isNew?`*[${node.highlightIndex}]`:`[${node.highlightIndex}]`;let line=`${depthStr}${highlightIndicator}<${node.tagName??""}`;if(attributesHtmlStr){line+=` ${attributesHtmlStr}`}if(node.extra){if(node.extra.scrollable){let scrollDataText="";if(node.extra.scrollData?.left)scrollDataText+=`left=${node.extra.scrollData.left}, `;if(node.extra.scrollData?.top)scrollDataText+=`top=${node.extra.scrollData.top}, `;if(node.extra.scrollData?.right)scrollDataText+=`right=${node.extra.scrollData.right}, `;if(node.extra.scrollData?.bottom)scrollDataText+=`bottom=${node.extra.scrollData.bottom}`;line+=` data-scrollable="${scrollDataText}"`}}if(text){const trimmedText=text.trim();if(!attributesHtmlStr){line+=" "}line+=`>${trimmedText}`}else if(!attributesHtmlStr){line+=" "}line+=" />";result22.push(line)}for(const child of node.children){processNode(child,nextDepth,result22)}}else if(node.type==="text"){if(hasParentWithHighlightIndex(node)){return}if(node.parent&&node.parent.type==="element"&&node.parent.isVisible&&node.parent.isTopElement){result22.push(`${depthStr}${node.text??""}`)}}},"processNode");const result2=[];processNode(rootNode,0,result2);return result2.join(`\n`)}__name(flatTreeToString,"flatTreeToString");const getAllTextTillNextClickableElement=__name((node,maxDepth=-1)=>{const textParts=[];const collectText=__name((currentNode,currentDepth)=>{if(maxDepth!==-1&&currentDepth>maxDepth){return}if(currentNode.type==="element"&&currentNode!==node&&currentNode.highlightIndex!==undefined){return}if(currentNode.type==="text"&&currentNode.text){textParts.push(currentNode.text)}else if(currentNode.type==="element"){for(const child of currentNode.children){collectText(child,currentDepth+1)}}},"collectText");collectText(node,0);return textParts.join(`\n`).trim()},"getAllTextTillNextClickableElement");function getSelectorMap(flatTree){const selectorMap=new Map;const keys=Object.keys(flatTree.map);for(const key of keys){const node=flatTree.map[key];if(node.isInteractive&&typeof node.highlightIndex==="number"){selectorMap.set(node.highlightIndex,node)}}return selectorMap}__name(getSelectorMap,"getSelectorMap");function getElementTextMap(simplifiedHTML){const lines=simplifiedHTML.split(`\n`).map((line)=>line.trim()).filter((line)=>line.length>0);const elementTextMap=new Map;for(const line of lines){const regex=/^\\[(\\d+)\\]<[^>]+>([^<]*)/;const match=regex.exec(line);if(match){const index=parseInt(match[1],10);elementTextMap.set(index,line)}}return elementTextMap}__name(getElementTextMap,"getElementTextMap");function cleanUpHighlights(){const cleanupFunctions=window._highlightCleanupFunctions||[];for(const cleanup of cleanupFunctions){if(typeof cleanup==="function"){cleanup()}}window._highlightCleanupFunctions=[]}__name(cleanUpHighlights,"cleanUpHighlights");window.addEventListener("popstate",()=>{cleanUpHighlights()});window.addEventListener("hashchange",()=>{cleanUpHighlights()});window.addEventListener("beforeunload",()=>{cleanUpHighlights()});const navigation=window.navigation;if(navigation&&typeof navigation.addEventListener==="function"){navigation.addEventListener("navigate",()=>{cleanUpHighlights()})}else{let currentUrl=window.location.href;setInterval(()=>{if(window.location.href!==currentUrl){currentUrl=window.location.href;cleanUpHighlights()}},500)}function getPageInfo(){const viewport_width=window.innerWidth;const viewport_height=window.innerHeight;const page_width=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth||0);const page_height=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight||0);const scroll_x=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0;const scroll_y=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;const pixels_below=Math.max(0,page_height-(window.innerHeight+scroll_y));const pixels_right=Math.max(0,page_width-(window.innerWidth+scroll_x));return{viewport_width,viewport_height,page_width,page_height,scroll_x,scroll_y,pixels_above:scroll_y,pixels_below,pages_above:viewport_height>0?scroll_y/viewport_height:0,pages_below:viewport_height>0?pixels_below/viewport_height:0,total_pages:viewport_height>0?page_height/viewport_height:0,current_page_position:scroll_y/Math.max(1,page_height-viewport_height),pixels_left:scroll_x,pixels_right}}__name(getPageInfo,"getPageInfo");function patchReact(pageController){const reactRootElements=document.querySelectorAll(\'[data-reactroot], [data-reactid], [data-react-checksum], #root, #app, [id^="root-"], [id^="app-"], #adex-wrapper, #adex-root\');for(const element of reactRootElements){element.setAttribute("data-page-agent-not-interactive","true")}}__name(patchReact,"patchReact");const _PageController=class _PageController extends EventTarget{config;flatTree=null;selectorMap=new Map;elementTextMap=new Map;simplifiedHTML="<EMPTY>";lastTimeUpdate=0;isIndexed=false;mask=null;maskReady=null;constructor(config={}){super();this.config=config;patchReact();if(config.enableMask)this.initMask()}initMask(){if(this.maskReady!==null)return;this.maskReady=(async()=>{var SimulatorMask = window.__LiteMask;this.mask=new SimulatorMask})()}async getCurrentUrl(){return window.location.href}async getLastUpdateTime(){return this.lastTimeUpdate}async getBrowserState(){const url=window.location.href;const title=document.title;const pi=getPageInfo();const viewportExpansion=resolveViewportExpansion(this.config.viewportExpansion);await this.updateTree();const content=this.simplifiedHTML;const titleLine=`Current Page: [${title}](${url})`;const pageInfoLine=`Page info: ${pi.viewport_width}x${pi.viewport_height}px viewport, ${pi.page_width}x${pi.page_height}px total page size, ${pi.pages_above.toFixed(1)} pages above, ${pi.pages_below.toFixed(1)} pages below, ${pi.total_pages.toFixed(1)} total pages, at ${(pi.current_page_position*100).toFixed(0)}% of page`;const elementsLabel=viewportExpansion===-1?"Interactive elements from top layer of the current page (full page):":"Interactive elements from top layer of the current page inside the viewport:";const hasContentAbove=pi.pixels_above>4;const scrollHintAbove=hasContentAbove&&viewportExpansion!==-1?`... ${pi.pixels_above} pixels above (${pi.pages_above.toFixed(1)} pages) - scroll to see more ...`:"[Start of page]";const header=`${titleLine}\n${pageInfoLine}\n\n${elementsLabel}\n\n${scrollHintAbove}`;const hasContentBelow=pi.pixels_below>4;const footer=hasContentBelow&&viewportExpansion!==-1?`... ${pi.pixels_below} pixels below (${pi.pages_below.toFixed(1)} pages) - scroll to see more ...`:"[End of page]";return{url,title,header,content,footer}}async updateTree(){this.dispatchEvent(new Event("beforeUpdate"));this.lastTimeUpdate=Date.now();if(this.mask){this.mask.wrapper.style.pointerEvents="none"}cleanUpHighlights();const blacklist=[...this.config.interactiveBlacklist||[],...document.querySelectorAll("[data-page-agent-not-interactive]").values()];this.flatTree=getFlatTree({...this.config,interactiveBlacklist:blacklist});this.simplifiedHTML=flatTreeToString(this.flatTree,this.config.includeAttributes);this.selectorMap.clear();this.selectorMap=getSelectorMap(this.flatTree);this.elementTextMap.clear();this.elementTextMap=getElementTextMap(this.simplifiedHTML);this.isIndexed=true;if(this.mask){this.mask.wrapper.style.pointerEvents="auto"}this.dispatchEvent(new Event("afterUpdate"));return this.simplifiedHTML}async cleanUpHighlights(){cleanUpHighlights()}assertIndexed(){if(!this.isIndexed){throw new Error("DOM tree not indexed yet. Can not perform actions on elements.")}}async clickElement(index){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await clickElement(element);if(isAnchorElement(element)&&element.target==="_blank"){return{success:true,message:`✅ Clicked element (${elemText??index}). ⚠️ Link opened in a new tab.`}}return{success:true,message:`✅ Clicked element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to click element: ${error}`}}}async inputText(index,text){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await inputTextElement(element,text);return{success:true,message:`✅ Input text (${text}) into element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to input text: ${error}`}}}async selectOption(index,optionText){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await selectOptionElement(element,optionText);return{success:true,message:`✅ Selected option (${optionText}) in element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to select option: ${error}`}}}async scroll(options){try{const{down,numPages,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels??numPages*(down?1:-1)*window.innerHeight;const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollVertically(down,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll: ${error}`}}}async scrollHorizontally(options){try{const{right,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels*(right?1:-1);const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollHorizontally(right,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll horizontally: ${error}`}}}async executeJavascript(script){try{const asyncFunction=eval(`(async () => { ${script} })`);const result=await asyncFunction();return{success:true,message:`✅ Executed JavaScript. Result: ${result}`}}catch(error){return{success:false,message:`❌ Error executing JavaScript: ${error}`}}}async showMask(){await this.maskReady;this.mask?.show()}async hideMask(){await this.maskReady;this.mask?.hide()}dispose(){cleanUpHighlights();this.flatTree=null;this.selectorMap.clear();this.elementTextMap.clear();this.simplifiedHTML="<EMPTY>";this.isIndexed=false;this.mask?.dispose();this.mask=null}};__name(_PageController,"PageController");let PageController=_PageController;window.__PageController=PageController})();\n})();\n\n// --- Signet Page Agent API ---\n(function(){\n var pc = new window.__PageController({ enableMask: false, highlightOpacity: 0, highlightLabelOpacity: 0 });\n \n window.signet = window.signet || {};\n window.signet.pageController = pc;\n \n window.signet.getDomState = async function(){\n try {\n var state = await pc.getBrowserState();\n return { success: true, state: state };\n } catch(e) {\n return { success: false, error: e.message || String(e) };\n }\n };\n \n window.signet.executeAction = async function(action){\n try {\n var result;\n switch(action.type){\n case \'click_element\':\n result = await pc.clickElement(action.index);\n break;\n case \'input_text\':\n result = await pc.inputText(action.index, action.text);\n break;\n case \'select_option\':\n result = await pc.selectOption(action.index, action.text);\n break;\n case \'scroll\':\n result = await pc.scroll({ down: action.direction === \'down\', numPages: action.amount || 1 });\n break;\n default:\n result = { success: false, message: \'Unknown action type: \' + action.type };\n }\n return result;\n } catch(e) {\n return { success: false, message: e.message || String(e) };\n }\n };\n \n window.signet.agentStart = async function(){\n pc.initMask();\n await pc.showMask();\n };\n \n window.signet.agentStop = async function(){\n await pc.hideMask();\n };\n})();',Yt=`
2
2
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
3
3
  html { font-family: 'Geist Mono', 'IBM Plex Mono', monospace; font-size: 13px; line-height: 1.5; color: var(--sig-text); background: var(--sig-bg); -webkit-font-smoothing: antialiased; }
4
4
  body { margin: 0; padding: 8px; min-height: 100%; }
@@ -0,0 +1 @@
1
+ import{bi as Ae,q as Ge,o as A,i as U,v as P,R as re,bj as bt}from"./Bh3nIh1p.js";class Ue{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Pe{constructor(t,n){this.status=t,this.location=n}}class Te extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function kt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function Et(e){return e.split("%25").map(decodeURI).join("%25")}function St(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function Rt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function xt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function Lt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const At=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&H.delete(Ie(e)),At(e,t));const H=new Map;function Ut(e,t){const n=Ie(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&H.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=Lt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Pt(e,t,n){if(H.size>0){const r=Ie(e,n),a=H.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);H.delete(r)}}return window.fetch(t,n)}function Ie(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${xt(...a)}"]`}return r}const Tt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function It(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${$t(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ve(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ve(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=Tt.exec(l),[,p,u,f,h]=d;return t.push({name:f,matcher:h,optional:!!p,rest:!!u,chained:u?c===1&&s[0]==="":!1}),u?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ve(l)}).join("")}).join("")}/?$`),params:t}}function Ot(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function $t(e){return e.slice(1).split("/").filter(Ot)}function Ct(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function ve(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function jt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:u}=It(o),f={id:o,exec:h=>{const v=p.exec(h);if(v)return Ct(v,u,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Qe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Me(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_1pp0b4p?.base??"",Nt=globalThis.__sveltekit_1pp0b4p?.assets??x??"",qt="1774228702488",Ze="sveltekit:snapshot",et="sveltekit:scroll",tt="sveltekit:states",Dt="sveltekit:pageurl",V="sveltekit:history",J="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Oe=location.origin;function nt(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function q(){return{x:pageXOffset,y:pageYOffset}}function D(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const He={...N,"":N.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function at(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function ke(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||pe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===Oe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function ae(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=D(o,"preload-code")),a===null&&(a=D(o,"preload-data")),t===null&&(t=D(o,"keepfocus")),n===null&&(n=D(o,"noscroll")),i===null&&(i=D(o,"reload")),s===null&&(s=D(o,"replacestate")),o=rt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:He[r??"off"],preload_data:He[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function We(e){const t=Ae(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const ot={v:()=>{}};function Vt(){const{set:e,subscribe:t}=Ae(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Nt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==qt;return s&&(e(!0),ot.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function pe(e,t,n){return e.origin!==Oe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function dn(e){}const st=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...st];const Bt=new Set([...st]);[...Bt];function Kt(e){return e.filter(t=>t!=null)}function $e(e){return e instanceof Ue||e instanceof Te?e.status:500}function Ft(e){return e instanceof Te?e.text:"Internal Error"}let b,Y,we;const Gt=Ge.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ge.toString()),Je="a:";Gt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Je)},Y={current:null},we={current:!1}):(b=new class{#e=A({});get data(){return U(this.#e)}set data(t){P(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){P(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){P(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){P(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){P(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){P(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){P(this.#s,t)}#i=A(new URL(Je));get url(){return U(this.#i)}set url(t){P(this.#i,t)}},Y=new class{#e=A(null);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},we=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ot.v=()=>we.current=!0);function it(e){Object.assign(b,e)}const Ye={spanContext(){return Mt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Mt={traceId:"",spanId:"",traceFlags:0},Ht=new Set(["icon","shortcut icon","apple-touch-icon"]);let G=null;const j=Qe(et)??{},z=Qe(Ze)??{},C={url:We({}),page:We({}),navigating:Ae(null),updated:Vt()};function Ce(e){j[e]=q()}function Wt(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;z[n];)delete z[n],n+=1}function X(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function lt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Ee(){}let je,Se,oe,T,Re,w;const se=[],ie=[];let L=null;function le(){L?.fork?.then(e=>e?.discard()),L=null}const ne=new Map,ct=new Set,Jt=new Set,W=new Set;let m={branch:[],error:null,url:null,nav:null},ut=!1,ce=!1,ze=!0,Q=!1,M=!1,ft=!1,ee=!1,Ne,y,R,I;const ue=new Set;let ye;const fe=new Map;async function _n(e,t,n){globalThis.__sveltekit_1pp0b4p?.data&&globalThis.__sveltekit_1pp0b4p.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),je=jt(e),T=document.documentElement,Re=t,Se=e.nodes[0],oe=e.nodes[1],Se(),oe(),y=history.state?.[V],R=history.state?.[J],y||(y=R=Date.now(),history.replaceState({...history.state,[V]:y,[J]:R},""));const r=j[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await sn(Re,n)):(await B({type:"enter",url:nt(w.hash?un(new URL(location.href)):location.href),replace_state:!0}),a()),on()}async function Yt(e=!0,t=!0){if(await(ye||=Promise.resolve()),!ye)return;ye=null;const n=I={},r=await te(m.url,!0);if(le(),ee&&fe.forEach(({resource:a})=>{a.refresh?.()}),e){const a=b.state,i=r&&await Ve(r);if(!i||n!==I)return;if(i.type==="redirect")return pt(new URL(i.location,m.url).href,{replaceState:!0},1,n);t||(i.props.page.state=a),it(i.props.page),m={...i.state,nav:m.nav},xe(),Ne.$set(i.props)}else xe();await Promise.all([...fe.values()].map(({resource:a})=>a)).catch(Ee)}function xe(){se.length=0,ee=!1}function dt(e){ie.some(t=>t?.snapshot)&&(z[e]=ie.map(t=>t?.snapshot?.capture()))}function ht(e){z[e]?.forEach((t,n)=>{ie[n]?.snapshot?.restore(t)})}function Xe(){Ce(y),Me(et,j),dt(R),Me(Ze,z)}async function pt(e,t,n,r){let a;t.invalidateAll&&le(),await B({type:"goto",url:nt(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(ee=!0,a=[...fe.keys()]),t.invalidate&&t.invalidate.forEach(an)}}),t.invalidateAll&&re().then(re).then(()=>{fe.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function zt(e){if(e.id!==L?.id){le();const t={};ue.add(t),L={id:e.id,token:t,promise:Ve({...e,preload:t}).then(n=>(ue.delete(t),n.type==="loaded"&&n.state.error&&le(),n)),fork:null}}return L.promise}async function be(e){const t=(await te(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function gt(e,t,n){const r={params:m.params,route:{id:m.route?.id??null},url:new URL(location.href)};m={...e.state,nav:r};const a=document.querySelector("style[data-sveltekit]");if(a&&a.remove(),Object.assign(b,e.props.page),Ne=new w.root({target:t,props:{...e.props,stores:C,components:ie},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),ht(R),n){const i={from:null,to:{...r,scroll:j[y]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};W.forEach(s=>s(i))}ce=!0}async function de({url:e,params:t,branch:n,errors:r,status:a,error:i,route:s,form:o}){let l="never";if(x&&(e.pathname===x||e.pathname===x+"/"))l="always";else for(const h of n)h?.slash!==void 0&&(l=h.slash);e.pathname=kt(e.pathname,l),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:s},props:{constructors:Kt(n).map(h=>h.node.component),page:Fe(b)}};o!==void 0&&(c.props.form=o);let d={},p=!b,u=0;for(let h=0;h<Math.max(n.length,m.branch.length);h+=1){const v=n[h],_=m.branch[h];v?.data!==_?.data&&(p=!0),v&&(d={...d,...v.data},p&&(c.props[`data_${u}`]=d),u+=1)}return(!m.url||e.href!==m.url.href||m.error!==i||o!==void 0&&o!==b.form||p)&&(c.props.page={error:i,params:t,route:{id:s?.id??null},state:{},status:a,url:new URL(e),form:o??null,data:p?d:b.data}),c}async function qe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...u){for(const f of u){const{href:h}=new URL(f,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ye,current:Ye},route:new Proxy(a,{get:(u,f)=>(o&&(l.route=!0),u[f])}),params:new Proxy(r,{get:(u,f)=>(o&&l.params.add(f),u[f])}),data:i?.data??null,url:Rt(n,()=>{o&&(l.url=!0)},u=>{o&&l.search_params.add(u)},w.hash),async fetch(u,f){u instanceof Request&&(f={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u?.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...f});const{resolved:h,promise:v}=_t(u,f,n);return o&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function _t(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=ce?Pt(r,a.href,t):Ut(r,t);return{resolved:a,promise:i}}function Xt(e,t,n,r,a,i){if(ee)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==m.params[s])return!0;for(const s of a.dependencies)if(se.some(o=>o(new URL(s))))return!0;return!1}function De(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Qt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Zt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Fe(b),constructors:[]}}}async function Ve({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ue.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(_=>_?.().catch(()=>{})),c.forEach(_=>_?.[1]().catch(()=>{}));const d=m.url?e!==he(m.url):!1,p=m.route?a.id!==m.route.id:!1,u=Qt(m.url,n);let f=!1;const h=c.map(async(_,g)=>{if(!_)return;const E=m.branch[g];return _[1]===E?.loader&&!Xt(f,p,d,u,E.universal?.uses,r)?E:(f=!0,qe({loader:_[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let $=0;$<g;$+=1)Object.assign(O,(await h[$])?.data);return O},server_data_node:De(_[0]?{type:"skip"}:null,_[0]?E?.server:void 0)}))});for(const _ of h)_.catch(()=>{});const v=[];for(let _=0;_<c.length;_+=1)if(c[_])try{v.push(await h[_])}catch(g){if(g instanceof Pe)return{type:"redirect",location:g.location};if(ue.has(i))return Zt({error:await Z(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=$e(g),S;if(g instanceof Ue)S=g.body;else{if(await C.updated.check())return await lt(),await X(n);S=await Z(g,{params:r,url:n,route:{id:a.id}})}const O=await en(_,v,s);return O?de({url:n,params:r,branch:v.slice(0,O.idx).concat(O.node),errors:s,status:E,error:S,route:a}):await vt(n,{id:a.id},S,E)}else v.push(void 0);return de({url:n,params:r,branch:v,errors:s,status:200,error:null,route:a,form:t?void 0:null})}async function en(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Be({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await qe({loader:Se,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:De(i)}),o={node:await oe(),loader:oe,universal:null,server:null,data:null};return de({url:n,params:a,branch:[s,o],status:e,error:t,errors:[],route:null})}catch(s){if(s instanceof Pe)return pt(new URL(s.location,location.href),{},0);throw s}}async function tn(e){const t=e.href;if(ne.has(t))return ne.get(t);let n;try{const r=(async()=>{let a=await w.hooks.reroute({url:new URL(e),fetch:async(i,s)=>_t(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);w.hash?i.hash=a:i.pathname=a,a=i}return a})();ne.set(t,r),n=await r}catch{ne.delete(t);return}return n}async function te(e,t){if(e&&!pe(e,x,w.hash)){const n=await tn(e);if(!n)return;const r=nn(n);for(const a of je){const i=a.exec(r);if(i)return{id:he(e),invalidating:t,route:a,params:St(i),url:e}}}}function nn(e){return Et(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function he(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function mt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Ke(m,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return Q||ct.forEach(c=>c(l)),s?null:o}async function B({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=Ee,block:d=Ee,event:p}){const u=I;I=l;const f=await te(t,!1),h=e==="enter"?Ke(m,f,t,e):mt({url:t,type:e,delta:n?.delta,intent:f,scroll:n?.scroll,event:p});if(!h){d(),I===l&&(I=u);return}const v=y,_=R;c(),Q=!0,ce&&h.navigation.type!=="enter"&&C.navigating.set(Y.current=h.navigation);let g=f&&await Ve(f);if(!g){if(pe(t,x,w.hash))return await X(t,i);g=await vt(t,{id:null},await Z(new Te(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=f?.url||t,I!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await B({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Be({status:500,error:await Z(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await C.updated.check()&&(await lt(),await X(t,i));if(xe(),Ce(v),dt(_),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const k=i?0:1,K={[V]:y+=k,[J]:R+=k,[tt]:s};(i?history.replaceState:history.pushState).call(history,K,"",t),i||Wt(y,R)}const E=f&&L?.id===f.id?L.fork:null;L=null,g.props.page.state=s;let S;if(ce){const k=(await Promise.all(Array.from(Jt,F=>F(h.navigation)))).filter(F=>typeof F=="function");if(k.length>0){let F=function(){k.forEach(_e=>{W.delete(_e)})};k.push(F),k.forEach(_e=>{W.add(_e)})}const K=h.navigation.to;m={...g.state,nav:{params:K.params,route:K.route,url:K.url}},g.props.page&&(g.props.page.url=t);const ge=E&&await E;ge?S=ge.commit():(G=null,Ne.$set(g.props),G&&Object.assign(g.props.page,G),it(g.props.page),S=bt?.()),ft=!0}else await gt(g,Re,!1);const{activeElement:O}=document;await S,await re(),await re();let $=null;if(ze){const k=n?n.scroll:a?q():null;k?scrollTo(k.x,k.y):($=t.hash&&document.getElementById(wt(t)))?$.scrollIntoView():scrollTo(0,0)}const yt=document.activeElement!==O&&document.activeElement!==document.body;!r&&!yt&&cn(t,!$),ze=!0,g.props.page&&(G&&Object.assign(g.props.page,G),Object.assign(b,g.props.page)),Q=!1,e==="popstate"&&ht(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=q()),W.forEach(k=>k(h.navigation)),C.navigating.set(Y.current=null)}async function vt(e,t,n,r,a){return e.origin===Oe&&e.pathname===location.pathname&&!ut?await Be({status:r,error:n,url:e,route:t}):await X(e,a)}function rn(){let e,t={element:void 0,href:void 0},n;T.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}T.addEventListener("mousedown",r),T.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(be(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=at(o,T),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:u,download:f}=ke(c,x,w.hash);if(u||f)return;const h=ae(c),v=p&&he(m.url)===he(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const _=await te(p,!1);if(!_)return;zt(_)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,be(p))}function s(){a.disconnect();for(const o of T.querySelectorAll("a")){const{url:l,external:c,download:d}=ke(o,x,w.hash);if(c||d)continue;const p=ae(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&be(l))}}W.add(s),s()}function Z(e,t){if(e instanceof Ue)return e.body;const n=$e(e),r=Ft(e);return w.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function an(e){if(typeof e=="function")se.push(e);else{const{href:t}=new URL(e,location.href);se.push(n=>n.href===t)}}function mn(){return ee=!0,Yt()}function on(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Xe(),!Q){const r=Ke(m,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};ct.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Xe()}),navigator.connection?.saveData||rn(),T.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=at(t.composedPath()[0],T);if(!n)return;const{url:r,external:a,target:i,download:s}=ke(n,x,w.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=ae(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(w.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===me(location);if(a||o.reload&&(!p||!d)){mt({url:r,type:"link",event:t})?Q=!0:t.preventDefault();return}if(d!==void 0&&p){const[,u]=m.url.href.split("#");if(u===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const f=n.ownerDocument.getElementById(decodeURIComponent(d));f&&(f.scrollIntoView(),f.focus())}return}if(M=!0,Ce(y),e(r),!o.replace_state)return;M=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await B({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),T.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(pe(s,x,!1))return;const o=t.target,l=ae(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),B({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Le){if(t.state?.[V]){const n=t.state[V];if(I={},n===y)return;const r=j[n],a=t.state[tt]??{},i=new URL(t.state[Dt]??location.href),s=t.state[J],o=m.url?me(location)===me(m.url):!1;if(s===R&&(ft||o)){a!==b.state&&(b.state=a),e(i),j[y]=q(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await B({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:I,event:t})}else if(!M){const n=new URL(location.href);e(n),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{M&&(M=!1,history.replaceState({...history.state,[V]:++y,[J]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Ht.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(Y.current=null)});function e(t){m.url=b.url=t,C.page.set(Fe(b)),C.page.notify()}}async function sn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){ut=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await te(c,!1)||{}),d=je.find(({id:f})=>f===i.id);let p,u=!0;try{const f=r.map(async(v,_)=>{const g=o[_];return g?.uses&&(g.uses=ln(g.uses)),qe({loader:w.nodes[v],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<_;S+=1)Object.assign(E,(await f[S]).data);return E},server_data_node:De(g)})}),h=await Promise.all(f);if(d){const v=d.layouts;for(let _=0;_<v.length;_++)v[_]||h.splice(_,0,void 0)}p=await de({url:c,params:a,branch:h,status:t,error:n,errors:d?.errors,form:l,route:d??null})}catch(f){if(f instanceof Pe){await X(new URL(f.location,location.href));return}p=await Be({status:$e(f),error:await Z(f,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",u=!1}p.props.page&&(p.props.page.state={}),await gt(p,e,u)}function ln(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Le=!1;function cn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=wt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=q();setTimeout(()=>{const o=history.state;Le=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),Le=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ke(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function Fe(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function un(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function wt(e){let t;if(w.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{_n as a,mn as i,dn as l,b as p,C as s};