studiograph 1.3.3-next.6 → 1.3.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 (70) hide show
  1. package/dist/cli/index.js +0 -3
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/core/workspace.js +1 -1
  4. package/dist/core/workspace.js.map +1 -1
  5. package/dist/server/chrome/chrome.js +212 -12
  6. package/dist/server/index.js +42 -54
  7. package/dist/server/index.js.map +1 -1
  8. package/dist/server/routes/graph-api.js +2 -0
  9. package/dist/server/routes/graph-api.js.map +1 -1
  10. package/dist/services/auth-service.d.ts +0 -37
  11. package/dist/services/auth-service.js +6 -132
  12. package/dist/services/auth-service.js.map +1 -1
  13. package/dist/web/_app/immutable/assets/{0.D0mpnn_z.css → 0.CDbX4Cwz.css} +1 -1
  14. package/dist/web/_app/immutable/assets/AppShell.D0rmbdqF.css +1 -0
  15. package/dist/web/_app/immutable/chunks/479TgXB4.js +1 -0
  16. package/dist/web/_app/immutable/chunks/{mqys3rB_.js → BFb0g4TQ.js} +19 -19
  17. package/dist/web/_app/immutable/chunks/Bopa-Ask.js +1 -0
  18. package/dist/web/_app/immutable/chunks/COwytaCP.js +1 -0
  19. package/dist/web/_app/immutable/chunks/{D3JV20PL.js → DEJSHbC3.js} +1 -1
  20. package/dist/web/_app/immutable/chunks/DNywhIex.js +23 -0
  21. package/dist/web/_app/immutable/chunks/{k7cHqfZG.js → DTUXhwEY.js} +1 -1
  22. package/dist/web/_app/immutable/chunks/{DiYW7nWb.js → DThXpa0U.js} +3 -3
  23. package/dist/web/_app/immutable/chunks/Dml-u95b.js +2 -0
  24. package/dist/web/_app/immutable/chunks/DvKVaE7M.js +1 -0
  25. package/dist/web/_app/immutable/chunks/MbiSz-iW.js +2 -0
  26. package/dist/web/_app/immutable/chunks/bSAC733J.js +1 -0
  27. package/dist/web/_app/immutable/entry/app.BvodXQQ0.js +2 -0
  28. package/dist/web/_app/immutable/entry/start.Bkui3Kyw.js +1 -0
  29. package/dist/web/_app/immutable/nodes/0.DfbCOBhn.js +2 -0
  30. package/dist/web/_app/immutable/nodes/1.vtxUGpe6.js +1 -0
  31. package/dist/web/_app/immutable/nodes/2.Cq29oW4h.js +1 -0
  32. package/dist/web/_app/immutable/nodes/3.SquslPZy.js +1 -0
  33. package/dist/web/_app/immutable/nodes/4.COV8FR8b.js +16 -0
  34. package/dist/web/_app/immutable/nodes/5.BBpmYkAu.js +4 -0
  35. package/dist/web/_app/immutable/nodes/6.BBbh6z9I.js +2 -0
  36. package/dist/web/_app/version.json +1 -1
  37. package/dist/web/index.html +12 -14
  38. package/package.json +1 -7
  39. package/dist/web/_app/immutable/assets/7.Cn2DG-J6.css +0 -1
  40. package/dist/web/_app/immutable/assets/8.DNePkG2G.css +0 -1
  41. package/dist/web/_app/immutable/assets/9.Sm6jB3a0.css +0 -1
  42. package/dist/web/_app/immutable/assets/AppShell.Dwgi1sJ2.css +0 -1
  43. package/dist/web/_app/immutable/assets/ConfirmDialog.nyU0oHj9.css +0 -1
  44. package/dist/web/_app/immutable/chunks/5Q3D38Jx.js +0 -1
  45. package/dist/web/_app/immutable/chunks/B53wS7kY.js +0 -1
  46. package/dist/web/_app/immutable/chunks/B6Qvlz8_.js +0 -2
  47. package/dist/web/_app/immutable/chunks/B8lPlWi9.js +0 -23
  48. package/dist/web/_app/immutable/chunks/BNNl3u5G.js +0 -1
  49. package/dist/web/_app/immutable/chunks/BPrnZEtq.js +0 -2
  50. package/dist/web/_app/immutable/chunks/Bevw5Env.js +0 -1
  51. package/dist/web/_app/immutable/chunks/C8GaZaTC.js +0 -1
  52. package/dist/web/_app/immutable/chunks/C9c9fKQ7.js +0 -1
  53. package/dist/web/_app/immutable/chunks/D4CY2rxN.js +0 -1
  54. package/dist/web/_app/immutable/chunks/DRrowDpW.js +0 -1
  55. package/dist/web/_app/immutable/chunks/DU_X_lSK.js +0 -1
  56. package/dist/web/_app/immutable/chunks/Db_-W430.js +0 -1
  57. package/dist/web/_app/immutable/chunks/De3BU01A.js +0 -1
  58. package/dist/web/_app/immutable/chunks/DhDqSWbJ.js +0 -1
  59. package/dist/web/_app/immutable/entry/app.Vz-ml7_v.js +0 -2
  60. package/dist/web/_app/immutable/entry/start.CWG1-PXE.js +0 -1
  61. package/dist/web/_app/immutable/nodes/0.CwYtDM-2.js +0 -2
  62. package/dist/web/_app/immutable/nodes/1._RYH6T6O.js +0 -1
  63. package/dist/web/_app/immutable/nodes/2.Cp9U5Fmz.js +0 -1
  64. package/dist/web/_app/immutable/nodes/3.kN5zb7nM.js +0 -1
  65. package/dist/web/_app/immutable/nodes/4.C4Os8Icx.js +0 -16
  66. package/dist/web/_app/immutable/nodes/5.w_7HfI6i.js +0 -4
  67. package/dist/web/_app/immutable/nodes/6.Cm7_m4M0.js +0 -2
  68. package/dist/web/_app/immutable/nodes/7.DyExi_V2.js +0 -1
  69. package/dist/web/_app/immutable/nodes/8.D6HHflqh.js +0 -1
  70. package/dist/web/_app/immutable/nodes/9.CnLcLqTc.js +0 -1
@@ -1,6 +1,6 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DtVH--hH.js","./DnlgZ_Tk.js","./Dh_H7Owr.js","./4QY4j-jX.js","./CUzqHQY_.js","./aosHekRC.js"])))=>i.map(i=>d[i]);
2
- import{d as ri,b as wt,e as De,a as A,c as L,f as K,q as lt,s as gn}from"./DhDqSWbJ.js";import{be as bo,h as xo,a as So,br as Ao,b as Eo,f as Oo,u as tn,D as ut,F as B,G as Xt,J as vt,t as ii,Q as R,U as nt,R as M,K as c,O as m,N as dt,al as D,M as yt,X as _,bs as Or,a3 as To,ao as _e,bt as Po,T as Ln,I as Co,ag as _o,bp as pt,bu as ko,bv as oi,L as si,am as Mo,V as Pn,aa as Xe,bq as Fo}from"./D3JV20PL.js";import{s as ht,c as ai,m as Ro,u as Do}from"./B6Qvlz8_.js";import{i as at}from"./DU_X_lSK.js";import{e as Yt,i as te,I as ve,s as pe,T as Io}from"./C8GaZaTC.js";import{c as ae}from"./k7cHqfZG.js";import{r as Bn,d as Qe,k as Cn,i as ue,h as No,j as _n,s as Lo}from"./BPrnZEtq.js";import{b as ci}from"./De3BU01A.js";import{b as Yn}from"./D4CY2rxN.js";import{p as x,s as Mt,r as ie,l as me}from"./B53wS7kY.js";import{g as Bo}from"./Db_-W430.js";import{w as Gn,u as Tr,b as Wo}from"./DRrowDpW.js";import{s as st}from"./BNNl3u5G.js";import{B as zo}from"./5Q3D38Jx.js";import"./Bevw5Env.js";import{C as Vo,P as Pr,g as Cr}from"./B8lPlWi9.js";import{_ as be}from"./PPVm8Dsz.js";function Ko(){return Symbol(bo)}const Ho=Symbol("NaN");function Uo(e,t,n){xo&&So();var r=new zo(e),i=!Ao();Eo(()=>{var s=t();s!==s&&(s=Ho),i&&s!==null&&typeof s=="object"&&(s={}),r.ensure(s,n)})}function jo(e,t,n){Oo(()=>{var r=tn(()=>t(e,n?.())||{});if(r?.destroy)return()=>r.destroy()})}var Yo=K('<span class="chip svelte-84vb17"> <button class="chip-remove svelte-84vb17">&times;</button></span>'),Go=K('<div><span class="entity-title svelte-84vb17"> </span> <span class="entity-meta svelte-84vb17"><span class="entity-type-badge svelte-84vb17"> </span> <span class="entity-repo svelte-84vb17"> </span></span></div>'),Xo=K('<div class="dropdown svelte-84vb17"></div>'),qo=K('<div class="autocomplete svelte-84vb17"><div class="input-row svelte-84vb17"><!> <input class="ac-input svelte-84vb17" type="text" placeholder="Search entities..."/></div> <!></div>');function Zo(e,t){ut(t,!0);let n=x(t,"multi",3,!1),r=B(""),i=B(0),s;const o=_(()=>Gn.repos.flatMap(O=>O.entities.map(k=>({id:k.id,title:k.title,entityType:k.entityType,repo:O.name})))),a=_(()=>()=>{const O=c(r).toLowerCase().trim();return O?c(o).filter(k=>k.title.toLowerCase().includes(O)||k.id.toLowerCase().includes(O)).slice(0,20):c(o).slice(0,20)}),l=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let u=B(Xt(l));vt(()=>{ii().then(()=>s?.focus())});function f(O){n()?(c(u).includes(O)||m(u,[...c(u),O],!0),m(r,""),m(i,0),s?.focus()):t.onselect(O)}function d(O){m(u,c(u).filter(k=>k!==O),!0)}function g(){c(u).length===l.length&&c(u).every((k,j)=>k===l[j])?t.oncancel():t.onselect(c(u))}function v(O){const k=c(a)();O.key==="ArrowDown"?(O.preventDefault(),m(i,Math.min(c(i)+1,k.length-1),!0)):O.key==="ArrowUp"?(O.preventDefault(),m(i,Math.max(c(i)-1,0),!0)):O.key==="Enter"?(O.preventDefault(),k.length>0?f(k[c(i)].id):n()&&g()):O.key==="Escape"?n()&&c(u).length>0?g():t.oncancel():O.key==="Backspace"&&!c(r)&&n()&&c(u).length>0&&m(u,c(u).slice(0,-1),!0)}var p=qo(),h=R(p),y=R(h);{var b=O=>{var k=L(),j=D(k);Yt(j,17,()=>c(u),te,(W,F)=>{var I=Yo(),H=R(I),X=nt(H);M(I),yt(()=>ht(H,`${c(F)??""} `)),wt("click",X,()=>d(c(F))),A(W,I)}),A(O,k)};at(y,O=>{n()&&O(b)})}var E=nt(y,2);Bn(E),Yn(E,O=>s=O,()=>s),M(h);var C=nt(h,2);{var S=O=>{var k=Xo();Yt(k,21,()=>c(a)(),te,(j,W,F)=>{var I=Go();let H;var X=R(I),q=R(X,!0);M(X);var J=nt(X,2),z=R(J),G=R(z,!0);M(z);var Z=nt(z,2),At=R(Z,!0);M(Z),M(J),M(I),yt(()=>{H=Qe(I,1,"dropdown-item svelte-84vb17",null,H,{highlighted:F===c(i)}),ht(q,c(W).title),ht(G,c(W).entityType),ht(At,c(W).repo)}),wt("mousedown",I,Te=>{Te.preventDefault(),f(c(W).id)}),De("mouseenter",I,()=>m(i,F,!0)),A(j,I)}),M(k),A(O,k)},N=_(()=>c(a)().length>0);at(C,O=>{c(N)&&O(S)})}M(p),wt("keydown",E,v),De("blur",E,()=>{setTimeout(()=>{n()&&c(u).length>0?g():n()||t.oncancel()},150)}),ci(E,()=>c(r),O=>m(r,O)),A(e,p),dt()}ri(["click","keydown","mousedown"]);function Jo(e){return typeof e=="function"}function Be(e){return e!==null&&typeof e=="object"}const Qo=["string","number","bigint","boolean"];function Wn(e){return e==null||Qo.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>Wn(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}const Se=Symbol("box"),vn=Symbol("is-writable");function T(e,t){const n=_(e);return t?{[Se]:!0,[vn]:!0,get current(){return c(n)},set current(r){t(r)}}:{[Se]:!0,get current(){return e()}}}function We(e){return Be(e)&&Se in e}function Xn(e){return We(e)&&vn in e}function li(e){return We(e)?e:Jo(e)?T(e):Wt(e)}function $o(e){return Object.entries(e).reduce((t,[n,r])=>We(r)?(Xn(r)?Object.defineProperty(t,n,{get(){return r.current},set(i){r.current=i}}):Object.defineProperty(t,n,{get(){return r.current}}),t):Object.assign(t,{[n]:r}),{})}function ts(e){return Xn(e)?{[Se]:!0,get current(){return e.current}}:e}function Wt(e){let t=B(Xt(e));return{[Se]:!0,[vn]:!0,get current(){return c(t)},set current(n){m(t,n,!0)}}}function ye(e){let t=B(Xt(e));return{[Se]:!0,[vn]:!0,get current(){return c(t)},set current(n){m(t,n,!0)}}}ye.from=li;ye.with=T;ye.flatten=$o;ye.readonly=ts;ye.isBox=We;ye.isWritableBox=Xn;function ui(...e){return function(t){for(const n of e)if(n){if(t.defaultPrevented)return;typeof n=="function"?n.call(this,t):n.current?.call(this,t)}}}var _r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,es=/\n/g,ns=/^\s*/,rs=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,is=/^:\s*/,os=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ss=/^[;\s]*/,as=/^\s+|\s+$/g,cs=`
2
+ import{g as ri,j as wt,e as De,a as A,d as L,f as K,q as lt,s as gn}from"./bSAC733J.js";import{b1 as bo,h as xo,a as So,br as Ao,b as Eo,au as Oo,B as tn,n as ut,P as B,Q as qt,A as vt,aM as ii,t as R,u as nt,w as M,F as c,T as m,q as dt,V as D,x as yt,Y as _,bs as Or,a0 as To,a1 as _e,bt as Po,o as Ln,R as Co,z as _o,bq as pt,bu as ko,bv as oi,S as si,X as Mo,v as Pn,W as qe,bc as Fo}from"./DEJSHbC3.js";import{s as ht,c as ai,m as Ro,u as Do}from"./MbiSz-iW.js";import{p as x,i as at,b as Yn,s as Mt,r as ie,l as ve}from"./DvKVaE7M.js";import{b as ci,e as Yt,i as te,I as pe,s as me,T as Io,C as No,P as Tr}from"./DNywhIex.js";import{c as ae}from"./DTUXhwEY.js";import{r as Bn,b as Qe,w as Gn,m as Cn,s as st,h as ue,e as Lo,i as _n,a as Bo,u as Pr,g as Cr,n as Wo}from"./Dml-u95b.js";import{g as zo}from"./479TgXB4.js";import{B as Vo}from"./Bopa-Ask.js";import"./COwytaCP.js";import{_ as be}from"./PPVm8Dsz.js";function Ko(){return Symbol(bo)}const Ho=Symbol("NaN");function Uo(e,t,n){xo&&So();var r=new Vo(e),i=!Ao();Eo(()=>{var s=t();s!==s&&(s=Ho),i&&s!==null&&typeof s=="object"&&(s={}),r.ensure(s,n)})}function jo(e,t,n){Oo(()=>{var r=tn(()=>t(e,n?.())||{});if(r?.destroy)return()=>r.destroy()})}var Yo=K('<span class="chip svelte-84vb17"> <button class="chip-remove svelte-84vb17">&times;</button></span>'),Go=K('<div><span class="entity-title svelte-84vb17"> </span> <span class="entity-meta svelte-84vb17"><span class="entity-type-badge svelte-84vb17"> </span> <span class="entity-repo svelte-84vb17"> </span></span></div>'),qo=K('<div class="dropdown svelte-84vb17"></div>'),Xo=K('<div class="autocomplete svelte-84vb17"><div class="input-row svelte-84vb17"><!> <input class="ac-input svelte-84vb17" type="text" placeholder="Search entities..."/></div> <!></div>');function Zo(e,t){ut(t,!0);let n=x(t,"multi",3,!1),r=B(""),i=B(0),s;const o=_(()=>Gn.repos.flatMap(O=>O.entities.map(k=>({id:k.id,title:k.title,entityType:k.entityType,repo:O.name})))),a=_(()=>()=>{const O=c(r).toLowerCase().trim();return O?c(o).filter(k=>k.title.toLowerCase().includes(O)||k.id.toLowerCase().includes(O)).slice(0,20):c(o).slice(0,20)}),l=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let u=B(qt(l));vt(()=>{ii().then(()=>s?.focus())});function f(O){n()?(c(u).includes(O)||m(u,[...c(u),O],!0),m(r,""),m(i,0),s?.focus()):t.onselect(O)}function d(O){m(u,c(u).filter(k=>k!==O),!0)}function g(){c(u).length===l.length&&c(u).every((k,j)=>k===l[j])?t.oncancel():t.onselect(c(u))}function v(O){const k=c(a)();O.key==="ArrowDown"?(O.preventDefault(),m(i,Math.min(c(i)+1,k.length-1),!0)):O.key==="ArrowUp"?(O.preventDefault(),m(i,Math.max(c(i)-1,0),!0)):O.key==="Enter"?(O.preventDefault(),k.length>0?f(k[c(i)].id):n()&&g()):O.key==="Escape"?n()&&c(u).length>0?g():t.oncancel():O.key==="Backspace"&&!c(r)&&n()&&c(u).length>0&&m(u,c(u).slice(0,-1),!0)}var p=Xo(),h=R(p),y=R(h);{var b=O=>{var k=L(),j=D(k);Yt(j,17,()=>c(u),te,(W,F)=>{var I=Yo(),H=R(I),q=nt(H);M(I),yt(()=>ht(H,`${c(F)??""} `)),wt("click",q,()=>d(c(F))),A(W,I)}),A(O,k)};at(y,O=>{n()&&O(b)})}var E=nt(y,2);Bn(E),Yn(E,O=>s=O,()=>s),M(h);var C=nt(h,2);{var S=O=>{var k=qo();Yt(k,21,()=>c(a)(),te,(j,W,F)=>{var I=Go();let H;var q=R(I),X=R(q,!0);M(q);var J=nt(q,2),z=R(J),G=R(z,!0);M(z);var Z=nt(z,2),At=R(Z,!0);M(Z),M(J),M(I),yt(()=>{H=Qe(I,1,"dropdown-item svelte-84vb17",null,H,{highlighted:F===c(i)}),ht(X,c(W).title),ht(G,c(W).entityType),ht(At,c(W).repo)}),wt("mousedown",I,Te=>{Te.preventDefault(),f(c(W).id)}),De("mouseenter",I,()=>m(i,F,!0)),A(j,I)}),M(k),A(O,k)},N=_(()=>c(a)().length>0);at(C,O=>{c(N)&&O(S)})}M(p),wt("keydown",E,v),De("blur",E,()=>{setTimeout(()=>{n()&&c(u).length>0?g():n()||t.oncancel()},150)}),ci(E,()=>c(r),O=>m(r,O)),A(e,p),dt()}ri(["click","keydown","mousedown"]);function Jo(e){return typeof e=="function"}function Be(e){return e!==null&&typeof e=="object"}const Qo=["string","number","bigint","boolean"];function Wn(e){return e==null||Qo.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>Wn(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}const Se=Symbol("box"),vn=Symbol("is-writable");function T(e,t){const n=_(e);return t?{[Se]:!0,[vn]:!0,get current(){return c(n)},set current(r){t(r)}}:{[Se]:!0,get current(){return e()}}}function We(e){return Be(e)&&Se in e}function qn(e){return We(e)&&vn in e}function li(e){return We(e)?e:Jo(e)?T(e):Wt(e)}function $o(e){return Object.entries(e).reduce((t,[n,r])=>We(r)?(qn(r)?Object.defineProperty(t,n,{get(){return r.current},set(i){r.current=i}}):Object.defineProperty(t,n,{get(){return r.current}}),t):Object.assign(t,{[n]:r}),{})}function ts(e){return qn(e)?{[Se]:!0,get current(){return e.current}}:e}function Wt(e){let t=B(qt(e));return{[Se]:!0,[vn]:!0,get current(){return c(t)},set current(n){m(t,n,!0)}}}function ye(e){let t=B(qt(e));return{[Se]:!0,[vn]:!0,get current(){return c(t)},set current(n){m(t,n,!0)}}}ye.from=li;ye.with=T;ye.flatten=$o;ye.readonly=ts;ye.isBox=We;ye.isWritableBox=qn;function ui(...e){return function(t){for(const n of e)if(n){if(t.defaultPrevented)return;typeof n=="function"?n.call(this,t):n.current?.call(this,t)}}}var _r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,es=/\n/g,ns=/^\s*/,rs=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,is=/^:\s*/,os=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ss=/^[;\s]*/,as=/^\s+|\s+$/g,cs=`
3
3
  `,kr="/",Mr="*",le="",ls="comment",us="declaration";function ds(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var h=p.match(es);h&&(n+=h.length);var y=p.lastIndexOf(cs);r=~y?p.length-y:r+p.length}function s(){var p={line:n,column:r};return function(h){return h.position=new o(p),u(),h}}function o(p){this.start=p,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(p){var h=new Error(t.source+":"+n+":"+r+": "+p);if(h.reason=p,h.filename=t.source,h.line=n,h.column=r,h.source=e,!t.silent)throw h}function l(p){var h=p.exec(e);if(h){var y=h[0];return i(y),e=e.slice(y.length),h}}function u(){l(ns)}function f(p){var h;for(p=p||[];h=d();)h!==!1&&p.push(h);return p}function d(){var p=s();if(!(kr!=e.charAt(0)||Mr!=e.charAt(1))){for(var h=2;le!=e.charAt(h)&&(Mr!=e.charAt(h)||kr!=e.charAt(h+1));)++h;if(h+=2,le===e.charAt(h-1))return a("End of comment missing");var y=e.slice(2,h-2);return r+=2,i(y),e=e.slice(h),r+=2,p({type:ls,comment:y})}}function g(){var p=s(),h=l(rs);if(h){if(d(),!l(is))return a("property missing ':'");var y=l(os),b=p({type:us,property:Fr(h[0].replace(_r,le)),value:y?Fr(y[0].replace(_r,le)):le});return l(ss),b}}function v(){var p=[];f(p);for(var h;h=g();)h!==!1&&(p.push(h),f(p));return p}return u(),v()}function Fr(e){return e?e.replace(as,le):le}function fs(e,t){let n=null;if(!e||typeof e!="string")return n;const r=ds(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}const hs=/\d/,gs=["-","_","/","."];function vs(e=""){if(!hs.test(e))return e!==e.toLowerCase()}function ps(e){const t=[];let n="",r,i;for(const s of e){const o=gs.includes(s);if(o===!0){t.push(n),n="",r=void 0;continue}const a=vs(s);if(i===!1){if(r===!1&&a===!0){t.push(n),n=s,r=a;continue}if(r===!0&&a===!1&&n.length>1){const l=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=l+s,r=a;continue}}n+=s,r=a,i=o}return t.push(n),t}function di(e){return e?ps(e).map(t=>ys(t)).join(""):""}function ms(e){return ws(di(e||""))}function ys(e){return e?e[0].toUpperCase()+e.slice(1):""}function ws(e){return e?e[0].toLowerCase()+e.slice(1):""}function Re(e){if(!e)return{};const t={};function n(r,i){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){t[di(r)]=i;return}if(r.startsWith("--")){t[r]=i;return}t[ms(r)]=i}return fs(e,n),t}function de(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}function bs(e,t){const n=RegExp(e,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,t):r}}const xs=bs(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Ss(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${xs(t)}: ${e[t]};`).join(`
4
4
  `)}function fi(e={}){return Ss(e).replace(`
5
- `," ")}const As=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],Es=new Set(As);function Os(e){return Es.has(e)}function qt(...e){const t={...e[0]};for(let n=1;n<e.length;n++){const r=e[n];if(r){for(const i of Object.keys(r)){const s=t[i],o=r[i],a=typeof s=="function",l=typeof o=="function";if(a&&Os(i)){const u=s,f=o;t[i]=ui(u,f)}else if(a&&l)t[i]=de(s,o);else if(i==="class"){const u=Wn(s),f=Wn(o);u&&f?t[i]=Cn(s,o):u?t[i]=Cn(s):f&&(t[i]=Cn(o))}else if(i==="style"){const u=typeof s=="object",f=typeof o=="object",d=typeof s=="string",g=typeof o=="string";if(u&&f)t[i]={...s,...o};else if(u&&g){const v=Re(o);t[i]={...s,...v}}else if(d&&f){const v=Re(s);t[i]={...v,...o}}else if(d&&g){const v=Re(s),p=Re(o);t[i]={...v,...p}}else u?t[i]=s:f?t[i]=o:d?t[i]=s:g&&(t[i]=o)}else t[i]=o!==void 0?o:s}for(const i of Object.getOwnPropertySymbols(r)){const s=t[i],o=r[i];t[i]=o!==void 0?o:s}}}return typeof t.style=="object"&&(t.style=fi(t.style).replaceAll(`
6
- `," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const hi=typeof window<"u"?window:void 0;function Ts(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Ps extends Map{#t=new Map;#e=B(0);#n=B(0);#r=Or||-1;constructor(t){if(super(),t){for(var[n,r]of t)super.set(n,r);this.#n.v=super.size}}#i(t){return Or===this.#r?B(t):To(t)}has(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else return c(this.#e),!1;return c(r),!0}forEach(t,n){this.#o(),super.forEach(t,n)}get(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else{c(this.#e);return}return c(r),super.get(t)}set(t,n){var r=this.#t,i=r.get(t),s=super.get(t),o=super.set(t,n),a=this.#e;if(i===void 0)i=this.#i(0),r.set(t,i),m(this.#n,super.size),_e(a);else if(s!==n){_e(i);var l=a.reactions===null?null:new Set(a.reactions),u=l===null||!i.reactions?.every(f=>l.has(f));u&&_e(a)}return o}delete(t){var n=this.#t,r=n.get(t),i=super.delete(t);return r!==void 0&&(n.delete(t),m(r,-1)),i&&(m(this.#n,super.size),_e(this.#e)),i}clear(){if(super.size!==0){super.clear();var t=this.#t;m(this.#n,0);for(var n of t.values())m(n,-1);_e(this.#e),t.clear()}}#o(){c(this.#e);var t=this.#t;if(this.#n.v!==t.size){for(var n of super.keys())if(!t.has(n)){var r=this.#i(0);t.set(n,r)}}for([,r]of this.#t)c(r)}keys(){return c(this.#e),super.keys()}values(){return this.#o(),super.values()}entries(){return this.#o(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return c(this.#n),super.size}}class Cs{#t;#e;constructor(t={}){const{window:n=hi,document:r=n?.document}=t;n!==void 0&&(this.#t=r,this.#e=ai(i=>{const s=lt(n,"focusin",i),o=lt(n,"focusout",i);return()=>{s(),o()}}))}get current(){return this.#e?.(),this.#t?Ts(this.#t):null}}new Cs;function _s(e){return typeof e=="function"}class we{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return Po(this.#e)}get(){const t=Ln(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const n=Ln(this.#e);return n===void 0?t:n}set(t){return Co(this.#e,t)}}function ks(e,t){switch(e){case"post":vt(t);break;case"pre":_o(t);break}}function gi(e,t,n,r={}){const{lazy:i=!1}=r;let s=!i,o=Array.isArray(e)?[]:void 0;ks(t,()=>{const a=Array.isArray(e)?e.map(u=>u()):e();if(!s){s=!0,o=a;return}const l=tn(()=>n(a,o));return o=a,l})}function St(e,t,n){gi(e,"post",t,n)}function Ms(e,t,n){gi(e,"pre",t,n)}St.pre=Ms;function Rr(e){return _s(e)?e():e}class Fs{#t={width:0,height:0};#e=!1;#n;#r;#i;#o=_(()=>(c(this.#s)?.(),this.getSize().width));#a=_(()=>(c(this.#s)?.(),this.getSize().height));#s=_(()=>{const t=Rr(this.#r);if(t)return ai(n=>{if(!this.#i)return;const r=new this.#i.ResizeObserver(i=>{this.#e=!0;for(const s of i){const o=this.#n.box==="content-box"?s.contentBoxSize:s.borderBoxSize,a=Array.isArray(o)?o:[o];this.#t.width=a.reduce((l,u)=>Math.max(l,u.inlineSize),0),this.#t.height=a.reduce((l,u)=>Math.max(l,u.blockSize),0)}n()});return r.observe(t),()=>{this.#e=!1,r.disconnect()}})});constructor(t,n={box:"border-box"}){this.#i=n.window??hi,this.#n=n,this.#r=t,this.#t={width:0,height:0}}calculateSize(){const t=Rr(this.#r);if(!t||!this.#i)return;const n=t.offsetWidth,r=t.offsetHeight;if(this.#n.box==="border-box")return{width:n,height:r};const i=this.#i.getComputedStyle(t),s=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),o=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),a=parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),l=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),u=n-s-a,f=r-o-l;return{width:u,height:f}}getSize(){return this.#e?this.#t:this.calculateSize()??this.#t}get current(){return c(this.#s)?.(),this.getSize()}get width(){return c(this.#o)}get height(){return c(this.#a)}}function ze(e){vt(()=>()=>{e()})}function Rs(e,t){return setTimeout(t,e)}function Gt(e){ii().then(e)}const Ds=1,Is=9,Ns=11;function zn(e){return Be(e)&&e.nodeType===Ds&&typeof e.nodeName=="string"}function vi(e){return Be(e)&&e.nodeType===Is}function Ls(e){return Be(e)&&e.constructor?.name==="VisualViewport"}function Bs(e){return Be(e)&&e.nodeType!==void 0}function pi(e){return Bs(e)&&e.nodeType===Ns&&"host"in e}function Ws(e,t){if(!e||!t||!zn(e)||!zn(t))return!1;const n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&pi(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ve(e){return vi(e)?e:Ls(e)?e.document:e?.ownerDocument??document}function qn(e){return pi(e)?qn(e.host):vi(e)?e.defaultView??window:zn(e)?e.ownerDocument?.defaultView??window:window}function zs(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Zn{element;#t=_(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return c(this.#t)}set root(t){m(this.#t,t)}constructor(t){typeof t=="function"?this.element=T(t):this.element=t}getDocument=()=>Ve(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>zs(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,n)=>this.getWindow().setTimeout(t,n);clearTimeout=t=>this.getWindow().clearTimeout(t)}function fe(e,t){return{[Ko()]:n=>We(e)?(e.current=n,tn(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),tn(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e(null),t?.(null))})}}function mi(e){return e?"true":"false"}function yi(e){return e?"":void 0}function wi(e){return e?"open":"closed"}class Vs{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(n=>[n,this.getAttr(n)]))}getAttr(t,n){return n?`data-${n}-${t}`:`${this.#e}${t}`}selector(t,n){return`[${this.getAttr(t,n)}]`}}function Ks(e){const t=new Vs(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const Ne="ArrowDown",Jn="ArrowLeft",Qn="ArrowRight",en="ArrowUp",bi="End",xi="Enter",Hs="Escape",Si="Home",Us="PageDown",js="PageUp",$n=" ",Ys="Tab";function Gs(e){return window.getComputedStyle(e).getPropertyValue("direction")}function Xs(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?Jn:Qn,vertical:Ne}[t]}function qs(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?Qn:Jn,vertical:en}[t]}function Zs(e="ltr",t="horizontal"){return["ltr","rtl"].includes(e)||(e="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:Xs(e,t),prevKey:qs(e,t)}}const Ai=typeof document<"u",Dr=Js();function Js(){return Ai&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Zt(e){return e instanceof HTMLElement}function Vn(e){return e instanceof Element}function Ei(e){return e instanceof Element||e instanceof SVGElement}function Qs(e){return e!==null}function $s(e){return e instanceof HTMLInputElement&&"select"in e}class ta{#t;#e=ye(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,n,r=!1){const i=this.#t.rootNode.current;if(!i||!t)return;const s=this.getCandidateNodes();if(!s.length)return;const o=s.indexOf(t),a=Gs(i),{nextKey:l,prevKey:u}=Zs(a,this.#t.orientation.current),f=this.#t.loop.current,d={[l]:o+1,[u]:o-1,[Si]:0,[bi]:s.length-1};if(r){const p=l===Ne?Qn:Ne,h=u===en?Jn:en;d[p]=o+1,d[h]=o-1}let g=d[n.key];if(g===void 0)return;n.preventDefault(),g<0&&f?g=s.length-1:g===s.length&&f&&(g=0);const v=s[g];if(v)return v.focus(),this.#e.current=v.id,this.#t.onCandidateFocus?.(v),v}getTabIndex(t){const n=this.getCandidateNodes(),r=this.#e.current!==null;return t&&!r&&n[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const n=this.#t.rootNode.current?.querySelector(`#${t}`);!n||!Zt(n)||n.focus()}}class ea{#t;#e=null;constructor(t){this.#t=t,ze(()=>this.#n())}#n(){this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null)}run(t){this.#n();const n=this.#t.ref.current;if(n){if(typeof n.getAnimations!="function"){this.#r(t);return}this.#e=window.requestAnimationFrame(()=>{const r=n.getAnimations();if(r.length===0){this.#r(t);return}Promise.allSettled(r.map(i=>i.finished)).then(()=>{this.#r(t)})})}}#r(t){const n=()=>{t()};this.#t.afterTick?Gt(n):n()}}class na{#t;#e;#n;#r=B(!1);constructor(t){this.#t=t,m(this.#r,t.open.current,!0),this.#e=t.enabled??!0,this.#n=new ea({ref:this.#t.ref,afterTick:this.#t.open}),St(()=>this.#t.open.current,n=>{n&&m(this.#r,!0),this.#e&&this.#n.run(()=>{n===this.#t.open.current&&(this.#t.open.current||m(this.#r,!1),this.#t.onComplete?.())})})}get shouldRender(){return c(this.#r)}}function ct(){}function pn(e,t){return`bits-${e}`}function ra(e,t){var n=L(),r=D(n);Uo(r,()=>t.children,i=>{var s=L(),o=D(s);st(o,()=>t.children??pt),A(i,s)}),A(e,n)}const ia=new we("BitsConfig");function oa(){const e=new sa(null,{});return ia.getOr(e).opts}class sa{opts;constructor(t,n){const r=aa(t,n);this.opts={defaultPortalTo:r(i=>i.defaultPortalTo),defaultLocale:r(i=>i.defaultLocale)}}}function aa(e,t){return n=>T(()=>{const i=n(t)?.current;if(i!==void 0)return i;if(e!==null)return n(e.opts)?.current})}function ca(e,t){return n=>{const r=oa();return T(()=>{const i=n();if(i!==void 0)return i;const s=e(r).current;return s!==void 0?s:t})}}const la=ca(e=>e.defaultPortalTo,"body");function ua(e,t){ut(t,!0);const n=la(()=>t.to),r=ko();let i=_(s);function s(){if(!Ai||t.disabled)return null;let d=null;return typeof n.current=="string"?d=document.querySelector(n.current):d=n.current,d}let o;function a(){o&&(Do(o),o=null)}St([()=>c(i),()=>t.disabled],([d,g])=>{if(!d||g){a();return}return o=Ro(ra,{target:d,props:{children:t.children},context:r}),()=>{a()}});var l=L(),u=D(l);{var f=d=>{var g=L(),v=D(g);st(v,()=>t.children??pt),A(d,g)};at(u,d=>{t.disabled&&d(f)})}A(e,l),dt()}class da{eventName;options;constructor(t,n={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=n}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,n){const r=this.createEvent(n);return t.dispatchEvent(r),r}listen(t,n,r){const i=s=>{n(s)};return lt(t,this.eventName,i,r)}}function Ir(e,t=500){let n=null;const r=(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function Oi(e,t){return e===t||e.contains(t)}function Ti(e){return e?.ownerDocument??document}function fa(e,t){const{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}const ha=[xi,$n],ga=[Ne,js,Si],Pi=[en,Us,bi],va=[...ga,...Pi];function Nr(e){return e.pointerType==="mouse"}function pa(e,{select:t=!1}={}){if(!e||!e.focus)return;const n=Ve(e);if(n.activeElement===e)return;const r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&$s(e)&&t&&e.select()}function ma(e,{select:t=!1}={},n){const r=n();for(const i of e)if(pa(i,{select:t}),n()!==r)return!0}let ke=B(!1);class ee{static _refs=0;static _cleanup;constructor(){vt(()=>(ee._refs===0&&(ee._cleanup=oi(()=>{const t=[],n=i=>{m(ke,!1)},r=i=>{m(ke,!0)};return t.push(lt(document,"pointerdown",n,{capture:!0}),lt(document,"pointermove",n,{capture:!0}),lt(document,"keydown",r,{capture:!0})),de(...t)})),ee._refs++,()=>{ee._refs--,ee._refs===0&&(m(ke,!1),ee._cleanup?.())}))}get current(){return c(ke)}set current(t){m(ke,t,!0)}}var Ci=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],nn=Ci.join(","),_i=typeof Element>"u",he=_i?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,rn=!_i&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},on=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",o=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):on(t.parentNode));return o},ya=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},ki=function(t,n,r){if(on(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(nn));return n&&he.call(t,nn)&&i.unshift(t),i=i.filter(r),i},sn=function(t,n,r){for(var i=[],s=Array.from(t);s.length;){var o=s.shift();if(!on(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,u=sn(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:o,candidates:u})}else{var f=he.call(o,nn);f&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),g=!on(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&g){var v=sn(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,v):i.push({scopeParent:o,candidates:v})}else s.unshift.apply(s,o.children)}}return i},Mi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Fi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ya(t))&&!Mi(t)?0:t.tabIndex},wa=function(t,n){var r=Fi(t);return r<0&&n&&!Mi(t)?0:r},ba=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ri=function(t){return t.tagName==="INPUT"},xa=function(t){return Ri(t)&&t.type==="hidden"},Sa=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Aa=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Ea=function(t){if(!t.name)return!0;var n=t.form||rn(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=Aa(i,t.form);return!s||s===t},Oa=function(t){return Ri(t)&&t.type==="radio"},Ta=function(t){return Oa(t)&&!Ea(t)},Pa=function(t){var n,r=t&&rn(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&i;){var u,f,d;r=rn(i),i=(u=r)===null||u===void 0?void 0:u.host,s=!!((f=i)!==null&&f!==void 0&&(d=f.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return s},Lr=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},Ca=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var o=he.call(t,"details>summary:first-of-type"),a=o?t.parentElement:t;if(he.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=rn(t);if(u&&!u.shadowRoot&&i(u)===!0)return Lr(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(Pa(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Lr(t);return!1},_a=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return he.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},an=function(t,n){return!(n.disabled||xa(n)||Ca(n,t)||Sa(n)||_a(n))},Kn=function(t,n){return!(Ta(n)||Fi(n)<0||!an(t,n))},ka=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Di=function(t){var n=[],r=[];return t.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=wa(a,o),u=o?Di(i.candidates):a;l===0?o?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:u})}),r.sort(ba).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Ii=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sn([t],n.includeContainer,{filter:Kn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ka}):r=ki(t,n.includeContainer,Kn.bind(null,n)),Di(r)},Ni=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sn([t],n.includeContainer,{filter:an.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=ki(t,n.includeContainer,an.bind(null,n)),r},tr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return he.call(t,nn)===!1?!1:Kn(n,t)},Ma=Ci.concat("iframe:not([inert]):not([inert] *)").join(","),Li=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return he.call(t,Ma)===!1?!1:an(n,t)};function Ie(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Fa(e,t){if(!tr(e,Ie()))return Ra(e,t);const n=Ve(e),r=Ii(n.body,Ie());t==="prev"&&r.reverse();const i=r.indexOf(e);return i===-1?n.body:r.slice(i+1)[0]}function Ra(e,t){const n=Ve(e);if(!Li(e,Ie()))return n.body;const r=Ni(n.body,Ie());t==="prev"&&r.reverse();const i=r.indexOf(e);return i===-1?n.body:r.slice(i+1).find(o=>tr(o,Ie()))??n.body}function Bi(e,t,n){const r=t.toLowerCase();if(r.endsWith(" ")){const d=r.slice(0,-1);if(e.filter(h=>h.toLowerCase().startsWith(d)).length<=1)return Bi(e,d,n);const v=n?.toLowerCase();if(v&&v.startsWith(d)&&v.charAt(d.length)===" "&&t.trim()===d)return n;const p=e.filter(h=>h.toLowerCase().startsWith(r));if(p.length>0){const h=n?e.indexOf(n):-1;return Br(p,Math.max(h,0)).find(E=>E!==n)||n}}const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=s.toLowerCase(),a=n?e.indexOf(n):-1;let l=Br(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const f=l.find(d=>d?.toLowerCase().startsWith(o));return f!==n?f:void 0}function Br(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Da={afterMs:1e4,onChange:ct};function Wi(e,t){const{afterMs:n,onChange:r,getWindow:i}={...Da,...t};let s=null,o=B(Xt(e));function a(){return i().setTimeout(()=>{m(o,e,!0),r?.(e)},n)}return vt(()=>()=>{s&&i().clearTimeout(s)}),T(()=>c(o),l=>{m(o,l,!0),r?.(l),s&&i().clearTimeout(s),s=a()})}class Ia{#t;#e;#n=_(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#r=_(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=Wi("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,n){if(!n.length)return;this.#e.current=this.#e.current+t;const r=c(this.#r)(),i=n.find(l=>l===r)?.textContent?.trim()??"",s=n.map(l=>l.textContent?.trim()??""),o=Bi(s,this.#e.current,i),a=n.find(l=>l.textContent?.trim()===o);return a&&c(this.#n)(a),a}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}class Na{#t;#e;#n;#r=B(null);constructor(t){this.#t=t,this.#e=_(()=>this.#t.enabled()),this.#n=Wi(!1,{afterMs:t.transitTimeout??300,onChange:n=>{c(this.#e)&&this.#t.setIsPointerInTransit?.(n)},getWindow:()=>qn(this.#t.triggerNode())}),St([t.triggerNode,t.contentNode,t.enabled],([n,r,i])=>{if(!n||!r||!i)return;const s=a=>{this.#o(a,r)},o=a=>{this.#o(a,n)};return de(lt(n,"pointerleave",s),lt(r,"pointerleave",o))}),St(()=>c(this.#r),()=>{const n=i=>{if(!c(this.#r))return;const s=i.target;if(!Vn(s))return;const o={x:i.clientX,y:i.clientY},a=t.triggerNode()?.contains(s)||t.contentNode()?.contains(s),l=!za(o,c(this.#r));a?this.#i():l&&(this.#i(),t.onPointerExit())},r=Ve(t.triggerNode()??t.contentNode());if(r)return lt(r,"pointermove",n)})}#i(){m(this.#r,null),this.#n.current=!1}#o(t,n){const r=t.currentTarget;if(!Zt(r))return;const i={x:t.clientX,y:t.clientY},s=La(i,r.getBoundingClientRect()),o=Ba(i,s),a=Wa(n.getBoundingClientRect()),l=Va([...o,...a]);m(this.#r,l,!0),this.#n.current=!0}}function La(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ba(e,t,n=5){const r=n*1.5;switch(t){case"top":return[{x:e.x-n,y:e.y+n},{x:e.x,y:e.y-r},{x:e.x+n,y:e.y+n}];case"bottom":return[{x:e.x-n,y:e.y-n},{x:e.x,y:e.y+r},{x:e.x+n,y:e.y-n}];case"left":return[{x:e.x+n,y:e.y-n},{x:e.x-r,y:e.y},{x:e.x+n,y:e.y+n}];case"right":return[{x:e.x-n,y:e.y-n},{x:e.x+r,y:e.y},{x:e.x-n,y:e.y+n}]}}function Wa(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function za(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s].x,l=t[s].y,u=t[o].x,f=t[o].y;l>r!=f>r&&n<(u-a)*(r-l)/(f-l)+a&&(i=!i)}return i}function Va(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Ka(t)}function Ka(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const Ha="data-context-menu-trigger",Ua="data-context-menu-content",zi=new we("Menu.Root"),er=new we("Menu.Root | Menu.Sub"),Vi=new we("Menu.Content"),ja=new da("bitsmenuopen",{bubbles:!1,cancelable:!0}),Ya=Ks({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class nr{static create(t){const n=new nr(t);return zi.set(n)}opts;isUsingKeyboard=new ee;#t=B(!1);get ignoreCloseAutoFocus(){return c(this.#t)}set ignoreCloseAutoFocus(t){m(this.#t,t,!0)}#e=B(!1);get isPointerInTransit(){return c(this.#e)}set isPointerInTransit(t){m(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>Ya.getAttr(t,this.opts.variant.current)}class rr{static create(t,n){return er.set(new rr(t,n,null))}opts;root;parentMenu;contentId=T(()=>"");#t=B(null);get contentNode(){return c(this.#t)}set contentNode(t){m(this.#t,t,!0)}contentPresence;#e=B(null);get triggerNode(){return c(this.#e)}set triggerNode(t){m(this.#e,t,!0)}constructor(t,n,r){this.opts=t,this.root=n,this.parentMenu=r,this.contentPresence=new na({ref:T(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&St(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class ir{static create(t){return Vi.set(new ir(t,er.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=B("");get search(){return c(this.#t)}set search(t){m(this.#t,t,!0)}#e=0;#n;#r=B(!1);get mounted(){return c(this.#r)}set mounted(t){m(this.#r,t,!0)}#i;constructor(t,n){this.opts=t,this.parentMenu=n,this.domContext=new Zn(t.ref),this.attachment=fe(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),n.contentId=t.id,this.#i=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Na({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),this.#n=new Ia({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new ta({rootNode:T(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:T(()=>"vertical")}),St(()=>this.parentMenu.contentNode,r=>{if(!r)return;const i=()=>{Gt(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return ja.listen(r,i)}),vt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#o(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=t=>{this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#i)&&this.parentMenu.triggerNode&&tr(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())};handleTabKeyDown(t){let n=this.parentMenu;for(;n.parentMenu!==null;)n=n.parentMenu;if(!n.triggerNode)return;t.preventDefault();const r=Fa(n.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,n.onClose(),Gt(()=>{r.focus(),Gt(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===Ys){this.handleTabKeyDown(t);return}const n=t.target,r=t.currentTarget;if(!Zt(n)||!Zt(r))return;const i=n.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,s=t.ctrlKey||t.altKey||t.metaKey,o=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(n,t)||t.code==="Space")return;const l=this.#o();i&&!s&&o&&this.#n(t.key,l),t.target?.id===this.parentMenu.contentId.current&&va.includes(t.key)&&(t.preventDefault(),Pi.includes(t.key)&&l.reverse(),ma(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){Vn(t.currentTarget)&&Vn(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&Gt(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(t){if(!Ei(t.target))return;const n=this.parentMenu.triggerNode?.id;if(t.target.id===n){t.preventDefault();return}t.target.closest(`#${n}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#s=_(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return c(this.#s)}set snippetProps(t){m(this.#s,t)}#c=_(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":wi(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return c(this.#c)}set props(t){m(this.#c,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class Ga{opts;content;attachment;#t=B(!1);constructor(t,n){this.opts=t,this.content=n,this.attachment=fe(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&Nr(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!Zt(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||Nr(t)&&this.content.onItemLeave(t)}onfocus(t){Gt(()=>{t.defaultPrevented||this.opts.disabled.current||m(this.#t,!0)})}onblur(t){Gt(()=>{t.defaultPrevented||m(this.#t,!1)})}#e=_(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":mi(this.opts.disabled.current),"data-disabled":yi(this.opts.disabled.current),"data-highlighted":c(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return c(this.#e)}set props(t){m(this.#e,t)}}class or{static create(t){const n=new Ga(t,Vi.get());return new or(t,n)}opts;item;root;#t=!1;constructor(t,n){this.opts=t,this.item=n,this.root=n.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const n=this.item.content.search!=="";if(!(this.item.opts.disabled.current||n&&t.key===$n)&&ha.includes(t.key)){if(!Zt(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!Zt(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#n=_(()=>qt(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return c(this.#n)}set props(t){m(this.#n,t)}}class sr{static create(t){return new sr(t,zi.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=fe(this.opts.ref)}#t=_(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return c(this.#t)}set props(t){m(this.#t,t)}}class ar{static create(t){return new ar(t,er.get())}opts;parentMenu;attachment;constructor(t,n){this.opts=t,this.parentMenu=n,this.attachment=fe(this.opts.ref,r=>this.parentMenu.triggerNode=r)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===$n||t.key===xi){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===Ne&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=_(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=_(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":mi(this.parentMenu.opts.open.current),"aria-controls":c(this.#t),"data-disabled":yi(this.opts.disabled.current),"data-state":wi(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return c(this.#e)}set props(t){m(this.#e,t)}}globalThis.bitsDismissableLayers??=new Map;class cr{static create(t){return new cr(t)}opts;#t;#e;#n={pointerdown:!1};#r=!1;#i=!1;#o=void 0;#a;#s=ct;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#a=t.onFocusOutside,vt(()=>{this.#o=Ti(this.opts.ref.current)});let n=ct;const r=()=>{this.#f(),globalThis.bitsDismissableLayers.delete(this),this.#l.destroy(),n()};St([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return Rs(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#e),n(),n=this.#d())}),r}),ze(()=>{this.#f.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#l.destroy(),this.#s(),n()})}#c=t=>{t.defaultPrevented||this.opts.ref.current&&Gt(()=>{!this.opts.ref.current||this.#p(t.target)||t.target&&!this.#i&&this.#a.current?.(t)})};#d(){return de(lt(this.#o,"pointerdown",de(this.#h,this.#v),{capture:!0}),lt(this.#o,"pointerdown",de(this.#g,this.#l)),lt(this.#o,"focusin",this.#c))}#u=t=>{let n=t;n.defaultPrevented&&(n=Wr(t)),this.#t.current(t)};#l=Ir(t=>{if(!this.opts.ref.current){this.#s();return}const n=this.opts.isValidEvent.current(t,this.opts.ref.current)||Za(t,this.opts.ref.current);if(!this.#r||this.#m()||!n){this.#s();return}let r=t;if(r.defaultPrevented&&(r=Wr(r)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#s();return}t.pointerType==="touch"?(this.#s(),this.#s=lt(this.#o,"click",this.#u,{once:!0})):this.#t.current(r)},10);#h=t=>{this.#n[t.type]=!0};#g=t=>{this.#n[t.type]=!1};#v=()=>{this.opts.ref.current&&(this.#r=qa(this.opts.ref.current))};#p=t=>this.opts.ref.current?Oi(this.opts.ref.current,t):!1;#f=Ir(()=>{for(const t in this.#n)this.#n[t]=!1;this.#r=!1},20);#m(){return Object.values(this.#n).some(Boolean)}#y=()=>{this.#i=!0};#w=()=>{this.#i=!1};props={onfocuscapture:this.#y,onblurcapture:this.#w}}function Xa(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([t,{current:n}])=>n==="close"||n==="ignore")}function qa(e){const t=[...globalThis.bitsDismissableLayers],n=Xa(t);if(n)return n[0].opts.ref.current===e;const[r]=t[0];return r.opts.ref.current===e}function Za(e,t){const n=e.target;if(!Ei(n))return!1;const r=!!n.closest(`[${Ha}]`);if("button"in e&&e.button>0&&!r)return!1;if("button"in e&&e.button===0&&r)return!0;const i=!!t.closest(`[${Ua}]`);return r&&i?!1:Ti(n).documentElement.contains(n)&&!Oi(t,n)&&fa(e,t)}function Wr(e){const t=e.currentTarget,n=e.target;let r;e instanceof PointerEvent?r=new PointerEvent(e.type,e):r=new PointerEvent("pointerdown",e);let i=!1;return new Proxy(r,{get:(o,a)=>a==="currentTarget"?t:a==="target"?n:a==="preventDefault"?()=>{i=!0,typeof o.preventDefault=="function"&&o.preventDefault()}:a==="defaultPrevented"?i:a in o?o[a]:e[a]})}function Ja(e,t){ut(t,!0);let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"onInteractOutside",3,ct),i=x(t,"onFocusOutside",3,ct),s=x(t,"isValidEvent",3,()=>!1);const o=cr.create({id:T(()=>t.id),interactOutsideBehavior:T(()=>n()),onInteractOutside:T(()=>r()),enabled:T(()=>t.enabled),onFocusOutside:T(()=>i()),isValidEvent:T(()=>s()),ref:t.ref});var a=L(),l=D(a);st(l,()=>t.children??pt,()=>({props:o.props})),A(e,a),dt()}globalThis.bitsEscapeLayers??=new Map;class lr{static create(t){return new lr(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new Zn(this.opts.ref);let n=ct;St(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),n=this.#t()),()=>{n(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>lt(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==Hs||!Qa(this))return;const n=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(n)}}function Qa(e){const t=[...globalThis.bitsEscapeLayers],n=t.findLast(([i,{current:s}])=>s==="close"||s==="ignore");if(n)return n[0]===e;const[r]=t[0];return r===e}function $a(e,t){ut(t,!0);let n=x(t,"escapeKeydownBehavior",3,"close"),r=x(t,"onEscapeKeydown",3,ct);lr.create({escapeKeydownBehavior:T(()=>n()),onEscapeKeydown:T(()=>r()),enabled:T(()=>t.enabled),ref:t.ref});var i=L(),s=D(i);st(s,()=>t.children??pt),A(e,i),dt()}class ur{static instance;#t=Wt([]);#e=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new ur),this.instance}register(t){const n=this.getActive();n&&n!==t&&n.pause();const r=document.activeElement;r&&r!==document.body&&this.#n.set(t,r),this.#t.current=this.#t.current.filter(i=>i!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(r=>r!==t);const n=this.getActive();n&&n.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,n){this.#e.set(t,n)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,n){this.#n.set(t,n)}getPreFocusMemory(t){return this.#n.get(t)}clearPreFocusMemory(t){this.#n.delete(t)}}class dr{#t=!1;#e=null;#n=ur.getInstance();#r=[];#i;constructor(t){this.#i=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#o(){for(const t of this.#r)t();this.#r=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#n.register(this),this.#c(),this.#a()}unmount(){this.#e&&(this.#o(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#e=null)}#a(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const n=this.#u();n?(n.focus(),this.#n.setFocusMemory(this,n)):this.#e.focus()})}#s(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const n=this.#n.getPreFocusMemory(this);if(n&&document.contains(n))try{n.focus()}catch{document.body.focus()}}}#c(){if(!this.#e||!this.#i.trap.current)return;const t=this.#e,n=t.ownerDocument,r=o=>{if(this.#t||!this.#n.isActiveScope(this))return;const a=o.target;if(!a)return;if(t.contains(a))this.#n.setFocusMemory(this,a);else{const u=this.#n.getFocusMemory(this);if(u&&t.contains(u)&&Li(u))o.preventDefault(),u.focus();else{const f=this.#u(),d=this.#l()[0];(f||d||t).focus()}}},i=o=>{if(!this.#i.loop||this.#t||o.key!=="Tab"||!this.#n.isActiveScope(this))return;const a=this.#d();if(a.length===0)return;const l=a[0],u=a[a.length-1];!o.shiftKey&&n.activeElement===u?(o.preventDefault(),l.focus()):o.shiftKey&&n.activeElement===l&&(o.preventDefault(),u.focus())};this.#r.push(lt(n,"focusin",r,{capture:!0}),lt(t,"keydown",i));const s=new MutationObserver(()=>{const o=this.#n.getFocusMemory(this);if(o&&!t.contains(o)){const a=this.#u(),l=this.#l()[0],u=a||l;u?(u.focus(),this.#n.setFocusMemory(this,u)):t.focus()}});s.observe(t,{childList:!0,subtree:!0}),this.#r.push(()=>s.disconnect())}#d(){return this.#e?Ii(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#d()[0]||null}#l(){return this.#e?Ni(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return St([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||(n=new dr(t)),n.mount(r)):n&&(n.unmount(),n=null)}),ze(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}}function tc(e,t){ut(t,!0);let n=x(t,"enabled",3,!1),r=x(t,"trapFocus",3,!1),i=x(t,"loop",3,!1),s=x(t,"onCloseAutoFocus",3,ct),o=x(t,"onOpenAutoFocus",3,ct);const a=dr.use({enabled:T(()=>n()),trap:T(()=>r()),loop:i(),onCloseAutoFocus:T(()=>s()),onOpenAutoFocus:T(()=>o()),ref:t.ref});var l=L(),u=D(l);st(u,()=>t.focusScope??pt,()=>({props:a.props})),A(e,l),dt()}globalThis.bitsTextSelectionLayers??=new Map;class fr{static create(t){return new fr(t)}opts;domContext;#t=ct;constructor(t){this.opts=t,this.domContext=new Zn(t.ref);let n=ct;St(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),n(),n=this.#e()),()=>{n(),this.#r(),globalThis.bitsTextSelectionLayers.delete(this)}))}#e(){return de(lt(this.domContext.getDocument(),"pointerdown",this.#n),lt(this.domContext.getDocument(),"pointerup",ui(this.#r,this.opts.onPointerUp.current)))}#n=t=>{const n=this.opts.ref.current,r=t.target;!Zt(n)||!Zt(r)||!this.opts.enabled.current||!nc(this)||!Ws(n,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&(this.#t=ec(n,this.domContext.getDocument().body)))};#r=()=>{this.#t(),this.#t=ct}}const zr=e=>e.style.userSelect||e.style.webkitUserSelect;function ec(e,t){const n=zr(t),r=zr(e);return qe(t,"none"),qe(e,"text"),()=>{qe(t,n),qe(e,r)}}function qe(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function nc(e){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const n=t.at(-1);return n?n[0]===e:!1}function rc(e,t){ut(t,!0);let n=x(t,"preventOverflowTextSelection",3,!0),r=x(t,"onPointerDown",3,ct),i=x(t,"onPointerUp",3,ct);fr.create({id:T(()=>t.id),onPointerDown:T(()=>r()),onPointerUp:T(()=>i()),enabled:T(()=>t.enabled&&n()),ref:t.ref});var s=L(),o=D(s);st(o,()=>t.children??pt),A(e,s),dt()}globalThis.bitsIdCounter??={current:0};function hr(e="bits"){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}class ic{#t;#e=0;#n=B();#r;constructor(t){this.#t=t}#i(){this.#e-=1,this.#r&&this.#e<=0&&(this.#r(),m(this.#n,void 0),this.#r=void 0)}get(...t){return this.#e+=1,c(this.#n)===void 0&&(this.#r=oi(()=>{m(this.#n,this.#t(...t),!0)})),vt(()=>()=>{this.#i()}),c(this.#n)}}const $e=new Ps;let Ze=B(null),kn=null,Me=null,Fe=!1;const Vr=T(()=>{for(const e of $e.values())if(e)return!0;return!1});let Mn=null;const oc=new ic(()=>{function e(){document.body.setAttribute("style",c(Ze)??""),document.body.style.removeProperty("--scrollbar-width"),Dr&&kn?.(),m(Ze,null)}function t(){Me!==null&&(window.clearTimeout(Me),Me=null)}function n(i,s){t(),Fe=!0,Mn=Date.now();const o=Mn,a=()=>{Me=null,Mn===o&&(Ki($e)?Fe=!1:(Fe=!1,s()))},l=i===null?24:i;Me=window.setTimeout(a,l)}function r(){c(Ze)===null&&$e.size===0&&!Fe&&m(Ze,document.body.getAttribute("style"),!0)}return St(()=>Vr.current,()=>{if(!Vr.current)return;r(),Fe=!1;const i=getComputedStyle(document.documentElement),s=getComputedStyle(document.body),o=i.scrollbarGutter?.includes("stable")||s.scrollbarGutter?.includes("stable"),a=window.innerWidth-document.documentElement.clientWidth,u={padding:Number.parseInt(s.paddingRight??"0",10)+a,margin:Number.parseInt(s.marginRight??"0",10)};a>0&&!o&&(document.body.style.paddingRight=`${u.padding}px`,document.body.style.marginRight=`${u.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",Dr&&(kn=lt(document,"touchmove",f=>{f.target===document.documentElement&&(f.touches.length>1||f.preventDefault())},{passive:!1})),Gt(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),ze(()=>()=>{kn?.()}),{get lockMap(){return $e},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});class sc{#t=hr();#e;#n=()=>null;#r;locked;constructor(t,n=()=>null){this.#e=t,this.#n=n,this.#r=oc.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#t,this.#e??!1),this.locked=T(()=>this.#r.lockMap.get(this.#t)??!1,r=>this.#r.lockMap.set(this.#t,r)),ze(()=>{if(this.#r.lockMap.delete(this.#t),Ki(this.#r.lockMap))return;const r=this.#n();this.#r.scheduleCleanupIfNoNewLocks(r,()=>{this.#r.resetBodyStyle()})}))}}function Ki(e){for(const[t,n]of e)if(n)return!0;return!1}function Kr(e,t){ut(t,!0);let n=x(t,"preventScroll",3,!0),r=x(t,"restoreScrollDelay",3,null);n()&&new sc(n(),()=>r()),dt()}const ac=["top","right","bottom","left"],ne=Math.min,Tt=Math.max,cn=Math.round,Je=Math.floor,Vt=e=>({x:e,y:e}),cc={left:"right",right:"left",bottom:"top",top:"bottom"},lc={start:"end",end:"start"};function Hn(e,t,n){return Tt(e,ne(t,n))}function Jt(e,t){return typeof e=="function"?e(t):e}function Qt(e){return e.split("-")[0]}function Ee(e){return e.split("-")[1]}function gr(e){return e==="x"?"y":"x"}function vr(e){return e==="y"?"height":"width"}const uc=new Set(["top","bottom"]);function zt(e){return uc.has(Qt(e))?"y":"x"}function pr(e){return gr(zt(e))}function dc(e,t,n){n===void 0&&(n=!1);const r=Ee(e),i=pr(e),s=vr(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=ln(o)),[o,ln(o)]}function fc(e){const t=ln(e);return[Un(e),t,Un(t)]}function Un(e){return e.replace(/start|end/g,t=>lc[t])}const Hr=["left","right"],Ur=["right","left"],hc=["top","bottom"],gc=["bottom","top"];function vc(e,t,n){switch(e){case"top":case"bottom":return n?t?Ur:Hr:t?Hr:Ur;case"left":case"right":return t?hc:gc;default:return[]}}function pc(e,t,n,r){const i=Ee(e);let s=vc(Qt(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Un)))),s}function ln(e){return e.replace(/left|right|bottom|top/g,t=>cc[t])}function mc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Hi(e){return typeof e!="number"?mc(e):{top:e,right:e,bottom:e,left:e}}function un(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function jr(e,t,n){let{reference:r,floating:i}=e;const s=zt(t),o=pr(t),a=vr(o),l=Qt(t),u=s==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let v;switch(l){case"top":v={x:f,y:r.y-i.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-i.width,y:d};break;default:v={x:r.x,y:r.y}}switch(Ee(t)){case"start":v[o]-=g*(n&&u?-1:1);break;case"end":v[o]+=g*(n&&u?-1:1);break}return v}async function yc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:g=!1,padding:v=0}=Jt(t,e),p=Hi(v),y=a[g?d==="floating"?"reference":"floating":d],b=un(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),E=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},N=un(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:C,strategy:l}):E);return{top:(b.top-N.top+p.top)/S.y,bottom:(N.bottom-b.bottom+p.bottom)/S.y,left:(b.left-N.left+p.left)/S.x,right:(N.right-b.right+p.right)/S.x}}const wc=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=jr(u,r,l),g=r,v={},p=0;for(let y=0;y<a.length;y++){var h;const{name:b,fn:E}=a[y],{x:C,y:S,data:N,reset:O}=await E({x:f,y:d,initialPlacement:r,placement:g,strategy:i,middlewareData:v,rects:u,platform:{...o,detectOverflow:(h=o.detectOverflow)!=null?h:yc},elements:{reference:e,floating:t}});f=C??f,d=S??d,v={...v,[b]:{...v[b],...N}},O&&p<=50&&(p++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(u=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:f,y:d}=jr(u,g,l)),y=-1)}return{x:f,y:d,placement:g,strategy:i,middlewareData:v}},bc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=Jt(e,t)||{};if(u==null)return{};const d=Hi(f),g={x:n,y:r},v=pr(i),p=vr(v),h=await o.getDimensions(u),y=v==="y",b=y?"top":"left",E=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[v]-g[v]-s.floating[p],N=g[v]-s.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=O?O[C]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=a.floating[C]||s.floating[p]);const j=S/2-N/2,W=k/2-h[p]/2-1,F=ne(d[b],W),I=ne(d[E],W),H=F,X=k-h[p]-I,q=k/2-h[p]/2+j,J=Hn(H,q,X),z=!l.arrow&&Ee(i)!=null&&q!==J&&s.reference[p]/2-(q<H?F:I)-h[p]/2<0,G=z?q<H?q-H:q-X:0;return{[v]:g[v]+G,data:{[v]:J,centerOffset:q-J-G,...z&&{alignmentOffset:G}},reset:z}}}),xc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...y}=Jt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Qt(i),E=zt(a),C=Qt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),N=g||(C||!h?[ln(a)]:fc(a)),O=p!=="none";!g&&O&&N.push(...pc(a,h,p,S));const k=[a,...N],j=await l.detectOverflow(t,y),W=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&W.push(j[b]),d){const q=dc(i,o,S);W.push(j[q[0]],j[q[1]])}if(F=[...F,{placement:i,overflows:W}],!W.every(q=>q<=0)){var I,H;const q=(((I=s.flip)==null?void 0:I.index)||0)+1,J=k[q];if(J&&(!(d==="alignment"?E!==zt(J):!1)||F.every(Z=>zt(Z.placement)===E?Z.overflows[0]>0:!0)))return{data:{index:q,overflows:F},reset:{placement:J}};let z=(H=F.filter(G=>G.overflows[0]<=0).sort((G,Z)=>G.overflows[1]-Z.overflows[1])[0])==null?void 0:H.placement;if(!z)switch(v){case"bestFit":{var X;const G=(X=F.filter(Z=>{if(O){const At=zt(Z.placement);return At===E||At==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(At=>At>0).reduce((At,Te)=>At+Te,0)]).sort((Z,At)=>Z[1]-At[1])[0])==null?void 0:X[0];G&&(z=G);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function Yr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gr(e){return ac.some(t=>e[t]>=0)}const Sc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...s}=Jt(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Yr(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Gr(a)}}}case"escaped":{const o=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Yr(o,n.floating);return{data:{escapedOffsets:a,escaped:Gr(a)}}}default:return{}}}}},Ui=new Set(["left","top"]);async function Ac(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Qt(n),a=Ee(n),l=zt(n)==="y",u=Ui.has(o)?-1:1,f=s&&l?-1:1,d=Jt(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(v=a==="end"?p*-1:p),l?{x:v*f,y:g*u}:{x:g*u,y:v*f}}const Ec=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await Ac(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Oc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:E,y:C}=b;return{x:E,y:C}}},...u}=Jt(e,t),f={x:n,y:r},d=await s.detectOverflow(t,u),g=zt(Qt(i)),v=gr(g);let p=f[v],h=f[g];if(o){const b=v==="y"?"top":"left",E=v==="y"?"bottom":"right",C=p+d[b],S=p-d[E];p=Hn(C,p,S)}if(a){const b=g==="y"?"top":"left",E=g==="y"?"bottom":"right",C=h+d[b],S=h-d[E];h=Hn(C,h,S)}const y=l.fn({...t,[v]:p,[g]:h});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[v]:o,[g]:a}}}}}},Tc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Jt(e,t),f={x:n,y:r},d=zt(i),g=gr(d);let v=f[g],p=f[d];const h=Jt(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const C=g==="y"?"height":"width",S=s.reference[g]-s.floating[C]+y.mainAxis,N=s.reference[g]+s.reference[C]-y.mainAxis;v<S?v=S:v>N&&(v=N)}if(u){var b,E;const C=g==="y"?"width":"height",S=Ui.has(Qt(i)),N=s.reference[d]-s.floating[C]+(S&&((b=o.offset)==null?void 0:b[d])||0)+(S?0:y.crossAxis),O=s.reference[d]+s.reference[C]+(S?0:((E=o.offset)==null?void 0:E[d])||0)-(S?y.crossAxis:0);p<N?p=N:p>O&&(p=O)}return{[g]:v,[d]:p}}}},Pc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}=Jt(e,t),f=await o.detectOverflow(t,u),d=Qt(i),g=Ee(i),v=zt(i)==="y",{width:p,height:h}=s.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=g===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,y=g==="end"?"top":"bottom");const E=h-f.top-f.bottom,C=p-f.left-f.right,S=ne(h-f[y],E),N=ne(p-f[b],C),O=!t.middlewareData.shift;let k=S,j=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=E),O&&!g){const F=Tt(f.left,0),I=Tt(f.right,0),H=Tt(f.top,0),X=Tt(f.bottom,0);v?j=p-2*(F!==0||I!==0?F+I:Tt(f.left,f.right)):k=h-2*(H!==0||X!==0?H+X:Tt(f.top,f.bottom))}await l({...t,availableWidth:j,availableHeight:k});const W=await o.getDimensions(a.floating);return p!==W.width||h!==W.height?{reset:{rects:!0}}:{}}}};function mn(){return typeof window<"u"}function Oe(e){return ji(e)?(e.nodeName||"").toLowerCase():"#document"}function Pt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ht(e){var t;return(t=(ji(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ji(e){return mn()?e instanceof Node||e instanceof Pt(e).Node:!1}function Lt(e){return mn()?e instanceof Element||e instanceof Pt(e).Element:!1}function Kt(e){return mn()?e instanceof HTMLElement||e instanceof Pt(e).HTMLElement:!1}function Xr(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pt(e).ShadowRoot}const Cc=new Set(["inline","contents"]);function Ke(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Cc.has(i)}const _c=new Set(["table","td","th"]);function kc(e){return _c.has(Oe(e))}const Mc=[":popover-open",":modal"];function yn(e){return Mc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Fc=["transform","translate","scale","rotate","perspective"],Rc=["transform","translate","scale","rotate","perspective","filter"],Dc=["paint","layout","strict","content"];function mr(e){const t=yr(),n=Lt(e)?Bt(e):e;return Fc.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Rc.some(r=>(n.willChange||"").includes(r))||Dc.some(r=>(n.contain||"").includes(r))}function Ic(e){let t=re(e);for(;Kt(t)&&!Ae(t);){if(mr(t))return t;if(yn(t))return null;t=re(t)}return null}function yr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Nc=new Set(["html","body","#document"]);function Ae(e){return Nc.has(Oe(e))}function Bt(e){return Pt(e).getComputedStyle(e)}function wn(e){return Lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function re(e){if(Oe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xr(e)&&e.host||Ht(e);return Xr(t)?t.host:t}function Yi(e){const t=re(e);return Ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Ke(t)?t:Yi(t)}function Le(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Yi(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Pt(i);if(s){const a=jn(o);return t.concat(o,o.visualViewport||[],Ke(i)?i:[],a&&n?Le(a):[])}return t.concat(i,Le(i,[],n))}function jn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gi(e){const t=Bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Kt(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=cn(n)!==s||cn(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function wr(e){return Lt(e)?e:e.contextElement}function xe(e){const t=wr(e);if(!Kt(t))return Vt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Gi(t);let o=(s?cn(n.width):n.width)/r,a=(s?cn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Lc=Vt(0);function Xi(e){const t=Pt(e);return!yr()||!t.visualViewport?Lc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pt(e)?!1:t}function ge(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=wr(e);let o=Vt(1);t&&(r?Lt(r)&&(o=xe(r)):o=xe(e));const a=Bc(s,n,r)?Xi(s):Vt(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,d=i.height/o.y;if(s){const g=Pt(s),v=r&&Lt(r)?Pt(r):r;let p=g,h=jn(p);for(;h&&r&&v!==p;){const y=xe(h),b=h.getBoundingClientRect(),E=Bt(h),C=b.left+(h.clientLeft+parseFloat(E.paddingLeft))*y.x,S=b.top+(h.clientTop+parseFloat(E.paddingTop))*y.y;l*=y.x,u*=y.y,f*=y.x,d*=y.y,l+=C,u+=S,p=Pt(h),h=jn(p)}}return un({width:f,height:d,x:l,y:u})}function bn(e,t){const n=wn(e).scrollLeft;return t?t.left+n:ge(Ht(e)).left+n}function qi(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bn(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Wc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Ht(r),a=t?yn(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Vt(1);const f=Vt(0),d=Kt(r);if((d||!d&&!s)&&((Oe(r)!=="body"||Ke(o))&&(l=wn(r)),Kt(r))){const v=ge(r);u=xe(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const g=o&&!d&&!s?qi(o,l):Vt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+g.x,y:n.y*u.y-l.scrollTop*u.y+f.y+g.y}}function zc(e){return Array.from(e.getClientRects())}function Vc(e){const t=Ht(e),n=wn(e),r=e.ownerDocument.body,i=Tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+bn(e);const a=-n.scrollTop;return Bt(r).direction==="rtl"&&(o+=Tt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const qr=25;function Kc(e,t){const n=Pt(e),r=Ht(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const f=yr();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=bn(r);if(u<=0){const f=r.ownerDocument,d=f.body,g=getComputedStyle(d),v=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-v);p<=qr&&(s-=p)}else u<=qr&&(s+=u);return{width:s,height:o,x:a,y:l}}const Hc=new Set(["absolute","fixed"]);function Uc(e,t){const n=ge(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Kt(e)?xe(e):Vt(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function Zr(e,t,n){let r;if(t==="viewport")r=Kc(e,n);else if(t==="document")r=Vc(Ht(e));else if(Lt(t))r=Uc(t,n);else{const i=Xi(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return un(r)}function Zi(e,t){const n=re(e);return n===t||!Lt(n)||Ae(n)?!1:Bt(n).position==="fixed"||Zi(n,t)}function jc(e,t){const n=t.get(e);if(n)return n;let r=Le(e,[],!1).filter(a=>Lt(a)&&Oe(a)!=="body"),i=null;const s=Bt(e).position==="fixed";let o=s?re(e):e;for(;Lt(o)&&!Ae(o);){const a=Bt(o),l=mr(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&Hc.has(i.position)||Ke(o)&&!l&&Zi(e,o))?r=r.filter(f=>f!==o):i=a,o=re(o)}return t.set(e,r),r}function Yc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?yn(t)?[]:jc(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,f)=>{const d=Zr(t,f,i);return u.top=Tt(d.top,u.top),u.right=ne(d.right,u.right),u.bottom=ne(d.bottom,u.bottom),u.left=Tt(d.left,u.left),u},Zr(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gc(e){const{width:t,height:n}=Gi(e);return{width:t,height:n}}function Xc(e,t,n){const r=Kt(t),i=Ht(t),s=n==="fixed",o=ge(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Vt(0);function u(){l.x=bn(i)}if(r||!r&&!s)if((Oe(t)!=="body"||Ke(i))&&(a=wn(t)),r){const v=ge(t,!0,s,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else i&&u();s&&!r&&i&&u();const f=i&&!r&&!s?qi(i,a):Vt(0),d=o.left+a.scrollLeft-l.x-f.x,g=o.top+a.scrollTop-l.y-f.y;return{x:d,y:g,width:o.width,height:o.height}}function Fn(e){return Bt(e).position==="static"}function Jr(e,t){if(!Kt(e)||Bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ht(e)===n&&(n=n.ownerDocument.body),n}function Ji(e,t){const n=Pt(e);if(yn(e))return n;if(!Kt(e)){let i=re(e);for(;i&&!Ae(i);){if(Lt(i)&&!Fn(i))return i;i=re(i)}return n}let r=Jr(e,t);for(;r&&kc(r)&&Fn(r);)r=Jr(r,t);return r&&Ae(r)&&Fn(r)&&!mr(r)?n:r||Ic(e)||n}const qc=async function(e){const t=this.getOffsetParent||Ji,n=this.getDimensions,r=await n(e.floating);return{reference:Xc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zc(e){return Bt(e).direction==="rtl"}const Jc={convertOffsetParentRelativeRectToViewportRelativeRect:Wc,getDocumentElement:Ht,getClippingRect:Yc,getOffsetParent:Ji,getElementRects:qc,getClientRects:zc,getDimensions:Gc,getScale:xe,isElement:Lt,isRTL:Zc};function Qi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qc(e,t){let n=null,r;const i=Ht(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:d,width:g,height:v}=u;if(a||t(),!g||!v)return;const p=Je(d),h=Je(i.clientWidth-(f+g)),y=Je(i.clientHeight-(d+v)),b=Je(f),C={rootMargin:-p+"px "+-h+"px "+-y+"px "+-b+"px",threshold:Tt(0,ne(1,l))||1};let S=!0;function N(O){const k=O[0].intersectionRatio;if(k!==l){if(!S)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!Qi(u,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(N,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,C)}n.observe(e)}return o(!0),s}function $c(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=wr(e),f=i||s?[...u?Le(u):[],...Le(t)]:[];f.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const d=u&&a?Qc(u,n):null;let g=-1,v=null;o&&(v=new ResizeObserver(b=>{let[E]=b;E&&E.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(t)})),n()}),u&&!l&&v.observe(u),v.observe(t));let p,h=l?ge(e):null;l&&y();function y(){const b=ge(e);h&&!Qi(h,b)&&n(),h=b,p=requestAnimationFrame(y)}return n(),()=>{var b;f.forEach(E=>{i&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),d?.(),(b=v)==null||b.disconnect(),v=null,l&&cancelAnimationFrame(p)}}const tl=Ec,el=Oc,nl=xc,rl=Pc,il=Sc,ol=bc,sl=Tc,al=(e,t,n)=>{const r=new Map,i={platform:Jc,...n},s={...i.platform,_c:r};return wc(e,t,{...i,platform:s})};function ce(e){return typeof e=="function"?e():e}function $i(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qr(e,t){const n=$i(e);return Math.round(t*n)/n}function $r(e){return{[`--bits-${e}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${e}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${e}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${e}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${e}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function cl(e){const t=e.whileElementsMounted,n=_(()=>ce(e.open)??!0),r=_(()=>ce(e.middleware)),i=_(()=>ce(e.transform)??!0),s=_(()=>ce(e.placement)??"bottom"),o=_(()=>ce(e.strategy)??"absolute"),a=_(()=>ce(e.sideOffset)??0),l=_(()=>ce(e.alignOffset)??0),u=e.reference;let f=B(0),d=B(0);const g=Wt(null);let v=B(Xt(c(o))),p=B(Xt(c(s))),h=B(Xt({})),y=B(!1),b=!1;const E=_(()=>{const W=g.current?Qr(g.current,c(f)):c(f),F=g.current?Qr(g.current,c(d)):c(d);return c(i)?{position:c(v),left:"0",top:"0",transform:`translate(${W}px, ${F}px)`,...g.current&&$i(g.current)>=1.5&&{willChange:"transform"}}:{position:c(v),left:`${W}px`,top:`${F}px`}});let C;function S(){u.current===null||g.current===null||al(u.current,g.current,{middleware:c(r),placement:c(s),strategy:c(o)}).then(W=>{const F=u.current;if(ll(F)){m(h,{...c(h),hide:{...c(h).hide,referenceHidden:!0}},!0);return}if(!c(n)&&c(f)!==0&&c(d)!==0){const H=Math.max(Math.abs(c(a)),Math.abs(c(l)),15);if(W.x<=H&&W.y<=H)return}m(f,W.x,!0),m(d,W.y,!0),m(v,W.strategy,!0),m(p,W.placement,!0),m(h,W.middlewareData,!0),m(y,!0)})}function N(){typeof C=="function"&&(C(),C=void 0)}function O(){if(N(),t===void 0){S();return}c(n)&&(u.current===null||g.current===null||(C=t(u.current,g.current,S)))}function k(){c(n)||m(y,!1)}function j(){return[c(r),c(s),c(o),c(a),c(l),c(n)]}return vt(()=>{t===void 0&&c(n)&&S()}),vt(O),vt(()=>{if(t!==void 0){if(j(),!c(n)){b=!1;return}if(!c(y)){b=!1;return}if(!b){b=!0;return}S()}}),vt(k),vt(()=>N),{floating:g,reference:u,get strategy(){return c(v)},get placement(){return c(p)},get middlewareData(){return c(h)},get isPositioned(){return c(y)},get floatingStyles(){return c(E)},get update(){return S}}}function ll(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}const ul={top:"bottom",right:"left",bottom:"top",left:"right"},br=new we("Floating.Root"),ti=new we("Floating.Content"),xr=new we("Floating.Root");class dn{static create(t=!1){return t?xr.set(new dn):br.set(new dn)}anchorNode=Wt(null);customAnchorNode=Wt(null);triggerNode=Wt(null);constructor(){vt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class fn{static create(t,n=!1){return n?ti.set(new fn(t,xr.get())):ti.set(new fn(t,br.get()))}opts;root;contentRef=Wt(null);wrapperRef=Wt(null);arrowRef=Wt(null);contentAttachment=fe(this.contentRef);wrapperAttachment=fe(this.wrapperRef);arrowAttachment=fe(this.arrowRef);arrowId=Wt(hr());#t=_(()=>{if(typeof this.opts.style=="string")return Re(this.opts.style);if(!this.opts.style)return{}});#e=void 0;#n=new Fs(()=>this.arrowRef.current??void 0);#r=_(()=>this.#n?.width??0);#i=_(()=>this.#n?.height??0);#o=_(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=_(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=_(()=>c(this.#a).length>0);get hasExplicitBoundaries(){return c(this.#s)}set hasExplicitBoundaries(t){m(this.#s,t)}#c=_(()=>({padding:this.opts.collisionPadding.current,boundary:c(this.#a).filter(Qs),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return c(this.#c)}set detectOverflowOptions(t){m(this.#c,t)}#d=B(void 0);#u=B(void 0);#l=B(void 0);#h=B(void 0);#g=_(()=>[tl({mainAxis:this.opts.sideOffset.current+c(this.#i),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&el({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?sl():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&nl({...this.detectOverflowOptions}),rl({...this.detectOverflowOptions,apply:({rects:t,availableWidth:n,availableHeight:r})=>{const{width:i,height:s}=t.reference;m(this.#d,n,!0),m(this.#u,r,!0),m(this.#l,i,!0),m(this.#h,s,!0)}}),this.arrowRef.current&&ol({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),dl({arrowWidth:c(this.#r),arrowHeight:c(this.#i)}),this.opts.hideWhenDetached.current&&il({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return c(this.#g)}set middleware(t){m(this.#g,t)}floating;#v=_(()=>fl(this.floating.placement));get placedSide(){return c(this.#v)}set placedSide(t){m(this.#v,t)}#p=_(()=>hl(this.floating.placement));get placedAlign(){return c(this.#p)}set placedAlign(t){m(this.#p,t)}#f=_(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return c(this.#f)}set arrowX(t){m(this.#f,t)}#m=_(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return c(this.#m)}set arrowY(t){m(this.#m,t)}#y=_(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return c(this.#y)}set cannotCenterArrow(t){m(this.#y,t)}#w=B();get contentZIndex(){return c(this.#w)}set contentZIndex(t){m(this.#w,t,!0)}#b=_(()=>ul[this.placedSide]);get arrowBaseSide(){return c(this.#b)}set arrowBaseSide(t){m(this.#b,t)}#x=_(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${c(this.#d)}px`,"--bits-floating-available-height":`${c(this.#u)}px`,"--bits-floating-anchor-width":`${c(this.#l)}px`,"--bits-floating-anchor-height":`${c(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...c(this.#t)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return c(this.#x)}set wrapperProps(t){m(this.#x,t)}#S=_(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:fi({...c(this.#t)}),...this.contentAttachment}));get props(){return c(this.#S)}set props(t){m(this.#S,t)}#A=_(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return c(this.#A)}set arrowStyle(t){m(this.#A,t)}constructor(t,n){this.opts=t,this.root=n,this.#e=t.updatePositionStrategy,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),St(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=cl({strategy:()=>this.opts.strategy.current,placement:()=>c(this.#o),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>$c(...r,{animationFrame:this.#e?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),vt(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),St(()=>this.contentRef.current,r=>{if(!r||!this.opts.enabled.current)return;const i=qn(r),s=i.requestAnimationFrame(()=>{if(this.contentRef.current!==r||!this.opts.enabled.current)return;const o=i.getComputedStyle(r).zIndex;o!==this.contentZIndex&&(this.contentZIndex=o)});return()=>{i.cancelAnimationFrame(s)}}),vt(()=>{this.floating.floating.current=this.wrapperRef.current})}}class hn{static create(t,n=!1){return n?new hn(t,xr.get()):new hn(t,br.get())}opts;root;constructor(t,n){this.opts=t,this.root=n,t.virtualEl&&t.virtualEl.current?n.triggerNode=li(t.virtualEl.current):n.triggerNode=t.ref}}function dl(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,f]=Sr(n),d={start:"0%",center:"50%",end:"100%"}[f],g=(i.arrow?.x??0)+a/2,v=(i.arrow?.y??0)+l/2;let p="",h="";return u==="bottom"?(p=o?d:`${g}px`,h=`${-l}px`):u==="top"?(p=o?d:`${g}px`,h=`${r.floating.height+l}px`):u==="right"?(p=`${-l}px`,h=o?d:`${v}px`):u==="left"&&(p=`${r.floating.width+l}px`,h=o?d:`${v}px`),{data:{x:p,y:h}}}}}function Sr(e){const[t,n="center"]=e.split("-");return[t,n]}function fl(e){return Sr(e)[0]}function hl(e){return Sr(e)[1]}function gl(e,t){ut(t,!0);let n=x(t,"tooltip",3,!1);dn.create(n());var r=L(),i=D(r);st(i,()=>t.children??pt),A(e,r),dt()}function vl(e,t){ut(t,!0);let n=x(t,"tooltip",3,!1);hn.create({id:T(()=>t.id),virtualEl:T(()=>t.virtualEl),ref:t.ref},n());var r=L(),i=D(r);st(i,()=>t.children??pt),A(e,r),dt()}function pl(e,t){ut(t,!0);let n=x(t,"side",3,"bottom"),r=x(t,"sideOffset",3,0),i=x(t,"align",3,"center"),s=x(t,"alignOffset",3,0),o=x(t,"arrowPadding",3,0),a=x(t,"avoidCollisions",3,!0),l=x(t,"collisionBoundary",19,()=>[]),u=x(t,"collisionPadding",3,0),f=x(t,"hideWhenDetached",3,!1),d=x(t,"onPlaced",3,()=>{}),g=x(t,"sticky",3,"partial"),v=x(t,"updatePositionStrategy",3,"optimized"),p=x(t,"strategy",3,"fixed"),h=x(t,"dir",3,"ltr"),y=x(t,"style",19,()=>({})),b=x(t,"wrapperId",19,hr),E=x(t,"customAnchor",3,null),C=x(t,"tooltip",3,!1);const S=fn.create({side:T(()=>n()),sideOffset:T(()=>r()),align:T(()=>i()),alignOffset:T(()=>s()),id:T(()=>t.id),arrowPadding:T(()=>o()),avoidCollisions:T(()=>a()),collisionBoundary:T(()=>l()),collisionPadding:T(()=>u()),hideWhenDetached:T(()=>f()),onPlaced:T(()=>d()),sticky:T(()=>g()),updatePositionStrategy:T(()=>v()),strategy:T(()=>p()),dir:T(()=>h()),style:T(()=>y()),enabled:T(()=>t.enabled),wrapperId:T(()=>b()),customAnchor:T(()=>E())},C()),N=_(()=>qt(S.wrapperProps,{style:{pointerEvents:"auto"}}));var O=L(),k=D(O);st(k,()=>t.content??pt,()=>({props:S.props,wrapperProps:c(N)})),A(e,O),dt()}function ml(e,t){ut(t,!0),si(()=>{t.onPlaced?.()});var n=L(),r=D(n);st(r,()=>t.content??pt,()=>({props:{},wrapperProps:{}})),A(e,n),dt()}function yl(e,t){let n=x(t,"isStatic",3,!1),r=ie(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var i=L(),s=D(i);{var o=l=>{ml(l,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},a=l=>{pl(l,Mt({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};at(s,l=>{n()?l(o):l(a,!1)})}A(e,i)}var wl=K("<!> <!>",1);function to(e,t){ut(t,!0);let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"trapFocus",3,!0),i=x(t,"isValidEvent",3,()=>!1),s=x(t,"customAnchor",3,null),o=x(t,"isStatic",3,!1),a=x(t,"tooltip",3,!1),l=x(t,"contentPointerEvents",3,"auto"),u=ie(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);yl(e,{get isStatic(){return o()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get enabled(){return t.enabled},get tooltip(){return a()},content:(d,g)=>{let v=()=>g?.().props,p=()=>g?.().wrapperProps;var h=wl(),y=D(h);{var b=S=>{Kr(S,{get preventScroll(){return t.preventScroll}})},E=S=>{Kr(S,{get preventScroll(){return t.preventScroll}})};at(y,S=>{t.forceMount&&t.enabled?S(b):t.forceMount||S(E,1)})}var C=nt(y,2);tc(C,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(N,O)=>{let k=()=>O?.().props;$a(N,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(j,W)=>{Ja(j,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return i()},get enabled(){return t.enabled},get ref(){return t.ref},children:(I,H)=>{let X=()=>H?.().props;rc(I,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(q,J)=>{var z=L(),G=D(z);{let Z=_(()=>({props:qt(u,v(),X(),k(),{style:{pointerEvents:l()}}),wrapperProps:p()}));st(G,()=>t.popper??pt,()=>c(Z))}A(q,z)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),A(d,h)},$$slots:{content:!0}}),dt()}function bl(e,t){let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"trapFocus",3,!0),i=x(t,"isValidEvent",3,()=>!1),s=x(t,"customAnchor",3,null),o=x(t,"isStatic",3,!1),a=ie(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=L(),u=D(l);{var f=d=>{to(d,Mt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>a))};at(u,d=>{t.shouldRender&&d(f)})}A(e,l)}function xl(e,t){let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"trapFocus",3,!0),i=x(t,"isValidEvent",3,()=>!1),s=x(t,"customAnchor",3,null),o=x(t,"isStatic",3,!1),a=ie(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);to(e,Mt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside}},()=>a,{forceMount:!0}))}var Sl=K("<div><!></div>");function Al(e,t){const n=gn();ut(t,!0);let r=x(t,"ref",15,null),i=x(t,"id",19,()=>pn(n)),s=x(t,"disabled",3,!1),o=x(t,"onSelect",3,ct),a=x(t,"closeOnSelect",3,!0),l=ie(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const u=or.create({id:T(()=>i()),disabled:T(()=>s()),onSelect:T(()=>o()),ref:T(()=>r(),h=>r(h)),closeOnSelect:T(()=>a())}),f=_(()=>qt(l,u.props));var d=L(),g=D(d);{var v=h=>{var y=L(),b=D(y);st(b,()=>t.child,()=>({props:c(f)})),A(h,y)},p=h=>{var y=Sl();ue(y,()=>({...c(f)}));var b=R(y);st(b,()=>t.children??pt),M(y),A(h,y)};at(g,h=>{t.child?h(v):h(p,!1)})}A(e,d),dt()}var El=K("<div><!></div>");function Ol(e,t){const n=gn();ut(t,!0);let r=x(t,"ref",15,null),i=x(t,"id",19,()=>pn(n)),s=ie(t,["$$slots","$$events","$$legacy","ref","id","child","children"]);const o=sr.create({id:T(()=>i()),ref:T(()=>r(),g=>r(g))}),a=_(()=>qt(s,o.props));var l=L(),u=D(l);{var f=g=>{var v=L(),p=D(v);st(p,()=>t.child,()=>({props:c(a)})),A(g,v)},d=g=>{var v=El();ue(v,()=>({...c(a)}));var p=R(v);st(p,()=>t.children??pt),M(v),A(g,v)};at(u,g=>{t.child?g(f):g(d,!1)})}A(e,l),dt()}function Tl(e,t){ut(t,!0);let n=x(t,"open",15,!1),r=x(t,"dir",3,"ltr"),i=x(t,"onOpenChange",3,ct),s=x(t,"onOpenChangeComplete",3,ct),o=x(t,"_internal_variant",3,"dropdown-menu");const a=nr.create({variant:T(()=>o()),dir:T(()=>r()),onClose:()=>{n(!1),i()(!1)}});rr.create({open:T(()=>n(),l=>{n(l),i()(l)}),onOpenChangeComplete:T(()=>s())},a),gl(e,{children:(l,u)=>{var f=L(),d=D(f);st(d,()=>t.children??pt),A(l,f)},$$slots:{default:!0}}),dt()}var Pl=K("<div><div><!></div></div>"),Cl=K("<div><div><!></div></div>");function _l(e,t){const n=gn();ut(t,!0);let r=x(t,"id",19,()=>pn(n)),i=x(t,"ref",15,null),s=x(t,"loop",3,!0),o=x(t,"onInteractOutside",3,ct),a=x(t,"onEscapeKeydown",3,ct),l=x(t,"onCloseAutoFocus",3,ct),u=x(t,"forceMount",3,!1),f=x(t,"trapFocus",3,!1),d=ie(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const g=ir.create({id:T(()=>r()),loop:T(()=>s()),ref:T(()=>i(),S=>i(S)),onCloseAutoFocus:T(()=>l())}),v=_(()=>qt(d,g.props));function p(S){if(g.handleInteractOutside(S),!S.defaultPrevented&&(o()(S),!S.defaultPrevented)){if(S.target&&S.target instanceof Element){const N=`[${g.parentMenu.root.getBitsAttr("sub-content")}]`;if(S.target.closest(N))return}g.parentMenu.onClose()}}function h(S){a()(S),!S.defaultPrevented&&g.parentMenu.onClose()}var y=L(),b=D(y);{var E=S=>{xl(S,Mt(()=>c(v),()=>g.popperProps,{get ref(){return g.opts.ref},get enabled(){return g.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:h,get trapFocus(){return f()},get loop(){return s()},forceMount:!0,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(O,k)=>{let j=()=>k?.().props,W=()=>k?.().wrapperProps;const F=_(()=>qt(j(),{style:$r("dropdown-menu")},{style:t.style}));var I=L(),H=D(I);{var X=J=>{var z=L(),G=D(z);{let Z=_(()=>({props:c(F),wrapperProps:W(),...g.snippetProps}));st(G,()=>t.child,()=>c(Z))}A(J,z)},q=J=>{var z=Pl();ue(z,()=>({...W()}));var G=R(z);ue(G,()=>({...c(F)}));var Z=R(G);st(Z,()=>t.children??pt),M(G),M(z),A(J,z)};at(H,J=>{t.child?J(X):J(q,!1)})}A(O,I)},$$slots:{popper:!0}}))},C=S=>{bl(S,Mt(()=>c(v),()=>g.popperProps,{get ref(){return g.opts.ref},get open(){return g.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:h,get trapFocus(){return f()},get loop(){return s()},forceMount:!1,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(O,k)=>{let j=()=>k?.().props,W=()=>k?.().wrapperProps;const F=_(()=>qt(j(),{style:$r("dropdown-menu")},{style:t.style}));var I=L(),H=D(I);{var X=J=>{var z=L(),G=D(z);{let Z=_(()=>({props:c(F),wrapperProps:W(),...g.snippetProps}));st(G,()=>t.child,()=>c(Z))}A(J,z)},q=J=>{var z=Cl();ue(z,()=>({...W()}));var G=R(z);ue(G,()=>({...c(F)}));var Z=R(G);st(Z,()=>t.children??pt),M(G),M(z),A(J,z)};at(H,J=>{t.child?J(X):J(q,!1)})}A(O,I)},$$slots:{popper:!0}}))};at(b,S=>{u()?S(E):u()||S(C,1)})}A(e,y),dt()}var kl=K("<button><!></button>");function Ml(e,t){const n=gn();ut(t,!0);let r=x(t,"id",19,()=>pn(n)),i=x(t,"ref",15,null),s=x(t,"disabled",3,!1),o=x(t,"type",3,"button"),a=ie(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=ar.create({id:T(()=>r()),disabled:T(()=>s()??!1),ref:T(()=>i(),f=>i(f))}),u=_(()=>qt(a,l.props,{type:o()}));vl(e,{get id(){return r()},get ref(){return l.opts.ref},children:(f,d)=>{var g=L(),v=D(g);{var p=y=>{var b=L(),E=D(b);st(E,()=>t.child,()=>({props:c(u)})),A(y,b)},h=y=>{var b=kl();ue(b,()=>({...c(u)}));var E=R(b);st(E,()=>t.children??pt),M(b),A(y,b)};at(v,y=>{t.child?y(p):y(h,!1)})}A(f,g)},$$slots:{default:!0}}),dt()}const Fl=Tl,Rl=Ml,Dl=ua,Il=_l,ei=Al,Nl=Ol;function Rn(e,t){const n=me(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 4v16"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}],["path",{d:"M9 20h6"}]];ve(e,Mt({name:"type"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);pe(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Dn(e,t){const n=me(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];ve(e,Mt({name:"calendar"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);pe(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function In(e,t){const n=me(t,["children","$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["circle",{cx:"12",cy:"12",r:"1"}]];ve(e,Mt({name:"circle-dot"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);pe(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Nn(e,t){const n=me(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];ve(e,Mt({name:"link"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);pe(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Ll(e,t){const n=me(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];ve(e,Mt({name:"tag"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);pe(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Bl(e,t){const n=me(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];ve(e,Mt({name:"check"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);pe(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Wl(e,t){const n=me(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m15 18-6-6 6-6"}]];ve(e,Mt({name:"chevron-left"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);pe(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}var zl=K('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Vl=K('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),Kl=K('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Hl=K("<!> <!> <!>",1),Ul=K("<!> <!>",1),jl=K('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Yl=K('<button><span class="ip-status-dot svelte-x7sio8"></span> </button>'),Gl=K('<div class="ip-status-wrap svelte-x7sio8"><div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div> <div class="ip-status-dropdown svelte-x7sio8"></div></div>'),Xl=K('<span class="ip-cal-wd svelte-x7sio8"> </span>'),ql=K("<button> </button>"),Zl=K('<div class="ip-cal-week svelte-x7sio8"></div>'),Jl=K('<div class="ip-cal-wrap svelte-x7sio8"><span class="ip-date-text svelte-x7sio8"> </span> <div class="ip-cal-dropdown svelte-x7sio8"><div class="ip-cal-header svelte-x7sio8"><button class="ip-cal-nav svelte-x7sio8"><!></button> <span class="ip-cal-title svelte-x7sio8"> </span> <button class="ip-cal-nav svelte-x7sio8"><!></button></div> <div class="ip-cal-weekdays svelte-x7sio8"></div> <!></div></div>'),Ql=K('<span class="ip-badge svelte-x7sio8"> </span>'),$l=K('<button class="ip-wikilink-chip svelte-x7sio8"> </button>'),tu=K('<div class="ip-wikilink-group svelte-x7sio8"></div>'),eu=K('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),nu=K('<span class="ip-date-text svelte-x7sio8"> </span>'),ru=K('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),iu=K('<span class="ip-text-value svelte-x7sio8"> </span>'),ou=K('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),su=K('<div class="ip-row ip-add-row svelte-x7sio8"><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"><input class="ip-add-key-input svelte-x7sio8" type="text" placeholder="Property name"/></div> <div class="ip-value svelte-x7sio8"></div></div>'),au=K('<button class="ip-add-btn svelte-x7sio8"><!> <span>Add property</span></button>'),cu=K('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function Iu(e,t){ut(t,!0);let n=x(t,"editable",3,!1);const r=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],i=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let s=B(null),o=B(!1),a=B(""),l=B(void 0);function u(P){switch(P.toLowerCase()){case"active":case"current":case"won":return"#3ecf8e";case"in-progress":case"open":return"#f0c246";case"inactive":case"lost":case"closed":case"former":return"#e54d4d";default:return"#5c5c66"}}function f(P){for(const w of Gn.repos){const rt=w.entities.find(Ct=>Ct.id===P);if(rt){Bo(`/${w.name}/${rt.entityType}/${rt.id}`);return}}}function d(P){return typeof P.value=="string"?P.value:P.value[0]}function g(P){return/^https?:\/\//.test(P)}function v(P){try{return new Date(P).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return P}}let p=B(Xt(new Date().getFullYear())),h=B(Xt(new Date().getMonth()));const y=["Su","Mo","Tu","We","Th","Fr","Sa"],b=["January","February","March","April","May","June","July","August","September","October","November","December"];function E(P,w){const rt=new Date(P,w,1).getDay(),Ct=new Date(P,w+1,0).getDate(),oe=new Date(P,w,0).getDate(),xt=[];let bt=[];for(let Ft=rt-1;Ft>=0;Ft--){const Pe=oe-Ft,se=w===0?11:w-1,xn=w===0?P-1:P;bt.push({day:Pe,month:se,year:xn,outside:!0})}for(let Ft=1;Ft<=Ct;Ft++)bt.push({day:Ft,month:w,year:P,outside:!1}),bt.length===7&&(xt.push(bt),bt=[]);if(bt.length>0){const Ft=w===11?0:w+1,Pe=w===11?P+1:P;let se=1;for(;bt.length<7;)bt.push({day:se++,month:Ft,year:Pe,outside:!0});xt.push(bt)}return xt}function C(P){const w=new Date;return P.day===w.getDate()&&P.month===w.getMonth()&&P.year===w.getFullYear()}function S(P,w){const rt=w.slice(0,10).split("-");return P.year===+rt[0]&&P.month===+rt[1]-1&&P.day===+rt[2]}function N(){c(h)===0?(m(h,11),Xe(p,-1)):Xe(h,-1)}function O(){c(h)===11?(m(h,0),Xe(p)):Xe(h)}function k(P){try{const w=P.slice(0,10).split("-");m(p,+w[0]),m(h,+w[1]-1)}catch{const w=new Date;m(p,w.getFullYear(),!0),m(h,w.getMonth(),!0)}}function j(P){requestAnimationFrame(()=>{P.focus(),P.select()})}function W(P){!n()||P.type==="badge"||(P.type==="date"&&k(d(P)),m(s,P.key,!0))}function F(P,w){t.onedit&&t.onedit(P,w),m(s,null)}function I(P,w){const rt=`${w.year}-${String(w.month+1).padStart(2,"0")}-${String(w.day).padStart(2,"0")}`;t.onedit&&t.onedit(P,rt),m(s,null)}function H(P,w){t.ontypechange&&t.ontypechange(P,w)}function X(P){m(s,null),t.onremove&&t.onremove(P)}function q(){m(o,!0),m(a,""),requestAnimationFrame(()=>c(l)?.focus())}function J(){const P=c(a).trim();P&&t.onadd&&t.onadd(P,""),m(o,!1),m(a,"")}function z(){m(o,!1),m(a,"")}function G(P){P.key==="Enter"?(P.preventDefault(),J()):P.key==="Escape"&&z()}var Z=cu();De("click",Mo,()=>{m(s,null)});var At=R(Z);Yt(At,17,()=>t.properties,P=>P.key,(P,w)=>{const rt=_(()=>c(s)===c(w).key);var Ct=ou();let oe;var xt=R(Ct),bt=R(xt);{var Ft=$=>{var Q=L(),tt=D(Q);ae(tt,()=>Fl,(Et,Rt)=>{Rt(Et,{children:(_t,Dt)=>{var It=Ul(),Y=D(It);ae(Y,()=>Rl,(U,V)=>{V(U,{class:"ip-icon-trigger",children:(it,ot)=>{var et=L(),Ot=D(et);{var gt=ft=>{Dn(ft,{size:14})},Ut=ft=>{In(ft,{size:14})},jt=ft=>{Nn(ft,{size:14})},$t=ft=>{Rn(ft,{size:14})};at(Ot,ft=>{c(w).type==="date"?ft(gt):c(w).type==="status"?ft(Ut,1):c(w).type==="wikilink"?ft(jt,2):ft($t,!1)})}A(it,et)},$$slots:{default:!0}})});var kt=nt(Y,2);ae(kt,()=>Dl,(U,V)=>{V(U,{children:(it,ot)=>{var et=L(),Ot=D(et);ae(Ot,()=>Il,(gt,Ut)=>{Ut(gt,{class:"ip-menu-content",sideOffset:4,align:"start",children:(jt,$t)=>{var ft=Hl(),He=D(ft);Yt(He,17,()=>r,te,(Ce,Nt)=>{var je=L(),Ar=D(je);ae(Ar,()=>ei,(Ye,Ge)=>{Ge(Ye,{class:"ip-menu-item",onSelect:()=>H(c(w).key,c(Nt).type),children:(An,mu)=>{var Er=Vl(),En=D(Er),uo=R(En);{var fo=mt=>{Rn(mt,{size:13})},ho=mt=>{Dn(mt,{size:13})},go=mt=>{In(mt,{size:13})},vo=mt=>{Nn(mt,{size:13})};at(uo,mt=>{c(Nt).type==="text"?mt(fo):c(Nt).type==="date"?mt(ho,1):c(Nt).type==="status"?mt(go,2):c(Nt).type==="wikilink"&&mt(vo,3)})}M(En);var On=nt(En,2),po=R(On,!0);M(On);var mo=nt(On,2);{var yo=mt=>{var Tn=zl(),wo=R(Tn);Bl(wo,{size:12}),M(Tn),A(mt,Tn)};at(mo,mt=>{c(w).type===c(Nt).type&&mt(yo)})}yt(()=>ht(po,c(Nt).label)),A(An,Er)},$$slots:{default:!0}})}),A(Ce,je)});var Ue=nt(He,2);ae(Ue,()=>Nl,(Ce,Nt)=>{Nt(Ce,{class:"ip-menu-sep"})});var lo=nt(Ue,2);ae(lo,()=>ei,(Ce,Nt)=>{Nt(Ce,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>X(c(w).key),children:(je,Ar)=>{var Ye=Kl(),Ge=D(Ye),An=R(Ge);Io(An,{size:13}),M(Ge),Pn(2),A(je,Ye)},$$slots:{default:!0}})}),A(jt,ft)},$$slots:{default:!0}})}),A(it,et)},$$slots:{default:!0}})}),A(_t,It)},$$slots:{default:!0}})}),A($,Q)},Pe=$=>{var Q=L(),tt=D(Q);{var Et=Y=>{Dn(Y,{size:14})},Rt=Y=>{In(Y,{size:14})},_t=Y=>{Nn(Y,{size:14})},Dt=Y=>{Ll(Y,{size:14})},It=Y=>{Rn(Y,{size:14})};at(tt,Y=>{c(w).type==="date"?Y(Et):c(w).type==="status"?Y(Rt,1):c(w).type==="wikilink"?Y(_t,2):c(w).type==="badge"?Y(Dt,3):Y(It,!1)})}A($,Q)};at(bt,$=>{n()&&c(w).type!=="badge"?$(Ft):$(Pe,!1)})}M(xt);var se=nt(xt,2),xn=R(se,!0);M(se);var Sn=nt(se,2),ro=R(Sn);{var io=$=>{var Q=jl();Bn(Q),jo(Q,tt=>j?.(tt)),yt(tt=>No(Q,tt),[()=>d(c(w))]),De("blur",Q,tt=>{const Et=tt.currentTarget.value;Et!==d(c(w))&&t.onedit?.(c(w).key,Et),m(s,null)}),wt("keydown",Q,tt=>{tt.key==="Enter"?tt.currentTarget.blur():tt.key==="Escape"&&(tt.currentTarget.value=d(c(w)),m(s,null))}),A($,Q)},oo=$=>{var Q=Gl(),tt=R(Q),Et=R(tt);let Rt;var _t=nt(Et,2),Dt=R(_t,!0);M(_t),M(tt);var It=nt(tt,2);Yt(It,21,()=>i,te,(Y,kt)=>{var U=Yl();let V;var it=R(U);let ot;var et=nt(it);M(U),yt((Ot,gt)=>{V=Qe(U,1,"ip-status-option svelte-x7sio8",null,V,Ot),ot=_n(it,"",ot,gt),ht(et,` ${c(kt)??""}`)},[()=>({selected:d(c(w))===c(kt)}),()=>({background:u(c(kt))})]),wt("click",U,()=>F(c(w).key,c(kt))),A(Y,U)}),M(It),M(Q),yt((Y,kt)=>{Rt=_n(Et,"",Rt,Y),ht(Dt,kt)},[()=>({background:u(d(c(w)))}),()=>d(c(w))]),wt("click",Q,Y=>Y.stopPropagation()),A($,Q)},so=$=>{var Q=Jl(),tt=R(Q),Et=R(tt,!0);M(tt);var Rt=nt(tt,2),_t=R(Rt),Dt=R(_t),It=R(Dt);Wl(It,{size:14}),M(Dt);var Y=nt(Dt,2),kt=R(Y);M(Y);var U=nt(Y,2),V=R(U);Vo(V,{size:14}),M(U),M(_t);var it=nt(_t,2);Yt(it,21,()=>y,te,(et,Ot)=>{var gt=Xl(),Ut=R(gt,!0);M(gt),yt(()=>ht(Ut,c(Ot))),A(et,gt)}),M(it);var ot=nt(it,2);Yt(ot,17,()=>E(c(p),c(h)),te,(et,Ot)=>{var gt=Zl();Yt(gt,21,()=>c(Ot),te,(Ut,jt)=>{var $t=ql();let ft;var He=R($t,!0);M($t),yt(Ue=>{ft=Qe($t,1,"ip-cal-day svelte-x7sio8",null,ft,Ue),ht(He,c(jt).day)},[()=>({outside:c(jt).outside,today:C(c(jt)),selected:S(c(jt),d(c(w)))})]),wt("click",$t,()=>I(c(w).key,c(jt))),A(Ut,$t)}),M(gt),A(et,gt)}),M(Rt),M(Q),yt(et=>{ht(Et,et),ht(kt,`${b[c(h)]??""} ${c(p)??""}`)},[()=>v(d(c(w)))]),wt("click",Q,et=>et.stopPropagation()),wt("click",Dt,N),wt("click",U,O),A($,Q)},ao=$=>{{let Q=_(()=>Array.isArray(c(w).value));Zo($,{get value(){return c(w).value},get multi(){return c(Q)},onselect:tt=>{t.onedit?.(c(w).key,tt),m(s,null)},oncancel:()=>{m(s,null)}})}},co=$=>{var Q=L(),tt=D(Q);{var Et=U=>{var V=Ql(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>d(c(w))]),A(U,V)},Rt=U=>{var V=tu();Yt(V,21,()=>Array.isArray(c(w).value)?c(w).value:[c(w).value],te,(it,ot)=>{var et=$l(),Ot=R(et,!0);M(et),yt(()=>ht(Ot,c(ot))),wt("click",et,gt=>{gt.stopPropagation(),f(c(ot))}),A(it,et)}),M(V),A(U,V)},_t=U=>{var V=eu(),it=R(V);let ot;var et=nt(it,2),Ot=R(et,!0);M(et),M(V),yt((gt,Ut)=>{ot=_n(it,"",ot,gt),ht(Ot,Ut)},[()=>({background:u(d(c(w)))}),()=>d(c(w))]),A(U,V)},Dt=U=>{var V=nu(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>v(d(c(w)))]),A(U,V)},It=U=>{var V=ru(),it=R(V,!0);M(V),yt((ot,et)=>{Lo(V,"href",ot),ht(it,et)},[()=>d(c(w)),()=>d(c(w))]),wt("click",V,ot=>ot.stopPropagation()),A(U,V)},Y=_(()=>g(d(c(w)))),kt=U=>{var V=iu(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>d(c(w))]),A(U,V)};at(tt,U=>{c(w).type==="badge"?U(Et):c(w).type==="wikilink"?U(Rt,1):c(w).type==="status"?U(_t,2):c(w).type==="date"?U(Dt,3):c(Y)?U(It,4):U(kt,!1)})}A($,Q)};at(ro,$=>{c(rt)&&c(w).type==="text"?$(io):c(rt)&&c(w).type==="status"?$(oo,1):c(rt)&&c(w).type==="date"?$(so,2):c(rt)&&c(w).type==="wikilink"?$(ao,3):$(co,!1)})}M(Sn),M(Ct),yt(()=>{oe=Qe(Ct,1,"ip-row svelte-x7sio8",null,oe,{"ip-focused":c(rt)}),ht(xn,c(w).key)}),wt("click",xt,$=>$.stopPropagation()),wt("click",Sn,$=>{$.stopPropagation(),W(c(w))}),A(P,Ct)});var Te=nt(At,2);{var eo=P=>{var w=su(),rt=R(w),Ct=R(rt);Pr(Ct,{size:14}),M(rt);var oe=nt(rt,2),xt=R(oe);Bn(xt),Yn(xt,bt=>m(l,bt),()=>c(l)),M(oe),Pn(2),M(w),wt("keydown",xt,G),De("blur",xt,z),ci(xt,()=>c(a),bt=>m(a,bt)),A(P,w)},no=P=>{var w=au(),rt=R(w);Pr(rt,{size:14}),Pn(2),M(w),wt("click",w,Ct=>{Ct.stopPropagation(),q()}),A(P,w)};at(Te,P=>{c(o)?P(eo):n()&&P(no,1)})}M(Z),A(e,Z),dt()}ri(["click","keydown"]);var lu=K('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div></div>');function Nu(e,t){ut(t,!0);let n=x(t,"readonly",3,!0),r=x(t,"resetKey",3,0);const i=Ln("theme");let s,o=null,a=t.content,l=!1;function u(g,v){return g.theme({"&":{backgroundColor:"transparent",color:"var(--color-text-primary)",fontSize:"15px",fontFamily:"var(--font-sans)"},".cm-content":{padding:"32px 40px",fontFamily:"var(--font-sans)",caretColor:"var(--color-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:v?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:v?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},".cm-header-1":{fontSize:"22px",fontWeight:"600"},".cm-header-2":{fontSize:"16px",fontWeight:"600"},".cm-header-3":{fontSize:"15px",fontWeight:"600"},".cm-formatting":{color:"var(--color-text-tertiary)",opacity:"0.5"},".cm-link":{color:"var(--color-link)",textDecoration:"none"}},{dark:v})}si(async()=>{const{EditorState:g}=await be(async()=>{const{EditorState:F}=await import("./DnlgZ_Tk.js");return{EditorState:F}},[],import.meta.url),{EditorView:v,keymap:p}=await be(async()=>{const{EditorView:F,keymap:I}=await import("./DtVH--hH.js").then(H=>H.i);return{EditorView:F,keymap:I}},__vite__mapDeps([0,1]),import.meta.url),{markdown:h}=await be(async()=>{const{markdown:F}=await import("./Dh_H7Owr.js");return{markdown:F}},__vite__mapDeps([2,1,0,3,4]),import.meta.url),{syntaxHighlighting:y,HighlightStyle:b}=await be(async()=>{const{syntaxHighlighting:F,HighlightStyle:I}=await import("./4QY4j-jX.js");return{syntaxHighlighting:F,HighlightStyle:I}},__vite__mapDeps([3,4,1,0]),import.meta.url),{tags:E}=await be(async()=>{const{tags:F}=await import("./CUzqHQY_.js").then(I=>I.i);return{tags:F}},[],import.meta.url),{livePreviewPlugin:C,livePreviewTheme:S}=await be(async()=>{const{livePreviewPlugin:F,livePreviewTheme:I}=await import("./aosHekRC.js");return{livePreviewPlugin:F,livePreviewTheme:I}},__vite__mapDeps([5,0,1,3,4]),import.meta.url),N=i.current==="dark",O=u(v,N),k=b.define([{tag:E.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),j=[h(),O,y(k),C,S,v.lineWrapping];n()&&j.push(g.readOnly.of(!0)),t.onchange&&j.push(v.updateListener.of(F=>{if(F.docChanged&&!l){const I=F.state.doc.toString();a=I,t.onchange(I)}})),j.push(v.domEventHandlers({click(F){const I=F.target;if(t.onwikilinkclick){const X=I.closest(".cm-live-wikilink");if(X){F.preventDefault();const q=X.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return q&&t.onwikilinkclick(q),!0}}const H=I.closest(".cm-live-link");if(H){const X=H.getAttribute("data-href");if(X)return F.preventDefault(),window.open(X,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&j.push(p.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const W=g.create({doc:t.content,extensions:j});o=new v({state:W,parent:s})}),vt(()=>{if(r(),o&&t.content!==a){a=t.content;const g=s.closest(".document-scroll"),v=g?.scrollTop??0;l=!0,o.dispatch({changes:{from:0,to:o.state.doc.length,insert:t.content}}),l=!1,g&&requestAnimationFrame(()=>{g.scrollTop=v})}}),Fo(()=>{o?.destroy()});var f=lu(),d=R(f);Yn(d,g=>s=g,()=>s),M(f),A(e,f),dt()}const uu=/^\d{4}-\d{2}-\d{2}/,du=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),fu=new Set(["entity_type","format"]),hu=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Lu(e,t){const n=[];for(const[r,i]of Object.entries(e)){if(hu.has(r)||i==null)continue;const s=gu(r,i);s&&n.push(s)}return n}function gu(e,t){if(fu.has(e))return{key:e,value:String(t).toUpperCase(),type:"badge"};if(e==="status")return{key:e,value:String(t),type:"status"};if(Array.isArray(t)){const i=t.map(String),s=i.some(a=>/^\[\[.+?\]\]$/.test(a)),o=i.map(a=>{const l=a.match(/^\[\[(.+?)\]\]$/);return l?l[1]:a});return s||o.every(a=>ni(a))?{key:e,value:o,type:"wikilink"}:{key:e,value:i.join(", "),type:"text"}}const n=String(t),r=n.match(/^\[\[(.+?)\]\]$/);return r?{key:e,value:r[1],type:"wikilink"}:uu.test(n)?{key:e,value:n,type:"date"}:du.has(n.toLowerCase())?{key:e,value:n,type:"status"}:ni(n)&&!n.includes(" ")?{key:e,value:n,type:"wikilink"}:{key:e,value:n,type:"text"}}function ni(e){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(e)&&e.includes("-")}const vu=800;function pu(){let e=B(!1),t=B(null),n=B(null),r=null,i=null,s=null,o=!1;function a(h,y,b,E){r&&r.repo===h&&r.type===y&&r.id===b?(E.data!==void 0&&(r.payload.data=E.data),E.content!==void 0&&(r.payload.content=E.content)):r={repo:h,type:y,id:b,payload:{...E}},i=null,u()}function l(h,y,b,E,C){i={repo:h,type:y,id:b,filePath:E,content:C},r=null,u()}function u(){s&&clearTimeout(s),s=setTimeout(f,vu)}async function f(){if(s=null,!o){if(r){const{repo:h,type:y,id:b,payload:E}=r;r=null,o=!0,m(e,!0),m(n,null);try{if(await Tr(h,y,b,E),m(t,new Date,!0),E.data?.name){const S=Gn.repos.find(N=>N.name===h)?.entities.find(N=>N.id===b);S&&(S.title=E.data.name)}d()}catch(C){m(n,C.message??"Save failed",!0),r={repo:h,type:y,id:b,payload:E}}finally{m(e,!1),o=!1,(r||i)&&f()}}else if(i){const{repo:h,type:y,id:b,filePath:E,content:C}=i;i=null,o=!0,m(e,!0),m(n,null);try{await Wo(h,y,b,E,C),m(t,new Date,!0),d()}catch(S){m(n,S.message??"Save failed",!0),i={repo:h,type:y,id:b,filePath:E,content:C}}finally{m(e,!1),o=!1,(r||i)&&f()}}}}function d(){Cr.refresh()}function g(){s&&(clearTimeout(s),s=null),(r||i)&&f()}async function v(h,y,b,E){m(e,!0),m(n,null);try{const C=await Tr(h,y,b,E);return m(t,new Date,!0),await Cr.refresh(),C}catch(C){return m(n,C.message??"Save failed",!0),null}finally{m(e,!1)}}function p(){m(n,null),m(t,null),r=null,i=null,s&&(clearTimeout(s),s=null)}return{get saving(){return c(e)},get lastSaved(){return c(t)},get error(){return c(n)},get hasPending(){return!!(r||i||o)},scheduleAutoSave:a,scheduleContentFileSave:l,flush:g,saveEntity:v,reset:p}}const Bu=pu();export{Nu as C,Iu as I,Bu as e,Lu as t};
5
+ `," ")}const As=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],Es=new Set(As);function Os(e){return Es.has(e)}function Xt(...e){const t={...e[0]};for(let n=1;n<e.length;n++){const r=e[n];if(r){for(const i of Object.keys(r)){const s=t[i],o=r[i],a=typeof s=="function",l=typeof o=="function";if(a&&Os(i)){const u=s,f=o;t[i]=ui(u,f)}else if(a&&l)t[i]=de(s,o);else if(i==="class"){const u=Wn(s),f=Wn(o);u&&f?t[i]=Cn(s,o):u?t[i]=Cn(s):f&&(t[i]=Cn(o))}else if(i==="style"){const u=typeof s=="object",f=typeof o=="object",d=typeof s=="string",g=typeof o=="string";if(u&&f)t[i]={...s,...o};else if(u&&g){const v=Re(o);t[i]={...s,...v}}else if(d&&f){const v=Re(s);t[i]={...v,...o}}else if(d&&g){const v=Re(s),p=Re(o);t[i]={...v,...p}}else u?t[i]=s:f?t[i]=o:d?t[i]=s:g&&(t[i]=o)}else t[i]=o!==void 0?o:s}for(const i of Object.getOwnPropertySymbols(r)){const s=t[i],o=r[i];t[i]=o!==void 0?o:s}}}return typeof t.style=="object"&&(t.style=fi(t.style).replaceAll(`
6
+ `," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const hi=typeof window<"u"?window:void 0;function Ts(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Ps extends Map{#t=new Map;#e=B(0);#n=B(0);#r=Or||-1;constructor(t){if(super(),t){for(var[n,r]of t)super.set(n,r);this.#n.v=super.size}}#i(t){return Or===this.#r?B(t):To(t)}has(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else return c(this.#e),!1;return c(r),!0}forEach(t,n){this.#o(),super.forEach(t,n)}get(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else{c(this.#e);return}return c(r),super.get(t)}set(t,n){var r=this.#t,i=r.get(t),s=super.get(t),o=super.set(t,n),a=this.#e;if(i===void 0)i=this.#i(0),r.set(t,i),m(this.#n,super.size),_e(a);else if(s!==n){_e(i);var l=a.reactions===null?null:new Set(a.reactions),u=l===null||!i.reactions?.every(f=>l.has(f));u&&_e(a)}return o}delete(t){var n=this.#t,r=n.get(t),i=super.delete(t);return r!==void 0&&(n.delete(t),m(r,-1)),i&&(m(this.#n,super.size),_e(this.#e)),i}clear(){if(super.size!==0){super.clear();var t=this.#t;m(this.#n,0);for(var n of t.values())m(n,-1);_e(this.#e),t.clear()}}#o(){c(this.#e);var t=this.#t;if(this.#n.v!==t.size){for(var n of super.keys())if(!t.has(n)){var r=this.#i(0);t.set(n,r)}}for([,r]of this.#t)c(r)}keys(){return c(this.#e),super.keys()}values(){return this.#o(),super.values()}entries(){return this.#o(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return c(this.#n),super.size}}class Cs{#t;#e;constructor(t={}){const{window:n=hi,document:r=n?.document}=t;n!==void 0&&(this.#t=r,this.#e=ai(i=>{const s=lt(n,"focusin",i),o=lt(n,"focusout",i);return()=>{s(),o()}}))}get current(){return this.#e?.(),this.#t?Ts(this.#t):null}}new Cs;function _s(e){return typeof e=="function"}class we{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return Po(this.#e)}get(){const t=Ln(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const n=Ln(this.#e);return n===void 0?t:n}set(t){return Co(this.#e,t)}}function ks(e,t){switch(e){case"post":vt(t);break;case"pre":_o(t);break}}function gi(e,t,n,r={}){const{lazy:i=!1}=r;let s=!i,o=Array.isArray(e)?[]:void 0;ks(t,()=>{const a=Array.isArray(e)?e.map(u=>u()):e();if(!s){s=!0,o=a;return}const l=tn(()=>n(a,o));return o=a,l})}function St(e,t,n){gi(e,"post",t,n)}function Ms(e,t,n){gi(e,"pre",t,n)}St.pre=Ms;function Rr(e){return _s(e)?e():e}class Fs{#t={width:0,height:0};#e=!1;#n;#r;#i;#o=_(()=>(c(this.#s)?.(),this.getSize().width));#a=_(()=>(c(this.#s)?.(),this.getSize().height));#s=_(()=>{const t=Rr(this.#r);if(t)return ai(n=>{if(!this.#i)return;const r=new this.#i.ResizeObserver(i=>{this.#e=!0;for(const s of i){const o=this.#n.box==="content-box"?s.contentBoxSize:s.borderBoxSize,a=Array.isArray(o)?o:[o];this.#t.width=a.reduce((l,u)=>Math.max(l,u.inlineSize),0),this.#t.height=a.reduce((l,u)=>Math.max(l,u.blockSize),0)}n()});return r.observe(t),()=>{this.#e=!1,r.disconnect()}})});constructor(t,n={box:"border-box"}){this.#i=n.window??hi,this.#n=n,this.#r=t,this.#t={width:0,height:0}}calculateSize(){const t=Rr(this.#r);if(!t||!this.#i)return;const n=t.offsetWidth,r=t.offsetHeight;if(this.#n.box==="border-box")return{width:n,height:r};const i=this.#i.getComputedStyle(t),s=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),o=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),a=parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),l=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),u=n-s-a,f=r-o-l;return{width:u,height:f}}getSize(){return this.#e?this.#t:this.calculateSize()??this.#t}get current(){return c(this.#s)?.(),this.getSize()}get width(){return c(this.#o)}get height(){return c(this.#a)}}function ze(e){vt(()=>()=>{e()})}function Rs(e,t){return setTimeout(t,e)}function Gt(e){ii().then(e)}const Ds=1,Is=9,Ns=11;function zn(e){return Be(e)&&e.nodeType===Ds&&typeof e.nodeName=="string"}function vi(e){return Be(e)&&e.nodeType===Is}function Ls(e){return Be(e)&&e.constructor?.name==="VisualViewport"}function Bs(e){return Be(e)&&e.nodeType!==void 0}function pi(e){return Bs(e)&&e.nodeType===Ns&&"host"in e}function Ws(e,t){if(!e||!t||!zn(e)||!zn(t))return!1;const n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&pi(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ve(e){return vi(e)?e:Ls(e)?e.document:e?.ownerDocument??document}function Xn(e){return pi(e)?Xn(e.host):vi(e)?e.defaultView??window:zn(e)?e.ownerDocument?.defaultView??window:window}function zs(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Zn{element;#t=_(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return c(this.#t)}set root(t){m(this.#t,t)}constructor(t){typeof t=="function"?this.element=T(t):this.element=t}getDocument=()=>Ve(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>zs(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,n)=>this.getWindow().setTimeout(t,n);clearTimeout=t=>this.getWindow().clearTimeout(t)}function fe(e,t){return{[Ko()]:n=>We(e)?(e.current=n,tn(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),tn(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e(null),t?.(null))})}}function mi(e){return e?"true":"false"}function yi(e){return e?"":void 0}function wi(e){return e?"open":"closed"}class Vs{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(n=>[n,this.getAttr(n)]))}getAttr(t,n){return n?`data-${n}-${t}`:`${this.#e}${t}`}selector(t,n){return`[${this.getAttr(t,n)}]`}}function Ks(e){const t=new Vs(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const Ne="ArrowDown",Jn="ArrowLeft",Qn="ArrowRight",en="ArrowUp",bi="End",xi="Enter",Hs="Escape",Si="Home",Us="PageDown",js="PageUp",$n=" ",Ys="Tab";function Gs(e){return window.getComputedStyle(e).getPropertyValue("direction")}function qs(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?Jn:Qn,vertical:Ne}[t]}function Xs(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?Qn:Jn,vertical:en}[t]}function Zs(e="ltr",t="horizontal"){return["ltr","rtl"].includes(e)||(e="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:qs(e,t),prevKey:Xs(e,t)}}const Ai=typeof document<"u",Dr=Js();function Js(){return Ai&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Zt(e){return e instanceof HTMLElement}function Vn(e){return e instanceof Element}function Ei(e){return e instanceof Element||e instanceof SVGElement}function Qs(e){return e!==null}function $s(e){return e instanceof HTMLInputElement&&"select"in e}class ta{#t;#e=ye(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,n,r=!1){const i=this.#t.rootNode.current;if(!i||!t)return;const s=this.getCandidateNodes();if(!s.length)return;const o=s.indexOf(t),a=Gs(i),{nextKey:l,prevKey:u}=Zs(a,this.#t.orientation.current),f=this.#t.loop.current,d={[l]:o+1,[u]:o-1,[Si]:0,[bi]:s.length-1};if(r){const p=l===Ne?Qn:Ne,h=u===en?Jn:en;d[p]=o+1,d[h]=o-1}let g=d[n.key];if(g===void 0)return;n.preventDefault(),g<0&&f?g=s.length-1:g===s.length&&f&&(g=0);const v=s[g];if(v)return v.focus(),this.#e.current=v.id,this.#t.onCandidateFocus?.(v),v}getTabIndex(t){const n=this.getCandidateNodes(),r=this.#e.current!==null;return t&&!r&&n[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const n=this.#t.rootNode.current?.querySelector(`#${t}`);!n||!Zt(n)||n.focus()}}class ea{#t;#e=null;constructor(t){this.#t=t,ze(()=>this.#n())}#n(){this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null)}run(t){this.#n();const n=this.#t.ref.current;if(n){if(typeof n.getAnimations!="function"){this.#r(t);return}this.#e=window.requestAnimationFrame(()=>{const r=n.getAnimations();if(r.length===0){this.#r(t);return}Promise.allSettled(r.map(i=>i.finished)).then(()=>{this.#r(t)})})}}#r(t){const n=()=>{t()};this.#t.afterTick?Gt(n):n()}}class na{#t;#e;#n;#r=B(!1);constructor(t){this.#t=t,m(this.#r,t.open.current,!0),this.#e=t.enabled??!0,this.#n=new ea({ref:this.#t.ref,afterTick:this.#t.open}),St(()=>this.#t.open.current,n=>{n&&m(this.#r,!0),this.#e&&this.#n.run(()=>{n===this.#t.open.current&&(this.#t.open.current||m(this.#r,!1),this.#t.onComplete?.())})})}get shouldRender(){return c(this.#r)}}function ct(){}function pn(e,t){return`bits-${e}`}function ra(e,t){var n=L(),r=D(n);Uo(r,()=>t.children,i=>{var s=L(),o=D(s);st(o,()=>t.children??pt),A(i,s)}),A(e,n)}const ia=new we("BitsConfig");function oa(){const e=new sa(null,{});return ia.getOr(e).opts}class sa{opts;constructor(t,n){const r=aa(t,n);this.opts={defaultPortalTo:r(i=>i.defaultPortalTo),defaultLocale:r(i=>i.defaultLocale)}}}function aa(e,t){return n=>T(()=>{const i=n(t)?.current;if(i!==void 0)return i;if(e!==null)return n(e.opts)?.current})}function ca(e,t){return n=>{const r=oa();return T(()=>{const i=n();if(i!==void 0)return i;const s=e(r).current;return s!==void 0?s:t})}}const la=ca(e=>e.defaultPortalTo,"body");function ua(e,t){ut(t,!0);const n=la(()=>t.to),r=ko();let i=_(s);function s(){if(!Ai||t.disabled)return null;let d=null;return typeof n.current=="string"?d=document.querySelector(n.current):d=n.current,d}let o;function a(){o&&(Do(o),o=null)}St([()=>c(i),()=>t.disabled],([d,g])=>{if(!d||g){a();return}return o=Ro(ra,{target:d,props:{children:t.children},context:r}),()=>{a()}});var l=L(),u=D(l);{var f=d=>{var g=L(),v=D(g);st(v,()=>t.children??pt),A(d,g)};at(u,d=>{t.disabled&&d(f)})}A(e,l),dt()}class da{eventName;options;constructor(t,n={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=n}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,n){const r=this.createEvent(n);return t.dispatchEvent(r),r}listen(t,n,r){const i=s=>{n(s)};return lt(t,this.eventName,i,r)}}function Ir(e,t=500){let n=null;const r=(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function Oi(e,t){return e===t||e.contains(t)}function Ti(e){return e?.ownerDocument??document}function fa(e,t){const{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}const ha=[xi,$n],ga=[Ne,js,Si],Pi=[en,Us,bi],va=[...ga,...Pi];function Nr(e){return e.pointerType==="mouse"}function pa(e,{select:t=!1}={}){if(!e||!e.focus)return;const n=Ve(e);if(n.activeElement===e)return;const r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&$s(e)&&t&&e.select()}function ma(e,{select:t=!1}={},n){const r=n();for(const i of e)if(pa(i,{select:t}),n()!==r)return!0}let ke=B(!1);class ee{static _refs=0;static _cleanup;constructor(){vt(()=>(ee._refs===0&&(ee._cleanup=oi(()=>{const t=[],n=i=>{m(ke,!1)},r=i=>{m(ke,!0)};return t.push(lt(document,"pointerdown",n,{capture:!0}),lt(document,"pointermove",n,{capture:!0}),lt(document,"keydown",r,{capture:!0})),de(...t)})),ee._refs++,()=>{ee._refs--,ee._refs===0&&(m(ke,!1),ee._cleanup?.())}))}get current(){return c(ke)}set current(t){m(ke,t,!0)}}var Ci=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],nn=Ci.join(","),_i=typeof Element>"u",he=_i?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,rn=!_i&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},on=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",o=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):on(t.parentNode));return o},ya=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},ki=function(t,n,r){if(on(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(nn));return n&&he.call(t,nn)&&i.unshift(t),i=i.filter(r),i},sn=function(t,n,r){for(var i=[],s=Array.from(t);s.length;){var o=s.shift();if(!on(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,u=sn(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:o,candidates:u})}else{var f=he.call(o,nn);f&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),g=!on(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&g){var v=sn(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,v):i.push({scopeParent:o,candidates:v})}else s.unshift.apply(s,o.children)}}return i},Mi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Fi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ya(t))&&!Mi(t)?0:t.tabIndex},wa=function(t,n){var r=Fi(t);return r<0&&n&&!Mi(t)?0:r},ba=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ri=function(t){return t.tagName==="INPUT"},xa=function(t){return Ri(t)&&t.type==="hidden"},Sa=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Aa=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Ea=function(t){if(!t.name)return!0;var n=t.form||rn(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=Aa(i,t.form);return!s||s===t},Oa=function(t){return Ri(t)&&t.type==="radio"},Ta=function(t){return Oa(t)&&!Ea(t)},Pa=function(t){var n,r=t&&rn(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&i;){var u,f,d;r=rn(i),i=(u=r)===null||u===void 0?void 0:u.host,s=!!((f=i)!==null&&f!==void 0&&(d=f.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return s},Lr=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},Ca=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var o=he.call(t,"details>summary:first-of-type"),a=o?t.parentElement:t;if(he.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=rn(t);if(u&&!u.shadowRoot&&i(u)===!0)return Lr(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(Pa(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Lr(t);return!1},_a=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return he.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},an=function(t,n){return!(n.disabled||xa(n)||Ca(n,t)||Sa(n)||_a(n))},Kn=function(t,n){return!(Ta(n)||Fi(n)<0||!an(t,n))},ka=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Di=function(t){var n=[],r=[];return t.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=wa(a,o),u=o?Di(i.candidates):a;l===0?o?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:u})}),r.sort(ba).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Ii=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sn([t],n.includeContainer,{filter:Kn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ka}):r=ki(t,n.includeContainer,Kn.bind(null,n)),Di(r)},Ni=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sn([t],n.includeContainer,{filter:an.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=ki(t,n.includeContainer,an.bind(null,n)),r},tr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return he.call(t,nn)===!1?!1:Kn(n,t)},Ma=Ci.concat("iframe:not([inert]):not([inert] *)").join(","),Li=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return he.call(t,Ma)===!1?!1:an(n,t)};function Ie(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Fa(e,t){if(!tr(e,Ie()))return Ra(e,t);const n=Ve(e),r=Ii(n.body,Ie());t==="prev"&&r.reverse();const i=r.indexOf(e);return i===-1?n.body:r.slice(i+1)[0]}function Ra(e,t){const n=Ve(e);if(!Li(e,Ie()))return n.body;const r=Ni(n.body,Ie());t==="prev"&&r.reverse();const i=r.indexOf(e);return i===-1?n.body:r.slice(i+1).find(o=>tr(o,Ie()))??n.body}function Bi(e,t,n){const r=t.toLowerCase();if(r.endsWith(" ")){const d=r.slice(0,-1);if(e.filter(h=>h.toLowerCase().startsWith(d)).length<=1)return Bi(e,d,n);const v=n?.toLowerCase();if(v&&v.startsWith(d)&&v.charAt(d.length)===" "&&t.trim()===d)return n;const p=e.filter(h=>h.toLowerCase().startsWith(r));if(p.length>0){const h=n?e.indexOf(n):-1;return Br(p,Math.max(h,0)).find(E=>E!==n)||n}}const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=s.toLowerCase(),a=n?e.indexOf(n):-1;let l=Br(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const f=l.find(d=>d?.toLowerCase().startsWith(o));return f!==n?f:void 0}function Br(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Da={afterMs:1e4,onChange:ct};function Wi(e,t){const{afterMs:n,onChange:r,getWindow:i}={...Da,...t};let s=null,o=B(qt(e));function a(){return i().setTimeout(()=>{m(o,e,!0),r?.(e)},n)}return vt(()=>()=>{s&&i().clearTimeout(s)}),T(()=>c(o),l=>{m(o,l,!0),r?.(l),s&&i().clearTimeout(s),s=a()})}class Ia{#t;#e;#n=_(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#r=_(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=Wi("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,n){if(!n.length)return;this.#e.current=this.#e.current+t;const r=c(this.#r)(),i=n.find(l=>l===r)?.textContent?.trim()??"",s=n.map(l=>l.textContent?.trim()??""),o=Bi(s,this.#e.current,i),a=n.find(l=>l.textContent?.trim()===o);return a&&c(this.#n)(a),a}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}class Na{#t;#e;#n;#r=B(null);constructor(t){this.#t=t,this.#e=_(()=>this.#t.enabled()),this.#n=Wi(!1,{afterMs:t.transitTimeout??300,onChange:n=>{c(this.#e)&&this.#t.setIsPointerInTransit?.(n)},getWindow:()=>Xn(this.#t.triggerNode())}),St([t.triggerNode,t.contentNode,t.enabled],([n,r,i])=>{if(!n||!r||!i)return;const s=a=>{this.#o(a,r)},o=a=>{this.#o(a,n)};return de(lt(n,"pointerleave",s),lt(r,"pointerleave",o))}),St(()=>c(this.#r),()=>{const n=i=>{if(!c(this.#r))return;const s=i.target;if(!Vn(s))return;const o={x:i.clientX,y:i.clientY},a=t.triggerNode()?.contains(s)||t.contentNode()?.contains(s),l=!za(o,c(this.#r));a?this.#i():l&&(this.#i(),t.onPointerExit())},r=Ve(t.triggerNode()??t.contentNode());if(r)return lt(r,"pointermove",n)})}#i(){m(this.#r,null),this.#n.current=!1}#o(t,n){const r=t.currentTarget;if(!Zt(r))return;const i={x:t.clientX,y:t.clientY},s=La(i,r.getBoundingClientRect()),o=Ba(i,s),a=Wa(n.getBoundingClientRect()),l=Va([...o,...a]);m(this.#r,l,!0),this.#n.current=!0}}function La(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ba(e,t,n=5){const r=n*1.5;switch(t){case"top":return[{x:e.x-n,y:e.y+n},{x:e.x,y:e.y-r},{x:e.x+n,y:e.y+n}];case"bottom":return[{x:e.x-n,y:e.y-n},{x:e.x,y:e.y+r},{x:e.x+n,y:e.y-n}];case"left":return[{x:e.x+n,y:e.y-n},{x:e.x-r,y:e.y},{x:e.x+n,y:e.y+n}];case"right":return[{x:e.x-n,y:e.y-n},{x:e.x+r,y:e.y},{x:e.x-n,y:e.y+n}]}}function Wa(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function za(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s].x,l=t[s].y,u=t[o].x,f=t[o].y;l>r!=f>r&&n<(u-a)*(r-l)/(f-l)+a&&(i=!i)}return i}function Va(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Ka(t)}function Ka(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const Ha="data-context-menu-trigger",Ua="data-context-menu-content",zi=new we("Menu.Root"),er=new we("Menu.Root | Menu.Sub"),Vi=new we("Menu.Content"),ja=new da("bitsmenuopen",{bubbles:!1,cancelable:!0}),Ya=Ks({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class nr{static create(t){const n=new nr(t);return zi.set(n)}opts;isUsingKeyboard=new ee;#t=B(!1);get ignoreCloseAutoFocus(){return c(this.#t)}set ignoreCloseAutoFocus(t){m(this.#t,t,!0)}#e=B(!1);get isPointerInTransit(){return c(this.#e)}set isPointerInTransit(t){m(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>Ya.getAttr(t,this.opts.variant.current)}class rr{static create(t,n){return er.set(new rr(t,n,null))}opts;root;parentMenu;contentId=T(()=>"");#t=B(null);get contentNode(){return c(this.#t)}set contentNode(t){m(this.#t,t,!0)}contentPresence;#e=B(null);get triggerNode(){return c(this.#e)}set triggerNode(t){m(this.#e,t,!0)}constructor(t,n,r){this.opts=t,this.root=n,this.parentMenu=r,this.contentPresence=new na({ref:T(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&St(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class ir{static create(t){return Vi.set(new ir(t,er.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=B("");get search(){return c(this.#t)}set search(t){m(this.#t,t,!0)}#e=0;#n;#r=B(!1);get mounted(){return c(this.#r)}set mounted(t){m(this.#r,t,!0)}#i;constructor(t,n){this.opts=t,this.parentMenu=n,this.domContext=new Zn(t.ref),this.attachment=fe(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),n.contentId=t.id,this.#i=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Na({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),this.#n=new Ia({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new ta({rootNode:T(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:T(()=>"vertical")}),St(()=>this.parentMenu.contentNode,r=>{if(!r)return;const i=()=>{Gt(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return ja.listen(r,i)}),vt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#o(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=t=>{this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#i)&&this.parentMenu.triggerNode&&tr(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())};handleTabKeyDown(t){let n=this.parentMenu;for(;n.parentMenu!==null;)n=n.parentMenu;if(!n.triggerNode)return;t.preventDefault();const r=Fa(n.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,n.onClose(),Gt(()=>{r.focus(),Gt(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===Ys){this.handleTabKeyDown(t);return}const n=t.target,r=t.currentTarget;if(!Zt(n)||!Zt(r))return;const i=n.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,s=t.ctrlKey||t.altKey||t.metaKey,o=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(n,t)||t.code==="Space")return;const l=this.#o();i&&!s&&o&&this.#n(t.key,l),t.target?.id===this.parentMenu.contentId.current&&va.includes(t.key)&&(t.preventDefault(),Pi.includes(t.key)&&l.reverse(),ma(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){Vn(t.currentTarget)&&Vn(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&Gt(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(t){if(!Ei(t.target))return;const n=this.parentMenu.triggerNode?.id;if(t.target.id===n){t.preventDefault();return}t.target.closest(`#${n}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#s=_(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return c(this.#s)}set snippetProps(t){m(this.#s,t)}#c=_(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":wi(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return c(this.#c)}set props(t){m(this.#c,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class Ga{opts;content;attachment;#t=B(!1);constructor(t,n){this.opts=t,this.content=n,this.attachment=fe(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&Nr(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!Zt(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||Nr(t)&&this.content.onItemLeave(t)}onfocus(t){Gt(()=>{t.defaultPrevented||this.opts.disabled.current||m(this.#t,!0)})}onblur(t){Gt(()=>{t.defaultPrevented||m(this.#t,!1)})}#e=_(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":mi(this.opts.disabled.current),"data-disabled":yi(this.opts.disabled.current),"data-highlighted":c(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return c(this.#e)}set props(t){m(this.#e,t)}}class or{static create(t){const n=new Ga(t,Vi.get());return new or(t,n)}opts;item;root;#t=!1;constructor(t,n){this.opts=t,this.item=n,this.root=n.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const n=this.item.content.search!=="";if(!(this.item.opts.disabled.current||n&&t.key===$n)&&ha.includes(t.key)){if(!Zt(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!Zt(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#n=_(()=>Xt(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return c(this.#n)}set props(t){m(this.#n,t)}}class sr{static create(t){return new sr(t,zi.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=fe(this.opts.ref)}#t=_(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return c(this.#t)}set props(t){m(this.#t,t)}}class ar{static create(t){return new ar(t,er.get())}opts;parentMenu;attachment;constructor(t,n){this.opts=t,this.parentMenu=n,this.attachment=fe(this.opts.ref,r=>this.parentMenu.triggerNode=r)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===$n||t.key===xi){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===Ne&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=_(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=_(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":mi(this.parentMenu.opts.open.current),"aria-controls":c(this.#t),"data-disabled":yi(this.opts.disabled.current),"data-state":wi(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return c(this.#e)}set props(t){m(this.#e,t)}}globalThis.bitsDismissableLayers??=new Map;class cr{static create(t){return new cr(t)}opts;#t;#e;#n={pointerdown:!1};#r=!1;#i=!1;#o=void 0;#a;#s=ct;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#a=t.onFocusOutside,vt(()=>{this.#o=Ti(this.opts.ref.current)});let n=ct;const r=()=>{this.#f(),globalThis.bitsDismissableLayers.delete(this),this.#l.destroy(),n()};St([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return Rs(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#e),n(),n=this.#d())}),r}),ze(()=>{this.#f.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#l.destroy(),this.#s(),n()})}#c=t=>{t.defaultPrevented||this.opts.ref.current&&Gt(()=>{!this.opts.ref.current||this.#p(t.target)||t.target&&!this.#i&&this.#a.current?.(t)})};#d(){return de(lt(this.#o,"pointerdown",de(this.#h,this.#v),{capture:!0}),lt(this.#o,"pointerdown",de(this.#g,this.#l)),lt(this.#o,"focusin",this.#c))}#u=t=>{let n=t;n.defaultPrevented&&(n=Wr(t)),this.#t.current(t)};#l=Ir(t=>{if(!this.opts.ref.current){this.#s();return}const n=this.opts.isValidEvent.current(t,this.opts.ref.current)||Za(t,this.opts.ref.current);if(!this.#r||this.#m()||!n){this.#s();return}let r=t;if(r.defaultPrevented&&(r=Wr(r)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#s();return}t.pointerType==="touch"?(this.#s(),this.#s=lt(this.#o,"click",this.#u,{once:!0})):this.#t.current(r)},10);#h=t=>{this.#n[t.type]=!0};#g=t=>{this.#n[t.type]=!1};#v=()=>{this.opts.ref.current&&(this.#r=Xa(this.opts.ref.current))};#p=t=>this.opts.ref.current?Oi(this.opts.ref.current,t):!1;#f=Ir(()=>{for(const t in this.#n)this.#n[t]=!1;this.#r=!1},20);#m(){return Object.values(this.#n).some(Boolean)}#y=()=>{this.#i=!0};#w=()=>{this.#i=!1};props={onfocuscapture:this.#y,onblurcapture:this.#w}}function qa(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([t,{current:n}])=>n==="close"||n==="ignore")}function Xa(e){const t=[...globalThis.bitsDismissableLayers],n=qa(t);if(n)return n[0].opts.ref.current===e;const[r]=t[0];return r.opts.ref.current===e}function Za(e,t){const n=e.target;if(!Ei(n))return!1;const r=!!n.closest(`[${Ha}]`);if("button"in e&&e.button>0&&!r)return!1;if("button"in e&&e.button===0&&r)return!0;const i=!!t.closest(`[${Ua}]`);return r&&i?!1:Ti(n).documentElement.contains(n)&&!Oi(t,n)&&fa(e,t)}function Wr(e){const t=e.currentTarget,n=e.target;let r;e instanceof PointerEvent?r=new PointerEvent(e.type,e):r=new PointerEvent("pointerdown",e);let i=!1;return new Proxy(r,{get:(o,a)=>a==="currentTarget"?t:a==="target"?n:a==="preventDefault"?()=>{i=!0,typeof o.preventDefault=="function"&&o.preventDefault()}:a==="defaultPrevented"?i:a in o?o[a]:e[a]})}function Ja(e,t){ut(t,!0);let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"onInteractOutside",3,ct),i=x(t,"onFocusOutside",3,ct),s=x(t,"isValidEvent",3,()=>!1);const o=cr.create({id:T(()=>t.id),interactOutsideBehavior:T(()=>n()),onInteractOutside:T(()=>r()),enabled:T(()=>t.enabled),onFocusOutside:T(()=>i()),isValidEvent:T(()=>s()),ref:t.ref});var a=L(),l=D(a);st(l,()=>t.children??pt,()=>({props:o.props})),A(e,a),dt()}globalThis.bitsEscapeLayers??=new Map;class lr{static create(t){return new lr(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new Zn(this.opts.ref);let n=ct;St(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),n=this.#t()),()=>{n(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>lt(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==Hs||!Qa(this))return;const n=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(n)}}function Qa(e){const t=[...globalThis.bitsEscapeLayers],n=t.findLast(([i,{current:s}])=>s==="close"||s==="ignore");if(n)return n[0]===e;const[r]=t[0];return r===e}function $a(e,t){ut(t,!0);let n=x(t,"escapeKeydownBehavior",3,"close"),r=x(t,"onEscapeKeydown",3,ct);lr.create({escapeKeydownBehavior:T(()=>n()),onEscapeKeydown:T(()=>r()),enabled:T(()=>t.enabled),ref:t.ref});var i=L(),s=D(i);st(s,()=>t.children??pt),A(e,i),dt()}class ur{static instance;#t=Wt([]);#e=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new ur),this.instance}register(t){const n=this.getActive();n&&n!==t&&n.pause();const r=document.activeElement;r&&r!==document.body&&this.#n.set(t,r),this.#t.current=this.#t.current.filter(i=>i!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(r=>r!==t);const n=this.getActive();n&&n.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,n){this.#e.set(t,n)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,n){this.#n.set(t,n)}getPreFocusMemory(t){return this.#n.get(t)}clearPreFocusMemory(t){this.#n.delete(t)}}class dr{#t=!1;#e=null;#n=ur.getInstance();#r=[];#i;constructor(t){this.#i=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#o(){for(const t of this.#r)t();this.#r=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#n.register(this),this.#c(),this.#a()}unmount(){this.#e&&(this.#o(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#e=null)}#a(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const n=this.#u();n?(n.focus(),this.#n.setFocusMemory(this,n)):this.#e.focus()})}#s(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const n=this.#n.getPreFocusMemory(this);if(n&&document.contains(n))try{n.focus()}catch{document.body.focus()}}}#c(){if(!this.#e||!this.#i.trap.current)return;const t=this.#e,n=t.ownerDocument,r=o=>{if(this.#t||!this.#n.isActiveScope(this))return;const a=o.target;if(!a)return;if(t.contains(a))this.#n.setFocusMemory(this,a);else{const u=this.#n.getFocusMemory(this);if(u&&t.contains(u)&&Li(u))o.preventDefault(),u.focus();else{const f=this.#u(),d=this.#l()[0];(f||d||t).focus()}}},i=o=>{if(!this.#i.loop||this.#t||o.key!=="Tab"||!this.#n.isActiveScope(this))return;const a=this.#d();if(a.length===0)return;const l=a[0],u=a[a.length-1];!o.shiftKey&&n.activeElement===u?(o.preventDefault(),l.focus()):o.shiftKey&&n.activeElement===l&&(o.preventDefault(),u.focus())};this.#r.push(lt(n,"focusin",r,{capture:!0}),lt(t,"keydown",i));const s=new MutationObserver(()=>{const o=this.#n.getFocusMemory(this);if(o&&!t.contains(o)){const a=this.#u(),l=this.#l()[0],u=a||l;u?(u.focus(),this.#n.setFocusMemory(this,u)):t.focus()}});s.observe(t,{childList:!0,subtree:!0}),this.#r.push(()=>s.disconnect())}#d(){return this.#e?Ii(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#d()[0]||null}#l(){return this.#e?Ni(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return St([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||(n=new dr(t)),n.mount(r)):n&&(n.unmount(),n=null)}),ze(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}}function tc(e,t){ut(t,!0);let n=x(t,"enabled",3,!1),r=x(t,"trapFocus",3,!1),i=x(t,"loop",3,!1),s=x(t,"onCloseAutoFocus",3,ct),o=x(t,"onOpenAutoFocus",3,ct);const a=dr.use({enabled:T(()=>n()),trap:T(()=>r()),loop:i(),onCloseAutoFocus:T(()=>s()),onOpenAutoFocus:T(()=>o()),ref:t.ref});var l=L(),u=D(l);st(u,()=>t.focusScope??pt,()=>({props:a.props})),A(e,l),dt()}globalThis.bitsTextSelectionLayers??=new Map;class fr{static create(t){return new fr(t)}opts;domContext;#t=ct;constructor(t){this.opts=t,this.domContext=new Zn(t.ref);let n=ct;St(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),n(),n=this.#e()),()=>{n(),this.#r(),globalThis.bitsTextSelectionLayers.delete(this)}))}#e(){return de(lt(this.domContext.getDocument(),"pointerdown",this.#n),lt(this.domContext.getDocument(),"pointerup",ui(this.#r,this.opts.onPointerUp.current)))}#n=t=>{const n=this.opts.ref.current,r=t.target;!Zt(n)||!Zt(r)||!this.opts.enabled.current||!nc(this)||!Ws(n,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&(this.#t=ec(n,this.domContext.getDocument().body)))};#r=()=>{this.#t(),this.#t=ct}}const zr=e=>e.style.userSelect||e.style.webkitUserSelect;function ec(e,t){const n=zr(t),r=zr(e);return Xe(t,"none"),Xe(e,"text"),()=>{Xe(t,n),Xe(e,r)}}function Xe(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function nc(e){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const n=t.at(-1);return n?n[0]===e:!1}function rc(e,t){ut(t,!0);let n=x(t,"preventOverflowTextSelection",3,!0),r=x(t,"onPointerDown",3,ct),i=x(t,"onPointerUp",3,ct);fr.create({id:T(()=>t.id),onPointerDown:T(()=>r()),onPointerUp:T(()=>i()),enabled:T(()=>t.enabled&&n()),ref:t.ref});var s=L(),o=D(s);st(o,()=>t.children??pt),A(e,s),dt()}globalThis.bitsIdCounter??={current:0};function hr(e="bits"){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}class ic{#t;#e=0;#n=B();#r;constructor(t){this.#t=t}#i(){this.#e-=1,this.#r&&this.#e<=0&&(this.#r(),m(this.#n,void 0),this.#r=void 0)}get(...t){return this.#e+=1,c(this.#n)===void 0&&(this.#r=oi(()=>{m(this.#n,this.#t(...t),!0)})),vt(()=>()=>{this.#i()}),c(this.#n)}}const $e=new Ps;let Ze=B(null),kn=null,Me=null,Fe=!1;const Vr=T(()=>{for(const e of $e.values())if(e)return!0;return!1});let Mn=null;const oc=new ic(()=>{function e(){document.body.setAttribute("style",c(Ze)??""),document.body.style.removeProperty("--scrollbar-width"),Dr&&kn?.(),m(Ze,null)}function t(){Me!==null&&(window.clearTimeout(Me),Me=null)}function n(i,s){t(),Fe=!0,Mn=Date.now();const o=Mn,a=()=>{Me=null,Mn===o&&(Ki($e)?Fe=!1:(Fe=!1,s()))},l=i===null?24:i;Me=window.setTimeout(a,l)}function r(){c(Ze)===null&&$e.size===0&&!Fe&&m(Ze,document.body.getAttribute("style"),!0)}return St(()=>Vr.current,()=>{if(!Vr.current)return;r(),Fe=!1;const i=getComputedStyle(document.documentElement),s=getComputedStyle(document.body),o=i.scrollbarGutter?.includes("stable")||s.scrollbarGutter?.includes("stable"),a=window.innerWidth-document.documentElement.clientWidth,u={padding:Number.parseInt(s.paddingRight??"0",10)+a,margin:Number.parseInt(s.marginRight??"0",10)};a>0&&!o&&(document.body.style.paddingRight=`${u.padding}px`,document.body.style.marginRight=`${u.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",Dr&&(kn=lt(document,"touchmove",f=>{f.target===document.documentElement&&(f.touches.length>1||f.preventDefault())},{passive:!1})),Gt(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),ze(()=>()=>{kn?.()}),{get lockMap(){return $e},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});class sc{#t=hr();#e;#n=()=>null;#r;locked;constructor(t,n=()=>null){this.#e=t,this.#n=n,this.#r=oc.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#t,this.#e??!1),this.locked=T(()=>this.#r.lockMap.get(this.#t)??!1,r=>this.#r.lockMap.set(this.#t,r)),ze(()=>{if(this.#r.lockMap.delete(this.#t),Ki(this.#r.lockMap))return;const r=this.#n();this.#r.scheduleCleanupIfNoNewLocks(r,()=>{this.#r.resetBodyStyle()})}))}}function Ki(e){for(const[t,n]of e)if(n)return!0;return!1}function Kr(e,t){ut(t,!0);let n=x(t,"preventScroll",3,!0),r=x(t,"restoreScrollDelay",3,null);n()&&new sc(n(),()=>r()),dt()}const ac=["top","right","bottom","left"],ne=Math.min,Tt=Math.max,cn=Math.round,Je=Math.floor,Vt=e=>({x:e,y:e}),cc={left:"right",right:"left",bottom:"top",top:"bottom"},lc={start:"end",end:"start"};function Hn(e,t,n){return Tt(e,ne(t,n))}function Jt(e,t){return typeof e=="function"?e(t):e}function Qt(e){return e.split("-")[0]}function Ee(e){return e.split("-")[1]}function gr(e){return e==="x"?"y":"x"}function vr(e){return e==="y"?"height":"width"}const uc=new Set(["top","bottom"]);function zt(e){return uc.has(Qt(e))?"y":"x"}function pr(e){return gr(zt(e))}function dc(e,t,n){n===void 0&&(n=!1);const r=Ee(e),i=pr(e),s=vr(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=ln(o)),[o,ln(o)]}function fc(e){const t=ln(e);return[Un(e),t,Un(t)]}function Un(e){return e.replace(/start|end/g,t=>lc[t])}const Hr=["left","right"],Ur=["right","left"],hc=["top","bottom"],gc=["bottom","top"];function vc(e,t,n){switch(e){case"top":case"bottom":return n?t?Ur:Hr:t?Hr:Ur;case"left":case"right":return t?hc:gc;default:return[]}}function pc(e,t,n,r){const i=Ee(e);let s=vc(Qt(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Un)))),s}function ln(e){return e.replace(/left|right|bottom|top/g,t=>cc[t])}function mc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Hi(e){return typeof e!="number"?mc(e):{top:e,right:e,bottom:e,left:e}}function un(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function jr(e,t,n){let{reference:r,floating:i}=e;const s=zt(t),o=pr(t),a=vr(o),l=Qt(t),u=s==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let v;switch(l){case"top":v={x:f,y:r.y-i.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-i.width,y:d};break;default:v={x:r.x,y:r.y}}switch(Ee(t)){case"start":v[o]-=g*(n&&u?-1:1);break;case"end":v[o]+=g*(n&&u?-1:1);break}return v}async function yc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:g=!1,padding:v=0}=Jt(t,e),p=Hi(v),y=a[g?d==="floating"?"reference":"floating":d],b=un(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),E=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},N=un(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:C,strategy:l}):E);return{top:(b.top-N.top+p.top)/S.y,bottom:(N.bottom-b.bottom+p.bottom)/S.y,left:(b.left-N.left+p.left)/S.x,right:(N.right-b.right+p.right)/S.x}}const wc=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=jr(u,r,l),g=r,v={},p=0;for(let y=0;y<a.length;y++){var h;const{name:b,fn:E}=a[y],{x:C,y:S,data:N,reset:O}=await E({x:f,y:d,initialPlacement:r,placement:g,strategy:i,middlewareData:v,rects:u,platform:{...o,detectOverflow:(h=o.detectOverflow)!=null?h:yc},elements:{reference:e,floating:t}});f=C??f,d=S??d,v={...v,[b]:{...v[b],...N}},O&&p<=50&&(p++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(u=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:f,y:d}=jr(u,g,l)),y=-1)}return{x:f,y:d,placement:g,strategy:i,middlewareData:v}},bc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=Jt(e,t)||{};if(u==null)return{};const d=Hi(f),g={x:n,y:r},v=pr(i),p=vr(v),h=await o.getDimensions(u),y=v==="y",b=y?"top":"left",E=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[v]-g[v]-s.floating[p],N=g[v]-s.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=O?O[C]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=a.floating[C]||s.floating[p]);const j=S/2-N/2,W=k/2-h[p]/2-1,F=ne(d[b],W),I=ne(d[E],W),H=F,q=k-h[p]-I,X=k/2-h[p]/2+j,J=Hn(H,X,q),z=!l.arrow&&Ee(i)!=null&&X!==J&&s.reference[p]/2-(X<H?F:I)-h[p]/2<0,G=z?X<H?X-H:X-q:0;return{[v]:g[v]+G,data:{[v]:J,centerOffset:X-J-G,...z&&{alignmentOffset:G}},reset:z}}}),xc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...y}=Jt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Qt(i),E=zt(a),C=Qt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),N=g||(C||!h?[ln(a)]:fc(a)),O=p!=="none";!g&&O&&N.push(...pc(a,h,p,S));const k=[a,...N],j=await l.detectOverflow(t,y),W=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&W.push(j[b]),d){const X=dc(i,o,S);W.push(j[X[0]],j[X[1]])}if(F=[...F,{placement:i,overflows:W}],!W.every(X=>X<=0)){var I,H;const X=(((I=s.flip)==null?void 0:I.index)||0)+1,J=k[X];if(J&&(!(d==="alignment"?E!==zt(J):!1)||F.every(Z=>zt(Z.placement)===E?Z.overflows[0]>0:!0)))return{data:{index:X,overflows:F},reset:{placement:J}};let z=(H=F.filter(G=>G.overflows[0]<=0).sort((G,Z)=>G.overflows[1]-Z.overflows[1])[0])==null?void 0:H.placement;if(!z)switch(v){case"bestFit":{var q;const G=(q=F.filter(Z=>{if(O){const At=zt(Z.placement);return At===E||At==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(At=>At>0).reduce((At,Te)=>At+Te,0)]).sort((Z,At)=>Z[1]-At[1])[0])==null?void 0:q[0];G&&(z=G);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function Yr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gr(e){return ac.some(t=>e[t]>=0)}const Sc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...s}=Jt(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Yr(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Gr(a)}}}case"escaped":{const o=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Yr(o,n.floating);return{data:{escapedOffsets:a,escaped:Gr(a)}}}default:return{}}}}},Ui=new Set(["left","top"]);async function Ac(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Qt(n),a=Ee(n),l=zt(n)==="y",u=Ui.has(o)?-1:1,f=s&&l?-1:1,d=Jt(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(v=a==="end"?p*-1:p),l?{x:v*f,y:g*u}:{x:g*u,y:v*f}}const Ec=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await Ac(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Oc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:E,y:C}=b;return{x:E,y:C}}},...u}=Jt(e,t),f={x:n,y:r},d=await s.detectOverflow(t,u),g=zt(Qt(i)),v=gr(g);let p=f[v],h=f[g];if(o){const b=v==="y"?"top":"left",E=v==="y"?"bottom":"right",C=p+d[b],S=p-d[E];p=Hn(C,p,S)}if(a){const b=g==="y"?"top":"left",E=g==="y"?"bottom":"right",C=h+d[b],S=h-d[E];h=Hn(C,h,S)}const y=l.fn({...t,[v]:p,[g]:h});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[v]:o,[g]:a}}}}}},Tc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Jt(e,t),f={x:n,y:r},d=zt(i),g=gr(d);let v=f[g],p=f[d];const h=Jt(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const C=g==="y"?"height":"width",S=s.reference[g]-s.floating[C]+y.mainAxis,N=s.reference[g]+s.reference[C]-y.mainAxis;v<S?v=S:v>N&&(v=N)}if(u){var b,E;const C=g==="y"?"width":"height",S=Ui.has(Qt(i)),N=s.reference[d]-s.floating[C]+(S&&((b=o.offset)==null?void 0:b[d])||0)+(S?0:y.crossAxis),O=s.reference[d]+s.reference[C]+(S?0:((E=o.offset)==null?void 0:E[d])||0)-(S?y.crossAxis:0);p<N?p=N:p>O&&(p=O)}return{[g]:v,[d]:p}}}},Pc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}=Jt(e,t),f=await o.detectOverflow(t,u),d=Qt(i),g=Ee(i),v=zt(i)==="y",{width:p,height:h}=s.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=g===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,y=g==="end"?"top":"bottom");const E=h-f.top-f.bottom,C=p-f.left-f.right,S=ne(h-f[y],E),N=ne(p-f[b],C),O=!t.middlewareData.shift;let k=S,j=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=E),O&&!g){const F=Tt(f.left,0),I=Tt(f.right,0),H=Tt(f.top,0),q=Tt(f.bottom,0);v?j=p-2*(F!==0||I!==0?F+I:Tt(f.left,f.right)):k=h-2*(H!==0||q!==0?H+q:Tt(f.top,f.bottom))}await l({...t,availableWidth:j,availableHeight:k});const W=await o.getDimensions(a.floating);return p!==W.width||h!==W.height?{reset:{rects:!0}}:{}}}};function mn(){return typeof window<"u"}function Oe(e){return ji(e)?(e.nodeName||"").toLowerCase():"#document"}function Pt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ht(e){var t;return(t=(ji(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ji(e){return mn()?e instanceof Node||e instanceof Pt(e).Node:!1}function Lt(e){return mn()?e instanceof Element||e instanceof Pt(e).Element:!1}function Kt(e){return mn()?e instanceof HTMLElement||e instanceof Pt(e).HTMLElement:!1}function qr(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pt(e).ShadowRoot}const Cc=new Set(["inline","contents"]);function Ke(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Cc.has(i)}const _c=new Set(["table","td","th"]);function kc(e){return _c.has(Oe(e))}const Mc=[":popover-open",":modal"];function yn(e){return Mc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Fc=["transform","translate","scale","rotate","perspective"],Rc=["transform","translate","scale","rotate","perspective","filter"],Dc=["paint","layout","strict","content"];function mr(e){const t=yr(),n=Lt(e)?Bt(e):e;return Fc.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Rc.some(r=>(n.willChange||"").includes(r))||Dc.some(r=>(n.contain||"").includes(r))}function Ic(e){let t=re(e);for(;Kt(t)&&!Ae(t);){if(mr(t))return t;if(yn(t))return null;t=re(t)}return null}function yr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Nc=new Set(["html","body","#document"]);function Ae(e){return Nc.has(Oe(e))}function Bt(e){return Pt(e).getComputedStyle(e)}function wn(e){return Lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function re(e){if(Oe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qr(e)&&e.host||Ht(e);return qr(t)?t.host:t}function Yi(e){const t=re(e);return Ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Ke(t)?t:Yi(t)}function Le(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Yi(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Pt(i);if(s){const a=jn(o);return t.concat(o,o.visualViewport||[],Ke(i)?i:[],a&&n?Le(a):[])}return t.concat(i,Le(i,[],n))}function jn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gi(e){const t=Bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Kt(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=cn(n)!==s||cn(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function wr(e){return Lt(e)?e:e.contextElement}function xe(e){const t=wr(e);if(!Kt(t))return Vt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Gi(t);let o=(s?cn(n.width):n.width)/r,a=(s?cn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Lc=Vt(0);function qi(e){const t=Pt(e);return!yr()||!t.visualViewport?Lc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pt(e)?!1:t}function ge(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=wr(e);let o=Vt(1);t&&(r?Lt(r)&&(o=xe(r)):o=xe(e));const a=Bc(s,n,r)?qi(s):Vt(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,d=i.height/o.y;if(s){const g=Pt(s),v=r&&Lt(r)?Pt(r):r;let p=g,h=jn(p);for(;h&&r&&v!==p;){const y=xe(h),b=h.getBoundingClientRect(),E=Bt(h),C=b.left+(h.clientLeft+parseFloat(E.paddingLeft))*y.x,S=b.top+(h.clientTop+parseFloat(E.paddingTop))*y.y;l*=y.x,u*=y.y,f*=y.x,d*=y.y,l+=C,u+=S,p=Pt(h),h=jn(p)}}return un({width:f,height:d,x:l,y:u})}function bn(e,t){const n=wn(e).scrollLeft;return t?t.left+n:ge(Ht(e)).left+n}function Xi(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bn(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Wc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Ht(r),a=t?yn(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Vt(1);const f=Vt(0),d=Kt(r);if((d||!d&&!s)&&((Oe(r)!=="body"||Ke(o))&&(l=wn(r)),Kt(r))){const v=ge(r);u=xe(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const g=o&&!d&&!s?Xi(o,l):Vt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+g.x,y:n.y*u.y-l.scrollTop*u.y+f.y+g.y}}function zc(e){return Array.from(e.getClientRects())}function Vc(e){const t=Ht(e),n=wn(e),r=e.ownerDocument.body,i=Tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+bn(e);const a=-n.scrollTop;return Bt(r).direction==="rtl"&&(o+=Tt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const Xr=25;function Kc(e,t){const n=Pt(e),r=Ht(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const f=yr();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=bn(r);if(u<=0){const f=r.ownerDocument,d=f.body,g=getComputedStyle(d),v=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-v);p<=Xr&&(s-=p)}else u<=Xr&&(s+=u);return{width:s,height:o,x:a,y:l}}const Hc=new Set(["absolute","fixed"]);function Uc(e,t){const n=ge(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Kt(e)?xe(e):Vt(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function Zr(e,t,n){let r;if(t==="viewport")r=Kc(e,n);else if(t==="document")r=Vc(Ht(e));else if(Lt(t))r=Uc(t,n);else{const i=qi(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return un(r)}function Zi(e,t){const n=re(e);return n===t||!Lt(n)||Ae(n)?!1:Bt(n).position==="fixed"||Zi(n,t)}function jc(e,t){const n=t.get(e);if(n)return n;let r=Le(e,[],!1).filter(a=>Lt(a)&&Oe(a)!=="body"),i=null;const s=Bt(e).position==="fixed";let o=s?re(e):e;for(;Lt(o)&&!Ae(o);){const a=Bt(o),l=mr(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&Hc.has(i.position)||Ke(o)&&!l&&Zi(e,o))?r=r.filter(f=>f!==o):i=a,o=re(o)}return t.set(e,r),r}function Yc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?yn(t)?[]:jc(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,f)=>{const d=Zr(t,f,i);return u.top=Tt(d.top,u.top),u.right=ne(d.right,u.right),u.bottom=ne(d.bottom,u.bottom),u.left=Tt(d.left,u.left),u},Zr(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gc(e){const{width:t,height:n}=Gi(e);return{width:t,height:n}}function qc(e,t,n){const r=Kt(t),i=Ht(t),s=n==="fixed",o=ge(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Vt(0);function u(){l.x=bn(i)}if(r||!r&&!s)if((Oe(t)!=="body"||Ke(i))&&(a=wn(t)),r){const v=ge(t,!0,s,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else i&&u();s&&!r&&i&&u();const f=i&&!r&&!s?Xi(i,a):Vt(0),d=o.left+a.scrollLeft-l.x-f.x,g=o.top+a.scrollTop-l.y-f.y;return{x:d,y:g,width:o.width,height:o.height}}function Fn(e){return Bt(e).position==="static"}function Jr(e,t){if(!Kt(e)||Bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ht(e)===n&&(n=n.ownerDocument.body),n}function Ji(e,t){const n=Pt(e);if(yn(e))return n;if(!Kt(e)){let i=re(e);for(;i&&!Ae(i);){if(Lt(i)&&!Fn(i))return i;i=re(i)}return n}let r=Jr(e,t);for(;r&&kc(r)&&Fn(r);)r=Jr(r,t);return r&&Ae(r)&&Fn(r)&&!mr(r)?n:r||Ic(e)||n}const Xc=async function(e){const t=this.getOffsetParent||Ji,n=this.getDimensions,r=await n(e.floating);return{reference:qc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zc(e){return Bt(e).direction==="rtl"}const Jc={convertOffsetParentRelativeRectToViewportRelativeRect:Wc,getDocumentElement:Ht,getClippingRect:Yc,getOffsetParent:Ji,getElementRects:Xc,getClientRects:zc,getDimensions:Gc,getScale:xe,isElement:Lt,isRTL:Zc};function Qi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qc(e,t){let n=null,r;const i=Ht(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:d,width:g,height:v}=u;if(a||t(),!g||!v)return;const p=Je(d),h=Je(i.clientWidth-(f+g)),y=Je(i.clientHeight-(d+v)),b=Je(f),C={rootMargin:-p+"px "+-h+"px "+-y+"px "+-b+"px",threshold:Tt(0,ne(1,l))||1};let S=!0;function N(O){const k=O[0].intersectionRatio;if(k!==l){if(!S)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!Qi(u,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(N,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,C)}n.observe(e)}return o(!0),s}function $c(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=wr(e),f=i||s?[...u?Le(u):[],...Le(t)]:[];f.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const d=u&&a?Qc(u,n):null;let g=-1,v=null;o&&(v=new ResizeObserver(b=>{let[E]=b;E&&E.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(t)})),n()}),u&&!l&&v.observe(u),v.observe(t));let p,h=l?ge(e):null;l&&y();function y(){const b=ge(e);h&&!Qi(h,b)&&n(),h=b,p=requestAnimationFrame(y)}return n(),()=>{var b;f.forEach(E=>{i&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),d?.(),(b=v)==null||b.disconnect(),v=null,l&&cancelAnimationFrame(p)}}const tl=Ec,el=Oc,nl=xc,rl=Pc,il=Sc,ol=bc,sl=Tc,al=(e,t,n)=>{const r=new Map,i={platform:Jc,...n},s={...i.platform,_c:r};return wc(e,t,{...i,platform:s})};function ce(e){return typeof e=="function"?e():e}function $i(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qr(e,t){const n=$i(e);return Math.round(t*n)/n}function $r(e){return{[`--bits-${e}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${e}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${e}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${e}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${e}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function cl(e){const t=e.whileElementsMounted,n=_(()=>ce(e.open)??!0),r=_(()=>ce(e.middleware)),i=_(()=>ce(e.transform)??!0),s=_(()=>ce(e.placement)??"bottom"),o=_(()=>ce(e.strategy)??"absolute"),a=_(()=>ce(e.sideOffset)??0),l=_(()=>ce(e.alignOffset)??0),u=e.reference;let f=B(0),d=B(0);const g=Wt(null);let v=B(qt(c(o))),p=B(qt(c(s))),h=B(qt({})),y=B(!1),b=!1;const E=_(()=>{const W=g.current?Qr(g.current,c(f)):c(f),F=g.current?Qr(g.current,c(d)):c(d);return c(i)?{position:c(v),left:"0",top:"0",transform:`translate(${W}px, ${F}px)`,...g.current&&$i(g.current)>=1.5&&{willChange:"transform"}}:{position:c(v),left:`${W}px`,top:`${F}px`}});let C;function S(){u.current===null||g.current===null||al(u.current,g.current,{middleware:c(r),placement:c(s),strategy:c(o)}).then(W=>{const F=u.current;if(ll(F)){m(h,{...c(h),hide:{...c(h).hide,referenceHidden:!0}},!0);return}if(!c(n)&&c(f)!==0&&c(d)!==0){const H=Math.max(Math.abs(c(a)),Math.abs(c(l)),15);if(W.x<=H&&W.y<=H)return}m(f,W.x,!0),m(d,W.y,!0),m(v,W.strategy,!0),m(p,W.placement,!0),m(h,W.middlewareData,!0),m(y,!0)})}function N(){typeof C=="function"&&(C(),C=void 0)}function O(){if(N(),t===void 0){S();return}c(n)&&(u.current===null||g.current===null||(C=t(u.current,g.current,S)))}function k(){c(n)||m(y,!1)}function j(){return[c(r),c(s),c(o),c(a),c(l),c(n)]}return vt(()=>{t===void 0&&c(n)&&S()}),vt(O),vt(()=>{if(t!==void 0){if(j(),!c(n)){b=!1;return}if(!c(y)){b=!1;return}if(!b){b=!0;return}S()}}),vt(k),vt(()=>N),{floating:g,reference:u,get strategy(){return c(v)},get placement(){return c(p)},get middlewareData(){return c(h)},get isPositioned(){return c(y)},get floatingStyles(){return c(E)},get update(){return S}}}function ll(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}const ul={top:"bottom",right:"left",bottom:"top",left:"right"},br=new we("Floating.Root"),ti=new we("Floating.Content"),xr=new we("Floating.Root");class dn{static create(t=!1){return t?xr.set(new dn):br.set(new dn)}anchorNode=Wt(null);customAnchorNode=Wt(null);triggerNode=Wt(null);constructor(){vt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class fn{static create(t,n=!1){return n?ti.set(new fn(t,xr.get())):ti.set(new fn(t,br.get()))}opts;root;contentRef=Wt(null);wrapperRef=Wt(null);arrowRef=Wt(null);contentAttachment=fe(this.contentRef);wrapperAttachment=fe(this.wrapperRef);arrowAttachment=fe(this.arrowRef);arrowId=Wt(hr());#t=_(()=>{if(typeof this.opts.style=="string")return Re(this.opts.style);if(!this.opts.style)return{}});#e=void 0;#n=new Fs(()=>this.arrowRef.current??void 0);#r=_(()=>this.#n?.width??0);#i=_(()=>this.#n?.height??0);#o=_(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=_(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=_(()=>c(this.#a).length>0);get hasExplicitBoundaries(){return c(this.#s)}set hasExplicitBoundaries(t){m(this.#s,t)}#c=_(()=>({padding:this.opts.collisionPadding.current,boundary:c(this.#a).filter(Qs),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return c(this.#c)}set detectOverflowOptions(t){m(this.#c,t)}#d=B(void 0);#u=B(void 0);#l=B(void 0);#h=B(void 0);#g=_(()=>[tl({mainAxis:this.opts.sideOffset.current+c(this.#i),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&el({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?sl():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&nl({...this.detectOverflowOptions}),rl({...this.detectOverflowOptions,apply:({rects:t,availableWidth:n,availableHeight:r})=>{const{width:i,height:s}=t.reference;m(this.#d,n,!0),m(this.#u,r,!0),m(this.#l,i,!0),m(this.#h,s,!0)}}),this.arrowRef.current&&ol({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),dl({arrowWidth:c(this.#r),arrowHeight:c(this.#i)}),this.opts.hideWhenDetached.current&&il({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return c(this.#g)}set middleware(t){m(this.#g,t)}floating;#v=_(()=>fl(this.floating.placement));get placedSide(){return c(this.#v)}set placedSide(t){m(this.#v,t)}#p=_(()=>hl(this.floating.placement));get placedAlign(){return c(this.#p)}set placedAlign(t){m(this.#p,t)}#f=_(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return c(this.#f)}set arrowX(t){m(this.#f,t)}#m=_(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return c(this.#m)}set arrowY(t){m(this.#m,t)}#y=_(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return c(this.#y)}set cannotCenterArrow(t){m(this.#y,t)}#w=B();get contentZIndex(){return c(this.#w)}set contentZIndex(t){m(this.#w,t,!0)}#b=_(()=>ul[this.placedSide]);get arrowBaseSide(){return c(this.#b)}set arrowBaseSide(t){m(this.#b,t)}#x=_(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${c(this.#d)}px`,"--bits-floating-available-height":`${c(this.#u)}px`,"--bits-floating-anchor-width":`${c(this.#l)}px`,"--bits-floating-anchor-height":`${c(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...c(this.#t)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return c(this.#x)}set wrapperProps(t){m(this.#x,t)}#S=_(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:fi({...c(this.#t)}),...this.contentAttachment}));get props(){return c(this.#S)}set props(t){m(this.#S,t)}#A=_(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return c(this.#A)}set arrowStyle(t){m(this.#A,t)}constructor(t,n){this.opts=t,this.root=n,this.#e=t.updatePositionStrategy,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),St(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=cl({strategy:()=>this.opts.strategy.current,placement:()=>c(this.#o),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>$c(...r,{animationFrame:this.#e?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),vt(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),St(()=>this.contentRef.current,r=>{if(!r||!this.opts.enabled.current)return;const i=Xn(r),s=i.requestAnimationFrame(()=>{if(this.contentRef.current!==r||!this.opts.enabled.current)return;const o=i.getComputedStyle(r).zIndex;o!==this.contentZIndex&&(this.contentZIndex=o)});return()=>{i.cancelAnimationFrame(s)}}),vt(()=>{this.floating.floating.current=this.wrapperRef.current})}}class hn{static create(t,n=!1){return n?new hn(t,xr.get()):new hn(t,br.get())}opts;root;constructor(t,n){this.opts=t,this.root=n,t.virtualEl&&t.virtualEl.current?n.triggerNode=li(t.virtualEl.current):n.triggerNode=t.ref}}function dl(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,f]=Sr(n),d={start:"0%",center:"50%",end:"100%"}[f],g=(i.arrow?.x??0)+a/2,v=(i.arrow?.y??0)+l/2;let p="",h="";return u==="bottom"?(p=o?d:`${g}px`,h=`${-l}px`):u==="top"?(p=o?d:`${g}px`,h=`${r.floating.height+l}px`):u==="right"?(p=`${-l}px`,h=o?d:`${v}px`):u==="left"&&(p=`${r.floating.width+l}px`,h=o?d:`${v}px`),{data:{x:p,y:h}}}}}function Sr(e){const[t,n="center"]=e.split("-");return[t,n]}function fl(e){return Sr(e)[0]}function hl(e){return Sr(e)[1]}function gl(e,t){ut(t,!0);let n=x(t,"tooltip",3,!1);dn.create(n());var r=L(),i=D(r);st(i,()=>t.children??pt),A(e,r),dt()}function vl(e,t){ut(t,!0);let n=x(t,"tooltip",3,!1);hn.create({id:T(()=>t.id),virtualEl:T(()=>t.virtualEl),ref:t.ref},n());var r=L(),i=D(r);st(i,()=>t.children??pt),A(e,r),dt()}function pl(e,t){ut(t,!0);let n=x(t,"side",3,"bottom"),r=x(t,"sideOffset",3,0),i=x(t,"align",3,"center"),s=x(t,"alignOffset",3,0),o=x(t,"arrowPadding",3,0),a=x(t,"avoidCollisions",3,!0),l=x(t,"collisionBoundary",19,()=>[]),u=x(t,"collisionPadding",3,0),f=x(t,"hideWhenDetached",3,!1),d=x(t,"onPlaced",3,()=>{}),g=x(t,"sticky",3,"partial"),v=x(t,"updatePositionStrategy",3,"optimized"),p=x(t,"strategy",3,"fixed"),h=x(t,"dir",3,"ltr"),y=x(t,"style",19,()=>({})),b=x(t,"wrapperId",19,hr),E=x(t,"customAnchor",3,null),C=x(t,"tooltip",3,!1);const S=fn.create({side:T(()=>n()),sideOffset:T(()=>r()),align:T(()=>i()),alignOffset:T(()=>s()),id:T(()=>t.id),arrowPadding:T(()=>o()),avoidCollisions:T(()=>a()),collisionBoundary:T(()=>l()),collisionPadding:T(()=>u()),hideWhenDetached:T(()=>f()),onPlaced:T(()=>d()),sticky:T(()=>g()),updatePositionStrategy:T(()=>v()),strategy:T(()=>p()),dir:T(()=>h()),style:T(()=>y()),enabled:T(()=>t.enabled),wrapperId:T(()=>b()),customAnchor:T(()=>E())},C()),N=_(()=>Xt(S.wrapperProps,{style:{pointerEvents:"auto"}}));var O=L(),k=D(O);st(k,()=>t.content??pt,()=>({props:S.props,wrapperProps:c(N)})),A(e,O),dt()}function ml(e,t){ut(t,!0),si(()=>{t.onPlaced?.()});var n=L(),r=D(n);st(r,()=>t.content??pt,()=>({props:{},wrapperProps:{}})),A(e,n),dt()}function yl(e,t){let n=x(t,"isStatic",3,!1),r=ie(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var i=L(),s=D(i);{var o=l=>{ml(l,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},a=l=>{pl(l,Mt({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};at(s,l=>{n()?l(o):l(a,!1)})}A(e,i)}var wl=K("<!> <!>",1);function to(e,t){ut(t,!0);let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"trapFocus",3,!0),i=x(t,"isValidEvent",3,()=>!1),s=x(t,"customAnchor",3,null),o=x(t,"isStatic",3,!1),a=x(t,"tooltip",3,!1),l=x(t,"contentPointerEvents",3,"auto"),u=ie(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);yl(e,{get isStatic(){return o()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get enabled(){return t.enabled},get tooltip(){return a()},content:(d,g)=>{let v=()=>g?.().props,p=()=>g?.().wrapperProps;var h=wl(),y=D(h);{var b=S=>{Kr(S,{get preventScroll(){return t.preventScroll}})},E=S=>{Kr(S,{get preventScroll(){return t.preventScroll}})};at(y,S=>{t.forceMount&&t.enabled?S(b):t.forceMount||S(E,1)})}var C=nt(y,2);tc(C,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(N,O)=>{let k=()=>O?.().props;$a(N,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(j,W)=>{Ja(j,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return i()},get enabled(){return t.enabled},get ref(){return t.ref},children:(I,H)=>{let q=()=>H?.().props;rc(I,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(X,J)=>{var z=L(),G=D(z);{let Z=_(()=>({props:Xt(u,v(),q(),k(),{style:{pointerEvents:l()}}),wrapperProps:p()}));st(G,()=>t.popper??pt,()=>c(Z))}A(X,z)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),A(d,h)},$$slots:{content:!0}}),dt()}function bl(e,t){let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"trapFocus",3,!0),i=x(t,"isValidEvent",3,()=>!1),s=x(t,"customAnchor",3,null),o=x(t,"isStatic",3,!1),a=ie(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=L(),u=D(l);{var f=d=>{to(d,Mt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>a))};at(u,d=>{t.shouldRender&&d(f)})}A(e,l)}function xl(e,t){let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"trapFocus",3,!0),i=x(t,"isValidEvent",3,()=>!1),s=x(t,"customAnchor",3,null),o=x(t,"isStatic",3,!1),a=ie(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);to(e,Mt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside}},()=>a,{forceMount:!0}))}var Sl=K("<div><!></div>");function Al(e,t){const n=gn();ut(t,!0);let r=x(t,"ref",15,null),i=x(t,"id",19,()=>pn(n)),s=x(t,"disabled",3,!1),o=x(t,"onSelect",3,ct),a=x(t,"closeOnSelect",3,!0),l=ie(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const u=or.create({id:T(()=>i()),disabled:T(()=>s()),onSelect:T(()=>o()),ref:T(()=>r(),h=>r(h)),closeOnSelect:T(()=>a())}),f=_(()=>Xt(l,u.props));var d=L(),g=D(d);{var v=h=>{var y=L(),b=D(y);st(b,()=>t.child,()=>({props:c(f)})),A(h,y)},p=h=>{var y=Sl();ue(y,()=>({...c(f)}));var b=R(y);st(b,()=>t.children??pt),M(y),A(h,y)};at(g,h=>{t.child?h(v):h(p,!1)})}A(e,d),dt()}var El=K("<div><!></div>");function Ol(e,t){const n=gn();ut(t,!0);let r=x(t,"ref",15,null),i=x(t,"id",19,()=>pn(n)),s=ie(t,["$$slots","$$events","$$legacy","ref","id","child","children"]);const o=sr.create({id:T(()=>i()),ref:T(()=>r(),g=>r(g))}),a=_(()=>Xt(s,o.props));var l=L(),u=D(l);{var f=g=>{var v=L(),p=D(v);st(p,()=>t.child,()=>({props:c(a)})),A(g,v)},d=g=>{var v=El();ue(v,()=>({...c(a)}));var p=R(v);st(p,()=>t.children??pt),M(v),A(g,v)};at(u,g=>{t.child?g(f):g(d,!1)})}A(e,l),dt()}function Tl(e,t){ut(t,!0);let n=x(t,"open",15,!1),r=x(t,"dir",3,"ltr"),i=x(t,"onOpenChange",3,ct),s=x(t,"onOpenChangeComplete",3,ct),o=x(t,"_internal_variant",3,"dropdown-menu");const a=nr.create({variant:T(()=>o()),dir:T(()=>r()),onClose:()=>{n(!1),i()(!1)}});rr.create({open:T(()=>n(),l=>{n(l),i()(l)}),onOpenChangeComplete:T(()=>s())},a),gl(e,{children:(l,u)=>{var f=L(),d=D(f);st(d,()=>t.children??pt),A(l,f)},$$slots:{default:!0}}),dt()}var Pl=K("<div><div><!></div></div>"),Cl=K("<div><div><!></div></div>");function _l(e,t){const n=gn();ut(t,!0);let r=x(t,"id",19,()=>pn(n)),i=x(t,"ref",15,null),s=x(t,"loop",3,!0),o=x(t,"onInteractOutside",3,ct),a=x(t,"onEscapeKeydown",3,ct),l=x(t,"onCloseAutoFocus",3,ct),u=x(t,"forceMount",3,!1),f=x(t,"trapFocus",3,!1),d=ie(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const g=ir.create({id:T(()=>r()),loop:T(()=>s()),ref:T(()=>i(),S=>i(S)),onCloseAutoFocus:T(()=>l())}),v=_(()=>Xt(d,g.props));function p(S){if(g.handleInteractOutside(S),!S.defaultPrevented&&(o()(S),!S.defaultPrevented)){if(S.target&&S.target instanceof Element){const N=`[${g.parentMenu.root.getBitsAttr("sub-content")}]`;if(S.target.closest(N))return}g.parentMenu.onClose()}}function h(S){a()(S),!S.defaultPrevented&&g.parentMenu.onClose()}var y=L(),b=D(y);{var E=S=>{xl(S,Mt(()=>c(v),()=>g.popperProps,{get ref(){return g.opts.ref},get enabled(){return g.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:h,get trapFocus(){return f()},get loop(){return s()},forceMount:!0,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(O,k)=>{let j=()=>k?.().props,W=()=>k?.().wrapperProps;const F=_(()=>Xt(j(),{style:$r("dropdown-menu")},{style:t.style}));var I=L(),H=D(I);{var q=J=>{var z=L(),G=D(z);{let Z=_(()=>({props:c(F),wrapperProps:W(),...g.snippetProps}));st(G,()=>t.child,()=>c(Z))}A(J,z)},X=J=>{var z=Pl();ue(z,()=>({...W()}));var G=R(z);ue(G,()=>({...c(F)}));var Z=R(G);st(Z,()=>t.children??pt),M(G),M(z),A(J,z)};at(H,J=>{t.child?J(q):J(X,!1)})}A(O,I)},$$slots:{popper:!0}}))},C=S=>{bl(S,Mt(()=>c(v),()=>g.popperProps,{get ref(){return g.opts.ref},get open(){return g.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:h,get trapFocus(){return f()},get loop(){return s()},forceMount:!1,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(O,k)=>{let j=()=>k?.().props,W=()=>k?.().wrapperProps;const F=_(()=>Xt(j(),{style:$r("dropdown-menu")},{style:t.style}));var I=L(),H=D(I);{var q=J=>{var z=L(),G=D(z);{let Z=_(()=>({props:c(F),wrapperProps:W(),...g.snippetProps}));st(G,()=>t.child,()=>c(Z))}A(J,z)},X=J=>{var z=Cl();ue(z,()=>({...W()}));var G=R(z);ue(G,()=>({...c(F)}));var Z=R(G);st(Z,()=>t.children??pt),M(G),M(z),A(J,z)};at(H,J=>{t.child?J(q):J(X,!1)})}A(O,I)},$$slots:{popper:!0}}))};at(b,S=>{u()?S(E):u()||S(C,1)})}A(e,y),dt()}var kl=K("<button><!></button>");function Ml(e,t){const n=gn();ut(t,!0);let r=x(t,"id",19,()=>pn(n)),i=x(t,"ref",15,null),s=x(t,"disabled",3,!1),o=x(t,"type",3,"button"),a=ie(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=ar.create({id:T(()=>r()),disabled:T(()=>s()??!1),ref:T(()=>i(),f=>i(f))}),u=_(()=>Xt(a,l.props,{type:o()}));vl(e,{get id(){return r()},get ref(){return l.opts.ref},children:(f,d)=>{var g=L(),v=D(g);{var p=y=>{var b=L(),E=D(b);st(E,()=>t.child,()=>({props:c(u)})),A(y,b)},h=y=>{var b=kl();ue(b,()=>({...c(u)}));var E=R(b);st(E,()=>t.children??pt),M(b),A(y,b)};at(v,y=>{t.child?y(p):y(h,!1)})}A(f,g)},$$slots:{default:!0}}),dt()}const Fl=Tl,Rl=Ml,Dl=ua,Il=_l,ei=Al,Nl=Ol;function Rn(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 4v16"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}],["path",{d:"M9 20h6"}]];pe(e,Mt({name:"type"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Dn(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];pe(e,Mt({name:"calendar"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function In(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["circle",{cx:"12",cy:"12",r:"1"}]];pe(e,Mt({name:"circle-dot"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Nn(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];pe(e,Mt({name:"link"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Ll(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];pe(e,Mt({name:"tag"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Bl(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];pe(e,Mt({name:"check"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Wl(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m15 18-6-6 6-6"}]];pe(e,Mt({name:"chevron-left"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}var zl=K('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Vl=K('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),Kl=K('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Hl=K("<!> <!> <!>",1),Ul=K("<!> <!>",1),jl=K('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Yl=K('<button><span class="ip-status-dot svelte-x7sio8"></span> </button>'),Gl=K('<div class="ip-status-wrap svelte-x7sio8"><div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div> <div class="ip-status-dropdown svelte-x7sio8"></div></div>'),ql=K('<span class="ip-cal-wd svelte-x7sio8"> </span>'),Xl=K("<button> </button>"),Zl=K('<div class="ip-cal-week svelte-x7sio8"></div>'),Jl=K('<div class="ip-cal-wrap svelte-x7sio8"><span class="ip-date-text svelte-x7sio8"> </span> <div class="ip-cal-dropdown svelte-x7sio8"><div class="ip-cal-header svelte-x7sio8"><button class="ip-cal-nav svelte-x7sio8"><!></button> <span class="ip-cal-title svelte-x7sio8"> </span> <button class="ip-cal-nav svelte-x7sio8"><!></button></div> <div class="ip-cal-weekdays svelte-x7sio8"></div> <!></div></div>'),Ql=K('<span class="ip-badge svelte-x7sio8"> </span>'),$l=K('<button class="ip-wikilink-chip svelte-x7sio8"> </button>'),tu=K('<div class="ip-wikilink-group svelte-x7sio8"></div>'),eu=K('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),nu=K('<span class="ip-date-text svelte-x7sio8"> </span>'),ru=K('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),iu=K('<span class="ip-text-value svelte-x7sio8"> </span>'),ou=K('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),su=K('<div class="ip-row ip-add-row svelte-x7sio8"><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"><input class="ip-add-key-input svelte-x7sio8" type="text" placeholder="Property name"/></div> <div class="ip-value svelte-x7sio8"></div></div>'),au=K('<button class="ip-add-btn svelte-x7sio8"><!> <span>Add property</span></button>'),cu=K('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function _u(e,t){ut(t,!0);let n=x(t,"editable",3,!1);const r=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],i=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let s=B(null),o=B(!1),a=B(""),l=B(void 0);function u(P){switch(P.toLowerCase()){case"active":case"current":case"won":return"#3ecf8e";case"in-progress":case"open":return"#f0c246";case"inactive":case"lost":case"closed":case"former":return"#e54d4d";default:return"#5c5c66"}}function f(P){for(const w of Gn.repos){const rt=w.entities.find(Ct=>Ct.id===P);if(rt){zo(`/${w.name}/${rt.entityType}/${rt.id}`);return}}}function d(P){return typeof P.value=="string"?P.value:P.value[0]}function g(P){return/^https?:\/\//.test(P)}function v(P){try{return new Date(P).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return P}}let p=B(qt(new Date().getFullYear())),h=B(qt(new Date().getMonth()));const y=["Su","Mo","Tu","We","Th","Fr","Sa"],b=["January","February","March","April","May","June","July","August","September","October","November","December"];function E(P,w){const rt=new Date(P,w,1).getDay(),Ct=new Date(P,w+1,0).getDate(),oe=new Date(P,w,0).getDate(),xt=[];let bt=[];for(let Ft=rt-1;Ft>=0;Ft--){const Pe=oe-Ft,se=w===0?11:w-1,xn=w===0?P-1:P;bt.push({day:Pe,month:se,year:xn,outside:!0})}for(let Ft=1;Ft<=Ct;Ft++)bt.push({day:Ft,month:w,year:P,outside:!1}),bt.length===7&&(xt.push(bt),bt=[]);if(bt.length>0){const Ft=w===11?0:w+1,Pe=w===11?P+1:P;let se=1;for(;bt.length<7;)bt.push({day:se++,month:Ft,year:Pe,outside:!0});xt.push(bt)}return xt}function C(P){const w=new Date;return P.day===w.getDate()&&P.month===w.getMonth()&&P.year===w.getFullYear()}function S(P,w){const rt=w.slice(0,10).split("-");return P.year===+rt[0]&&P.month===+rt[1]-1&&P.day===+rt[2]}function N(){c(h)===0?(m(h,11),qe(p,-1)):qe(h,-1)}function O(){c(h)===11?(m(h,0),qe(p)):qe(h)}function k(P){try{const w=P.slice(0,10).split("-");m(p,+w[0]),m(h,+w[1]-1)}catch{const w=new Date;m(p,w.getFullYear(),!0),m(h,w.getMonth(),!0)}}function j(P){requestAnimationFrame(()=>{P.focus(),P.select()})}function W(P){!n()||P.type==="badge"||(P.type==="date"&&k(d(P)),m(s,P.key,!0))}function F(P,w){t.onedit&&t.onedit(P,w),m(s,null)}function I(P,w){const rt=`${w.year}-${String(w.month+1).padStart(2,"0")}-${String(w.day).padStart(2,"0")}`;t.onedit&&t.onedit(P,rt),m(s,null)}function H(P,w){t.ontypechange&&t.ontypechange(P,w)}function q(P){m(s,null),t.onremove&&t.onremove(P)}function X(){m(o,!0),m(a,""),requestAnimationFrame(()=>c(l)?.focus())}function J(){const P=c(a).trim();P&&t.onadd&&t.onadd(P,""),m(o,!1),m(a,"")}function z(){m(o,!1),m(a,"")}function G(P){P.key==="Enter"?(P.preventDefault(),J()):P.key==="Escape"&&z()}var Z=cu();De("click",Mo,()=>{m(s,null)});var At=R(Z);Yt(At,17,()=>t.properties,P=>P.key,(P,w)=>{const rt=_(()=>c(s)===c(w).key);var Ct=ou();let oe;var xt=R(Ct),bt=R(xt);{var Ft=$=>{var Q=L(),tt=D(Q);ae(tt,()=>Fl,(Et,Rt)=>{Rt(Et,{children:(_t,Dt)=>{var It=Ul(),Y=D(It);ae(Y,()=>Rl,(U,V)=>{V(U,{class:"ip-icon-trigger",children:(it,ot)=>{var et=L(),Ot=D(et);{var gt=ft=>{Dn(ft,{size:14})},Ut=ft=>{In(ft,{size:14})},jt=ft=>{Nn(ft,{size:14})},$t=ft=>{Rn(ft,{size:14})};at(Ot,ft=>{c(w).type==="date"?ft(gt):c(w).type==="status"?ft(Ut,1):c(w).type==="wikilink"?ft(jt,2):ft($t,!1)})}A(it,et)},$$slots:{default:!0}})});var kt=nt(Y,2);ae(kt,()=>Dl,(U,V)=>{V(U,{children:(it,ot)=>{var et=L(),Ot=D(et);ae(Ot,()=>Il,(gt,Ut)=>{Ut(gt,{class:"ip-menu-content",sideOffset:4,align:"start",children:(jt,$t)=>{var ft=Hl(),He=D(ft);Yt(He,17,()=>r,te,(Ce,Nt)=>{var je=L(),Ar=D(je);ae(Ar,()=>ei,(Ye,Ge)=>{Ge(Ye,{class:"ip-menu-item",onSelect:()=>H(c(w).key,c(Nt).type),children:(An,mu)=>{var Er=Vl(),En=D(Er),uo=R(En);{var fo=mt=>{Rn(mt,{size:13})},ho=mt=>{Dn(mt,{size:13})},go=mt=>{In(mt,{size:13})},vo=mt=>{Nn(mt,{size:13})};at(uo,mt=>{c(Nt).type==="text"?mt(fo):c(Nt).type==="date"?mt(ho,1):c(Nt).type==="status"?mt(go,2):c(Nt).type==="wikilink"&&mt(vo,3)})}M(En);var On=nt(En,2),po=R(On,!0);M(On);var mo=nt(On,2);{var yo=mt=>{var Tn=zl(),wo=R(Tn);Bl(wo,{size:12}),M(Tn),A(mt,Tn)};at(mo,mt=>{c(w).type===c(Nt).type&&mt(yo)})}yt(()=>ht(po,c(Nt).label)),A(An,Er)},$$slots:{default:!0}})}),A(Ce,je)});var Ue=nt(He,2);ae(Ue,()=>Nl,(Ce,Nt)=>{Nt(Ce,{class:"ip-menu-sep"})});var lo=nt(Ue,2);ae(lo,()=>ei,(Ce,Nt)=>{Nt(Ce,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>q(c(w).key),children:(je,Ar)=>{var Ye=Kl(),Ge=D(Ye),An=R(Ge);Io(An,{size:13}),M(Ge),Pn(2),A(je,Ye)},$$slots:{default:!0}})}),A(jt,ft)},$$slots:{default:!0}})}),A(it,et)},$$slots:{default:!0}})}),A(_t,It)},$$slots:{default:!0}})}),A($,Q)},Pe=$=>{var Q=L(),tt=D(Q);{var Et=Y=>{Dn(Y,{size:14})},Rt=Y=>{In(Y,{size:14})},_t=Y=>{Nn(Y,{size:14})},Dt=Y=>{Ll(Y,{size:14})},It=Y=>{Rn(Y,{size:14})};at(tt,Y=>{c(w).type==="date"?Y(Et):c(w).type==="status"?Y(Rt,1):c(w).type==="wikilink"?Y(_t,2):c(w).type==="badge"?Y(Dt,3):Y(It,!1)})}A($,Q)};at(bt,$=>{n()&&c(w).type!=="badge"?$(Ft):$(Pe,!1)})}M(xt);var se=nt(xt,2),xn=R(se,!0);M(se);var Sn=nt(se,2),ro=R(Sn);{var io=$=>{var Q=jl();Bn(Q),jo(Q,tt=>j?.(tt)),yt(tt=>Lo(Q,tt),[()=>d(c(w))]),De("blur",Q,tt=>{const Et=tt.currentTarget.value;Et!==d(c(w))&&t.onedit?.(c(w).key,Et),m(s,null)}),wt("keydown",Q,tt=>{tt.key==="Enter"?tt.currentTarget.blur():tt.key==="Escape"&&(tt.currentTarget.value=d(c(w)),m(s,null))}),A($,Q)},oo=$=>{var Q=Gl(),tt=R(Q),Et=R(tt);let Rt;var _t=nt(Et,2),Dt=R(_t,!0);M(_t),M(tt);var It=nt(tt,2);Yt(It,21,()=>i,te,(Y,kt)=>{var U=Yl();let V;var it=R(U);let ot;var et=nt(it);M(U),yt((Ot,gt)=>{V=Qe(U,1,"ip-status-option svelte-x7sio8",null,V,Ot),ot=_n(it,"",ot,gt),ht(et,` ${c(kt)??""}`)},[()=>({selected:d(c(w))===c(kt)}),()=>({background:u(c(kt))})]),wt("click",U,()=>F(c(w).key,c(kt))),A(Y,U)}),M(It),M(Q),yt((Y,kt)=>{Rt=_n(Et,"",Rt,Y),ht(Dt,kt)},[()=>({background:u(d(c(w)))}),()=>d(c(w))]),wt("click",Q,Y=>Y.stopPropagation()),A($,Q)},so=$=>{var Q=Jl(),tt=R(Q),Et=R(tt,!0);M(tt);var Rt=nt(tt,2),_t=R(Rt),Dt=R(_t),It=R(Dt);Wl(It,{size:14}),M(Dt);var Y=nt(Dt,2),kt=R(Y);M(Y);var U=nt(Y,2),V=R(U);No(V,{size:14}),M(U),M(_t);var it=nt(_t,2);Yt(it,21,()=>y,te,(et,Ot)=>{var gt=ql(),Ut=R(gt,!0);M(gt),yt(()=>ht(Ut,c(Ot))),A(et,gt)}),M(it);var ot=nt(it,2);Yt(ot,17,()=>E(c(p),c(h)),te,(et,Ot)=>{var gt=Zl();Yt(gt,21,()=>c(Ot),te,(Ut,jt)=>{var $t=Xl();let ft;var He=R($t,!0);M($t),yt(Ue=>{ft=Qe($t,1,"ip-cal-day svelte-x7sio8",null,ft,Ue),ht(He,c(jt).day)},[()=>({outside:c(jt).outside,today:C(c(jt)),selected:S(c(jt),d(c(w)))})]),wt("click",$t,()=>I(c(w).key,c(jt))),A(Ut,$t)}),M(gt),A(et,gt)}),M(Rt),M(Q),yt(et=>{ht(Et,et),ht(kt,`${b[c(h)]??""} ${c(p)??""}`)},[()=>v(d(c(w)))]),wt("click",Q,et=>et.stopPropagation()),wt("click",Dt,N),wt("click",U,O),A($,Q)},ao=$=>{{let Q=_(()=>Array.isArray(c(w).value));Zo($,{get value(){return c(w).value},get multi(){return c(Q)},onselect:tt=>{t.onedit?.(c(w).key,tt),m(s,null)},oncancel:()=>{m(s,null)}})}},co=$=>{var Q=L(),tt=D(Q);{var Et=U=>{var V=Ql(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>d(c(w))]),A(U,V)},Rt=U=>{var V=tu();Yt(V,21,()=>Array.isArray(c(w).value)?c(w).value:[c(w).value],te,(it,ot)=>{var et=$l(),Ot=R(et,!0);M(et),yt(()=>ht(Ot,c(ot))),wt("click",et,gt=>{gt.stopPropagation(),f(c(ot))}),A(it,et)}),M(V),A(U,V)},_t=U=>{var V=eu(),it=R(V);let ot;var et=nt(it,2),Ot=R(et,!0);M(et),M(V),yt((gt,Ut)=>{ot=_n(it,"",ot,gt),ht(Ot,Ut)},[()=>({background:u(d(c(w)))}),()=>d(c(w))]),A(U,V)},Dt=U=>{var V=nu(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>v(d(c(w)))]),A(U,V)},It=U=>{var V=ru(),it=R(V,!0);M(V),yt((ot,et)=>{Bo(V,"href",ot),ht(it,et)},[()=>d(c(w)),()=>d(c(w))]),wt("click",V,ot=>ot.stopPropagation()),A(U,V)},Y=_(()=>g(d(c(w)))),kt=U=>{var V=iu(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>d(c(w))]),A(U,V)};at(tt,U=>{c(w).type==="badge"?U(Et):c(w).type==="wikilink"?U(Rt,1):c(w).type==="status"?U(_t,2):c(w).type==="date"?U(Dt,3):c(Y)?U(It,4):U(kt,!1)})}A($,Q)};at(ro,$=>{c(rt)&&c(w).type==="text"?$(io):c(rt)&&c(w).type==="status"?$(oo,1):c(rt)&&c(w).type==="date"?$(so,2):c(rt)&&c(w).type==="wikilink"?$(ao,3):$(co,!1)})}M(Sn),M(Ct),yt(()=>{oe=Qe(Ct,1,"ip-row svelte-x7sio8",null,oe,{"ip-focused":c(rt)}),ht(xn,c(w).key)}),wt("click",xt,$=>$.stopPropagation()),wt("click",Sn,$=>{$.stopPropagation(),W(c(w))}),A(P,Ct)});var Te=nt(At,2);{var eo=P=>{var w=su(),rt=R(w),Ct=R(rt);Tr(Ct,{size:14}),M(rt);var oe=nt(rt,2),xt=R(oe);Bn(xt),Yn(xt,bt=>m(l,bt),()=>c(l)),M(oe),Pn(2),M(w),wt("keydown",xt,G),De("blur",xt,z),ci(xt,()=>c(a),bt=>m(a,bt)),A(P,w)},no=P=>{var w=au(),rt=R(w);Tr(rt,{size:14}),Pn(2),M(w),wt("click",w,Ct=>{Ct.stopPropagation(),X()}),A(P,w)};at(Te,P=>{c(o)?P(eo):n()&&P(no,1)})}M(Z),A(e,Z),dt()}ri(["click","keydown"]);var lu=K('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div></div>');function ku(e,t){ut(t,!0);let n=x(t,"readonly",3,!0),r=x(t,"resetKey",3,0);const i=Ln("theme");let s,o=null,a=t.content,l=!1;function u(g,v){return g.theme({"&":{backgroundColor:"transparent",color:"var(--color-text-primary)",fontSize:"15px",fontFamily:"var(--font-sans)"},".cm-content":{padding:"32px 40px",fontFamily:"var(--font-sans)",caretColor:"var(--color-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:v?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:v?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},".cm-header-1":{fontSize:"22px",fontWeight:"600"},".cm-header-2":{fontSize:"16px",fontWeight:"600"},".cm-header-3":{fontSize:"15px",fontWeight:"600"},".cm-formatting":{color:"var(--color-text-tertiary)",opacity:"0.5"},".cm-link":{color:"var(--color-link)",textDecoration:"none"}},{dark:v})}si(async()=>{const{EditorState:g}=await be(async()=>{const{EditorState:F}=await import("./DnlgZ_Tk.js");return{EditorState:F}},[],import.meta.url),{EditorView:v,keymap:p}=await be(async()=>{const{EditorView:F,keymap:I}=await import("./DtVH--hH.js").then(H=>H.i);return{EditorView:F,keymap:I}},__vite__mapDeps([0,1]),import.meta.url),{markdown:h}=await be(async()=>{const{markdown:F}=await import("./Dh_H7Owr.js");return{markdown:F}},__vite__mapDeps([2,1,0,3,4]),import.meta.url),{syntaxHighlighting:y,HighlightStyle:b}=await be(async()=>{const{syntaxHighlighting:F,HighlightStyle:I}=await import("./4QY4j-jX.js");return{syntaxHighlighting:F,HighlightStyle:I}},__vite__mapDeps([3,4,1,0]),import.meta.url),{tags:E}=await be(async()=>{const{tags:F}=await import("./CUzqHQY_.js").then(I=>I.i);return{tags:F}},[],import.meta.url),{livePreviewPlugin:C,livePreviewTheme:S}=await be(async()=>{const{livePreviewPlugin:F,livePreviewTheme:I}=await import("./aosHekRC.js");return{livePreviewPlugin:F,livePreviewTheme:I}},__vite__mapDeps([5,0,1,3,4]),import.meta.url),N=i.current==="dark",O=u(v,N),k=b.define([{tag:E.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),j=[h(),O,y(k),C,S,v.lineWrapping];n()&&j.push(g.readOnly.of(!0)),t.onchange&&j.push(v.updateListener.of(F=>{if(F.docChanged&&!l){const I=F.state.doc.toString();a=I,t.onchange(I)}})),j.push(v.domEventHandlers({click(F){const I=F.target;if(t.onwikilinkclick){const q=I.closest(".cm-live-wikilink");if(q){F.preventDefault();const X=q.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return X&&t.onwikilinkclick(X),!0}}const H=I.closest(".cm-live-link");if(H){const q=H.getAttribute("data-href");if(q)return F.preventDefault(),window.open(q,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&j.push(p.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const W=g.create({doc:t.content,extensions:j});o=new v({state:W,parent:s})}),vt(()=>{if(r(),o&&t.content!==a){a=t.content;const g=s.closest(".document-scroll"),v=g?.scrollTop??0;l=!0,o.dispatch({changes:{from:0,to:o.state.doc.length,insert:t.content}}),l=!1,g&&requestAnimationFrame(()=>{g.scrollTop=v})}}),Fo(()=>{o?.destroy()});var f=lu(),d=R(f);Yn(d,g=>s=g,()=>s),M(f),A(e,f),dt()}const uu=/^\d{4}-\d{2}-\d{2}/,du=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),fu=new Set(["entity_type","format"]),hu=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Mu(e,t){const n=[];for(const[r,i]of Object.entries(e)){if(hu.has(r)||i==null)continue;const s=gu(r,i);s&&n.push(s)}return n}function gu(e,t){if(fu.has(e))return{key:e,value:String(t).toUpperCase(),type:"badge"};if(e==="status")return{key:e,value:String(t),type:"status"};if(Array.isArray(t)){const i=t.map(String),s=i.some(a=>/^\[\[.+?\]\]$/.test(a)),o=i.map(a=>{const l=a.match(/^\[\[(.+?)\]\]$/);return l?l[1]:a});return s||o.every(a=>ni(a))?{key:e,value:o,type:"wikilink"}:{key:e,value:i.join(", "),type:"text"}}const n=String(t),r=n.match(/^\[\[(.+?)\]\]$/);return r?{key:e,value:r[1],type:"wikilink"}:uu.test(n)?{key:e,value:n,type:"date"}:du.has(n.toLowerCase())?{key:e,value:n,type:"status"}:ni(n)&&!n.includes(" ")?{key:e,value:n,type:"wikilink"}:{key:e,value:n,type:"text"}}function ni(e){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(e)&&e.includes("-")}const vu=800;function pu(){let e=B(!1),t=B(null),n=B(null),r=null,i=null,s=null,o=!1;function a(h,y,b,E){r&&r.repo===h&&r.type===y&&r.id===b?(E.data!==void 0&&(r.payload.data=E.data),E.content!==void 0&&(r.payload.content=E.content)):r={repo:h,type:y,id:b,payload:{...E}},i=null,u()}function l(h,y,b,E,C){i={repo:h,type:y,id:b,filePath:E,content:C},r=null,u()}function u(){s&&clearTimeout(s),s=setTimeout(f,vu)}async function f(){if(s=null,!o){if(r){const{repo:h,type:y,id:b,payload:E}=r;r=null,o=!0,m(e,!0),m(n,null);try{if(await Pr(h,y,b,E),m(t,new Date,!0),E.data?.name){const S=Gn.repos.find(N=>N.name===h)?.entities.find(N=>N.id===b);S&&(S.title=E.data.name)}d()}catch(C){m(n,C.message??"Save failed",!0),r={repo:h,type:y,id:b,payload:E}}finally{m(e,!1),o=!1,(r||i)&&f()}}else if(i){const{repo:h,type:y,id:b,filePath:E,content:C}=i;i=null,o=!0,m(e,!0),m(n,null);try{await Wo(h,y,b,E,C),m(t,new Date,!0),d()}catch(S){m(n,S.message??"Save failed",!0),i={repo:h,type:y,id:b,filePath:E,content:C}}finally{m(e,!1),o=!1,(r||i)&&f()}}}}function d(){Cr.refresh()}function g(){s&&(clearTimeout(s),s=null),(r||i)&&f()}async function v(h,y,b,E){m(e,!0),m(n,null);try{const C=await Pr(h,y,b,E);return m(t,new Date,!0),await Cr.refresh(),C}catch(C){return m(n,C.message??"Save failed",!0),null}finally{m(e,!1)}}function p(){m(n,null),m(t,null),r=null,i=null,s&&(clearTimeout(s),s=null)}return{get saving(){return c(e)},get lastSaved(){return c(t)},get error(){return c(n)},get hasPending(){return!!(r||i||o)},scheduleAutoSave:a,scheduleContentFileSave:l,flush:g,saveEntity:v,reset:p}}const Fu=pu();export{ku as C,_u as I,Fu as e,Mu as t};