@maudecode/talaria-web 0.0.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_release.json +20 -0
- package/dist/api/chat-router.d.ts +54 -1
- package/dist/api/sessions-router.d.ts +296 -1
- package/dist/api/settings-router.d.ts +8 -0
- package/dist/api/settings-router.js +13 -5
- package/dist/api/settings-router.js.map +1 -1
- package/dist/api/sse-routes.js +1 -1
- package/dist/api/sse-routes.js.map +1 -1
- package/dist/api/tools-router.d.ts +91 -0
- package/dist/api/tools-router.js +4 -4
- package/dist/api/tools-router.js.map +1 -1
- package/dist/app.d.ts +449 -2
- package/dist/bin/talaria-web.js +4 -1
- package/dist/bin/talaria-web.js.map +1 -1
- package/dist/cli/supervise.js +2 -1
- package/dist/cli/supervise.js.map +1 -1
- package/dist/runtime.js +8 -2
- package/dist/runtime.js.map +1 -1
- package/dist/sessions/anchor.d.ts +57 -5
- package/dist/sessions/anchor.js +368 -32
- package/dist/sessions/anchor.js.map +1 -1
- package/dist/sessions/merge.d.ts +6 -0
- package/dist/sessions/merge.js +35 -4
- package/dist/sessions/merge.js.map +1 -1
- package/dist/sessions/service.d.ts +2 -0
- package/dist/sessions/service.js +31 -16
- package/dist/sessions/service.js.map +1 -1
- package/dist/sessions/session.js +1 -1
- package/dist/sessions/session.js.map +1 -1
- package/dist/sessions/turn.d.ts +14 -0
- package/dist/sessions/turn.js +147 -20
- package/dist/sessions/turn.js.map +1 -1
- package/dist/sessions/window.d.ts +1 -0
- package/dist/sessions/window.js +1 -1
- package/dist/sessions/window.js.map +1 -1
- package/dist/settings.js +5 -0
- package/dist/settings.js.map +1 -1
- package/dist/sidecar/client.d.ts +1 -1
- package/dist/sidecar/client.js +15 -4
- package/dist/sidecar/client.js.map +1 -1
- package/dist/sidecar/fake.js +3 -2
- package/dist/sidecar/fake.js.map +1 -1
- package/dist/tools/crons.js +55 -43
- package/dist/tools/crons.js.map +1 -1
- package/dist/tools/updates.d.ts +51 -13
- package/dist/tools/updates.js +362 -114
- package/dist/tools/updates.js.map +1 -1
- package/package.json +2 -2
- package/sidecar/agent_dependency.json +4 -3
- package/sidecar/talaria_sidecar/home.py +29 -20
- package/sidecar/talaria_sidecar/methods/config.py +5 -3
- package/sidecar/talaria_sidecar/runtime.py +3 -9
- package/static/dist/FILES.txt +116 -116
- package/static/dist/assets/AppShell-hikzkcql.js +1 -0
- package/static/dist/assets/ChatPage-ofqn89h9.js +21 -0
- package/static/dist/assets/{HubRoute-qs9vzuh0.js → HubRoute-f2zrs9si.js} +1 -1
- package/static/dist/assets/{Markdown-bt9bqd6a.js → Markdown-ftyfzds0.js} +7 -7
- package/static/dist/assets/RightPanel-febk3dkd.js +1 -0
- package/static/dist/assets/Select-lvx8gihl.js +1 -0
- package/static/dist/assets/SessionListPanel-o70ljmik.js +1 -0
- package/static/dist/assets/SettingsLayout-pdpmhy1o.js +1 -0
- package/static/dist/assets/States-i46tz8an.js +1 -0
- package/static/dist/assets/{Toaster-jtn59pjm.js → Toaster-fklyeeyh.js} +1 -1
- package/static/dist/assets/_app-j3rors25.js +1 -0
- package/static/dist/assets/_app.ext._extensionId-c0ey5ec9.js +1 -0
- package/static/dist/assets/_app.index-coy9jrto.js +1 -0
- package/static/dist/assets/_app.insights-ebd2k0i5.js +1 -0
- package/static/dist/assets/_app.kanban-e2p7ypi5.js +1 -0
- package/static/dist/assets/_app.logs-ml21mfyz.js +1 -0
- package/static/dist/assets/_app.memory-lhu5mm47.js +1 -0
- package/static/dist/assets/_app.profiles-egx0fgjo.js +1 -0
- package/static/dist/assets/{_app.session._sessionId-kevi4qd2.js → _app.session._sessionId-n1ggcf5e.js} +1 -1
- package/static/dist/assets/_app.settings-d0vqtyid.js +1 -0
- package/static/dist/assets/_app.settings._section-cnzj6pli.js +1 -0
- package/static/dist/assets/_app.skills-kkug8obu.js +1 -0
- package/static/dist/assets/{_app.tasks-b99d98fo.js → _app.tasks-nf285d2o.js} +2 -2
- package/static/dist/assets/_app.todos-dxalqp1e.js +1 -0
- package/static/dist/assets/_app.workspaces-bqtduujs.js +1 -0
- package/static/dist/assets/{abnfDiagram-VCTEODGH-hvrr25lb.js → abnfDiagram-VCTEODGH-i4bgzu83.js} +1 -1
- package/static/dist/assets/architecture-7GRP2DOG-o8zqevhv.js +1 -0
- package/static/dist/assets/{architectureDiagram-5GKGNRK7-b3r0z8sq.js → architectureDiagram-5GKGNRK7-mx21lwqa.js} +1 -1
- package/static/dist/assets/{blockDiagram-I7D4REHJ-hd3gw0cj.js → blockDiagram-I7D4REHJ-o1hhchxv.js} +1 -1
- package/static/dist/assets/{c4Diagram-7LVT6UL2-jlmbjiji.js → c4Diagram-7LVT6UL2-jygqtvd8.js} +1 -1
- package/static/dist/assets/channel-mw8l793e.js +1 -0
- package/static/dist/assets/{chunk-4HAMMTFA-oydbpsin.js → chunk-4HAMMTFA-hjcpubgk.js} +1 -1
- package/static/dist/assets/{chunk-75Z2AOVW-j633otj1.js → chunk-75Z2AOVW-eibnex6m.js} +1 -1
- package/static/dist/assets/{chunk-DU6HZSFF-ods2l027.js → chunk-DU6HZSFF-k1tp3qnp.js} +3 -3
- package/static/dist/assets/{chunk-F27PBJKO-ln4n2cwt.js → chunk-F27PBJKO-lvcgn16f.js} +1 -1
- package/static/dist/assets/{chunk-GMAD6QVW-fpz133eh.js → chunk-GMAD6QVW-ldlzruv1.js} +1 -1
- package/static/dist/assets/{chunk-GVQU2GXP-abs9ixiy.js → chunk-GVQU2GXP-hs1mva9d.js} +1 -1
- package/static/dist/assets/{chunk-IMKFNOWR-j9vukdy1.js → chunk-IMKFNOWR-o7eqx3yb.js} +1 -1
- package/static/dist/assets/{chunk-L3NEJ4N5-cfyw87r3.js → chunk-L3NEJ4N5-bp1ofl70.js} +1 -1
- package/static/dist/assets/{chunk-OSK3NFVY-baja78wr.js → chunk-OSK3NFVY-o8m6mdz5.js} +1 -1
- package/static/dist/assets/{chunk-P2QGCYS3-g66xby8h.js → chunk-P2QGCYS3-kx83fti2.js} +1 -1
- package/static/dist/assets/{chunk-POPQ4Y6H-osqu864t.js → chunk-POPQ4Y6H-mwl99e9y.js} +1 -1
- package/static/dist/assets/{chunk-PWAF6VOD-egejasv1.js → chunk-PWAF6VOD-oriuokxy.js} +1 -1
- package/static/dist/assets/{chunk-SHT3W25Y-l014h8zz.js → chunk-SHT3W25Y-ab5cf00v.js} +1 -1
- package/static/dist/assets/{chunk-SVP7TREG-n3z10bp3.js → chunk-SVP7TREG-kqdrpr17.js} +1 -1
- package/static/dist/assets/{chunk-TICWLB2K-bzozkjc0.js → chunk-TICWLB2K-kfbnjabk.js} +1 -1
- package/static/dist/assets/classDiagram-ZZMXUADV-egajr1wp.js +1 -0
- package/static/dist/assets/classDiagram-v2-VYDZK3BY-egajr1wp.js +1 -0
- package/static/dist/assets/{copied-cjsttec1.js → copied-dp33szhq.js} +1 -1
- package/static/dist/assets/{cynefin-OW5HDTMX-elpt7h1j.js → cynefin-OW5HDTMX-mm5sj9s7.js} +1 -1
- package/static/dist/assets/{cynefinDiagram-5FMLGOSQ-5mzl5pi2.js → cynefinDiagram-5FMLGOSQ-nfon5q38.js} +1 -1
- package/static/dist/assets/{dagre-GXQ25YYZ-ihwlhmfl.js → dagre-GXQ25YYZ-dzdp9ypb.js} +1 -1
- package/static/dist/assets/{diagram-S7CK7UJ4-4z90agaz.js → diagram-S7CK7UJ4-ckxzqo01.js} +1 -1
- package/static/dist/assets/{diagram-UQ7AKVKN-eifw0lg7.js → diagram-UQ7AKVKN-hw16h1um.js} +1 -1
- package/static/dist/assets/{diagram-VSXAHHWV-ksh3sjqv.js → diagram-VSXAHHWV-mu7wu2zg.js} +1 -1
- package/static/dist/assets/{diagram-VX7I27RA-ett72f71.js → diagram-VX7I27RA-k9uprwtj.js} +1 -1
- package/static/dist/assets/{diagram-Z3DM3KII-l8scp8nu.js → diagram-Z3DM3KII-csdjzrg9.js} +1 -1
- package/static/dist/assets/{ebnfDiagram-PWID7BFC-f0pxcmit.js → ebnfDiagram-PWID7BFC-n8mbw2jj.js} +1 -1
- package/static/dist/assets/endpoints-f6ngsyu5.js +64 -0
- package/static/dist/assets/{erDiagram-RLTQ6QDP-f47m5xh0.js → erDiagram-RLTQ6QDP-fsfe1uj0.js} +1 -1
- package/static/dist/assets/eventmodeling-NTZA5JFV-k3zhqcyl.js +1 -0
- package/static/dist/assets/flowDiagram-HODETNUW-bdxes51f.js +1 -0
- package/static/dist/assets/{ganttDiagram-EL5Y4UJY-bmktjdi0.js → ganttDiagram-EL5Y4UJY-gsba3iq9.js} +1 -1
- package/static/dist/assets/{gitGraph-4MIJSDKK-j2ueg258.js → gitGraph-4MIJSDKK-na86q1pu.js} +1 -1
- package/static/dist/assets/{gitGraphDiagram-WWUBYQGX-ms6586v9.js → gitGraphDiagram-WWUBYQGX-g72ew3xz.js} +1 -1
- package/static/dist/assets/{highlighted-body-KPVGNVTW-ev52d2si.js → highlighted-body-KPVGNVTW-okn18cp1.js} +1 -1
- package/static/dist/assets/index-ab0wj9ik.css +2 -0
- package/static/dist/assets/index-fd27xooo.js +11 -0
- package/static/dist/assets/{info-A6RAGUB7-j717vyt7.js → info-A6RAGUB7-i01jeltk.js} +1 -1
- package/static/dist/assets/{infoDiagram-27XIBGKW-dsbpib36.js → infoDiagram-27XIBGKW-cayiv6fa.js} +1 -1
- package/static/dist/assets/{ishikawaDiagram-5VMMS53U-n0sz3i2d.js → ishikawaDiagram-5VMMS53U-g4rf14bv.js} +1 -1
- package/static/dist/assets/{journeyDiagram-3NMN7TZE-mcxz1mme.js → journeyDiagram-3NMN7TZE-fusb2424.js} +1 -1
- package/static/dist/assets/{kanban-definition-UXKFOSKX-n6hq2lyc.js → kanban-definition-UXKFOSKX-g831pwlr.js} +1 -1
- package/static/dist/assets/{lazyRouteComponent-faquioun.js → lazyRouteComponent-ol965zwk.js} +1 -1
- package/static/dist/assets/{line-h5xq20s4.js → line-md6em6gc.js} +1 -1
- package/static/dist/assets/login-kfclsqd2.js +1 -0
- package/static/dist/assets/mermaid-HWGCJPDP-ejk0d88t.js +1 -0
- package/static/dist/assets/{mermaid-parser.core-n9cuu5ue.js → mermaid-parser.core-mq3uns9m.js} +3 -3
- package/static/dist/assets/{mindmap-definition-YA3MSWOX-gta3u7z4.js → mindmap-definition-YA3MSWOX-oxafrned.js} +1 -1
- package/static/dist/assets/onboarding-fo6hnkyv.js +1 -0
- package/static/dist/assets/{packet-AYTQ26CC-bpzuq5n6.js → packet-AYTQ26CC-ggxyvbym.js} +1 -1
- package/static/dist/assets/{pegDiagram-XKGWAZYB-juye13e5.js → pegDiagram-XKGWAZYB-nk7xcqgp.js} +1 -1
- package/static/dist/assets/{pie-WAS4IAKB-odhb8buq.js → pie-WAS4IAKB-ito2razh.js} +1 -1
- package/static/dist/assets/{pieDiagram-E7YTZNPT-mgb14ksh.js → pieDiagram-E7YTZNPT-g02xexar.js} +1 -1
- package/static/dist/assets/{quadrantDiagram-AXDQQJYC-cg36naog.js → quadrantDiagram-AXDQQJYC-d4jn4xq5.js} +1 -1
- package/static/dist/assets/{radar-RG4KPBEZ-lgzfpnef.js → radar-RG4KPBEZ-nebvfdzt.js} +1 -1
- package/static/dist/assets/{railroad-74A4TZTK-gmglc3ua.js → railroad-74A4TZTK-ny3gebse.js} +1 -1
- package/static/dist/assets/railroad-abnf-HS5TGJTU-gtd38edw.js +1 -0
- package/static/dist/assets/railroad-ebnf-LZEXJU2U-o238oax2.js +1 -0
- package/static/dist/assets/railroad-peg-WCYAUIDC-c4acqp2j.js +1 -0
- package/static/dist/assets/{railroadDiagram-O6MQD6OU-cmxwjt73.js → railroadDiagram-O6MQD6OU-m09mmu67.js} +1 -1
- package/static/dist/assets/{refresh-cw-mf192q3f.js → refresh-cw-eitd7yva.js} +1 -1
- package/static/dist/assets/{requirementDiagram-BXWQKSXE-ir0s2mek.js → requirementDiagram-BXWQKSXE-evggpcbk.js} +1 -1
- package/static/dist/assets/{sankeyDiagram-P5KCCOFB-jo7jcdq0.js → sankeyDiagram-P5KCCOFB-bun89039.js} +1 -1
- package/static/dist/assets/{saved-g777hp1t.js → saved-culx14ii.js} +1 -1
- package/static/dist/assets/{search-i2kfogyx.js → search-nu6kzq55.js} +1 -1
- package/static/dist/assets/{sequenceDiagram-WJ2MYXX4-n0pf6xk5.js → sequenceDiagram-WJ2MYXX4-hhs9f09o.js} +1 -1
- package/static/dist/assets/{settings_section_extensions_title-hgvh507l.js → settings_section_extensions_title-mj0gcozh.js} +1 -1
- package/static/dist/assets/share._token-k4pcnxqu.js +2 -0
- package/static/dist/assets/sliders-horizontal-b9ljga1o.js +1 -0
- package/static/dist/assets/{stateDiagram-D77RDMKH-olbrwyv9.js → stateDiagram-D77RDMKH-gi7t1tro.js} +1 -1
- package/static/dist/assets/stateDiagram-v2-MP3YSRHH-jtadbol7.js +1 -0
- package/static/dist/assets/{swimlanes-42K2YHIH-od14zrw6.js → swimlanes-42K2YHIH-ea5urvph.js} +1 -1
- package/static/dist/assets/swimlanesDiagram-VR7AAH4N-ki7weepw.js +8 -0
- package/static/dist/assets/{timeline-definition-24CTP7MA-l0qokmnb.js → timeline-definition-24CTP7MA-mq64rm3b.js} +1 -1
- package/static/dist/assets/{todoStore-la6uyqzj.js → todoStore-azvfuqbv.js} +1 -1
- package/static/dist/assets/{trash-bxz1k9cw.js → trash-osyo895g.js} +1 -1
- package/static/dist/assets/{treeView-Q6P3EWNA-hma3ip8m.js → treeView-Q6P3EWNA-cimbtxlz.js} +1 -1
- package/static/dist/assets/{treemap-WGGIJYW6-bghjng5m.js → treemap-WGGIJYW6-wig5gi1y.js} +1 -1
- package/static/dist/assets/{untitled-nfaw0q7m.js → untitled-mbwemvxf.js} +1 -1
- package/static/dist/assets/{useForm-k7fj2zsr.js → useForm-li4bljlv.js} +1 -1
- package/static/dist/assets/useLocale-kdew6auf.js +1 -0
- package/static/dist/assets/{vennDiagram-4TSXK5OY-bo97zf3z.js → vennDiagram-4TSXK5OY-ez63kh7n.js} +1 -1
- package/static/dist/assets/{wardley-WFR3VGLG-pbjl6jav.js → wardley-WFR3VGLG-r7rftz31.js} +1 -1
- package/static/dist/assets/{wardleyDiagram-VM6X3IG4-bmy9i09l.js → wardleyDiagram-VM6X3IG4-mvqg9eqc.js} +1 -1
- package/static/dist/assets/{xychartDiagram-S5SC5T6Z-eercu0mc.js → xychartDiagram-S5SC5T6Z-eqxdfc91.js} +1 -1
- package/static/dist/index.html +1 -1
- package/static/dist/sw.js +1 -1
- package/static/dist/assets/AppShell-gs0grlbs.js +0 -1
- package/static/dist/assets/ChatPage-gi1xlz52.js +0 -18
- package/static/dist/assets/RightPanel-dn19xu42.js +0 -1
- package/static/dist/assets/Select-y7wtf85g.js +0 -1
- package/static/dist/assets/SessionListPanel-igwdj9xr.js +0 -1
- package/static/dist/assets/SettingsLayout-n6mu0ghg.js +0 -1
- package/static/dist/assets/States-oil2issf.js +0 -1
- package/static/dist/assets/_app-k4jrkgfa.js +0 -1
- package/static/dist/assets/_app.ext._extensionId-mmf1mepm.js +0 -1
- package/static/dist/assets/_app.index-mb41nf00.js +0 -1
- package/static/dist/assets/_app.insights-mz5cep8m.js +0 -1
- package/static/dist/assets/_app.kanban-ocgw506i.js +0 -1
- package/static/dist/assets/_app.logs-lstmoju6.js +0 -1
- package/static/dist/assets/_app.memory-dishj9ra.js +0 -1
- package/static/dist/assets/_app.profiles-dynpvsio.js +0 -1
- package/static/dist/assets/_app.settings-c2czm9v4.js +0 -1
- package/static/dist/assets/_app.settings._section-exwflld7.js +0 -1
- package/static/dist/assets/_app.skills-j5jh2nug.js +0 -1
- package/static/dist/assets/_app.todos-ma8urvn3.js +0 -1
- package/static/dist/assets/_app.workspaces-l86cxeod.js +0 -1
- package/static/dist/assets/architecture-7GRP2DOG-mqft9w2p.js +0 -1
- package/static/dist/assets/channel-ix8cxdld.js +0 -1
- package/static/dist/assets/classDiagram-ZZMXUADV-c210y3il.js +0 -1
- package/static/dist/assets/classDiagram-v2-VYDZK3BY-c210y3il.js +0 -1
- package/static/dist/assets/endpoints-ipnv1hd4.js +0 -64
- package/static/dist/assets/eventmodeling-NTZA5JFV-d9b5a0ia.js +0 -1
- package/static/dist/assets/flowDiagram-HODETNUW-kfxxsyrk.js +0 -1
- package/static/dist/assets/index-bz7g7rhx.css +0 -2
- package/static/dist/assets/index-hywfjw88.js +0 -11
- package/static/dist/assets/login-mvjys1ol.js +0 -1
- package/static/dist/assets/mermaid-HWGCJPDP-gmnkgf1n.js +0 -1
- package/static/dist/assets/onboarding-l6quy6gz.js +0 -1
- package/static/dist/assets/railroad-abnf-HS5TGJTU-5mjl5wpv.js +0 -1
- package/static/dist/assets/railroad-ebnf-LZEXJU2U-bfram8v8.js +0 -1
- package/static/dist/assets/railroad-peg-WCYAUIDC-nwfczn88.js +0 -1
- package/static/dist/assets/share._token-il3y6js2.js +0 -2
- package/static/dist/assets/sliders-horizontal-kd99ffvl.js +0 -1
- package/static/dist/assets/stateDiagram-v2-MP3YSRHH-dnzlmdpu.js +0 -1
- package/static/dist/assets/swimlanesDiagram-VR7AAH4N-ck0eqqdp.js +0 -8
- package/static/dist/assets/useLocale-evhacmv2.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-b9miacsj.js";import{n as t,t as n}from"./jsx-runtime-eu92a5pu.js";import{n as r,r as i}from"./useSelector-f2aak1ol.js";import{$ as a,B as o,U as s,V as c,Vt as l,Wt as u,j as d,st as f,tn as p}from"./endpoints-f6ngsyu5.js";import{a as m,i as h,r as g}from"./Toaster-fklyeeyh.js";import{A as _,B as v,E as y,I as b,J as x,M as S,P as C,U as w,a as T,i as E,o as D,z as O}from"./index-fd27xooo.js";var k=class extends S{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),O(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&C(t.mutationKey)!==C(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??y();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){_.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},A=e(t(),1);function j(e,t){let n=w(t),[r]=A.useState(()=>new k(n,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);let i=A.useSyncExternalStore(A.useCallback(e=>r.subscribe(_.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=A.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(b)},[r]);if(i.error&&v(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var M={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};M.node;var N=h(M),P={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};P.node;var F=h(P);function I(){return m({queryKey:g.settings,queryFn:a,staleTime:3e4})}function L(){let e=w();return j({mutationKey:g.settings,mutationFn:e=>l(e),onSuccess:t=>{t&&typeof t==`object`&&`bot_name`in t&&e.setQueryData(g.settings,t),e.invalidateQueries({queryKey:g.settings})}})}function R(){let e=w();return j({mutationFn:({model:e,provider:t})=>u(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:g.settings}),e.invalidateQueries({queryKey:g.models})}})}function z(){return m({queryKey:g.profiles,queryFn:s,staleTime:3e4})}function ee(e={}){return m({queryKey:g.models,queryFn:()=>o(),staleTime:6e4,...e})}function te(){return m({queryKey:g.workspaces,queryFn:f,staleTime:3e4})}function ne(e=!0){return m({queryKey:g.dashboard,queryFn:d,staleTime:6e4,enabled:e})}function re(){return m({queryKey:g.onboarding,queryFn:c,staleTime:0})}function ie(){let e=w();return j({mutationFn:e=>p(e),onSuccess:async()=>{e.clear(),await e.invalidateQueries()}})}function B(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var V=B(`https://base-ui.com/production-error`,`Base UI`),ae={};function oe(e,t){let n=A.useRef(ae);return n.current===ae&&(n.current=e(t)),n}function se(e,t,n,r){let i=oe(le).current;return ue(i,e,t,n,r)&&fe(i,[e,t,n,r]),i.callback}function ce(e){let t=oe(le).current;return de(t,e)&&fe(t,e),t.callback}function le(){return{callback:null,cleanup:null,refs:[]}}function ue(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function de(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function fe(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var pe=e(x(),1),H=n(),me=19;function he(e){return me>=e}function ge(e){if(!A.isValidElement(e))return null;let t=e,n=t.props;return(he(19)?n?.ref:t.ref)??null}function _e(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ve(){}var ye=Object.freeze([]),be=Object.freeze({});function xe(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Se(e,t){return typeof e==`function`?e(t):e}function Ce(e,t){return typeof e==`function`?e(t):e}var we={};function Te(e,t,n,r,i){if(!n&&!r&&!i&&!e)return De(t);let a=De(e);return t&&(a=Oe(a,t)),n&&(a=Oe(a,n)),r&&(a=Oe(a,r)),i&&(a=Oe(a,i)),a}function Ee(e){if(e.length===0)return we;if(e.length===1)return De(e[0]);let t=De(e[0]);for(let n=1;n<e.length;n+=1)t=Oe(t,e[n]);return t}function De(e){return Me(e)?{...Ne(e,we)}:ke(e)}function Oe(e,t){return Me(t)?Ne(t,e):Ae(e,t)}function ke(e){let t={...e};for(let e in t){let n=t[e];je(e,n)&&(t[e]=Fe(n))}return t}function Ae(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=_e(e.style,r);break;case`className`:e[n]=Le(e.className,r);break;default:e[n]=je(n,r)?Pe(e[n],r):r}}return e}function je(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Me(e){return typeof e==`function`}function Ne(e,t){return Me(e)?e(t):e??we}function Pe(e,t){return t?e?(...n)=>{let r=n[0];if(Re(r)){let i=r;Ie(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Fe(t):e}function Fe(e){return e&&((...t)=>{let n=t[0];return Re(n)&&Ie(n),e(...t)})}function Ie(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Le(e,t){return t?e?t+` `+e:t:e}function Re(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function ze(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ue(r));let i=Be(t,n,r);if(n.enabled===!1)return null;let a=n.state??be;return We(e,r,i,a)}function Be(e,t,n){let{className:r,style:i}=e,{state:a=be,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Se(r,a):void 0,d=l?Ce(i,a):void 0,f=l?xe(a,c):be,p=l&&s?Ve(s):void 0,m=l?_e(f,p)??{}:be;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?ce([m.ref,ge(n),...o]):se(m.ref,ge(n),o):se(null,null)),l?(u!==void 0&&(m.className=Le(m.className,u)),d!==void 0&&(m.style=_e(m.style,d)),m):be}function Ve(e){return Array.isArray(e)?Ee(e):Te(void 0,e)}var He=Symbol.for(`react.lazy`);function Ue(e){if(e?.$$typeof!==He)return e;let t=A.Children.toArray(e)[0];return A.isValidElement(t)?t:e}function We(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Te(n,t.props);return e.ref=n.ref,A.cloneElement(t,e)}if(e&&typeof e==`string`)return Ge(e,n);throw Error(V(8))}function Ge(e,t){return e===`button`?(0,A.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,A.createElement)(`img`,{alt:``,...t,key:t.key}):A.createElement(e,t)}var Ke=`data-starting-style`,qe=`data-ending-style`,Je={[Ke]:``},Ye={[qe]:``},Xe={transitionStatus(e){return e===`starting`?Je:e===`ending`?Ye:null}},Ze=`data-open`,Qe=`data-closed`,$e=Ke,et=qe,tt=`data-anchor-hidden`,nt=`data-popup-open`,rt=`data-pressed`,it={[nt]:``},at={[nt]:``,[rt]:``},ot={[Ze]:``},st={[Qe]:``},ct={[tt]:``},lt={open(e){return e?it:null}},ut={open(e){return e?at:null}},dt={open(e){return e?ot:st},anchorHidden(e){return e?ct:null}},ft={...dt,...Xe},pt=`none`,mt=`trigger-press`,ht=`trigger-hover`,gt=`trigger-focus`,_t=`outside-press`,vt=`item-press`,yt=`close-press`,bt=`focus-out`,xt=`escape-key`,St=`list-navigation`,Ct=`cancel-open`,wt=`sibling-open`,Tt=`imperative-action`,Et=`window-resize`;function Dt({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=A.useRef(e!==void 0),[a,o]=A.useState(t);return[i&&e!==void 0?e:a,A.useCallback(e=>{i||o(e)},[])]}function Ot(){return typeof window<`u`}function kt(e){return jt(e)?(e.nodeName||``).toLowerCase():`#document`}function U(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){return((jt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jt(e){return Ot()?e instanceof Node||e instanceof U(e).Node:!1}function W(e){return Ot()?e instanceof Element||e instanceof U(e).Element:!1}function G(e){return Ot()?e instanceof HTMLElement||e instanceof U(e).HTMLElement:!1}function Mt(e){return!Ot()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof U(e).ShadowRoot}function Nt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Pt(e){return/^(table|td|th)$/.test(kt(e))}function Ft(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var It=/transform|translate|scale|rotate|perspective|filter/,Lt=/paint|layout|strict|content/,Rt=e=>!!e&&e!==`none`,zt;function Bt(e){let t=W(e)?Wt(e):e;return Rt(t.transform)||Rt(t.translate)||Rt(t.scale)||Rt(t.rotate)||Rt(t.perspective)||!Ht()&&(Rt(t.backdropFilter)||Rt(t.filter))||It.test(t.willChange||``)||Lt.test(t.contain||``)}function Vt(e){let t=Kt(e);for(;G(t)&&!Ut(t);){if(Bt(t))return t;if(Ft(t))return null;t=Kt(t)}return null}function Ht(){return zt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),zt}function Ut(e){return/^(html|body|#document)$/.test(kt(e))}function Wt(e){return U(e).getComputedStyle(e)}function Gt(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kt(e){if(kt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Mt(e)&&e.host||At(e);return Mt(t)?t.host:t}function qt(e){let t=Kt(e);return Ut(t)?(e.ownerDocument||e).body:G(t)&&Nt(t)?t:qt(t)}function Jt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qt(e),i=r===e.ownerDocument?.body,a=U(r);if(i){let e=Yt(a);return t.concat(a,a.visualViewport||[],Nt(r)?r:[],e&&n?Jt(e):[])}return t.concat(r,Jt(r,[],n))}function Yt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Xt={...A},Zt=Xt.useInsertionEffect,Qt=Zt&&Zt!==Xt.useLayoutEffect?Zt:e=>e();function K(e){let t=oe($t).current;return t.next=e,Qt(t.effect),t.trampoline}function $t(){let e={next:void 0,callback:en,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function en(){}var q=typeof document<`u`?A.useLayoutEffect:()=>{},tn=A.createContext(void 0);function nn(e=!1){let t=A.useContext(tn);if(t===void 0&&!e)throw Error(V(16));return t}function rn(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:A.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function J(e){return e?.ownerDocument||document}function an(e,t,{detail:n=0}={}){e.dispatchEvent(new(U(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function on(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=A.useRef(null),s=nn(!0),c=a??s!==void 0,{props:l}=rn({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=A.useCallback(()=>{let e=o.current;sn(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return q(u,[u]),{getButtonProps:A.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Te({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Ie(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=sn(r),s=!i&&cn(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),an(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),an(r,e)))},onKeyUp(e){if(!t){if(Ie(e),a?.(e),e.target===e.currentTarget&&i&&c&&sn(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),an(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:K(e=>{o.current=e,u()})}}function sn(e){return G(e)&&e.tagName===`BUTTON`}function cn(e){return G(e)&&e.tagName===`A`&&!!e.href}function ln(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:un,platform:dn,maxTouchPoints:fn}=ln(),pn=un.toLowerCase(),mn=dn.toLowerCase(),hn=/^i(os$|p)/.test(mn)||mn===`macintel`&&fn>1,gn=`android`,_n=mn===gn||pn.includes(gn),vn=!hn&&mn.startsWith(`mac`);mn.startsWith(`win`),!_n&&/^(linux|chrome os)/.test(mn);var yn=vn||hn,bn=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!bn&&pn.includes(`firefox`),!bn&&pn.includes(`chrom`);var xn=yn,Sn=/jsdom|happydom/.test(pn),Cn=A.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function wn(){return A.useContext(Cn)}function Tn(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=wn(),u=A.useRef(-1),[d,f]=A.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=A.useRef(null),h=A.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var En=0;function Dn(e,t=`mui`){let[n,r]=A.useState(e),i=e||n;return A.useEffect(()=>{n??(En+=1,r(`${t}-${En}`))},[n,t]),i}var On=Xt.useId;function kn(e,t){if(On!==void 0){let n=On();return e??(t?`${t}-${n}`:n)}return Dn(e,t)}function An(e){return kn(e,`base-ui`)}function Y(e,t,n,r){let i=!1,a=!1,o=r??be;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function jn(e){A.useEffect(e,ye)}var Mn=null;globalThis.requestAnimationFrame;var Nn=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Pn=class e{static create(){return new e}static request(e){return Nn.request(e)}static cancel(e){return Nn.cancel(e)}currentId=Mn;request(e){this.cancel(),this.currentId=Nn.request(()=>{this.currentId=Mn,e()})}cancel=()=>{this.currentId!==Mn&&(Nn.cancel(this.currentId),this.currentId=Mn)};disposeEffect=()=>this.cancel};function Fn(){let e=oe(Pn.create).current;return jn(e.disposeEffect),e}var In=i(),Ln=r();function Rn(e,t=!1,n=!1,r=!1){let[i,a]=A.useState(e&&t?`idle`:void 0),[o,s]=A.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),q(()=>{if(!e&&o&&i!==`ending`&&n){let e=Pn.request(()=>{a(`ending`)});return()=>{Pn.cancel(e)}}},[e,o,i,n]),q(()=>{if(!e||t)return;let n=Pn.request(()=>{a(void 0)});return()=>{Pn.cancel(n)}},[t,e]),q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Pn.request(()=>{a(`idle`)});return()=>{Pn.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function zn(e){return e==null?e:`current`in e?e.current:e}var Bn=null;function Vn(e){if(!Bn){let e=[];Bn=e,queueMicrotask(()=>{Bn=null,pe.flushSync(()=>{for(let t of e)t()})})}Bn.push(e)}function Hn(e,t=!1,n=!1){let r=Fn();return K((i,a=null)=>{r.cancel();let o=zn(e);if(o==null)return;let s=o,c=()=>{if(!n){pe.flushSync(i);return}Vn(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Ke;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Un(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=K(a),s=Hn(r,n,i);A.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var Wn=0,Gn=class e{static create(){return new e}currentId=Wn;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Wn,t()},e)}isStarted(){return this.currentId!==Wn}clear=()=>{this.currentId!==Wn&&(clearTimeout(this.currentId),this.currentId=Wn)};disposeEffect=()=>this.clear};function Kn(){let e=oe(Gn.create).current;return jn(e.disposeEffect),e}function qn(e){e.preventDefault(),e.stopPropagation()}function Jn(e){return`nativeEvent`in e}function Yn(e){return e.pointerType===``&&e.isTrusted?!0:_n&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Xn(e){return Sn?!1:!_n&&e.width===0&&e.height===0||_n&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Zn(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Qn(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function $n(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function X(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Mt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function er(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var tr=`data-base-ui-focusable`,nr=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,rr=`ArrowLeft`,ir=`ArrowRight`,ar=`ArrowUp`,or=`ArrowDown`,sr=`data-trigger-disabled`;function cr(e,t){if(!W(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(sr);for(let[,e]of t.entries())if(X(e,n))return!e.hasAttribute(sr);return!1}function lr(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function ur(e){return e.matches(`html,body`)}function dr(e){return G(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function fr(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${nr}`)!=null}function pr(e){return e?e.getAttribute(`role`)===`combobox`&&dr(e):!1}function mr(e){if(!e||Sn)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function hr(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function gr(e,t){return t!=null&&!Zn(t)?0:typeof e==`function`?e():e}function _r(e,t,n){let r=gr(e,n);return typeof r==`number`?r:r?.[t]}function vr(e){return typeof e==`function`?e():e}function yr(e,t){return t||e===`click`||e===`mousedown`}function br(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function xr(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Q(e){let t=oe(Sr,e).current;return t.next=e,q(t.effect),t}function Sr(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Cr={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},wr={...Cr,position:`fixed`,top:0,left:0},Tr={...Cr,position:`absolute`},Er=A.forwardRef(function(e,t){let[n,r]=A.useState();q(()=>{xn&&bn&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,H.jsx)(`span`,{...e,ref:t,style:wr,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Dr=Math.min,Or=Math.max,kr=Math.round,Ar=Math.floor,jr=e=>({x:e,y:e}),Mr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Nr(e,t,n){return Or(e,Dr(t,n))}function Pr(e,t){return typeof e==`function`?e(t):e}function Fr(e){return e.split(`-`)[0]}function Ir(e){return e.split(`-`)[1]}function Lr(e){return e===`x`?`y`:`x`}function Rr(e){return e===`y`?`height`:`width`}function zr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Br(e){return Lr(zr(e))}function Vr(e,t,n){n===void 0&&(n=!1);let r=Ir(e),i=Br(e),a=Rr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Xr(o)),[o,Xr(o)]}function Hr(e){let t=Xr(e);return[Ur(e),t,Ur(t)]}function Ur(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Wr=[`left`,`right`],Gr=[`right`,`left`],Kr=[`top`,`bottom`],qr=[`bottom`,`top`];function Jr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Gr:Wr:t?Wr:Gr;case`left`:case`right`:return t?Kr:qr;default:return[]}}function Yr(e,t,n,r){let i=Ir(e),a=Jr(Fr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ur)))),a}function Xr(e){let t=Fr(e);return Mr[t]+e.slice(t.length)}function Zr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Qr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Zr(e)}function $r(e){let{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 ei(e,t){return t<0||t>=e.length}function ti(e,t){return ri(e.current,{disabledIndices:t})}function ni(e,t){return ri(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ri(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&ii(e,a,r));return a}function ii(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!oi(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function ai(e){return e.visibility===`hidden`||e.visibility===`collapse`}function oi(e,t=e?Wt(e):null){return!e||!e.isConnected||!t||ai(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var si=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function ci(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Mt(n)?n.host:null}function li(e){for(let t of Array.from(e.children))if(kt(t)===`summary`)return t;return null}function ui(e,t){let n=li(t);return!!n&&(e===n||X(n,e))}function di(e){let t=e?kt(e):``;return e!=null&&e.matches(si)&&(t!==`summary`||e.parentElement!=null&&kt(e.parentElement)===`details`&&li(e.parentElement)===e)&&(t!==`details`||li(e)==null)&&(t!==`input`||e.type!==`hidden`)}function fi(e){if(!di(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=ci(t)){let n=t!==e,r=kt(t)===`slot`;if(t.hasAttribute(`inert`)||n&&kt(t)===`details`&&!t.open&&!ui(e,t)||t.hasAttribute(`hidden`)||!r&&!pi(t,n))return!1}return!0}function pi(e,t){let n=Wt(e);return t?n.display!==`none`:oi(e,n)}function mi(e){let t=e.tabIndex;if(t<0){let t=kt(e);if(t===`details`||t===`audio`||t===`video`||G(e)&&e.isContentEditable)return 0}return t}function hi(e){if(kt(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function gi(e,t){let n=hi(e);if(!n)return!0;let r=t.find(e=>{let t=hi(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=hi(e);return t?.name===n.name&&t.form===n.form})===n}function _i(e){if(G(e)&&kt(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return G(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function vi(e,t){_i(e).forEach(e=>{di(e)&&t.push(e),vi(e,t)})}function yi(e,t,n){_i(e).forEach(e=>{G(e)&&e.matches(t)&&n.push(e),yi(e,t,n)})}function bi(e){return fi(e)&&mi(e)>=0}function xi(e){let t=[];return vi(e,t),t.filter(fi)}function Si(e){let t=xi(e);return t.filter(e=>mi(e)>=0&&gi(e,t))}function Ci(e,t){let n=Si(e),r=n.length;if(r===0)return;let i=$n(J(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function wi(e){return Ci(J(e).body,1)||e}function Ti(e){return Ci(J(e).body,-1)||e}function Ei(e,t){if(!e)return null;let n=Si(J(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Di(e){return Ei(e,1)}function Oi(e){return Ei(e,-1)}function ki(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function Ai(e){Si(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ji(e){let t=[];yi(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Mi(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Mi(e,t.id,n)])}function Ni(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Pi(e){return`data-base-ui-${e}`}var Fi=0;function Ii(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Fi);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),ve;let o=requestAnimationFrame(a);return Fi=o,()=>{Fi===o&&(cancelAnimationFrame(o),Fi=0)}}var Li={inert:new WeakMap,"aria-hidden":new WeakMap},Ri=`data-base-ui-inert`,zi={inert:new WeakSet,"aria-hidden":new WeakSet},Bi=new WeakMap,Vi=0;function Hi(e){return zi[e]}function Ui(e){return e?Mt(e)?e.host:Ui(e.parentNode):null}var Wi=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ui(t);return e.contains(n)?n:null}).filter(e=>e!=null),Gi=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Ki=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{kt(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function qi(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Wi(t,e),l=i?Ki(t,Gi(c),new Set(c)):[],u=[],d=[];if(a){let e=Li[a],n=Hi(a);s=n,o=e;let r=Wi(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Ki(t,Gi(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Bi.get(e)||0)+1;Bi.set(e,t),d.push(e),t===1&&e.setAttribute(Ri,``)}),Vi+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Bi.get(e)||0)-1;Bi.set(e,t),t||e.removeAttribute(Ri)}),--Vi,Vi||(Li.inert=new WeakMap,Li[`aria-hidden`]=new WeakMap,zi.inert=new WeakSet,zi[`aria-hidden`]=new WeakSet,Bi=new WeakMap)}}function Ji(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=J(e[0]).body;return qi(e,a,n,r,{mark:i})}var Yi={style:{transition:`none`}},Xi=`data-base-ui-click-trigger`,Zi={fallbackAxisSide:`none`},Qi={fallbackAxisSide:`end`},$i={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},ea=A.createContext(null),ta=()=>A.useContext(ea),na=Pi(`portal`);function ra(e={}){let{ref:t,container:n,componentProps:r=be,elementProps:i}=e,a=kn(),o=ta()?.portalNode,[s,c]=A.useState(null),[l,u]=A.useState(null),d=K(e=>{e!==null&&u(e)}),f=A.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(jt(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=ze(`div`,r,{ref:[t,d],props:[{id:a,[na]:``},i]}),m=s&&p?pe.createPortal(p,s):null;return{node:l,nodeId:A.isValidElement(p)?p.props.id:void 0,subtree:m}}var ia=A.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ra({container:o,ref:t,componentProps:e,elementProps:c}),f=A.useRef(null),p=A.useRef(null),m=A.useRef(null),h=A.useRef(null),[g,_]=A.useState(null),v=A.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;A.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&ki(e)&&(e.type===`focusin`?v.current&&=(ji(l),!1):(Ai(l),v.current=!0))}return xr(Z(l,`focusin`,e,!0),Z(l,`focusout`,e,!0))},[l,y]),q(()=>{l&&b===!0&&v.current&&(ji(l),v.current=!1)},[b,l]);let S=A.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,H.jsxs)(A.Fragment,{children:[d,(0,H.jsxs)(ea.Provider,{value:S,children:[x&&l&&(0,H.jsx)(Er,{"data-type":`outside`,ref:f,onFocus:e=>{ki(e,l)?m.current?.focus():Ti(g?g.domReference:null)?.focus()}}),x&&l&&(0,H.jsx)(`span`,{role:s,"aria-owns":u,style:$i}),l&&pe.createPortal(a,l),x&&l&&(0,H.jsx)(Er,{"data-type":`outside`,ref:p,onFocus:e=>{ki(e,l)?h.current?.focus():(wi(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Y(`focus-out`,e.nativeEvent)))}})]})]})});function aa(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var oa=class{nodesRef={current:[]};events=aa();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},sa=A.createContext(null),ca=A.createContext(null),la=()=>A.useContext(sa)?.id||null,ua=e=>{let t=A.useContext(ca);return e??t};function da(e){let t=kn(),n=ua(e),r=la();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function fa(e){let{children:t,id:n}=e,r=la();return(0,H.jsx)(sa.Provider,{value:A.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function pa(e){let{children:t,externalTree:n}=e,r=oe(()=>n??new oa).current;return(0,H.jsx)(ca.Provider,{value:r,children:t})}function ma(e,t){let n=U(er(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var ha=20,ga=[];function _a(){ga=ga.filter(e=>e.deref()?.isConnected)}function va(e){_a(),e&&kt(e)!==`body`&&(ga.push(new WeakRef(e)),ga.length>ha&&(ga=ga.slice(-20)))}function ya(){return _a(),ga[ga.length-1]?.deref()}function ba(e){return e?bi(e)?e:Si(e)[0]||e:null}function xa(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=xi(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return bi(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Sa(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=K(()=>b.current.floatingContext?.nodeId),S=i===!1,C=pr(_)&&S,w=Q(i),T=Q(a),E=Q(l),D=Q(g),O=ua(p),k=ta(),j=A.useRef(!1),M=A.useRef(!1),N=A.useRef(!1),P=A.useRef(null),F=A.useRef(``),I=A.useRef(``),L=A.useRef(null),R=A.useRef(null),z=se(L,f,k?.beforeInsideRef),ee=se(R,k?.afterInsideRef),te=Kn(),ne=Kn(),re=Fn(),ie=k!=null,B=hr(v),V=K((e=B)=>e?Si(e):[]),ae=K(()=>m?.().filter(e=>e!=null)??[]);A.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&X(B,$n(J(B)))&&V().length===0&&!C&&qn(e)}return Z(J(B),`keydown`,e)},[r,B,s,C,V]),A.useEffect(()=>{if(r||!g)return;let e=J(B);function t(){N.current=!1}function n(e){let t=er(e),n=ae(),r=X(v,t)||X(_,t)||X(k?.portalNode,t)||n.some(e=>e===t||X(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,ne.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return xr(Z(e,`pointerdown`,n,!0),Z(e,`pointerup`,t,!0),Z(e,`pointercancel`,t,!0),Z(e,`keydown`,i,!0),t)},[r,v,_,B,g,k,ne,ae]),A.useEffect(()=>{if(r||!c)return;let e=J(B);function t(){M.current=!0,ne.start(0,()=>{M.current=!1})}function n(e){let t=er(e);bi(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=er(t);s&&n==null&&i!=null&&X(v,i)&&va(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=ae(),f=n?.hasAttribute(Pi(`focus-guard`))&&[L.current,R.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,zn(d),zn(u)].includes(n),p=!(X(_,n)||X(v,n)||X(n,v)||X(k?.portalNode,n)||l.some(e=>e===n||X(e,n))||c.hasMatchingElement(e=>X(e,n))||f||O&&(Mi(O.nodesRef.current,a).find(e=>X(e.context?.elements.floating,n)||X(e.context?.elements.domReference,n))||Ni(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,hr(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&B&&xa(B),o&&r!==_&&!oi(i)&&$n(e)===e.body){if(G(B)&&(B.focus(),o===`popup`)){re.request(()=>{B.focus()});return}let e=V(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;G(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!M.current&&(C||n!==ya())&&(j.current=!0,h.setOpen(!1,Y(bt,t)))})}function a(){N.current||(b.current.insideReactTree=!0,te.start(0,()=>{b.current.insideReactTree=!1}))}let l=G(_)?_:null;if(v||l)return xr(l&&Z(l,`focusout`,i),l&&Z(l,`pointerdown`,t),v&&Z(v,`focusin`,n),v&&Z(v,`focusout`,i),v&&k&&Z(v,`focusout`,a,!0))},[r,_,v,B,s,O,k,h,c,o,V,C,x,b,te,ne,re,u,d,ae]),A.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${Pi(`portal`)}]`)||[]),t=(O?Ni(O.nodesRef.current,x()):[]).find(e=>pr(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ji([v,...e,L.current,R.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...ae(),t,zn(d),zn(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=Ji([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,k,C,O,x,u,d,ae]),q(()=>{if(!g||r||!G(B))return;F.current=``,I.current=``;let e=J(B),t=$n(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||X(B,t))return;let i=null,a=()=>(i??=V(B),i[0]||B),o;o=r===!0||r===null?a():zn(r),o||=a();let s=X(B,$n(e));Ii(o,{preventScroll:o===B,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=$n(e);return!(t!==o&&X(B,t))}})})},[r,g,B,V,w,E,D]),q(()=>{if(r||!B)return;let e=J(B),t=$n(e),n=E.current==null;va(t);function i(e){if(e.open||(F.current=ma(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(Yn(e.nativeEvent)||Xn(e.nativeEvent))j.current=!1;else{let e=!1;J(B).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&kt(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ya()||null,typeof i==`boolean`?s:zn(i)||s||null}return()=>{y.off(`openchange`,i);let t=$n(e),n=ae(),r=X(v,t)||n.some(e=>e===t||X(e,t))||O&&Mi(O.nodesRef.current,x(),!1).some(e=>X(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=ba(c),i=typeof o!=`boolean`;if(o&&!j.current&&G(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,B,T,E,y,O,_,x,ae]),q(()=>{if(!bn||g||!v)return;let e=$n(J(v));G(e)&&dr(e)&&X(v,e)&&e.blur()},[g,v]),q(()=>{if(!r&&k)return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),q(()=>{if(!r&&B)return xa(B),()=>{queueMicrotask(_a)}},[r,B]);let oe=!r&&(!s||!C)&&(ie||s);return(0,H.jsxs)(A.Fragment,{children:[oe&&(0,H.jsx)(Er,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=V();Ii(e[e.length-1])}else k?.portalNode&&(j.current=!1,ki(e,k.portalNode)?wi(_)?.focus():zn(d??k.beforeOutsideRef)?.focus())}}),n,oe&&(0,H.jsx)(Er,{"data-type":`inside`,ref:ee,onFocus:e=>{s?Ii(V()[0]):k?.portalNode&&(c&&(j.current=!0),ki(e,k.portalNode)?Ti(_)?.focus():zn(u??k.afterOutsideRef)?.focus())}})]})}function Ca(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=mt}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=A.useRef(void 0),f=Fn(),p=Kn(),m=A.useMemo(()=>{function e(e,t,n,r){let i=Y(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=Zn(e.pointerType,!0)&&Xn(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Zn(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=er(o);if(dr(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}Zn(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return A.useMemo(()=>n?{reference:m}:be,[n,m])}function wa(){return!1}function Ta(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Ea(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=wa,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=ua(c),h=K(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=K(()=>a),{escapeKey:y,outsidePress:b}=Ta(s),x=A.useRef(!1),S=A.useRef(!1),C=A.useRef(!1),w=A.useRef(!1),T=A.useRef(!1),E=A.useRef(``),D=A.useRef(null),O=Kn(),k=Kn(),j=K(()=>{k.clear(),f.current.insideReactTree=!1}),M=K(e=>{let t=f.current.floatingContext?.nodeId;return(m?Mi(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=K(e=>lr(e,l.select(`floatingElement`))||lr(e,l.select(`domReferenceElement`))),P=K(e=>{o()&&l.setOpen(!1,Y(mt,e.nativeEvent))}),F=K(e=>{if(!u||!n||!r||e.key!==`Escape`||T.current||!y&&M(`__escapeKeyBubbles`))return;let t=Y(xt,Jn(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=K(()=>{f.current.insideReactTree=!0,k.start(0,j)}),L=K(e=>{if(!u||!n||e.button!==0)return;let t=er(e.nativeEvent);X(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),R=K(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});A.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),A.useEffect(()=>{if(!u||!n)return u||(w.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new Gn,t=new Gn,i=J(d);function a(){e.clear(),T.current=!0}function o(){e.start(bn?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function p(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function k(e){let t=f.current.floatingContext?.nodeId,n=m&&Mi(m.nodesRef.current,t).some(t=>lr(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=er(e),r=`[${Pi(`inert`)}]`,i=W(n)?n.getRootNode():null,a=Array.from((Mt(i)?i:J(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>X(e,n))))return;let s=W(n)?n:null;for(;s&&!Ut(s);){let e=Kt(s);if(Ut(e)||!W(e))break;s=e}if(!(a.length&&W(n)&&!ur(n)&&!X(n,l.select(`floatingElement`))&&a.every(e=>!X(s,e)))){if(G(n)&&!(`touches`in e)){let t=Ut(n),r=Wt(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!k(e)){if(p()===`intentional`){if(e.detail!==0&&!Yn(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof g!=`function`||g(e))&&(M(`__outsidePressBubbles`)||(l.setOpen(!1,Y(_t,e)),j()))}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=er(e);if(!n)return;let r=Z(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function ee(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;if(c(),p()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!k(e)){if(n){s();return}(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())}}}function te(e){if(p()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(A(e),O.clear(),D.current=null)}function ne(e){L(e,te)}function re(e){p()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&A(e),O.clear(),D.current=null)}function ie(e){L(e,re)}let B=xr(r&&xr(Z(i,`keydown`,F),Z(i,`compositionstart`,a),Z(i,`compositionend`,o)),_&&xr(Z(i,`click`,z,!0),Z(i,`pointerdown`,z,!0),Z(i,`pointerup`,ee,!0),Z(i,`pointercancel`,ee,!0),Z(i,`mousedown`,z,!0),Z(i,`mouseup`,ee,!0),Z(i,`touchstart`,R,{capture:!0,passive:!0}),Z(i,`touchmove`,ne,{capture:!0,passive:!0}),Z(i,`touchend`,ie,{capture:!0,passive:!0})));return()=>{B(),e.clear(),t.clear(),c(),C.current=!1,j()}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,l,O]);let z=A.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ee=A.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return A.useMemo(()=>n?{reference:z,floating:ee,trigger:z}:{},[n,z,ee])}function Da(e,t,n){let{reference:r,floating:i}=e,a=zr(t),o=Br(t),s=Rr(o),c=Fr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ir(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Oa(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Pr(t,e),p=Qr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$r(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=$r(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ka=50,Aa=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Oa},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Da(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ka&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Da(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ja=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Pr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Fr(r),_=zr(o),v=Fr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Xr(o)]:Hr(o)),x=p!==`none`;!d&&x&&b.push(...Yr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Vr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===zr(t)||T.every(e=>zr(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=zr(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Ma=new Set([`left`,`top`]);async function Na(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Fr(n),s=Ir(n),c=zr(n)===`y`,l=Ma.has(o)?-1:1,u=a&&c?-1:1,d=Pr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Pa=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Na(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Fa=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Pr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=zr(i),p=Lr(f),m=u[p],h=u[f],g=(e,t)=>Nr(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ia=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Pr(e,t),u={x:n,y:r},d=zr(i),f=Lr(d),p=u[f],m=u[d],h=Pr(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ma.has(Fr(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},La=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Pr(e,t),c=await i.detectOverflow(t,s),l=Fr(n),u=Ir(n),d=zr(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Dr(p-c[m],g),y=Dr(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Or(c.left,c.right):S=p-2*Or(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ra(e){let t=Wt(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=kr(n)!==a||kr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function za(e){return W(e)?e:e.contextElement}function Ba(e){let t=za(e);if(!G(t))return jr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ra(t),o=(a?kr(n.width):n.width)/r,s=(a?kr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Va=jr(0);function Ha(e){let t=U(e);return!Ht()||!t.visualViewport?Va:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ua(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===U(e)}function Wa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=za(e),o=jr(1);t&&(r?W(r)&&(o=Ba(r)):o=Ba(e));let s=Ua(a,n,r)?Ha(a):jr(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=U(a),t=W(r)?U(r):r,n=e,i=Yt(n);for(;i&&t!==n;){let e=Ba(i),t=i.getBoundingClientRect(),r=Wt(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=U(i),i=Yt(n)}}return $r({width:u,height:d,x:c,y:l})}function Ga(e,t){let n=Gt(e).scrollLeft;return t?t.left+n:Wa(At(e)).left+n}function Ka(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ga(e,n),y:n.top+t.scrollTop}}function qa(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=At(r),s=t?Ft(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=jr(1),u=jr(0),d=G(r);if((d||!a)&&((kt(r)!==`body`||Nt(o))&&(c=Gt(r)),d)){let e=Wa(r);l=Ba(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ka(o,c):jr(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ja(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ya(e){let t=Gt(e),n=e.ownerDocument.body,r=Or(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Or(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ga(e),o=-t.scrollTop;return Wt(n).direction===`rtl`&&(a+=Or(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Xa=25;function Za(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=U(e),a=At(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ht()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ga(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Xa&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Qa(e,t){let n=Wa(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ba(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function $a(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Za(e,n,t);else if(t===`document`)r=Ya(At(e));else if(W(t))r=Qa(t,n);else{let n=Ha(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $r(r)}function eo(e,t){let n=t.get(e);if(n)return n;let r=Jt(e,[],!1).filter(e=>W(e)&&kt(e)!==`body`),i=null,a=Wt(e).position===`fixed`,o=a?Kt(e):e;for(;W(o)&&!Ut(o);){let e=Wt(o),t=Bt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Kt(o)}return t.set(e,r),r}function to(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ft(t)?[]:eo(t,this._c):[].concat(n),r],o=$a(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=$a(t,a[e],i);s=Or(n.top,s),c=Dr(n.right,c),l=Dr(n.bottom,l),u=Or(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function no(e){let{width:t,height:n}=Ra(e);return{width:t,height:n}}function ro(e,t,n){let r=G(t),i=At(t),a=n===`fixed`,o=Wa(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=jr(0);if((r||!a)&&((kt(t)!==`body`||Nt(i))&&(s=Gt(t)),r)){let e=Wa(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ga(i));let l=i&&!r&&!a?Ka(i,s):jr(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function io(e){return Wt(e).position===`static`}function ao(e,t){if(!G(e)||Wt(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return At(e)===n&&(n=n.ownerDocument.body),n}function oo(e,t){let n=U(e);if(Ft(e))return n;if(!G(e)){let t=Kt(e);for(;t&&!Ut(t);){if(W(t)&&!io(t))return t;t=Kt(t)}return n}let r=ao(e,t);for(;r&&Pt(r)&&io(r);)r=ao(r,t);return r&&Ut(r)&&io(r)&&!Bt(r)?n:r||Vt(e)||n}var so=async function(e){let t=this.getOffsetParent||oo,n=this.getDimensions,r=await n(e.floating);return{reference:ro(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function co(e){return Wt(e).direction===`rtl`}var lo={convertOffsetParentRelativeRectToViewportRelativeRect:qa,getDocumentElement:At,getClippingRect:to,getOffsetParent:oo,getElementRects:so,getClientRects:Ja,getDimensions:no,getScale:Ba,isElement:W,isRTL:co};function uo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fo(e,t,n){let r=null,i,a=At(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ar(d),h=Ar(a.clientWidth-(u+f)),g=Ar(a.clientHeight-(d+p)),_=Ar(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Or(0,Dr(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!uo(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=U(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function po(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=za(e),u=i||a?[...l?Jt(l):[],...t?Jt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?fo(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Wa(e):null;c&&g();function g(){let t=Wa(e);h&&!uo(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var mo=Pa,ho=Fa,go=ja,_o=La,vo=Ia,yo=(e,t,n)=>{let r=new Map,i=n??{},a={...lo,...i.platform,_c:r};return Aa(e,t,{...i,platform:a})},bo=typeof document<`u`?A.useLayoutEffect:function(){};function xo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function So(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Co(e,t){let n=So(e);return Math.round(t*n)/n}function wo(e){let t=A.useRef(e);return bo(()=>{t.current=e}),t}function To(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=A.useState(r);xo(f,r)||p(r);let[m,h]=A.useState(null),[g,_]=A.useState(null),v=A.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=A.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=A.useRef(null),C=A.useRef(null),w=A.useRef(u),T=c!=null,E=wo(c),D=wo(i),O=wo(l),k=A.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),yo(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};j.current&&!xo(w.current,t)&&(w.current=t,pe.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);bo(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=A.useRef(!1);bo(()=>(j.current=!0,()=>{j.current=!1}),[]),bo(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let M=A.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=A.useMemo(()=>({reference:b,floating:x}),[b,x]),P=A.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Co(N.floating,u.x),r=Co(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...So(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return A.useMemo(()=>({...u,update:k,refs:M,elements:N,floatingStyles:P}),[u,k,M,N,P])}var Eo=(e,t)=>{let n=mo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Do=(e,t)=>{let n=ho(e);return{name:n.name,fn:n.fn,options:[e,t]}},Oo=(e,t)=>({fn:vo(e).fn,options:[e,t]}),ko=(e,t)=>{let n=go(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ao=(e,t)=>{let n=_o(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=[],Mo=void 0;function No(){return Mo}function Po(e){jo.push(e)}function Fo(e){let t=(t,n)=>{let r=oe(Lo).current,i;try{Mo=r;for(let e of jo)e.before(r);i=e(t,n);for(let e of jo)e.after(r);r.didInitialize=!0}finally{Mo=void 0}return i};return t.displayName=e.displayName||e.name,t}function Io(e){return A.forwardRef(Fo(e))}function Lo(){return{didInitialize:!1}}var Ro=he(19)?Vo:Ho;function zo(e,t,n,r,i){return Ro(e,t,n,r,i)}function Bo(e,t,n,r,i){let a=A.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,In.useSyncExternalStore)(e.subscribe,a,a)}Po({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,In.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Vo(e,t,n,r,i){let a=No();if(!a)return Bo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Ho(e,t,n,r,i){return(0,Ln.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Uo=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return zo(this,e,t,n,r)}},Wo=class extends Uo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){A.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){A.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return A.useDebugValue(e),zo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){A.useDebugValue(e);let n=K(t??ve);this.context[e]=n}useStateSetter(e){let t=A.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Go={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Ko=class extends Wo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:aa(),nested:n,triggerElements:i},Go),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Qn(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function qo(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=A.useRef(null);r===void 0&&f.current===null&&(f.current=new Ko({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};W(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var Jo={tabIndex:-1,[tr]:``};function Yo(e){return t=>t!==`touch`||e.current}function Xo(e,t=!1){let n=kn(),r=la()!=null,i=oe(()=>e(n,r)).current;return qo({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Zo({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function Qo(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function $o(e,t){let n=A.useRef(null);return K(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Qo(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Qo(t))})}function es(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function ts(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ns(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=$o(e,n),o=K(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=K(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function rs(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=A.useRef(null),i=e.useState(`open`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Y(pt);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function is(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=Rn(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=K(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Un({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function as(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:be,inactiveTriggerProps:be,popupProps:be})},[e])}function os(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var ss=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function cs(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Ko({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:be,inactiveTriggerProps:be,popupProps:be}}var ls=e=>e.triggerIdProp??e.activeTriggerId,us=e=>e.openProp??e.open,ds=e=>(e.popupElement?.id??e.floatingId)||void 0;function fs(e,t){return t!==void 0&&us(e)&&ls(e)===t}function ps(e,t){return fs(e,t)?!0:t!==void 0&&us(e)&&ls(e)==null&&e.triggerCount===1}var ms={open:us,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:ls,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:ds,isTriggerActive:(e,t)=>t!==void 0&&ls(e)===t,isOpenedByTrigger:(e,t)=>fs(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&ls(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ps(e,t)?ds(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function hs(e){let t=A.useCallback(t=>e===void 0?ve:e.subscribeStore(t),[e]),n=A.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,In.useSyncExternalStore)(t,n,()=>e?.serverStore)}function gs(e){return _s(e,e.rootContext)}function _s(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=A.useState(null),[d,f]=A.useState(void 0),[p,m]=A.useState(void 0),h=A.useRef(null),g=ua(r),_=A.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=To({...e,elements:{..._,...l&&{reference:l}}}),y=W(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=A.useCallback(e=>{let t=W(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=A.useCallback(e=>{(W(e)||e===null)&&(h.current=e,f(e)),(W(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!W(e))&&v.refs.setReference(e)},[v.refs,f]),C=A.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=A.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=A.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=A.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return q(()=>{o&&(h.current=o)},[o]),q(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),A.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var vs=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Gn,this.restTimeout=new Gn,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ys=new WeakMap;function bs(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ys.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ys.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function xs(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ys.get(n);a&&a!==e&&bs(a),bs(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ys.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Ss(e){let t=e.context.dataRef.current,n=oe(()=>t.hoverInteractionState??vs.create()).current;return t.hoverInteractionState||=n,jn(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Cs(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=ua(),d=la(),f=Ss(a),p=Kn(),m=K(()=>yr(l.current.openEvent?.type,f.interactedInside)),h=K(()=>br(l.current.openEvent?.type)),g=K(()=>{bs(f)});q(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),A.useEffect(()=>g,[g]),q(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&W(c)&&s){let e=c,t=s,n=J(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return xs(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),A.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&Mi(u.nodesRef.current,d).length>0)}function t(e){let t=_r(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,Y(ht,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=er(e);if(!fr(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(cr(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&W(o)&&Mi(u.nodesRef.current,r,!1).some(e=>X(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,Y(ht,t)),u.events.emit(`floating.closed`,t)})}let y=s;return xr(y&&Z(y,`mouseenter`,c),y&&Z(y,`mouseleave`,_),y&&Z(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var ws={current:null};function Ts(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=ws,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=ua(l),y=Ss(h),b=A.useRef(!1),x=Q(i),S=Q(r),C=Q(o),w=Q(n),T=Q(p),E=Q(f),D=K(()=>yr(g.current.openEvent?.type,y.interactedInside)),O=K(()=>T.current?.()!==!1),k=K((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!X(e,t);if(!W(n))return!1;let i=n;return r.hasMatchingElement(e=>X(e,i))&&(!e||!X(e,i))}),j=K(()=>{y.handler&&=(J(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=K(()=>{bs(y)});return u&&(y.handleCloseOptions=i?.__options),A.useEffect(()=>j,[j]),A.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===ht,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),A.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=_r(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,Y(ht,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,Y(ht,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!W(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Zn(y.pointerType))return;let t=vr(C.current),n=_r(S.current,`open`,y.pointerType),r=er(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(W(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(X(e,r)){s=e;break}}W(i)&&W(o)&&!h.context.triggerElements.hasElement(i)&&X(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&W(s)&&W(o)&&X(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){O()&&h.setOpen(!0,Y(ht,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,Y(ht,e,s))}):g&&O()&&h.setOpen(!0,Y(ht,e,s)))}function i(t){if(D()){M();return}j();let n=J(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!cr(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!X(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){X(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?Z(t,`mouseout`,o):void 0;return s?xr(Z(t,`mousemove`,r,{once:!0}),Z(t,`mouseenter`,r),Z(t,`mouseleave`,i),l):xr(Z(t,`mouseenter`,r),Z(t,`mouseleave`,i),l)},[j,M,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),A.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=k(r,n,e.target);if(a&&!Zn(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;xs(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=vr(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,Y(ht,t,n))}y.pointerType===`touch`?pe.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var Es=`Escape`;function Ds(e){return bn&&e.movementX===0&&e.movementY===0}function Os(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function ks(e,t){return Os(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function As(e,t,n){return Os(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function js(e,t,n){return Os(t,n?e===rr:e===ir,e===or)}function Ms(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Es:Os(t,n?e===ir:e===rr,e===ar)}function Ns(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=hr(T),k=pr(E),j=Q(O),M=la(),N=ua(b),P=A.useRef(f),F=A.useRef(o??-1),I=A.useRef(null),L=A.useRef(!0),R=K(e=>{i(F.current===-1?null:F.current,e)}),z=A.useRef(!!T),ee=A.useRef(w),te=A.useRef(!1),ne=A.useRef(!1),re=A.useRef(null),ie=Q(h),B=Q(w),V=Q(o),ae=Q(y),oe=Fn(),se=Fn(),ce=K(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):re.current=Ii(e,{sync:te.current,preventScroll:!0})}let t=n.current[F.current],r=ne.current;t&&e(t),(te.current?e=>e():e=>oe.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),H&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{D.current.orientation=g},[D,g]),q(()=>{a&&(w&&T?(F.current=o??-1,P.current&&o!=null&&(ne.current=!0,R())):z.current&&(F.current=-1,R()))},[a,w,T,o,R]),q(()=>{if(a){if(!w){te.current=!1;return}if(T){if(r==null){if(te.current=!1,V.current!=null)return;if(z.current&&(F.current=-1,ce()),(!ee.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>se.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||As(I.current,g,u)||l?ti(n):ni(n),I.current=null,R())};t()}}else ei(n.current,r)||(F.current=r,ce(),ne.current=!1)}}},[a,w,T,r,V,l,n,g,u,R,ce,se]),q(()=>{if(!a||T||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=$n(J(E??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,T,E,N,M,d]),q(()=>{ee.current=w,z.current=!!T}),q(()=>{w||(I.current=null,P.current=f)},[w,f]);let le=r!=null,ue=K(e=>{if(!B.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),de=K(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),fe=K(()=>ti(n,ie.current)),pe=K(e=>{if(L.current=!1,te.current=!0,e.which===229||!B.current&&e.currentTarget===j.current)return;if(l&&Ms(e.key,g,u,S)){ks(e.key,de())||qn(e),C.setOpen(!1,Y(St,e.nativeEvent)),G(E)&&(d?N?.events.emit(`virtualfocus`,E):E.focus());return}let t=F.current,r=ti(n,h),i=ni(n,h);if(k||(e.key===`Home`&&(qn(e),F.current=r,R(e)),e.key===`End`&&(qn(e),F.current=i,R(e))),x!=null){let t=x(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,R(e)),g===`both`)return}if(ks(e.key,g)){if(qn(e),w&&!d&&$n(e.currentTarget.ownerDocument)===e.currentTarget){F.current=As(e.key,g,u)?r:i,R(e);return}As(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(te.current=!1,F.current=r):F.current=ri(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,ri(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(te.current=!1,F.current=i):F.current=ri(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,ri(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),ei(n.current,F.current)&&(F.current=-1),R(e)}}),H=A.useMemo(()=>({onFocus(e){te.current=!0,ue(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){Ds(e)||(te.current=!0,ne.current=!1,p&&ue(e))},onPointerLeave(e){if(!B.current||!L.current||e.pointerType===`touch`)return;te.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ae.current&&(re.current?.(),re.current=null,F.current=-1,R(e),!d)){let e=j.current,t=$n(J(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[ue,B,j,p,n,R,ae,d]),me=A.useMemo(()=>d&&w&&le&&{"aria-activedescendant":`${v}-${r}`},[d,w,le,v,r]),he=A.useMemo(()=>({...k?{}:me,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=er(e.nativeEvent);if(t&&!X(j.current,t))return;qn(e),C.setOpen(!1,Y(bt,e.nativeEvent)),G(E)&&E.focus();return}pe(e)},onPointerMove(e){Ds(e)||(L.current=!0)}}),[me,pe,j,k,C,w,d,E]),ge=A.useMemo(()=>{function e(e){C.setOpen(!0,Y(St,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&Yn(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&Xn(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=C.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=js(t.key,de(),u),a=ks(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return pe(t);if(n||m||!r){if(o){let e=ks(t.key,de());I.current=l&&e?null:t.key}if(l){i&&(qn(t),n?(F.current=fe(),R(t)):e(t));return}a&&(V.current!=null&&(F.current=V.current),qn(t),!n&&m?e(t):pe(t),n&&R(t))}},onFocus(e){C.select(`open`)&&!d&&(F.current=-1,R(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[pe,f,fe,l,R,C,m,g,de,u,V,d]),_e=A.useMemo(()=>({...me,...ge}),[me,ge]);return A.useMemo(()=>a?{reference:_e,floating:he,item:H,trigger:ge}:{},[a,_e,he,ge,H])}function Ps(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=Kn(),m=A.useRef(``),h=A.useRef(u??i??-1),g=A.useRef(null),_=K(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!oi(n)||n?.matches(`:disabled`)?!1:o==null||!ii(ye,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(qn(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(qn(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=K(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);X(n,t)||X(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=A.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return A.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var Fs=.1,Is=Fs*Fs,$=.5;function Ls(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Rs(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ls(e,t,n,r,i,a)&&(u=!u),Ls(e,t,i,a,o,s)&&(u=!u),Ls(e,t,o,s,c,l)&&(u=!u),Ls(e,t,c,l,n,r)&&(u=!u),u}function zs(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Bs(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Vs(e={}){let{blockPointerEvents:t=!1}=e,n=new Gn,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Is;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=er(r),g=r.type===`mouseleave`,_=X(u,h),v=X(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&W(r.relatedTarget)&&X(u,r.relatedTarget))return;function y(){return!!(s&&Mi(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Bs(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Bs(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Bs(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Bs(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!zs(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+$+1,o=C||T?S.bottom-$:S.top,s=C?T?S.bottom-$:S.top:S.bottom-$;M=Rs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-$,o=C||T?S.top+$:S.bottom,s=C?T?S.top+$:S.bottom:S.top+$;M=Rs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+$+1,o=w||E?S.right-$:S.left,s=w?E?S.right-$:S.left:S.right-$;M=Rs(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-$,o=w||E?S.left+$:S.right,s=w?E?S.left+$:S.right:S.left+$;M=Rs(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Hs=A.createContext(void 0);function Us(e){let t=A.useContext(Hs);if(t===void 0&&!e)throw Error(V(69));return t}var Ws=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function Gs(e){return e===`starting`?Yi:be}function Ks(e){return he(19)?e:e?`true`:void 0}var qs=A.createContext(void 0);function Js(){return A.useContext(qs)?.direction??`ltr`}var Ys=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Pr(e,t)||{};if(l==null)return{};let f=Qr(u),p={x:n,y:r},m=Br(i),h=Rr(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Nr(k,j,A),N=!c.arrow&&Ir(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Xs=(e,t)=>{let{name:n,fn:r}=Ys(e);return{name:n,fn:r,options:[e,t]}},Zs={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Qs={sideX:`left`,sideY:`top`},$s=`--available-width`,ec=`--available-height`,tc=`--anchor-width`,nc=`--anchor-height`,rc=`--transform-origin`,ic=$s,ac=ec;function oc(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function sc(e,t,n){let{rects:r,placement:i}=e;return{side:oc(t,Fr(i),n),align:Ir(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function cc(e){return lc(e,gs)}function lc(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=A.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=K(j),N=j?M:n,P=Q(n),F=Q(g),I=Js()===`rtl`,L=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],R=o===`center`?L:`${L}-${o}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let ee=+(i===`bottom`),te=+(i===`top`),ne=+(i===`right`),re=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},B=A.useRef(null),V=Q(a),ae=Q(s),oe=typeof a==`function`?0:a,se=typeof s==`function`?0:s,ce=[];p&&ce.push(p),ce.push(Eo(e=>{let t=sc(e,i,I),n=typeof V.current==`function`?V.current(t):V.current,r=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[oe,se,I,i]));let le=E===`none`&&T!==`shift`,ue=!le&&(u||O||T===`shift`),de=T===`none`?null:ko({...ie,padding:{top:z.top+1+ee,right:z.right+1+re,bottom:z.bottom+1+te,left:z.left+1+ne},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),fe=le?null:Do({...ie,rootBoundary:k,mainAxis:E!==`none`,crossAxis:ue,limiter:u||O?void 0:Oo(e=>{if(!B.current)return{};let{width:t,height:n}=B.current.getBoundingClientRect(),r=zr(Fr(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[ie,u,O,k,z,E]);T===`shift`||E===`shift`||o===`center`?ce.push(fe,de):ce.push(de,fe),ce.push(Ao({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(ic,`${t}px`),i.setProperty(ac,`${n}px`);let a=U(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(tc,`${u}px`),i.setProperty(nc,`${d}px`)}}),Xs(e=>({element:B.current||J(e.elements.floating).createElement(`div`),padding:B.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Fr(r),u=Ir(r),d=zr(l)===`y`,f=B.current,p=typeof a==`function`?a(sc(e,i,I)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ue&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(rc,d?`${m} ${h}`:`${h} ${m}`),{}}},Zs,b),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let pe=A.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:H,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:R,middleware:ce,strategy:r,whileElementsMounted:m?void 0:(...e)=>po(...e,pe),nodeId:y,externalTree:S}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||Qs,Te=xe?r:`fixed`,Ee=A.useMemo(()=>{let e;return e=xe?b?{position:Te,[Ce]:he,[we]:ge}:{...Se,position:Te}:{position:Te,top:0,left:0},e[ic]=`100vw`,e[ac]=`100vh`,xe||(e.opacity=0),e},[b,Te,Ce,he,we,ge,Se,xe]),De=A.useRef(null);q(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(uc(t)?t.current:t)||null;n!==De.current&&(H.setPositionReference(n),De.current=n)},[g,H,N,P]),A.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&uc(e)&&e.current!==De.current&&(H.setPositionReference(e.current),De.current=e.current)},[g,H,N,P]),A.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return po(me.reference,me.floating,ve,pe)},[m,g,me,ve,pe]);let Oe=Fr(ye),ke=oc(i,Oe,I),Ae=Ir(ye)||`center`,je=!!_e.hide?.referenceHidden;q(()=>{x&&g&&xe&&Oe!==L&&w(Oe)},[x,g,xe,Oe,L]);let Me=A.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return A.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:B,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:H,context:be,isPositioned:xe,update:ve}),[Ee,Me,B,Ne,ke,Ae,Oe,je,H,be,xe,ve])}function uc(e){return e!=null&&`current`in e}function dc(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=K(i),[,o]=A.useState(!1),s=oe(pc).current,c=oe(fc).current,l=A.useRef(0),u=A.useRef(!0),d=A.useRef(null),f=A.useRef(null),p=K(()=>{u.current||(u.current=!0,o(e=>!e))}),m=K((e,t)=>{c.set(e,t),p()}),h=K(e=>{c.delete(e),p()}),g=K(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!gc(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&_c(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=hc(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=K(()=>{let[e,t]=mc(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),q(()=>{u.current&&v()}),q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=K(e=>(s.add(e),()=>{s.delete(e)})),b=A.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,H.jsx)(Cn.Provider,{value:b,children:t})}function fc(){return new Map}function pc(){return new Set}function mc(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>_c(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function hc(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function gc(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function _c(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var vc=A.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,H.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function yc(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),ze(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Gs(r),i],stateAttributesMapping:dt})}var bc={},xc={},Sc=``;function Cc(e,t){return Nt(e)?e:t}function wc(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Cc(t,n)).overflowY)}function Tc(e){if(typeof document>`u`)return!1;let t=J(e);return U(t).innerWidth-t.documentElement.clientWidth>0}function Ec(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=J(e),n=t.documentElement,r=t.body,i=Cc(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Dc(e){let t=J(e),n=t.documentElement,r=t.body,i=Cc(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Oc(e){let t=J(e),n=t.documentElement,r=t.body,i=U(n),a=0,o=0,s=!1,c=Pn.create();if(bn&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,bc={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Sc=n.style.scrollBehavior,xc={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Cc(n,r);if(s=Ec(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,bc),Object.assign(r.style,xc),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Sc)}function d(){u(),c.request(l)}l();let f=Z(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var kc=new class{lockCount=0;restore=null;timeoutLock=Gn.create();timeoutUnlock=Gn.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=J(e),n=t.documentElement,r=t.body,i=U(n);if(wc(i,n,r)){let t=new i.MutationObserver(()=>{wc(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=hn||!Tc(e);this.restore=a?Dc(e):Oc(e)}};function Ac(e=!0,t=null){q(()=>{if(e)return kc.acquire(t)},[e,t])}var jc=20;function Mc(e,t,n,r){let[i,a]=A.useState(!1);q(()=>{if(!e||!t||n==null){a(!1);return}let r=J(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-jc)},[e,t,n]),Ac(e&&(!t||i),r)}function Nc(e){let t=A.useRef(``),n=A.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:A.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Pc(e,t){let n=A.useRef(e),r=K(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Fc(e,t){let{onClick:n,onPointerDown:r}=Nc(K((n,r)=>{(typeof e==`function`?e():e)||t(r||(hn?`touch`:``))}));return A.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Ic(e){let[t,n]=A.useState(null),r=Fc(e,n);return Pc(e,t=>{t&&!e&&n(null)}),A.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Lc=5;function Rc(e,t){let n=zc(t);return e.clientX>=n.left-Lc&&e.clientX<=n.right+Lc&&e.clientY>=n.top-Lc&&e.clientY<=n.bottom+Lc}function zc(e){let t=e.getBoundingClientRect(),n=U(e);if(Sn)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Bc(e,t){let n=A.useRef(null);function r(t){pe.flushSync(()=>{e.setOpen(!1,Y(bt,t.nativeEvent,t.currentTarget))}),Oi(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&ki(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{pe.flushSync(()=>{e.setOpen(!1,Y(bt,n.nativeEvent,n.currentTarget))});let i=Di(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&X(r,i);){let e=i;if(i=wi(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Vc(...e){return e.filter(Boolean).join(` `)}function Hc(){return(0,A.useSyncExternalStore)(D,T,T),E()}export{oa as $,_t as $t,ts as A,I as An,Tn as At,Ko as B,U as Bt,Cs as C,V as Cn,Un as Ct,ss as D,z as Dn,Y as Dt,ms as E,re as En,Fn as Et,as as F,j as Fn,J as Ft,Ea as G,Ct as Gt,Fo as H,G as Ht,Xo as I,nn as It,fa as J,bt as Jt,Ca as K,yt as Kt,os as L,q as Lt,es as M,te as Mn,vn as Mt,rs as N,F as Nn,on as Nt,Jo as O,L as On,An as Ot,is as P,N as Pn,an as Pt,ua as Q,pt as Qt,ns as R,K as Rt,Ts as S,oe as Sn,Kn as St,cs as T,ee as Tn,Rn as Tt,Io as U,Ut,Wo as V,W as Vt,lo as W,Dt as Wt,da as X,vt as Xt,pa as Y,Tt as Yt,la as Z,St as Zt,Ws as _,Te as _n,$n as _t,Ic as a,dt as an,$r as at,Ps as b,ve as bn,Yn as bt,Mc as c,lt as cn,Tr as ct,vc as d,Qe as dn,Z as dt,wt as en,ia as et,dc as f,et as fn,_r as ft,Gs as g,ze as gn,mr as gt,Ks as h,Xe as hn,dr as ht,Rc as i,Et as in,Pi as it,Yo as j,ie as jn,bn as jt,Zo as k,R as kn,kn as kt,Ac as l,nt as ln,Q as lt,Js as m,$e as mn,cr as mt,Vc as n,ht as nn,Zi as nt,Fc as o,ft as on,Er as ot,cc as p,Ze as pn,hr as pt,Sa as q,xt as qt,Bc as r,mt as rn,Qi as rt,Pc as s,ut as sn,wr as st,Hc as t,gt as tn,Xi as tt,yc as u,rt as un,xr as ut,Us as v,ye as vn,X as vt,hs as w,ne as wn,Hn as wt,Ns as x,se as xn,Gn as xt,Vs as y,be as yn,er as yt,qo as z,Kt as zt};
|
package/static/dist/assets/{vennDiagram-4TSXK5OY-bo97zf3z.js → vennDiagram-4TSXK5OY-ez63kh7n.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as e}from"./Markdown-bt9bqd6a.js";import{n as t}from"./chunk-Y2CYZVJY-n9gs7k4d.js";import{p as n}from"./src-hjyib4mu.js";import{H as r,K as i,U as a,a as o,b as s,c,et as l,f as u,nt as d,rt as f,tt as p,v as m,w as h,y as g}from"./chunk-DU6HZSFF-ods2l027.js";import{i as _}from"./chunk-75Z2AOVW-j633otj1.js";import{t as v}from"./rough.esm-on4k4je3.js";var y=(e,t)=>d(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e==="default"?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
|
|
1
|
+
import{x as e}from"./Markdown-ftyfzds0.js";import{n as t}from"./chunk-Y2CYZVJY-n9gs7k4d.js";import{p as n}from"./src-hjyib4mu.js";import{H as r,K as i,U as a,a as o,b as s,c,et as l,f as u,nt as d,rt as f,tt as p,v as m,w as h,y as g}from"./chunk-DU6HZSFF-k1tp3qnp.js";import{i as _}from"./chunk-75Z2AOVW-eibnex6m.js";import{t as v}from"./rough.esm-on4k4je3.js";var y=(e,t)=>d(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e==="default"?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
|
|
2
2
|
M`,e,t),r.push(`
|
|
3
3
|
m`,-n,0),r.push(`
|
|
4
4
|
a`,n,n,0,1,0,n*2,0),r.push(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-opuflp73.js";import{i as e}from"./mermaid-parser.core-
|
|
1
|
+
import"./chunk-FOHPRMQF-opuflp73.js";import{i as e}from"./mermaid-parser.core-mq3uns9m.js";export{e as createWardleyServices};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./mermaid-parser.core-
|
|
1
|
+
import{n as e}from"./mermaid-parser.core-mq3uns9m.js";import{x as t}from"./Markdown-ftyfzds0.js";import{n}from"./chunk-Y2CYZVJY-n9gs7k4d.js";import{m as r}from"./src-hjyib4mu.js";import{D as i,H as a,K as o,U as s,a as c,b as l,c as u,v as d,w as f,x as p,y as m}from"./chunk-DU6HZSFF-k1tp3qnp.js";import{i as h}from"./chunk-75Z2AOVW-eibnex6m.js";import{t as g}from"./chunk-JWPE2WC7-mw03m5s9.js";var _=n((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=n((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=n(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=n(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=n((e,t)=>{if(g(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:n(async t=>{let n=await e(`wardley`,t);r.debug(n);let i=S.parser?.yy;if(!i||typeof i.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);x(n,i)},`parse`)},C=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{n(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function w(){return p()[`wardley-beta`]}n(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}n(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}n(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}n(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}n(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}n(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}n(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}n(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}n(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}n(N,`setSize`);function P(e){C.startPipeline(e)}n(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}n(F,`addPipelineComponent`);function I(e){C.setAxes(e)}n(I,`updateAxes`);function L(e){return C.getNode(e)}n(L,`getNode`);function R(e){return C.resolveNodeId(e)}n(R,`resolveNodeId`);function z(){return C.build()}n(z,`getWardleyData`);function B(){C.clear(),c()}n(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:s,getAccTitle:m,setDiagramTitle:o,getDiagramTitle:f,getAccDescription:d,setAccDescription:a},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=n(()=>{let{themeVariables:e}=p();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=n(()=>{let e=p()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:n((e,i,a,o)=>{r.debug(`Rendering Wardley map
|
|
2
2
|
`+e);let s=W(),c=U(),l=s.nodeRadius*1.6,d=o.db,f=d.getWardleyData(),p=d.getDiagramTitle(),m=f.size?.width??s.width,h=f.size?.height??s.height,g=t(i);g.selectAll(`*`).remove(),u(g,h,m,s.useMaxWidth),g.attr(`viewBox`,`0 0 ${m} ${h}`);let _=g.append(`g`).attr(`class`,`wardley-map`),v=g.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${i}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,c.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${i}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,c.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${i}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,c.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,m).attr(`height`,h).attr(`fill`,c.backgroundColor);let y=m-s.padding*2,b=h-s.padding*2;p&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,m/2).attr(`y`,s.padding/2).attr(`fill`,c.axisTextColor).attr(`font-size`,s.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(p);let x=n(e=>s.padding+e/100*y,`projectX`),S=n(e=>h-s.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,s.padding).attr(`x2`,m-s.padding).attr(`y1`,h-s.padding).attr(`y2`,h-s.padding).attr(`stroke`,c.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,s.padding).attr(`x2`,s.padding).attr(`y1`,s.padding).attr(`y2`,h-s.padding).attr(`stroke`,c.axisColor).attr(`stroke-width`,1);let w=f.axes.xLabel??`Evolution`,T=f.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,s.padding+y/2).attr(`y`,h-s.padding/4).attr(`fill`,c.axisTextColor).attr(`font-size`,s.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,s.padding/3).attr(`y`,s.padding+b/2).attr(`fill`,c.axisTextColor).attr(`font-size`,s.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${s.padding/3} ${s.padding+b/2})`).text(T);let E=f.axes.stages&&f.axes.stages.length>0?f.axes.stages:H;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=f.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=s.padding+i.start*y,o=(a+(s.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,s.padding).attr(`y2`,h-s.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,o).attr(`y`,h-s.padding/1.5).attr(`fill`,c.axisTextColor).attr(`font-size`,s.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(s.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=s.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,s.padding).attr(`y2`,h-s.padding).attr(`stroke`,c.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,s.padding).attr(`x2`,m-s.padding).attr(`y1`,h-s.padding-b*n).attr(`y2`,h-s.padding-b*n).attr(`stroke`,c.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(f.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),f.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);f.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:f.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,c.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,o=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),o=t.y)}),i!==1/0&&a!==-1/0){let t=s.nodeRadius*4,r=o-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-l/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,c.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;f.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=f.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=f.nodes.find(t=>t.id===e.source).isPipelineParent?l/Math.sqrt(2):s.nodeRadius,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return t.x+i/o*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=f.nodes.find(t=>t.id===e.source).isPipelineParent?l/Math.sqrt(2):s.nodeRadius,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return t.y+a/o*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=f.nodes.find(t=>t.id===e.target).isPipelineParent?l/Math.sqrt(2):s.nodeRadius,i=t.x-n.x,a=t.y-n.y,o=Math.sqrt(i*i+a*a);return n.x+i/o*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=f.nodes.find(t=>t.id===e.target).isPipelineParent?l/Math.sqrt(2):s.nodeRadius,i=t.x-n.x,a=t.y-n.y,o=Math.sqrt(i*i+a*a);return n.y+a/o*r}).attr(`stroke`,c.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${i})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${i})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,c.axisTextColor).attr(`font-size`,s.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=f.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,o=Math.sqrt(i*i+a*a),c=s.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:o>c?n-i/o*c:n,adjustedY2:o>c?r-a/o*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,c.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${i})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(f.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,s.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,c.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,s.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,c.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,s.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,s.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,c.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,s.nodeRadius).attr(`fill`,c.componentFill).attr(`stroke`,c.componentStroke).attr(`stroke-width`,1);let F=s.nodeRadius*.7,I=s.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,c.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,c.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,c.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,c.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,c.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,c.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-l/2).attr(`y`,e=>D.get(e.id).y-l/2).attr(`width`,l).attr(`height`,l).attr(`fill`,c.componentFill).attr(`stroke`,c.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l/2+15:s.nodeRadius+15;return e.sourceStrategy&&(n+=s.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l:s.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l/2+15:s.nodeRadius+15;return e.sourceStrategy&&(n+=s.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l:s.nodeRadius*2;return t.y+n/2}).attr(`stroke`,c.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=s.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-s.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?c.evolutionStroke:e.className===`anchor`?`#000`:c.componentLabelColor).attr(`font-size`,s.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),f.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(f.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,c.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,c.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,c.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),f.annotationsBox){let t=x(f.annotationsBox.x),n=S(f.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...f.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,c.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,o=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();o=Math.max(o,i.height)});let l=e+20+105,u=i.length*16+20+o/2,d=s.padding,f=m-s.padding-l,p=s.padding,g=h-s.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(p,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,c.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(f.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);f.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,c.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(f.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);f.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
|
|
3
3
|
M ${n} ${r-15}
|
|
4
4
|
L ${n+60-20} ${r-15}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as e}from"./Markdown-
|
|
1
|
+
import{x as e}from"./Markdown-ftyfzds0.js";import{n as t}from"./chunk-Y2CYZVJY-n9gs7k4d.js";import{m as n}from"./src-hjyib4mu.js";import{D as r,H as i,K as a,U as o,a as s,b as c,c as l,f as u,v as d,w as f,y as p,z as m}from"./chunk-DU6HZSFF-k1tp3qnp.js";import{t as h}from"./linear-becwlnhk.js";import{t as g}from"./ordinal-d88pfdla.js";import{t as _}from"./init-ljpdkjra.js";import{i as v}from"./chunk-75Z2AOVW-eibnex6m.js";import{t as y}from"./line-md6em6gc.js";import"./chunk-PWAF6VOD-oriuokxy.js";import{t as b}from"./chunk-GMAD6QVW-ldlzruv1.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=g().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},_.apply(d(),arguments)}var C=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s]}},`anonymous`),table:[e(n,r,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},e(n,r,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),e(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,36]),e(c,[2,37]),e(c,[2,38]),{1:[2,1]},e(n,r,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},e(c,[2,5]),e(n,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),e(E,[2,40]),e(E,[2,41]),e(D,[2,42]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(D,[2,52]),e(D,[2,53]),e(T,[2,10]),e(T,[2,24],{32:41,31:56,24:x,29:S}),e(T,[2,26]),e(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,11]),e(T,[2,32],{35:60,29:C}),e(T,[2,34]),{33:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},e(T,[2,14]),{17:66,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,43]),e(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(T,[2,33]),{29:[1,70]},e(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(k,[2,23],{30:[1,73]}),e(T,[2,15]),e(T,[2,28]),e(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,35]),e(T,[2,19]),{25:75,27:64,29:O},e(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};A.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
package/static/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="__LANG__"><head><base href="__BASE_HREF__"><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/><link rel="stylesheet" href="./assets/index-
|
|
1
|
+
<!DOCTYPE html><html lang="__LANG__"><head><base href="__BASE_HREF__"><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/><link rel="stylesheet" href="./assets/index-ab0wj9ik.css" data-precedence="default"/><title>Hermes</title><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><meta name="apple-mobile-web-app-title" content="Hermes"/><meta name="theme-color" content="#0D0D1A"/><meta name="color-scheme" content="dark light"/><link rel="modulepreload" href="./assets/index-fd27xooo.js"/><link rel="modulepreload" href="./assets/rolldown-runtime-b9miacsj.js"/><link rel="modulepreload" href="./assets/jsx-runtime-eu92a5pu.js"/><link rel="modulepreload" href="./assets/lazyRouteComponent-ol965zwk.js"/><link rel="modulepreload" href="./assets/link-ib4prsn5.js"/><link rel="modulepreload" href="./assets/not-found-ccnnac39.js"/><link rel="modulepreload" href="./assets/root-mbklpuv4.js"/><link rel="modulepreload" href="./assets/matchContext-f8oy3lo7.js"/><link rel="modulepreload" href="./assets/useSelector-f2aak1ol.js"/><link rel="modulepreload" href="./assets/endpoints-f6ngsyu5.js"/><link rel="modulepreload" href="./assets/_app-j3rors25.js"/><link rel="icon" type="image/png" sizes="32x32" href="static/brand/favicon-32.png"/><link rel="shortcut icon" href="static/brand/favicon.ico"/><link rel="icon" type="image/svg+xml" sizes="any" href="static/brand/favicon.svg"/><link rel="apple-touch-icon" sizes="512x512" href="static/brand/apple-touch-icon.png"/><link rel="manifest" href="manifest.webmanifest" crossorigin="use-credentials"/><link rel="preload" href="./assets/InterVariable-nonokl6i.woff2" as="font" type="font/woff2" crossorigin="anonymous"/><script src="./assets/prepaint-f14kbd49.js"></script></head><body><div id="app"></div><script type="module" async="" src="./assets/index-fd27xooo.js"></script></body></html>
|
package/static/dist/sw.js
CHANGED
|
@@ -907,7 +907,7 @@ var $ = class {
|
|
|
907
907
|
this._cacheExpirations = /* @__PURE__ */ new Map();
|
|
908
908
|
}
|
|
909
909
|
}, Te = "./index.html";
|
|
910
|
-
N([{"revision":"
|
|
910
|
+
N([{"revision":"caea38ad31c44d17b123579bd35f81be","url":"./assets/_app-j3rors25.js"},{"revision":"57d48b5cc3352827d45085de5c0cd023","url":"./assets/endpoints-f6ngsyu5.js"},{"revision":"cde35165193b1878f59870f97b15e4d0","url":"./assets/index-ab0wj9ik.css"},{"revision":"a0d70a41bf2bf0fc75e47c0288f1f609","url":"./assets/index-fd27xooo.js"},{"revision":"10c5400068d0398439c967e6bda04b57","url":"./assets/jsx-runtime-eu92a5pu.js"},{"revision":"dbe71b63f54c8c5c48cb8206675c9fad","url":"./assets/lazyRouteComponent-ol965zwk.js"},{"revision":"1c94843db7d592650b0c7d1d26e4b802","url":"./assets/link-ib4prsn5.js"},{"revision":"ee739ef7f8a1e195b3dd980773043c5b","url":"./assets/matchContext-f8oy3lo7.js"},{"revision":"fd7dd0c269d902acb5cb670fe3b478ad","url":"./assets/not-found-ccnnac39.js"},{"revision":"b871f1049739c8ce7944011c59ea6e98","url":"./assets/prepaint-f14kbd49.js"},{"revision":"026deff3b32fe7b54729af120c91375e","url":"./assets/rolldown-runtime-b9miacsj.js"},{"revision":"3e4f1f48a48bd0f5501dcb45ced7358d","url":"./assets/root-mbklpuv4.js"},{"revision":"df989abda5e89c3e65e680690cf7ca05","url":"./assets/useSelector-f2aak1ol.js"},{"revision":"aa8c5fcf362562ec0cabd6086e8d2807","url":"./index.html"},{"revision":"dfc02d3012147ec40b9a27d9a06effae","url":"./manifest.webmanifest"}]), A(), E(({ url: e, request: t }) => t.method === "GET" && e.origin === self.location.origin && e.pathname.startsWith(new URL("./assets/", self.registration.scope).pathname), new P({
|
|
911
911
|
cacheName: "hermes-assets-v1",
|
|
912
912
|
plugins: [new $({
|
|
913
913
|
maxEntries: 400,
|