studiograph 1.2.0-beta.9 → 1.2.1
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/README.md +13 -18
- package/dist/agent/orchestrator.d.ts +56 -0
- package/dist/agent/orchestrator.js +167 -22
- package/dist/agent/orchestrator.js.map +1 -1
- package/dist/agent/prompts/system.md +51 -63
- package/dist/agent/skill-loader.js +8 -0
- package/dist/agent/skill-loader.js.map +1 -1
- package/dist/agent/skills/entity-schema.md +4 -19
- package/dist/agent/skills/gather-context.md +1 -1
- package/dist/agent/tools/graph-tools.d.ts +41 -1
- package/dist/agent/tools/graph-tools.js +133 -57
- package/dist/agent/tools/graph-tools.js.map +1 -1
- package/dist/agent/tools/ops-tools.js +82 -0
- package/dist/agent/tools/ops-tools.js.map +1 -1
- package/dist/agent/tools/permission-tools.d.ts +90 -0
- package/dist/agent/tools/permission-tools.js +207 -0
- package/dist/agent/tools/permission-tools.js.map +1 -0
- package/dist/agent/tools/sync-tools.js +2 -2
- package/dist/agent/tools/sync-tools.js.map +1 -1
- package/dist/auth/github.d.ts +1 -1
- package/dist/auth/github.js +21 -13
- package/dist/auth/github.js.map +1 -1
- package/dist/cli/commands/access.d.ts +11 -0
- package/dist/cli/commands/access.js +156 -0
- package/dist/cli/commands/access.js.map +1 -0
- package/dist/cli/commands/app.js +25 -2
- package/dist/cli/commands/app.js.map +1 -1
- package/dist/cli/commands/clear.d.ts +5 -0
- package/dist/cli/commands/clear.js +36 -0
- package/dist/cli/commands/clear.js.map +1 -0
- package/dist/cli/commands/clone.js +3 -3
- package/dist/cli/commands/clone.js.map +1 -1
- package/dist/cli/commands/collection.d.ts +10 -0
- package/dist/cli/commands/collection.js +187 -0
- package/dist/cli/commands/collection.js.map +1 -0
- package/dist/cli/commands/commit.js +2 -1
- package/dist/cli/commands/commit.js.map +1 -1
- package/dist/cli/commands/config.d.ts +100 -0
- package/dist/cli/commands/config.js +1 -1
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/deploy.js +10 -1
- package/dist/cli/commands/deploy.js.map +1 -1
- package/dist/cli/commands/index.js +1 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.js +32 -40
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/join.d.ts +0 -6
- package/dist/cli/commands/join.js +26 -111
- package/dist/cli/commands/join.js.map +1 -1
- package/dist/cli/commands/lint.js +1 -2
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mcp.js +6 -5
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/org.d.ts +10 -0
- package/dist/cli/commands/org.js +132 -0
- package/dist/cli/commands/org.js.map +1 -0
- package/dist/cli/commands/orphans.js +1 -2
- package/dist/cli/commands/orphans.js.map +1 -1
- package/dist/cli/commands/provision.js +3 -3
- package/dist/cli/commands/provision.js.map +1 -1
- package/dist/cli/commands/resolve.d.ts +8 -0
- package/dist/cli/commands/resolve.js +85 -0
- package/dist/cli/commands/resolve.js.map +1 -0
- package/dist/cli/commands/serve.js +55 -25
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/start.js +22 -205
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/sync.js +53 -8
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/commands/team.d.ts +12 -0
- package/dist/cli/commands/team.js +185 -0
- package/dist/cli/commands/team.js.map +1 -0
- package/dist/cli/index.js +41 -34
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/scaffolding.d.ts +5 -3
- package/dist/cli/scaffolding.js +191 -97
- package/dist/cli/scaffolding.js.map +1 -1
- package/dist/cli/setup-wizard.js +20 -10
- package/dist/cli/setup-wizard.js.map +1 -1
- package/dist/cli/sync-review-interactive.js +1 -1
- package/dist/cli/sync-review-interactive.js.map +1 -1
- package/dist/core/graph.d.ts +5 -10
- package/dist/core/graph.js +84 -85
- package/dist/core/graph.js.map +1 -1
- package/dist/core/migration-runner.d.ts +42 -0
- package/dist/core/migration-runner.js +232 -0
- package/dist/core/migration-runner.js.map +1 -0
- package/dist/core/migration-types.d.ts +101 -0
- package/dist/core/migration-types.js +21 -0
- package/dist/core/migration-types.js.map +1 -0
- package/dist/core/migrations/20260219-formalize-memory-location.d.ts +2 -0
- package/dist/core/migrations/20260219-formalize-memory-location.js +35 -0
- package/dist/core/migrations/20260219-formalize-memory-location.js.map +1 -0
- package/dist/core/migrations/20260220-add-workspace-metadata.d.ts +12 -0
- package/dist/core/migrations/20260220-add-workspace-metadata.js +65 -0
- package/dist/core/migrations/20260220-add-workspace-metadata.js.map +1 -0
- package/dist/core/migrations/20260220-add-workspace-readme.d.ts +11 -0
- package/dist/core/migrations/20260220-add-workspace-readme.js +82 -0
- package/dist/core/migrations/20260220-add-workspace-readme.js.map +1 -0
- package/dist/core/migrations/20260220-migrate-yaml-to-json.d.ts +9 -0
- package/dist/core/migrations/20260220-migrate-yaml-to-json.js +64 -0
- package/dist/core/migrations/20260220-migrate-yaml-to-json.js.map +1 -0
- package/dist/core/migrations/index.d.ts +11 -0
- package/dist/core/migrations/index.js +23 -0
- package/dist/core/migrations/index.js.map +1 -0
- package/dist/core/types.d.ts +19 -34
- package/dist/core/types.js +3 -21
- package/dist/core/types.js.map +1 -1
- package/dist/core/user-config.d.ts +27 -0
- package/dist/core/user-config.js +51 -0
- package/dist/core/user-config.js.map +1 -1
- package/dist/core/validation.d.ts +978 -2182
- package/dist/core/validation.js +242 -397
- package/dist/core/validation.js.map +1 -1
- package/dist/core/workspace-manager.d.ts +32 -31
- package/dist/core/workspace-manager.js +171 -186
- package/dist/core/workspace-manager.js.map +1 -1
- package/dist/core/workspace.d.ts +0 -5
- package/dist/core/workspace.js +33 -101
- package/dist/core/workspace.js.map +1 -1
- package/dist/lib/lib/utils.d.ts +2 -0
- package/dist/lib/lib/utils.js +6 -0
- package/dist/lib/lib/utils.js.map +1 -0
- package/dist/mcp/tools.js +13 -13
- package/dist/mcp/tools.js.map +1 -1
- package/dist/server/chrome/chrome.css +562 -0
- package/dist/server/chrome/chrome.js +540 -0
- package/dist/server/index.js +163 -10
- package/dist/server/index.js.map +1 -1
- package/dist/server/plugin-loader.d.ts +7 -0
- package/dist/server/plugin-loader.js +9 -1
- package/dist/server/plugin-loader.js.map +1 -1
- package/dist/server/routes/chat.d.ts +3 -2
- package/dist/server/routes/chat.js +67 -16
- package/dist/server/routes/chat.js.map +1 -1
- package/dist/server/routes/git-api.d.ts +9 -0
- package/dist/server/routes/git-api.js +82 -0
- package/dist/server/routes/git-api.js.map +1 -0
- package/dist/server/routes/graph-api.d.ts +2 -2
- package/dist/server/routes/graph-api.js +267 -3
- package/dist/server/routes/graph-api.js.map +1 -1
- package/dist/server/routes/permissions-api.d.ts +9 -0
- package/dist/server/routes/permissions-api.js +176 -0
- package/dist/server/routes/permissions-api.js.map +1 -0
- package/dist/server/routes/workspace-api.d.ts +9 -0
- package/dist/server/routes/workspace-api.js +283 -0
- package/dist/server/routes/workspace-api.js.map +1 -0
- package/dist/services/assets/base.d.ts +2 -2
- package/dist/services/assets/base.js +4 -4
- package/dist/services/assets/base.js.map +1 -1
- package/dist/services/assets/index.d.ts +6 -6
- package/dist/services/assets/index.js +12 -12
- package/dist/services/assets/index.js.map +1 -1
- package/dist/services/git.d.ts +35 -0
- package/dist/services/git.js +93 -0
- package/dist/services/git.js.map +1 -1
- package/dist/services/github-provisioner.js +1 -2
- package/dist/services/github-provisioner.js.map +1 -1
- package/dist/services/github-service.d.ts +99 -0
- package/dist/services/github-service.js +310 -0
- package/dist/services/github-service.js.map +1 -0
- package/dist/services/markdown.js +4 -9
- package/dist/services/markdown.js.map +1 -1
- package/dist/services/memory-service.d.ts +4 -0
- package/dist/services/memory-service.js +13 -1
- package/dist/services/memory-service.js.map +1 -1
- package/dist/services/sync/commit.d.ts +2 -0
- package/dist/services/sync/commit.js +21 -6
- package/dist/services/sync/commit.js.map +1 -1
- package/dist/services/sync/graphrag-indexer.js +2 -2
- package/dist/services/sync/graphrag-indexer.js.map +1 -1
- package/dist/utils/git.d.ts +5 -0
- package/dist/utils/git.js +10 -0
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/merge-resolver.d.ts +33 -8
- package/dist/utils/merge-resolver.js +157 -55
- package/dist/utils/merge-resolver.js.map +1 -1
- package/dist/utils/preflight.d.ts +1 -1
- package/dist/utils/preflight.js +1 -1
- package/dist/web/_app/env.js +1 -0
- package/dist/web/_app/immutable/assets/0.CDbX4Cwz.css +1 -0
- package/dist/web/_app/immutable/assets/2.DRHi7ABa.css +1 -0
- package/dist/web/_app/immutable/assets/3.BJy7pVXi.css +1 -0
- package/dist/web/_app/immutable/assets/4.Ad16uh9o.css +1 -0
- package/dist/web/_app/immutable/assets/5.BhKgiXd2.css +1 -0
- package/dist/web/_app/immutable/assets/6.CeHKR5ZY.css +1 -0
- package/dist/web/_app/immutable/assets/AppShell.CJtUfb0N.css +1 -0
- package/dist/web/_app/immutable/assets/ChatPanel.RFD5GGYI.css +1 -0
- package/dist/web/_app/immutable/assets/editor.CPAf2SRV.css +1 -0
- package/dist/web/_app/immutable/chunks/3_5VIr68.js +1 -0
- package/dist/web/_app/immutable/chunks/4QY4j-jX.js +1 -0
- package/dist/web/_app/immutable/chunks/BB_5th5W.js +3383 -0
- package/dist/web/_app/immutable/chunks/BButMJ6M.js +1 -0
- package/dist/web/_app/immutable/chunks/BiubvAUI.js +2 -0
- package/dist/web/_app/immutable/chunks/CAXuTUkp.js +1 -0
- package/dist/web/_app/immutable/chunks/CQENNNNl.js +6 -0
- package/dist/web/_app/immutable/chunks/CUzqHQY_.js +1 -0
- package/dist/web/_app/immutable/chunks/CV8ganSj.js +23 -0
- package/dist/web/_app/immutable/chunks/CYrVHOHA.js +1 -0
- package/dist/web/_app/immutable/chunks/CqkleIqs.js +1 -0
- package/dist/web/_app/immutable/chunks/DKyztuK9.js +1 -0
- package/dist/web/_app/immutable/chunks/DdNsM6oV.js +64 -0
- package/dist/web/_app/immutable/chunks/Dh_H7Owr.js +18 -0
- package/dist/web/_app/immutable/chunks/DnlgZ_Tk.js +5 -0
- package/dist/web/_app/immutable/chunks/DtVH--hH.js +6 -0
- package/dist/web/_app/immutable/chunks/F20aIBpJ.js +1 -0
- package/dist/web/_app/immutable/chunks/PPVm8Dsz.js +1 -0
- package/dist/web/_app/immutable/chunks/WSUKABI_.js +1 -0
- package/dist/web/_app/immutable/chunks/YFT1281h.js +2 -0
- package/dist/web/_app/immutable/chunks/aosHekRC.js +1 -0
- package/dist/web/_app/immutable/chunks/fwnBoL5x.js +1 -0
- package/dist/web/_app/immutable/chunks/hHxe9oXh.js +1 -0
- package/dist/web/_app/immutable/entry/app.BFVUP2fV.js +2 -0
- package/dist/web/_app/immutable/entry/start.BqsXHYP6.js +1 -0
- package/dist/web/_app/immutable/nodes/0.DQ5KdeNU.js +1 -0
- package/dist/web/_app/immutable/nodes/1.DwnzyOvm.js +1 -0
- package/dist/web/_app/immutable/nodes/2.FZxrWJeh.js +1 -0
- package/dist/web/_app/immutable/nodes/3.CQVWlbKr.js +1 -0
- package/dist/web/_app/immutable/nodes/4.CEh40Z_h.js +16 -0
- package/dist/web/_app/immutable/nodes/5.D_QsCLEf.js +4 -0
- package/dist/web/_app/immutable/nodes/6.CndEQ0o5.js +2 -0
- package/dist/web/_app/version.json +1 -0
- package/dist/web/index.html +43 -0
- package/package.json +21 -3
- package/dist/agent/skills/bundled/enrich-entities.md +0 -124
- package/dist/agent/skills/bundled/gather-context.md +0 -46
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as F,h as O,a as H,E as M,r as j,H as C,a5 as U,s as m,c as q,d as A,e as z,au as G,_ as $,B as L,a2 as Q,av as R,a3 as T,a0 as W,W as D,ad as g,aw as N,F as S,ax as _,ay as Y,az as x,aA as Z,Q as J,T as V,aB as X,aC as k,aD as ee,aE as re,aF as ne,aG as se,aH as ie,I as ae,aI as ue}from"./fwnBoL5x.js";import{B as te}from"./3_5VIr68.js";function ve(e,r,s=!1){var n;O&&(n=z,H());var i=new te(e),a=s?M:0;function v(t,l){if(O){var o=j(n),f;if(o===C?f=0:o===U?f=!1:f=parseInt(o.substring(1)),t!==f){var h=m();q(h),i.anchor=h,A(!1),i.ensure(t,l),A(!0);return}}i.ensure(t,l)}F(()=>{var t=!1;r((l,o=0)=>{t=!0,v(o,l)}),t||v(!1,null)},a)}function B(e,r){return e===r||e?.[R]===r}function he(e={},r,s,n){return G(()=>{var i,a;return $(()=>{i=a,a=n?.()||[],L(()=>{e!==s(...a)&&(r(e,...a),i&&B(s(...i),e)&&r(null,...i))})}),()=>{Q(()=>{a&&B(s(...a),e)&&r(null,...a)})}}),e}let P=!1;function fe(e){var r=P;try{return P=!1,[e(),P]}finally{P=r}}const le={get(e,r){if(!e.exclude.includes(r))return e.props[r]},set(e,r){return!1},getOwnPropertyDescriptor(e,r){if(!e.exclude.includes(r)&&r in e.props)return{enumerable:!0,configurable:!0,value:e.props[r]}},has(e,r){return e.exclude.includes(r)?!1:r in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(r=>!e.exclude.includes(r))}};function be(e,r,s){return new Proxy({props:e,exclude:r},le)}const oe={get(e,r){if(!e.exclude.includes(r))return S(e.version),r in e.special?e.special[r]():e.props[r]},set(e,r,s){if(!(r in e.special)){var n=T;try{g(e.parent_effect),e.special[r]=pe({get[r](){return e.props[r]}},r,N)}finally{g(n)}}return e.special[r](s),D(e.version),!0},getOwnPropertyDescriptor(e,r){if(!e.exclude.includes(r)&&r in e.props)return{enumerable:!0,configurable:!0,value:e.props[r]}},deleteProperty(e,r){return e.exclude.includes(r)||(e.exclude.push(r),D(e.version)),!0},has(e,r){return e.exclude.includes(r)?!1:r in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(r=>!e.exclude.includes(r))}};function Pe(e,r){return new Proxy({props:e,exclude:r,special:{},version:W(0),parent_effect:T},oe)}const ce={get(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(_(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n)return n[r]}},set(e,r,s){let n=e.props.length;for(;n--;){let i=e.props[n];_(i)&&(i=i());const a=x(i,r);if(a&&a.set)return a.set(s),!0}return!1},getOwnPropertyDescriptor(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(_(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n){const i=x(n,r);return i&&!i.configurable&&(i.configurable=!0),i}}},has(e,r){if(r===R||r===Y)return!1;for(let s of e.props)if(_(s)&&(s=s()),s!=null&&r in s)return!0;return!1},ownKeys(e){const r=[];for(let s of e.props)if(_(s)&&(s=s()),!!s){for(const n in s)r.includes(n)||r.push(n);for(const n of Object.getOwnPropertySymbols(s))r.includes(n)||r.push(n)}return r}};function Se(...e){return new Proxy({props:e},ce)}function pe(e,r,s,n){var i=!ne||(s&se)!==0,a=(s&re)!==0,v=(s&ee)!==0,t=n,l=!0,o=()=>(l&&(l=!1,t=v?L(n):n),t),f;if(a){var h=R in e||Y in e;f=x(e,r)?.set??(h&&r in e?u=>e[r]=u:void 0)}var p,E=!1;a?[p,E]=fe(()=>e[r]):p=e[r],p===void 0&&n!==void 0&&(p=o(),f&&(i&&Z(),f(p)));var c;if(i?c=()=>{var u=e[r];return u===void 0?o():(l=!0,u)}:c=()=>{var u=e[r];return u!==void 0&&(t=void 0),u===void 0?t:u},i&&(s&N)===0)return c;if(f){var y=e.$$legacy;return(function(u,b){return arguments.length>0?((!i||!b||y||E)&&f(b?c():u),u):c()})}var w=!1,d=((s&ie)!==0?ae:ue)(()=>(w=!1,c()));a&&S(d);var K=T;return(function(u,b){if(arguments.length>0){const I=b?S(d):i&&a?J(u):u;return V(d,I),w=!0,t!==void 0&&(t=I),u}return X&&w||(K.f&k)!==0?d.v:S(d)})}export{he as b,ve as i,Pe as l,pe as p,be as r,Se as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Z as K,F as W,_ as Q,a0 as z,B as X,a1 as M,a2 as R,e as u,h as p,a3 as y,a4 as C,b as ee,a as te,a5 as se,a6 as H,j as c,i as J,a7 as F,p as O,m as re,a8 as B,a9 as ie,aa as L,ab as ne,ac as ae,ad as j,ae as q,af as $,ag as he,ah as fe,y as U,ai as oe,g as S,c as w,v as de,s as _e,aj as b,E as le,L as ce,ak as ue,al as pe,am as Y,O as ge,M as Z,H as ve,N as ye,an as k,d as E,ao as me,ap as be,aq as Ee,ar as Te,n as Re,as as we,at as De,q as Ne}from"./fwnBoL5x.js";import{b as Ae,r as P,h as V,i as Fe,c as Oe}from"./hHxe9oXh.js";function Se(i){let e=0,t=z(0),r;return()=>{K()&&(W(t),Q(()=>(e===0&&(r=X(()=>i(()=>M(t)))),e+=1,()=>{R(()=>{e-=1,e===0&&(r?.(),r=void 0,M(t))})})))}}var Ye=le|ce;function ke(i,e,t,r){new xe(i,e,t,r)}class xe{parent;is_pending=!1;transform_error;#t;#g=p?u:null;#i;#o;#e;#n=null;#s=null;#r=null;#a=null;#d=0;#f=0;#_=!1;#l=new Set;#c=new Set;#h=null;#m=Se(()=>(this.#h=z(this.#d),()=>{this.#h=null}));constructor(e,t,r,f){this.#t=e,this.#i=t,this.#o=s=>{var n=y;n.b=this,n.f|=C,r(s)},this.parent=y.b,this.transform_error=f??this.parent?.transform_error??(s=>s),this.#e=ee(()=>{if(p){const s=this.#g;te();const n=s.data===se;if(s.data.startsWith(H)){const a=JSON.parse(s.data.slice(H.length));this.#E(a)}else n?this.#T():this.#b()}else this.#v()},Ye),p&&(this.#t=u)}#b(){try{this.#n=c(()=>this.#o(this.#t))}catch(e){this.error(e)}}#E(e){const t=this.#i.failed;t&&(this.#r=c(()=>{t(this.#t,()=>e,()=>()=>{})}))}#T(){const e=this.#i.pending;e&&(this.is_pending=!0,this.#s=c(()=>e(this.#t)),R(()=>{var t=this.#a=document.createDocumentFragment(),r=J();t.append(r),this.#n=this.#p(()=>(F.ensure(),c(()=>this.#o(r)))),this.#f===0&&(this.#t.before(t),this.#a=null,O(this.#s,()=>{this.#s=null}),this.#u())}))}#v(){try{if(this.is_pending=this.has_pending_snippet(),this.#f=0,this.#d=0,this.#n=c(()=>{this.#o(this.#t)}),this.#f>0){var e=this.#a=document.createDocumentFragment();re(this.#n,e);const t=this.#i.pending;this.#s=c(()=>t(this.#t))}else this.#u()}catch(t){this.error(t)}}#u(){this.is_pending=!1;for(const e of this.#l)B(e,ie),L(e);for(const e of this.#c)B(e,ne),L(e);this.#l.clear(),this.#c.clear()}defer_effect(e){ae(e,this.#l,this.#c)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#i.pending}#p(e){var t=y,r=fe,f=U;j(this.#e),q(this.#e),$(this.#e.ctx);try{return e()}catch(s){return he(s),null}finally{j(t),q(r),$(f)}}#y(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(e);return}this.#f+=e,this.#f===0&&(this.#u(),this.#s&&O(this.#s,()=>{this.#s=null}),this.#a&&(this.#t.before(this.#a),this.#a=null))}update_pending_count(e){this.#y(e),this.#d+=e,!(!this.#h||this.#_)&&(this.#_=!0,R(()=>{this.#_=!1,this.#h&&oe(this.#h,this.#d)}))}get_effect_pending(){return this.#m(),W(this.#h)}error(e){var t=this.#i.onerror;let r=this.#i.failed;if(!t&&!r)throw e;this.#n&&(S(this.#n),this.#n=null),this.#s&&(S(this.#s),this.#s=null),this.#r&&(S(this.#r),this.#r=null),p&&(w(this.#g),de(),w(_e()));var f=!1,s=!1;const n=()=>{if(f){pe();return}f=!0,s&&ue(),this.#r!==null&&O(this.#r,()=>{this.#r=null}),this.#p(()=>{F.ensure(),this.#v()})},l=a=>{try{s=!0,t?.(a,n),s=!1}catch(h){b(h,this.#e&&this.#e.parent)}r&&(this.#r=this.#p(()=>{F.ensure();try{return c(()=>{var h=y;h.b=this,h.f|=C,r(this.#t,()=>a,()=>n)})}catch(h){return b(h,this.#e.parent),null}}))};R(()=>{var a;try{a=this.transform_error(e)}catch(h){b(h,this.#e&&this.#e.parent);return}a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(l,h=>b(h,this.#e&&this.#e.parent)):l(a)})}}function He(i,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(i.__t??=i.nodeValue)&&(i.__t=t,i.nodeValue=`${t}`)}function Ie(i,e){return G(i,e)}function Be(i,e){Y(),e.intro=e.intro??!1;const t=e.target,r=p,f=u;try{for(var s=ge(t);s&&(s.nodeType!==Z||s.data!==ve);)s=ye(s);if(!s)throw k;E(!0),w(s);const n=G(i,{...e,anchor:s});return E(!1),n}catch(n){if(n instanceof Error&&n.message.split(`
|
|
2
|
+
`).some(l=>l.startsWith("https://svelte.dev/e/")))throw n;return n!==k&&console.warn("Failed to hydrate: ",n),e.recover===!1&&me(),Y(),be(t),E(!1),Ie(i,e)}finally{E(r),w(f)}}const T=new Map;function G(i,{target:e,anchor:t,props:r={},events:f,context:s,intro:n=!0,transformError:l}){Y();var a=void 0,h=Ee(()=>{var m=t??e.appendChild(J());ke(m,{pending:()=>{}},o=>{Re({});var d=U;if(s&&(d.c=s),f&&(r.$$events=f),p&&Oe(o,null),a=i(o,r)||{},p&&(y.nodes.end=u,u===null||u.nodeType!==Z||u.data!==we))throw De(),k;Ne()},l);var D=new Set,N=o=>{for(var d=0;d<o.length;d++){var _=o[d];if(!D.has(_)){D.add(_);var v=Fe(_);for(const A of[e,document]){var g=T.get(A);g===void 0&&(g=new Map,T.set(A,g));var I=g.get(_);I===void 0?(A.addEventListener(_,V,{passive:v}),g.set(_,1)):g.set(_,I+1)}}}};return N(Te(Ae)),P.add(N),()=>{for(var o of D)for(const v of[e,document]){var d=T.get(v),_=d.get(o);--_==0?(v.removeEventListener(o,V),d.delete(o),d.size===0&&T.delete(v)):d.set(o,_)}P.delete(N),m!==t&&m.parentNode?.removeChild(m)}});return x.set(a,h),a}let x=new WeakMap;function Le(i,e){const t=x.get(i);return t?(x.delete(i),t(e)):Promise.resolve()}export{Se as c,Be as h,Ie as m,He as s,Le as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as d,z as g,A as c,B as m,C as i,D as b,F as p,G as v,I as y,J as h}from"./fwnBoL5x.js";function x(n=!1){const s=d,e=s.l.u;if(!e)return;let f=()=>v(s.s);if(n){let a=0,t={};const _=y(()=>{let l=!1;const r=s.s;for(const o in r)r[o]!==t[o]&&(t[o]=r[o],l=!0);return l&&a++,a});f=()=>p(_)}e.b.length&&g(()=>{u(s,f),i(e.b)}),c(()=>{const a=m(()=>e.m.map(b));return()=>{for(const t of a)typeof t=="function"&&t()}}),e.a.length&&c(()=>{u(s,f),i(e.a)})}function u(n,s){if(n.l.s)for(const e of n.l.s)p(e);s()}h();export{x as i};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DtVH--hH.js","./DnlgZ_Tk.js","./Dh_H7Owr.js","./4QY4j-jX.js","./CUzqHQY_.js","./aosHekRC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as ri,j as wt,e as De,a as A,d as L,f as K,q as lt,s as gn}from"./hHxe9oXh.js";import{b1 as bo,h as xo,a as So,br as Ao,b as Eo,au as Oo,B as tn,n as ut,P as B,Q as qt,A as vt,aM as ii,t as R,u as nt,w as M,F as c,T as m,q as dt,V as D,x as yt,Y as _,bs as Or,a0 as To,a1 as _e,bt as Po,o as Ln,R as Co,z as _o,bq as pt,bu as ko,bv as oi,S as si,X as Mo,v as Pn,W as qe,bc as Fo}from"./fwnBoL5x.js";import{s as ht,c as ai,m as Ro,u as Do}from"./BiubvAUI.js";import{p as x,i as at,b as Yn,s as Mt,r as ie,l as ve}from"./BButMJ6M.js";import{b as ci,e as Yt,i as te,I as pe,s as me,T as Io,C as No,P as Tr}from"./CV8ganSj.js";import{c as ae}from"./F20aIBpJ.js";import{r as Bn,b as Qe,w as Gn,m as Cn,s as st,h as ue,e as Lo,j as _n,a as Bo,u as Pr,g as Cr,n as Wo}from"./YFT1281h.js";import{g as zo}from"./DKyztuK9.js";import{B as Vo}from"./3_5VIr68.js";import"./CAXuTUkp.js";import{_ as be}from"./PPVm8Dsz.js";function Ko(){return Symbol(bo)}const Ho=Symbol("NaN");function Uo(e,t,n){xo&&So();var r=new Vo(e),i=!Ao();Eo(()=>{var s=t();s!==s&&(s=Ho),i&&s!==null&&typeof s=="object"&&(s={}),r.ensure(s,n)})}function jo(e,t,n){Oo(()=>{var r=tn(()=>t(e,n?.())||{});if(r?.destroy)return()=>r.destroy()})}var Yo=K('<span class="chip svelte-84vb17"> <button class="chip-remove svelte-84vb17">×</button></span>'),Go=K('<div><span class="entity-title svelte-84vb17"> </span> <span class="entity-meta svelte-84vb17"><span class="entity-type-badge svelte-84vb17"> </span> <span class="entity-repo svelte-84vb17"> </span></span></div>'),qo=K('<div class="dropdown svelte-84vb17"></div>'),Xo=K('<div class="autocomplete svelte-84vb17"><div class="input-row svelte-84vb17"><!> <input class="ac-input svelte-84vb17" type="text" placeholder="Search entities..."/></div> <!></div>');function Zo(e,t){ut(t,!0);let n=x(t,"multi",3,!1),r=B(""),i=B(0),s;const o=_(()=>Gn.repos.flatMap(O=>O.entities.map(k=>({id:k.id,title:k.title,entityType:k.entityType,repo:O.name})))),a=_(()=>()=>{const O=c(r).toLowerCase().trim();return O?c(o).filter(k=>k.title.toLowerCase().includes(O)||k.id.toLowerCase().includes(O)).slice(0,20):c(o).slice(0,20)}),l=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let u=B(qt(l));vt(()=>{ii().then(()=>s?.focus())});function f(O){n()?(c(u).includes(O)||m(u,[...c(u),O],!0),m(r,""),m(i,0),s?.focus()):t.onselect(O)}function d(O){m(u,c(u).filter(k=>k!==O),!0)}function g(){c(u).length===l.length&&c(u).every((k,j)=>k===l[j])?t.oncancel():t.onselect(c(u))}function v(O){const k=c(a)();O.key==="ArrowDown"?(O.preventDefault(),m(i,Math.min(c(i)+1,k.length-1),!0)):O.key==="ArrowUp"?(O.preventDefault(),m(i,Math.max(c(i)-1,0),!0)):O.key==="Enter"?(O.preventDefault(),k.length>0?f(k[c(i)].id):n()&&g()):O.key==="Escape"?n()&&c(u).length>0?g():t.oncancel():O.key==="Backspace"&&!c(r)&&n()&&c(u).length>0&&m(u,c(u).slice(0,-1),!0)}var p=Xo(),h=R(p),y=R(h);{var b=O=>{var k=L(),j=D(k);Yt(j,17,()=>c(u),te,(W,F)=>{var I=Yo(),H=R(I),q=nt(H);M(I),yt(()=>ht(H,`${c(F)??""} `)),wt("click",q,()=>d(c(F))),A(W,I)}),A(O,k)};at(y,O=>{n()&&O(b)})}var E=nt(y,2);Bn(E),Yn(E,O=>s=O,()=>s),M(h);var C=nt(h,2);{var S=O=>{var k=qo();Yt(k,21,()=>c(a)(),te,(j,W,F)=>{var I=Go();let H;var q=R(I),X=R(q,!0);M(q);var J=nt(q,2),z=R(J),G=R(z,!0);M(z);var Z=nt(z,2),At=R(Z,!0);M(Z),M(J),M(I),yt(()=>{H=Qe(I,1,"dropdown-item svelte-84vb17",null,H,{highlighted:F===c(i)}),ht(X,c(W).title),ht(G,c(W).entityType),ht(At,c(W).repo)}),wt("mousedown",I,Te=>{Te.preventDefault(),f(c(W).id)}),De("mouseenter",I,()=>m(i,F,!0)),A(j,I)}),M(k),A(O,k)},N=_(()=>c(a)().length>0);at(C,O=>{c(N)&&O(S)})}M(p),wt("keydown",E,v),De("blur",E,()=>{setTimeout(()=>{n()&&c(u).length>0?g():n()||t.oncancel()},150)}),ci(E,()=>c(r),O=>m(r,O)),A(e,p),dt()}ri(["click","keydown","mousedown"]);function Jo(e){return typeof e=="function"}function Be(e){return e!==null&&typeof e=="object"}const Qo=["string","number","bigint","boolean"];function Wn(e){return e==null||Qo.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>Wn(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}const Se=Symbol("box"),vn=Symbol("is-writable");function T(e,t){const n=_(e);return t?{[Se]:!0,[vn]:!0,get current(){return c(n)},set current(r){t(r)}}:{[Se]:!0,get current(){return e()}}}function We(e){return Be(e)&&Se in e}function qn(e){return We(e)&&vn in e}function li(e){return We(e)?e:Jo(e)?T(e):Wt(e)}function $o(e){return Object.entries(e).reduce((t,[n,r])=>We(r)?(qn(r)?Object.defineProperty(t,n,{get(){return r.current},set(i){r.current=i}}):Object.defineProperty(t,n,{get(){return r.current}}),t):Object.assign(t,{[n]:r}),{})}function ts(e){return qn(e)?{[Se]:!0,get current(){return e.current}}:e}function Wt(e){let t=B(qt(e));return{[Se]:!0,[vn]:!0,get current(){return c(t)},set current(n){m(t,n,!0)}}}function ye(e){let t=B(qt(e));return{[Se]:!0,[vn]:!0,get current(){return c(t)},set current(n){m(t,n,!0)}}}ye.from=li;ye.with=T;ye.flatten=$o;ye.readonly=ts;ye.isBox=We;ye.isWritableBox=qn;function ui(...e){return function(t){for(const n of e)if(n){if(t.defaultPrevented)return;typeof n=="function"?n.call(this,t):n.current?.call(this,t)}}}var _r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,es=/\n/g,ns=/^\s*/,rs=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,is=/^:\s*/,os=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ss=/^[;\s]*/,as=/^\s+|\s+$/g,cs=`
|
|
3
|
+
`,kr="/",Mr="*",le="",ls="comment",us="declaration";function ds(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var h=p.match(es);h&&(n+=h.length);var y=p.lastIndexOf(cs);r=~y?p.length-y:r+p.length}function s(){var p={line:n,column:r};return function(h){return h.position=new o(p),u(),h}}function o(p){this.start=p,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(p){var h=new Error(t.source+":"+n+":"+r+": "+p);if(h.reason=p,h.filename=t.source,h.line=n,h.column=r,h.source=e,!t.silent)throw h}function l(p){var h=p.exec(e);if(h){var y=h[0];return i(y),e=e.slice(y.length),h}}function u(){l(ns)}function f(p){var h;for(p=p||[];h=d();)h!==!1&&p.push(h);return p}function d(){var p=s();if(!(kr!=e.charAt(0)||Mr!=e.charAt(1))){for(var h=2;le!=e.charAt(h)&&(Mr!=e.charAt(h)||kr!=e.charAt(h+1));)++h;if(h+=2,le===e.charAt(h-1))return a("End of comment missing");var y=e.slice(2,h-2);return r+=2,i(y),e=e.slice(h),r+=2,p({type:ls,comment:y})}}function g(){var p=s(),h=l(rs);if(h){if(d(),!l(is))return a("property missing ':'");var y=l(os),b=p({type:us,property:Fr(h[0].replace(_r,le)),value:y?Fr(y[0].replace(_r,le)):le});return l(ss),b}}function v(){var p=[];f(p);for(var h;h=g();)h!==!1&&(p.push(h),f(p));return p}return u(),v()}function Fr(e){return e?e.replace(as,le):le}function fs(e,t){let n=null;if(!e||typeof e!="string")return n;const r=ds(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}const hs=/\d/,gs=["-","_","/","."];function vs(e=""){if(!hs.test(e))return e!==e.toLowerCase()}function ps(e){const t=[];let n="",r,i;for(const s of e){const o=gs.includes(s);if(o===!0){t.push(n),n="",r=void 0;continue}const a=vs(s);if(i===!1){if(r===!1&&a===!0){t.push(n),n=s,r=a;continue}if(r===!0&&a===!1&&n.length>1){const l=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=l+s,r=a;continue}}n+=s,r=a,i=o}return t.push(n),t}function di(e){return e?ps(e).map(t=>ys(t)).join(""):""}function ms(e){return ws(di(e||""))}function ys(e){return e?e[0].toUpperCase()+e.slice(1):""}function ws(e){return e?e[0].toLowerCase()+e.slice(1):""}function Re(e){if(!e)return{};const t={};function n(r,i){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){t[di(r)]=i;return}if(r.startsWith("--")){t[r]=i;return}t[ms(r)]=i}return fs(e,n),t}function de(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}function bs(e,t){const n=RegExp(e,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,t):r}}const xs=bs(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Ss(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${xs(t)}: ${e[t]};`).join(`
|
|
4
|
+
`)}function fi(e={}){return Ss(e).replace(`
|
|
5
|
+
`," ")}const As=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],Es=new Set(As);function Os(e){return Es.has(e)}function Xt(...e){const t={...e[0]};for(let n=1;n<e.length;n++){const r=e[n];if(r){for(const i of Object.keys(r)){const s=t[i],o=r[i],a=typeof s=="function",l=typeof o=="function";if(a&&Os(i)){const u=s,f=o;t[i]=ui(u,f)}else if(a&&l)t[i]=de(s,o);else if(i==="class"){const u=Wn(s),f=Wn(o);u&&f?t[i]=Cn(s,o):u?t[i]=Cn(s):f&&(t[i]=Cn(o))}else if(i==="style"){const u=typeof s=="object",f=typeof o=="object",d=typeof s=="string",g=typeof o=="string";if(u&&f)t[i]={...s,...o};else if(u&&g){const v=Re(o);t[i]={...s,...v}}else if(d&&f){const v=Re(s);t[i]={...v,...o}}else if(d&&g){const v=Re(s),p=Re(o);t[i]={...v,...p}}else u?t[i]=s:f?t[i]=o:d?t[i]=s:g&&(t[i]=o)}else t[i]=o!==void 0?o:s}for(const i of Object.getOwnPropertySymbols(r)){const s=t[i],o=r[i];t[i]=o!==void 0?o:s}}}return typeof t.style=="object"&&(t.style=fi(t.style).replaceAll(`
|
|
6
|
+
`," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const hi=typeof window<"u"?window:void 0;function Ts(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Ps extends Map{#t=new Map;#e=B(0);#n=B(0);#r=Or||-1;constructor(t){if(super(),t){for(var[n,r]of t)super.set(n,r);this.#n.v=super.size}}#i(t){return Or===this.#r?B(t):To(t)}has(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else return c(this.#e),!1;return c(r),!0}forEach(t,n){this.#o(),super.forEach(t,n)}get(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else{c(this.#e);return}return c(r),super.get(t)}set(t,n){var r=this.#t,i=r.get(t),s=super.get(t),o=super.set(t,n),a=this.#e;if(i===void 0)i=this.#i(0),r.set(t,i),m(this.#n,super.size),_e(a);else if(s!==n){_e(i);var l=a.reactions===null?null:new Set(a.reactions),u=l===null||!i.reactions?.every(f=>l.has(f));u&&_e(a)}return o}delete(t){var n=this.#t,r=n.get(t),i=super.delete(t);return r!==void 0&&(n.delete(t),m(r,-1)),i&&(m(this.#n,super.size),_e(this.#e)),i}clear(){if(super.size!==0){super.clear();var t=this.#t;m(this.#n,0);for(var n of t.values())m(n,-1);_e(this.#e),t.clear()}}#o(){c(this.#e);var t=this.#t;if(this.#n.v!==t.size){for(var n of super.keys())if(!t.has(n)){var r=this.#i(0);t.set(n,r)}}for([,r]of this.#t)c(r)}keys(){return c(this.#e),super.keys()}values(){return this.#o(),super.values()}entries(){return this.#o(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return c(this.#n),super.size}}class Cs{#t;#e;constructor(t={}){const{window:n=hi,document:r=n?.document}=t;n!==void 0&&(this.#t=r,this.#e=ai(i=>{const s=lt(n,"focusin",i),o=lt(n,"focusout",i);return()=>{s(),o()}}))}get current(){return this.#e?.(),this.#t?Ts(this.#t):null}}new Cs;function _s(e){return typeof e=="function"}class we{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return Po(this.#e)}get(){const t=Ln(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const n=Ln(this.#e);return n===void 0?t:n}set(t){return Co(this.#e,t)}}function ks(e,t){switch(e){case"post":vt(t);break;case"pre":_o(t);break}}function gi(e,t,n,r={}){const{lazy:i=!1}=r;let s=!i,o=Array.isArray(e)?[]:void 0;ks(t,()=>{const a=Array.isArray(e)?e.map(u=>u()):e();if(!s){s=!0,o=a;return}const l=tn(()=>n(a,o));return o=a,l})}function St(e,t,n){gi(e,"post",t,n)}function Ms(e,t,n){gi(e,"pre",t,n)}St.pre=Ms;function Rr(e){return _s(e)?e():e}class Fs{#t={width:0,height:0};#e=!1;#n;#r;#i;#o=_(()=>(c(this.#s)?.(),this.getSize().width));#a=_(()=>(c(this.#s)?.(),this.getSize().height));#s=_(()=>{const t=Rr(this.#r);if(t)return ai(n=>{if(!this.#i)return;const r=new this.#i.ResizeObserver(i=>{this.#e=!0;for(const s of i){const o=this.#n.box==="content-box"?s.contentBoxSize:s.borderBoxSize,a=Array.isArray(o)?o:[o];this.#t.width=a.reduce((l,u)=>Math.max(l,u.inlineSize),0),this.#t.height=a.reduce((l,u)=>Math.max(l,u.blockSize),0)}n()});return r.observe(t),()=>{this.#e=!1,r.disconnect()}})});constructor(t,n={box:"border-box"}){this.#i=n.window??hi,this.#n=n,this.#r=t,this.#t={width:0,height:0}}calculateSize(){const t=Rr(this.#r);if(!t||!this.#i)return;const n=t.offsetWidth,r=t.offsetHeight;if(this.#n.box==="border-box")return{width:n,height:r};const i=this.#i.getComputedStyle(t),s=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),o=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),a=parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),l=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),u=n-s-a,f=r-o-l;return{width:u,height:f}}getSize(){return this.#e?this.#t:this.calculateSize()??this.#t}get current(){return c(this.#s)?.(),this.getSize()}get width(){return c(this.#o)}get height(){return c(this.#a)}}function ze(e){vt(()=>()=>{e()})}function Rs(e,t){return setTimeout(t,e)}function Gt(e){ii().then(e)}const Ds=1,Is=9,Ns=11;function zn(e){return Be(e)&&e.nodeType===Ds&&typeof e.nodeName=="string"}function vi(e){return Be(e)&&e.nodeType===Is}function Ls(e){return Be(e)&&e.constructor?.name==="VisualViewport"}function Bs(e){return Be(e)&&e.nodeType!==void 0}function pi(e){return Bs(e)&&e.nodeType===Ns&&"host"in e}function Ws(e,t){if(!e||!t||!zn(e)||!zn(t))return!1;const n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&pi(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ve(e){return vi(e)?e:Ls(e)?e.document:e?.ownerDocument??document}function Xn(e){return pi(e)?Xn(e.host):vi(e)?e.defaultView??window:zn(e)?e.ownerDocument?.defaultView??window:window}function zs(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Zn{element;#t=_(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return c(this.#t)}set root(t){m(this.#t,t)}constructor(t){typeof t=="function"?this.element=T(t):this.element=t}getDocument=()=>Ve(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>zs(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,n)=>this.getWindow().setTimeout(t,n);clearTimeout=t=>this.getWindow().clearTimeout(t)}function fe(e,t){return{[Ko()]:n=>We(e)?(e.current=n,tn(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),tn(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e(null),t?.(null))})}}function mi(e){return e?"true":"false"}function yi(e){return e?"":void 0}function wi(e){return e?"open":"closed"}class Vs{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(n=>[n,this.getAttr(n)]))}getAttr(t,n){return n?`data-${n}-${t}`:`${this.#e}${t}`}selector(t,n){return`[${this.getAttr(t,n)}]`}}function Ks(e){const t=new Vs(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const Ne="ArrowDown",Jn="ArrowLeft",Qn="ArrowRight",en="ArrowUp",bi="End",xi="Enter",Hs="Escape",Si="Home",Us="PageDown",js="PageUp",$n=" ",Ys="Tab";function Gs(e){return window.getComputedStyle(e).getPropertyValue("direction")}function qs(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?Jn:Qn,vertical:Ne}[t]}function Xs(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?Qn:Jn,vertical:en}[t]}function Zs(e="ltr",t="horizontal"){return["ltr","rtl"].includes(e)||(e="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:qs(e,t),prevKey:Xs(e,t)}}const Ai=typeof document<"u",Dr=Js();function Js(){return Ai&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Zt(e){return e instanceof HTMLElement}function Vn(e){return e instanceof Element}function Ei(e){return e instanceof Element||e instanceof SVGElement}function Qs(e){return e!==null}function $s(e){return e instanceof HTMLInputElement&&"select"in e}class ta{#t;#e=ye(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,n,r=!1){const i=this.#t.rootNode.current;if(!i||!t)return;const s=this.getCandidateNodes();if(!s.length)return;const o=s.indexOf(t),a=Gs(i),{nextKey:l,prevKey:u}=Zs(a,this.#t.orientation.current),f=this.#t.loop.current,d={[l]:o+1,[u]:o-1,[Si]:0,[bi]:s.length-1};if(r){const p=l===Ne?Qn:Ne,h=u===en?Jn:en;d[p]=o+1,d[h]=o-1}let g=d[n.key];if(g===void 0)return;n.preventDefault(),g<0&&f?g=s.length-1:g===s.length&&f&&(g=0);const v=s[g];if(v)return v.focus(),this.#e.current=v.id,this.#t.onCandidateFocus?.(v),v}getTabIndex(t){const n=this.getCandidateNodes(),r=this.#e.current!==null;return t&&!r&&n[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const n=this.#t.rootNode.current?.querySelector(`#${t}`);!n||!Zt(n)||n.focus()}}class ea{#t;#e=null;constructor(t){this.#t=t,ze(()=>this.#n())}#n(){this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null)}run(t){this.#n();const n=this.#t.ref.current;if(n){if(typeof n.getAnimations!="function"){this.#r(t);return}this.#e=window.requestAnimationFrame(()=>{const r=n.getAnimations();if(r.length===0){this.#r(t);return}Promise.allSettled(r.map(i=>i.finished)).then(()=>{this.#r(t)})})}}#r(t){const n=()=>{t()};this.#t.afterTick?Gt(n):n()}}class na{#t;#e;#n;#r=B(!1);constructor(t){this.#t=t,m(this.#r,t.open.current,!0),this.#e=t.enabled??!0,this.#n=new ea({ref:this.#t.ref,afterTick:this.#t.open}),St(()=>this.#t.open.current,n=>{n&&m(this.#r,!0),this.#e&&this.#n.run(()=>{n===this.#t.open.current&&(this.#t.open.current||m(this.#r,!1),this.#t.onComplete?.())})})}get shouldRender(){return c(this.#r)}}function ct(){}function pn(e,t){return`bits-${e}`}function ra(e,t){var n=L(),r=D(n);Uo(r,()=>t.children,i=>{var s=L(),o=D(s);st(o,()=>t.children??pt),A(i,s)}),A(e,n)}const ia=new we("BitsConfig");function oa(){const e=new sa(null,{});return ia.getOr(e).opts}class sa{opts;constructor(t,n){const r=aa(t,n);this.opts={defaultPortalTo:r(i=>i.defaultPortalTo),defaultLocale:r(i=>i.defaultLocale)}}}function aa(e,t){return n=>T(()=>{const i=n(t)?.current;if(i!==void 0)return i;if(e!==null)return n(e.opts)?.current})}function ca(e,t){return n=>{const r=oa();return T(()=>{const i=n();if(i!==void 0)return i;const s=e(r).current;return s!==void 0?s:t})}}const la=ca(e=>e.defaultPortalTo,"body");function ua(e,t){ut(t,!0);const n=la(()=>t.to),r=ko();let i=_(s);function s(){if(!Ai||t.disabled)return null;let d=null;return typeof n.current=="string"?d=document.querySelector(n.current):d=n.current,d}let o;function a(){o&&(Do(o),o=null)}St([()=>c(i),()=>t.disabled],([d,g])=>{if(!d||g){a();return}return o=Ro(ra,{target:d,props:{children:t.children},context:r}),()=>{a()}});var l=L(),u=D(l);{var f=d=>{var g=L(),v=D(g);st(v,()=>t.children??pt),A(d,g)};at(u,d=>{t.disabled&&d(f)})}A(e,l),dt()}class da{eventName;options;constructor(t,n={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=n}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,n){const r=this.createEvent(n);return t.dispatchEvent(r),r}listen(t,n,r){const i=s=>{n(s)};return lt(t,this.eventName,i,r)}}function Ir(e,t=500){let n=null;const r=(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function Oi(e,t){return e===t||e.contains(t)}function Ti(e){return e?.ownerDocument??document}function fa(e,t){const{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}const ha=[xi,$n],ga=[Ne,js,Si],Pi=[en,Us,bi],va=[...ga,...Pi];function Nr(e){return e.pointerType==="mouse"}function pa(e,{select:t=!1}={}){if(!e||!e.focus)return;const n=Ve(e);if(n.activeElement===e)return;const r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&$s(e)&&t&&e.select()}function ma(e,{select:t=!1}={},n){const r=n();for(const i of e)if(pa(i,{select:t}),n()!==r)return!0}let ke=B(!1);class ee{static _refs=0;static _cleanup;constructor(){vt(()=>(ee._refs===0&&(ee._cleanup=oi(()=>{const t=[],n=i=>{m(ke,!1)},r=i=>{m(ke,!0)};return t.push(lt(document,"pointerdown",n,{capture:!0}),lt(document,"pointermove",n,{capture:!0}),lt(document,"keydown",r,{capture:!0})),de(...t)})),ee._refs++,()=>{ee._refs--,ee._refs===0&&(m(ke,!1),ee._cleanup?.())}))}get current(){return c(ke)}set current(t){m(ke,t,!0)}}var Ci=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],nn=Ci.join(","),_i=typeof Element>"u",he=_i?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,rn=!_i&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},on=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",o=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):on(t.parentNode));return o},ya=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},ki=function(t,n,r){if(on(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(nn));return n&&he.call(t,nn)&&i.unshift(t),i=i.filter(r),i},sn=function(t,n,r){for(var i=[],s=Array.from(t);s.length;){var o=s.shift();if(!on(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,u=sn(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:o,candidates:u})}else{var f=he.call(o,nn);f&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),g=!on(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&g){var v=sn(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,v):i.push({scopeParent:o,candidates:v})}else s.unshift.apply(s,o.children)}}return i},Mi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Fi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ya(t))&&!Mi(t)?0:t.tabIndex},wa=function(t,n){var r=Fi(t);return r<0&&n&&!Mi(t)?0:r},ba=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ri=function(t){return t.tagName==="INPUT"},xa=function(t){return Ri(t)&&t.type==="hidden"},Sa=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Aa=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Ea=function(t){if(!t.name)return!0;var n=t.form||rn(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=Aa(i,t.form);return!s||s===t},Oa=function(t){return Ri(t)&&t.type==="radio"},Ta=function(t){return Oa(t)&&!Ea(t)},Pa=function(t){var n,r=t&&rn(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&i;){var u,f,d;r=rn(i),i=(u=r)===null||u===void 0?void 0:u.host,s=!!((f=i)!==null&&f!==void 0&&(d=f.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return s},Lr=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},Ca=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var o=he.call(t,"details>summary:first-of-type"),a=o?t.parentElement:t;if(he.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=rn(t);if(u&&!u.shadowRoot&&i(u)===!0)return Lr(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(Pa(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Lr(t);return!1},_a=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return he.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},an=function(t,n){return!(n.disabled||xa(n)||Ca(n,t)||Sa(n)||_a(n))},Kn=function(t,n){return!(Ta(n)||Fi(n)<0||!an(t,n))},ka=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Di=function(t){var n=[],r=[];return t.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=wa(a,o),u=o?Di(i.candidates):a;l===0?o?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:u})}),r.sort(ba).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Ii=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sn([t],n.includeContainer,{filter:Kn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ka}):r=ki(t,n.includeContainer,Kn.bind(null,n)),Di(r)},Ni=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sn([t],n.includeContainer,{filter:an.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=ki(t,n.includeContainer,an.bind(null,n)),r},tr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return he.call(t,nn)===!1?!1:Kn(n,t)},Ma=Ci.concat("iframe:not([inert]):not([inert] *)").join(","),Li=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return he.call(t,Ma)===!1?!1:an(n,t)};function Ie(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Fa(e,t){if(!tr(e,Ie()))return Ra(e,t);const n=Ve(e),r=Ii(n.body,Ie());t==="prev"&&r.reverse();const i=r.indexOf(e);return i===-1?n.body:r.slice(i+1)[0]}function Ra(e,t){const n=Ve(e);if(!Li(e,Ie()))return n.body;const r=Ni(n.body,Ie());t==="prev"&&r.reverse();const i=r.indexOf(e);return i===-1?n.body:r.slice(i+1).find(o=>tr(o,Ie()))??n.body}function Bi(e,t,n){const r=t.toLowerCase();if(r.endsWith(" ")){const d=r.slice(0,-1);if(e.filter(h=>h.toLowerCase().startsWith(d)).length<=1)return Bi(e,d,n);const v=n?.toLowerCase();if(v&&v.startsWith(d)&&v.charAt(d.length)===" "&&t.trim()===d)return n;const p=e.filter(h=>h.toLowerCase().startsWith(r));if(p.length>0){const h=n?e.indexOf(n):-1;return Br(p,Math.max(h,0)).find(E=>E!==n)||n}}const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=s.toLowerCase(),a=n?e.indexOf(n):-1;let l=Br(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const f=l.find(d=>d?.toLowerCase().startsWith(o));return f!==n?f:void 0}function Br(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Da={afterMs:1e4,onChange:ct};function Wi(e,t){const{afterMs:n,onChange:r,getWindow:i}={...Da,...t};let s=null,o=B(qt(e));function a(){return i().setTimeout(()=>{m(o,e,!0),r?.(e)},n)}return vt(()=>()=>{s&&i().clearTimeout(s)}),T(()=>c(o),l=>{m(o,l,!0),r?.(l),s&&i().clearTimeout(s),s=a()})}class Ia{#t;#e;#n=_(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#r=_(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=Wi("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,n){if(!n.length)return;this.#e.current=this.#e.current+t;const r=c(this.#r)(),i=n.find(l=>l===r)?.textContent?.trim()??"",s=n.map(l=>l.textContent?.trim()??""),o=Bi(s,this.#e.current,i),a=n.find(l=>l.textContent?.trim()===o);return a&&c(this.#n)(a),a}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}class Na{#t;#e;#n;#r=B(null);constructor(t){this.#t=t,this.#e=_(()=>this.#t.enabled()),this.#n=Wi(!1,{afterMs:t.transitTimeout??300,onChange:n=>{c(this.#e)&&this.#t.setIsPointerInTransit?.(n)},getWindow:()=>Xn(this.#t.triggerNode())}),St([t.triggerNode,t.contentNode,t.enabled],([n,r,i])=>{if(!n||!r||!i)return;const s=a=>{this.#o(a,r)},o=a=>{this.#o(a,n)};return de(lt(n,"pointerleave",s),lt(r,"pointerleave",o))}),St(()=>c(this.#r),()=>{const n=i=>{if(!c(this.#r))return;const s=i.target;if(!Vn(s))return;const o={x:i.clientX,y:i.clientY},a=t.triggerNode()?.contains(s)||t.contentNode()?.contains(s),l=!za(o,c(this.#r));a?this.#i():l&&(this.#i(),t.onPointerExit())},r=Ve(t.triggerNode()??t.contentNode());if(r)return lt(r,"pointermove",n)})}#i(){m(this.#r,null),this.#n.current=!1}#o(t,n){const r=t.currentTarget;if(!Zt(r))return;const i={x:t.clientX,y:t.clientY},s=La(i,r.getBoundingClientRect()),o=Ba(i,s),a=Wa(n.getBoundingClientRect()),l=Va([...o,...a]);m(this.#r,l,!0),this.#n.current=!0}}function La(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ba(e,t,n=5){const r=n*1.5;switch(t){case"top":return[{x:e.x-n,y:e.y+n},{x:e.x,y:e.y-r},{x:e.x+n,y:e.y+n}];case"bottom":return[{x:e.x-n,y:e.y-n},{x:e.x,y:e.y+r},{x:e.x+n,y:e.y-n}];case"left":return[{x:e.x+n,y:e.y-n},{x:e.x-r,y:e.y},{x:e.x+n,y:e.y+n}];case"right":return[{x:e.x-n,y:e.y-n},{x:e.x+r,y:e.y},{x:e.x-n,y:e.y+n}]}}function Wa(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function za(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s].x,l=t[s].y,u=t[o].x,f=t[o].y;l>r!=f>r&&n<(u-a)*(r-l)/(f-l)+a&&(i=!i)}return i}function Va(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Ka(t)}function Ka(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const Ha="data-context-menu-trigger",Ua="data-context-menu-content",zi=new we("Menu.Root"),er=new we("Menu.Root | Menu.Sub"),Vi=new we("Menu.Content"),ja=new da("bitsmenuopen",{bubbles:!1,cancelable:!0}),Ya=Ks({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class nr{static create(t){const n=new nr(t);return zi.set(n)}opts;isUsingKeyboard=new ee;#t=B(!1);get ignoreCloseAutoFocus(){return c(this.#t)}set ignoreCloseAutoFocus(t){m(this.#t,t,!0)}#e=B(!1);get isPointerInTransit(){return c(this.#e)}set isPointerInTransit(t){m(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>Ya.getAttr(t,this.opts.variant.current)}class rr{static create(t,n){return er.set(new rr(t,n,null))}opts;root;parentMenu;contentId=T(()=>"");#t=B(null);get contentNode(){return c(this.#t)}set contentNode(t){m(this.#t,t,!0)}contentPresence;#e=B(null);get triggerNode(){return c(this.#e)}set triggerNode(t){m(this.#e,t,!0)}constructor(t,n,r){this.opts=t,this.root=n,this.parentMenu=r,this.contentPresence=new na({ref:T(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&St(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class ir{static create(t){return Vi.set(new ir(t,er.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=B("");get search(){return c(this.#t)}set search(t){m(this.#t,t,!0)}#e=0;#n;#r=B(!1);get mounted(){return c(this.#r)}set mounted(t){m(this.#r,t,!0)}#i;constructor(t,n){this.opts=t,this.parentMenu=n,this.domContext=new Zn(t.ref),this.attachment=fe(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),n.contentId=t.id,this.#i=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Na({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),this.#n=new Ia({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new ta({rootNode:T(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:T(()=>"vertical")}),St(()=>this.parentMenu.contentNode,r=>{if(!r)return;const i=()=>{Gt(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return ja.listen(r,i)}),vt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#o(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=t=>{this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#i)&&this.parentMenu.triggerNode&&tr(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())};handleTabKeyDown(t){let n=this.parentMenu;for(;n.parentMenu!==null;)n=n.parentMenu;if(!n.triggerNode)return;t.preventDefault();const r=Fa(n.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,n.onClose(),Gt(()=>{r.focus(),Gt(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===Ys){this.handleTabKeyDown(t);return}const n=t.target,r=t.currentTarget;if(!Zt(n)||!Zt(r))return;const i=n.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,s=t.ctrlKey||t.altKey||t.metaKey,o=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(n,t)||t.code==="Space")return;const l=this.#o();i&&!s&&o&&this.#n(t.key,l),t.target?.id===this.parentMenu.contentId.current&&va.includes(t.key)&&(t.preventDefault(),Pi.includes(t.key)&&l.reverse(),ma(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){Vn(t.currentTarget)&&Vn(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&Gt(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(t){if(!Ei(t.target))return;const n=this.parentMenu.triggerNode?.id;if(t.target.id===n){t.preventDefault();return}t.target.closest(`#${n}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#s=_(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return c(this.#s)}set snippetProps(t){m(this.#s,t)}#c=_(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":wi(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return c(this.#c)}set props(t){m(this.#c,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class Ga{opts;content;attachment;#t=B(!1);constructor(t,n){this.opts=t,this.content=n,this.attachment=fe(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&Nr(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!Zt(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||Nr(t)&&this.content.onItemLeave(t)}onfocus(t){Gt(()=>{t.defaultPrevented||this.opts.disabled.current||m(this.#t,!0)})}onblur(t){Gt(()=>{t.defaultPrevented||m(this.#t,!1)})}#e=_(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":mi(this.opts.disabled.current),"data-disabled":yi(this.opts.disabled.current),"data-highlighted":c(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return c(this.#e)}set props(t){m(this.#e,t)}}class or{static create(t){const n=new Ga(t,Vi.get());return new or(t,n)}opts;item;root;#t=!1;constructor(t,n){this.opts=t,this.item=n,this.root=n.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const n=this.item.content.search!=="";if(!(this.item.opts.disabled.current||n&&t.key===$n)&&ha.includes(t.key)){if(!Zt(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!Zt(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#n=_(()=>Xt(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return c(this.#n)}set props(t){m(this.#n,t)}}class sr{static create(t){return new sr(t,zi.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=fe(this.opts.ref)}#t=_(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return c(this.#t)}set props(t){m(this.#t,t)}}class ar{static create(t){return new ar(t,er.get())}opts;parentMenu;attachment;constructor(t,n){this.opts=t,this.parentMenu=n,this.attachment=fe(this.opts.ref,r=>this.parentMenu.triggerNode=r)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===$n||t.key===xi){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===Ne&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=_(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=_(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":mi(this.parentMenu.opts.open.current),"aria-controls":c(this.#t),"data-disabled":yi(this.opts.disabled.current),"data-state":wi(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return c(this.#e)}set props(t){m(this.#e,t)}}globalThis.bitsDismissableLayers??=new Map;class cr{static create(t){return new cr(t)}opts;#t;#e;#n={pointerdown:!1};#r=!1;#i=!1;#o=void 0;#a;#s=ct;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#a=t.onFocusOutside,vt(()=>{this.#o=Ti(this.opts.ref.current)});let n=ct;const r=()=>{this.#f(),globalThis.bitsDismissableLayers.delete(this),this.#l.destroy(),n()};St([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return Rs(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#e),n(),n=this.#d())}),r}),ze(()=>{this.#f.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#l.destroy(),this.#s(),n()})}#c=t=>{t.defaultPrevented||this.opts.ref.current&&Gt(()=>{!this.opts.ref.current||this.#p(t.target)||t.target&&!this.#i&&this.#a.current?.(t)})};#d(){return de(lt(this.#o,"pointerdown",de(this.#h,this.#v),{capture:!0}),lt(this.#o,"pointerdown",de(this.#g,this.#l)),lt(this.#o,"focusin",this.#c))}#u=t=>{let n=t;n.defaultPrevented&&(n=Wr(t)),this.#t.current(t)};#l=Ir(t=>{if(!this.opts.ref.current){this.#s();return}const n=this.opts.isValidEvent.current(t,this.opts.ref.current)||Za(t,this.opts.ref.current);if(!this.#r||this.#m()||!n){this.#s();return}let r=t;if(r.defaultPrevented&&(r=Wr(r)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#s();return}t.pointerType==="touch"?(this.#s(),this.#s=lt(this.#o,"click",this.#u,{once:!0})):this.#t.current(r)},10);#h=t=>{this.#n[t.type]=!0};#g=t=>{this.#n[t.type]=!1};#v=()=>{this.opts.ref.current&&(this.#r=Xa(this.opts.ref.current))};#p=t=>this.opts.ref.current?Oi(this.opts.ref.current,t):!1;#f=Ir(()=>{for(const t in this.#n)this.#n[t]=!1;this.#r=!1},20);#m(){return Object.values(this.#n).some(Boolean)}#y=()=>{this.#i=!0};#w=()=>{this.#i=!1};props={onfocuscapture:this.#y,onblurcapture:this.#w}}function qa(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([t,{current:n}])=>n==="close"||n==="ignore")}function Xa(e){const t=[...globalThis.bitsDismissableLayers],n=qa(t);if(n)return n[0].opts.ref.current===e;const[r]=t[0];return r.opts.ref.current===e}function Za(e,t){const n=e.target;if(!Ei(n))return!1;const r=!!n.closest(`[${Ha}]`);if("button"in e&&e.button>0&&!r)return!1;if("button"in e&&e.button===0&&r)return!0;const i=!!t.closest(`[${Ua}]`);return r&&i?!1:Ti(n).documentElement.contains(n)&&!Oi(t,n)&&fa(e,t)}function Wr(e){const t=e.currentTarget,n=e.target;let r;e instanceof PointerEvent?r=new PointerEvent(e.type,e):r=new PointerEvent("pointerdown",e);let i=!1;return new Proxy(r,{get:(o,a)=>a==="currentTarget"?t:a==="target"?n:a==="preventDefault"?()=>{i=!0,typeof o.preventDefault=="function"&&o.preventDefault()}:a==="defaultPrevented"?i:a in o?o[a]:e[a]})}function Ja(e,t){ut(t,!0);let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"onInteractOutside",3,ct),i=x(t,"onFocusOutside",3,ct),s=x(t,"isValidEvent",3,()=>!1);const o=cr.create({id:T(()=>t.id),interactOutsideBehavior:T(()=>n()),onInteractOutside:T(()=>r()),enabled:T(()=>t.enabled),onFocusOutside:T(()=>i()),isValidEvent:T(()=>s()),ref:t.ref});var a=L(),l=D(a);st(l,()=>t.children??pt,()=>({props:o.props})),A(e,a),dt()}globalThis.bitsEscapeLayers??=new Map;class lr{static create(t){return new lr(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new Zn(this.opts.ref);let n=ct;St(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),n=this.#t()),()=>{n(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>lt(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==Hs||!Qa(this))return;const n=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(n)}}function Qa(e){const t=[...globalThis.bitsEscapeLayers],n=t.findLast(([i,{current:s}])=>s==="close"||s==="ignore");if(n)return n[0]===e;const[r]=t[0];return r===e}function $a(e,t){ut(t,!0);let n=x(t,"escapeKeydownBehavior",3,"close"),r=x(t,"onEscapeKeydown",3,ct);lr.create({escapeKeydownBehavior:T(()=>n()),onEscapeKeydown:T(()=>r()),enabled:T(()=>t.enabled),ref:t.ref});var i=L(),s=D(i);st(s,()=>t.children??pt),A(e,i),dt()}class ur{static instance;#t=Wt([]);#e=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new ur),this.instance}register(t){const n=this.getActive();n&&n!==t&&n.pause();const r=document.activeElement;r&&r!==document.body&&this.#n.set(t,r),this.#t.current=this.#t.current.filter(i=>i!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(r=>r!==t);const n=this.getActive();n&&n.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,n){this.#e.set(t,n)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,n){this.#n.set(t,n)}getPreFocusMemory(t){return this.#n.get(t)}clearPreFocusMemory(t){this.#n.delete(t)}}class dr{#t=!1;#e=null;#n=ur.getInstance();#r=[];#i;constructor(t){this.#i=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#o(){for(const t of this.#r)t();this.#r=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#n.register(this),this.#c(),this.#a()}unmount(){this.#e&&(this.#o(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#e=null)}#a(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const n=this.#u();n?(n.focus(),this.#n.setFocusMemory(this,n)):this.#e.focus()})}#s(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const n=this.#n.getPreFocusMemory(this);if(n&&document.contains(n))try{n.focus()}catch{document.body.focus()}}}#c(){if(!this.#e||!this.#i.trap.current)return;const t=this.#e,n=t.ownerDocument,r=o=>{if(this.#t||!this.#n.isActiveScope(this))return;const a=o.target;if(!a)return;if(t.contains(a))this.#n.setFocusMemory(this,a);else{const u=this.#n.getFocusMemory(this);if(u&&t.contains(u)&&Li(u))o.preventDefault(),u.focus();else{const f=this.#u(),d=this.#l()[0];(f||d||t).focus()}}},i=o=>{if(!this.#i.loop||this.#t||o.key!=="Tab"||!this.#n.isActiveScope(this))return;const a=this.#d();if(a.length===0)return;const l=a[0],u=a[a.length-1];!o.shiftKey&&n.activeElement===u?(o.preventDefault(),l.focus()):o.shiftKey&&n.activeElement===l&&(o.preventDefault(),u.focus())};this.#r.push(lt(n,"focusin",r,{capture:!0}),lt(t,"keydown",i));const s=new MutationObserver(()=>{const o=this.#n.getFocusMemory(this);if(o&&!t.contains(o)){const a=this.#u(),l=this.#l()[0],u=a||l;u?(u.focus(),this.#n.setFocusMemory(this,u)):t.focus()}});s.observe(t,{childList:!0,subtree:!0}),this.#r.push(()=>s.disconnect())}#d(){return this.#e?Ii(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#d()[0]||null}#l(){return this.#e?Ni(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return St([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||(n=new dr(t)),n.mount(r)):n&&(n.unmount(),n=null)}),ze(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}}function tc(e,t){ut(t,!0);let n=x(t,"enabled",3,!1),r=x(t,"trapFocus",3,!1),i=x(t,"loop",3,!1),s=x(t,"onCloseAutoFocus",3,ct),o=x(t,"onOpenAutoFocus",3,ct);const a=dr.use({enabled:T(()=>n()),trap:T(()=>r()),loop:i(),onCloseAutoFocus:T(()=>s()),onOpenAutoFocus:T(()=>o()),ref:t.ref});var l=L(),u=D(l);st(u,()=>t.focusScope??pt,()=>({props:a.props})),A(e,l),dt()}globalThis.bitsTextSelectionLayers??=new Map;class fr{static create(t){return new fr(t)}opts;domContext;#t=ct;constructor(t){this.opts=t,this.domContext=new Zn(t.ref);let n=ct;St(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),n(),n=this.#e()),()=>{n(),this.#r(),globalThis.bitsTextSelectionLayers.delete(this)}))}#e(){return de(lt(this.domContext.getDocument(),"pointerdown",this.#n),lt(this.domContext.getDocument(),"pointerup",ui(this.#r,this.opts.onPointerUp.current)))}#n=t=>{const n=this.opts.ref.current,r=t.target;!Zt(n)||!Zt(r)||!this.opts.enabled.current||!nc(this)||!Ws(n,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&(this.#t=ec(n,this.domContext.getDocument().body)))};#r=()=>{this.#t(),this.#t=ct}}const zr=e=>e.style.userSelect||e.style.webkitUserSelect;function ec(e,t){const n=zr(t),r=zr(e);return Xe(t,"none"),Xe(e,"text"),()=>{Xe(t,n),Xe(e,r)}}function Xe(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function nc(e){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const n=t.at(-1);return n?n[0]===e:!1}function rc(e,t){ut(t,!0);let n=x(t,"preventOverflowTextSelection",3,!0),r=x(t,"onPointerDown",3,ct),i=x(t,"onPointerUp",3,ct);fr.create({id:T(()=>t.id),onPointerDown:T(()=>r()),onPointerUp:T(()=>i()),enabled:T(()=>t.enabled&&n()),ref:t.ref});var s=L(),o=D(s);st(o,()=>t.children??pt),A(e,s),dt()}globalThis.bitsIdCounter??={current:0};function hr(e="bits"){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}class ic{#t;#e=0;#n=B();#r;constructor(t){this.#t=t}#i(){this.#e-=1,this.#r&&this.#e<=0&&(this.#r(),m(this.#n,void 0),this.#r=void 0)}get(...t){return this.#e+=1,c(this.#n)===void 0&&(this.#r=oi(()=>{m(this.#n,this.#t(...t),!0)})),vt(()=>()=>{this.#i()}),c(this.#n)}}const $e=new Ps;let Ze=B(null),kn=null,Me=null,Fe=!1;const Vr=T(()=>{for(const e of $e.values())if(e)return!0;return!1});let Mn=null;const oc=new ic(()=>{function e(){document.body.setAttribute("style",c(Ze)??""),document.body.style.removeProperty("--scrollbar-width"),Dr&&kn?.(),m(Ze,null)}function t(){Me!==null&&(window.clearTimeout(Me),Me=null)}function n(i,s){t(),Fe=!0,Mn=Date.now();const o=Mn,a=()=>{Me=null,Mn===o&&(Ki($e)?Fe=!1:(Fe=!1,s()))},l=i===null?24:i;Me=window.setTimeout(a,l)}function r(){c(Ze)===null&&$e.size===0&&!Fe&&m(Ze,document.body.getAttribute("style"),!0)}return St(()=>Vr.current,()=>{if(!Vr.current)return;r(),Fe=!1;const i=getComputedStyle(document.documentElement),s=getComputedStyle(document.body),o=i.scrollbarGutter?.includes("stable")||s.scrollbarGutter?.includes("stable"),a=window.innerWidth-document.documentElement.clientWidth,u={padding:Number.parseInt(s.paddingRight??"0",10)+a,margin:Number.parseInt(s.marginRight??"0",10)};a>0&&!o&&(document.body.style.paddingRight=`${u.padding}px`,document.body.style.marginRight=`${u.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",Dr&&(kn=lt(document,"touchmove",f=>{f.target===document.documentElement&&(f.touches.length>1||f.preventDefault())},{passive:!1})),Gt(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),ze(()=>()=>{kn?.()}),{get lockMap(){return $e},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});class sc{#t=hr();#e;#n=()=>null;#r;locked;constructor(t,n=()=>null){this.#e=t,this.#n=n,this.#r=oc.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#t,this.#e??!1),this.locked=T(()=>this.#r.lockMap.get(this.#t)??!1,r=>this.#r.lockMap.set(this.#t,r)),ze(()=>{if(this.#r.lockMap.delete(this.#t),Ki(this.#r.lockMap))return;const r=this.#n();this.#r.scheduleCleanupIfNoNewLocks(r,()=>{this.#r.resetBodyStyle()})}))}}function Ki(e){for(const[t,n]of e)if(n)return!0;return!1}function Kr(e,t){ut(t,!0);let n=x(t,"preventScroll",3,!0),r=x(t,"restoreScrollDelay",3,null);n()&&new sc(n(),()=>r()),dt()}const ac=["top","right","bottom","left"],ne=Math.min,Tt=Math.max,cn=Math.round,Je=Math.floor,Vt=e=>({x:e,y:e}),cc={left:"right",right:"left",bottom:"top",top:"bottom"},lc={start:"end",end:"start"};function Hn(e,t,n){return Tt(e,ne(t,n))}function Jt(e,t){return typeof e=="function"?e(t):e}function Qt(e){return e.split("-")[0]}function Ee(e){return e.split("-")[1]}function gr(e){return e==="x"?"y":"x"}function vr(e){return e==="y"?"height":"width"}const uc=new Set(["top","bottom"]);function zt(e){return uc.has(Qt(e))?"y":"x"}function pr(e){return gr(zt(e))}function dc(e,t,n){n===void 0&&(n=!1);const r=Ee(e),i=pr(e),s=vr(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=ln(o)),[o,ln(o)]}function fc(e){const t=ln(e);return[Un(e),t,Un(t)]}function Un(e){return e.replace(/start|end/g,t=>lc[t])}const Hr=["left","right"],Ur=["right","left"],hc=["top","bottom"],gc=["bottom","top"];function vc(e,t,n){switch(e){case"top":case"bottom":return n?t?Ur:Hr:t?Hr:Ur;case"left":case"right":return t?hc:gc;default:return[]}}function pc(e,t,n,r){const i=Ee(e);let s=vc(Qt(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Un)))),s}function ln(e){return e.replace(/left|right|bottom|top/g,t=>cc[t])}function mc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Hi(e){return typeof e!="number"?mc(e):{top:e,right:e,bottom:e,left:e}}function un(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function jr(e,t,n){let{reference:r,floating:i}=e;const s=zt(t),o=pr(t),a=vr(o),l=Qt(t),u=s==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let v;switch(l){case"top":v={x:f,y:r.y-i.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-i.width,y:d};break;default:v={x:r.x,y:r.y}}switch(Ee(t)){case"start":v[o]-=g*(n&&u?-1:1);break;case"end":v[o]+=g*(n&&u?-1:1);break}return v}async function yc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:g=!1,padding:v=0}=Jt(t,e),p=Hi(v),y=a[g?d==="floating"?"reference":"floating":d],b=un(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),E=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},N=un(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:C,strategy:l}):E);return{top:(b.top-N.top+p.top)/S.y,bottom:(N.bottom-b.bottom+p.bottom)/S.y,left:(b.left-N.left+p.left)/S.x,right:(N.right-b.right+p.right)/S.x}}const wc=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=jr(u,r,l),g=r,v={},p=0;for(let y=0;y<a.length;y++){var h;const{name:b,fn:E}=a[y],{x:C,y:S,data:N,reset:O}=await E({x:f,y:d,initialPlacement:r,placement:g,strategy:i,middlewareData:v,rects:u,platform:{...o,detectOverflow:(h=o.detectOverflow)!=null?h:yc},elements:{reference:e,floating:t}});f=C??f,d=S??d,v={...v,[b]:{...v[b],...N}},O&&p<=50&&(p++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(u=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:f,y:d}=jr(u,g,l)),y=-1)}return{x:f,y:d,placement:g,strategy:i,middlewareData:v}},bc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=Jt(e,t)||{};if(u==null)return{};const d=Hi(f),g={x:n,y:r},v=pr(i),p=vr(v),h=await o.getDimensions(u),y=v==="y",b=y?"top":"left",E=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[v]-g[v]-s.floating[p],N=g[v]-s.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=O?O[C]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=a.floating[C]||s.floating[p]);const j=S/2-N/2,W=k/2-h[p]/2-1,F=ne(d[b],W),I=ne(d[E],W),H=F,q=k-h[p]-I,X=k/2-h[p]/2+j,J=Hn(H,X,q),z=!l.arrow&&Ee(i)!=null&&X!==J&&s.reference[p]/2-(X<H?F:I)-h[p]/2<0,G=z?X<H?X-H:X-q:0;return{[v]:g[v]+G,data:{[v]:J,centerOffset:X-J-G,...z&&{alignmentOffset:G}},reset:z}}}),xc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...y}=Jt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Qt(i),E=zt(a),C=Qt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),N=g||(C||!h?[ln(a)]:fc(a)),O=p!=="none";!g&&O&&N.push(...pc(a,h,p,S));const k=[a,...N],j=await l.detectOverflow(t,y),W=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&W.push(j[b]),d){const X=dc(i,o,S);W.push(j[X[0]],j[X[1]])}if(F=[...F,{placement:i,overflows:W}],!W.every(X=>X<=0)){var I,H;const X=(((I=s.flip)==null?void 0:I.index)||0)+1,J=k[X];if(J&&(!(d==="alignment"?E!==zt(J):!1)||F.every(Z=>zt(Z.placement)===E?Z.overflows[0]>0:!0)))return{data:{index:X,overflows:F},reset:{placement:J}};let z=(H=F.filter(G=>G.overflows[0]<=0).sort((G,Z)=>G.overflows[1]-Z.overflows[1])[0])==null?void 0:H.placement;if(!z)switch(v){case"bestFit":{var q;const G=(q=F.filter(Z=>{if(O){const At=zt(Z.placement);return At===E||At==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(At=>At>0).reduce((At,Te)=>At+Te,0)]).sort((Z,At)=>Z[1]-At[1])[0])==null?void 0:q[0];G&&(z=G);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function Yr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gr(e){return ac.some(t=>e[t]>=0)}const Sc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...s}=Jt(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Yr(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Gr(a)}}}case"escaped":{const o=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Yr(o,n.floating);return{data:{escapedOffsets:a,escaped:Gr(a)}}}default:return{}}}}},Ui=new Set(["left","top"]);async function Ac(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Qt(n),a=Ee(n),l=zt(n)==="y",u=Ui.has(o)?-1:1,f=s&&l?-1:1,d=Jt(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(v=a==="end"?p*-1:p),l?{x:v*f,y:g*u}:{x:g*u,y:v*f}}const Ec=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await Ac(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Oc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:E,y:C}=b;return{x:E,y:C}}},...u}=Jt(e,t),f={x:n,y:r},d=await s.detectOverflow(t,u),g=zt(Qt(i)),v=gr(g);let p=f[v],h=f[g];if(o){const b=v==="y"?"top":"left",E=v==="y"?"bottom":"right",C=p+d[b],S=p-d[E];p=Hn(C,p,S)}if(a){const b=g==="y"?"top":"left",E=g==="y"?"bottom":"right",C=h+d[b],S=h-d[E];h=Hn(C,h,S)}const y=l.fn({...t,[v]:p,[g]:h});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[v]:o,[g]:a}}}}}},Tc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Jt(e,t),f={x:n,y:r},d=zt(i),g=gr(d);let v=f[g],p=f[d];const h=Jt(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const C=g==="y"?"height":"width",S=s.reference[g]-s.floating[C]+y.mainAxis,N=s.reference[g]+s.reference[C]-y.mainAxis;v<S?v=S:v>N&&(v=N)}if(u){var b,E;const C=g==="y"?"width":"height",S=Ui.has(Qt(i)),N=s.reference[d]-s.floating[C]+(S&&((b=o.offset)==null?void 0:b[d])||0)+(S?0:y.crossAxis),O=s.reference[d]+s.reference[C]+(S?0:((E=o.offset)==null?void 0:E[d])||0)-(S?y.crossAxis:0);p<N?p=N:p>O&&(p=O)}return{[g]:v,[d]:p}}}},Pc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}=Jt(e,t),f=await o.detectOverflow(t,u),d=Qt(i),g=Ee(i),v=zt(i)==="y",{width:p,height:h}=s.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=g===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,y=g==="end"?"top":"bottom");const E=h-f.top-f.bottom,C=p-f.left-f.right,S=ne(h-f[y],E),N=ne(p-f[b],C),O=!t.middlewareData.shift;let k=S,j=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=E),O&&!g){const F=Tt(f.left,0),I=Tt(f.right,0),H=Tt(f.top,0),q=Tt(f.bottom,0);v?j=p-2*(F!==0||I!==0?F+I:Tt(f.left,f.right)):k=h-2*(H!==0||q!==0?H+q:Tt(f.top,f.bottom))}await l({...t,availableWidth:j,availableHeight:k});const W=await o.getDimensions(a.floating);return p!==W.width||h!==W.height?{reset:{rects:!0}}:{}}}};function mn(){return typeof window<"u"}function Oe(e){return ji(e)?(e.nodeName||"").toLowerCase():"#document"}function Pt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ht(e){var t;return(t=(ji(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ji(e){return mn()?e instanceof Node||e instanceof Pt(e).Node:!1}function Lt(e){return mn()?e instanceof Element||e instanceof Pt(e).Element:!1}function Kt(e){return mn()?e instanceof HTMLElement||e instanceof Pt(e).HTMLElement:!1}function qr(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pt(e).ShadowRoot}const Cc=new Set(["inline","contents"]);function Ke(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Cc.has(i)}const _c=new Set(["table","td","th"]);function kc(e){return _c.has(Oe(e))}const Mc=[":popover-open",":modal"];function yn(e){return Mc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Fc=["transform","translate","scale","rotate","perspective"],Rc=["transform","translate","scale","rotate","perspective","filter"],Dc=["paint","layout","strict","content"];function mr(e){const t=yr(),n=Lt(e)?Bt(e):e;return Fc.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Rc.some(r=>(n.willChange||"").includes(r))||Dc.some(r=>(n.contain||"").includes(r))}function Ic(e){let t=re(e);for(;Kt(t)&&!Ae(t);){if(mr(t))return t;if(yn(t))return null;t=re(t)}return null}function yr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Nc=new Set(["html","body","#document"]);function Ae(e){return Nc.has(Oe(e))}function Bt(e){return Pt(e).getComputedStyle(e)}function wn(e){return Lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function re(e){if(Oe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qr(e)&&e.host||Ht(e);return qr(t)?t.host:t}function Yi(e){const t=re(e);return Ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Ke(t)?t:Yi(t)}function Le(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Yi(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Pt(i);if(s){const a=jn(o);return t.concat(o,o.visualViewport||[],Ke(i)?i:[],a&&n?Le(a):[])}return t.concat(i,Le(i,[],n))}function jn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gi(e){const t=Bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Kt(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=cn(n)!==s||cn(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function wr(e){return Lt(e)?e:e.contextElement}function xe(e){const t=wr(e);if(!Kt(t))return Vt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Gi(t);let o=(s?cn(n.width):n.width)/r,a=(s?cn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Lc=Vt(0);function qi(e){const t=Pt(e);return!yr()||!t.visualViewport?Lc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pt(e)?!1:t}function ge(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=wr(e);let o=Vt(1);t&&(r?Lt(r)&&(o=xe(r)):o=xe(e));const a=Bc(s,n,r)?qi(s):Vt(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,d=i.height/o.y;if(s){const g=Pt(s),v=r&&Lt(r)?Pt(r):r;let p=g,h=jn(p);for(;h&&r&&v!==p;){const y=xe(h),b=h.getBoundingClientRect(),E=Bt(h),C=b.left+(h.clientLeft+parseFloat(E.paddingLeft))*y.x,S=b.top+(h.clientTop+parseFloat(E.paddingTop))*y.y;l*=y.x,u*=y.y,f*=y.x,d*=y.y,l+=C,u+=S,p=Pt(h),h=jn(p)}}return un({width:f,height:d,x:l,y:u})}function bn(e,t){const n=wn(e).scrollLeft;return t?t.left+n:ge(Ht(e)).left+n}function Xi(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bn(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Wc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Ht(r),a=t?yn(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Vt(1);const f=Vt(0),d=Kt(r);if((d||!d&&!s)&&((Oe(r)!=="body"||Ke(o))&&(l=wn(r)),Kt(r))){const v=ge(r);u=xe(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const g=o&&!d&&!s?Xi(o,l):Vt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+g.x,y:n.y*u.y-l.scrollTop*u.y+f.y+g.y}}function zc(e){return Array.from(e.getClientRects())}function Vc(e){const t=Ht(e),n=wn(e),r=e.ownerDocument.body,i=Tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+bn(e);const a=-n.scrollTop;return Bt(r).direction==="rtl"&&(o+=Tt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const Xr=25;function Kc(e,t){const n=Pt(e),r=Ht(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const f=yr();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=bn(r);if(u<=0){const f=r.ownerDocument,d=f.body,g=getComputedStyle(d),v=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-v);p<=Xr&&(s-=p)}else u<=Xr&&(s+=u);return{width:s,height:o,x:a,y:l}}const Hc=new Set(["absolute","fixed"]);function Uc(e,t){const n=ge(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Kt(e)?xe(e):Vt(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function Zr(e,t,n){let r;if(t==="viewport")r=Kc(e,n);else if(t==="document")r=Vc(Ht(e));else if(Lt(t))r=Uc(t,n);else{const i=qi(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return un(r)}function Zi(e,t){const n=re(e);return n===t||!Lt(n)||Ae(n)?!1:Bt(n).position==="fixed"||Zi(n,t)}function jc(e,t){const n=t.get(e);if(n)return n;let r=Le(e,[],!1).filter(a=>Lt(a)&&Oe(a)!=="body"),i=null;const s=Bt(e).position==="fixed";let o=s?re(e):e;for(;Lt(o)&&!Ae(o);){const a=Bt(o),l=mr(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&Hc.has(i.position)||Ke(o)&&!l&&Zi(e,o))?r=r.filter(f=>f!==o):i=a,o=re(o)}return t.set(e,r),r}function Yc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?yn(t)?[]:jc(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,f)=>{const d=Zr(t,f,i);return u.top=Tt(d.top,u.top),u.right=ne(d.right,u.right),u.bottom=ne(d.bottom,u.bottom),u.left=Tt(d.left,u.left),u},Zr(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gc(e){const{width:t,height:n}=Gi(e);return{width:t,height:n}}function qc(e,t,n){const r=Kt(t),i=Ht(t),s=n==="fixed",o=ge(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Vt(0);function u(){l.x=bn(i)}if(r||!r&&!s)if((Oe(t)!=="body"||Ke(i))&&(a=wn(t)),r){const v=ge(t,!0,s,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else i&&u();s&&!r&&i&&u();const f=i&&!r&&!s?Xi(i,a):Vt(0),d=o.left+a.scrollLeft-l.x-f.x,g=o.top+a.scrollTop-l.y-f.y;return{x:d,y:g,width:o.width,height:o.height}}function Fn(e){return Bt(e).position==="static"}function Jr(e,t){if(!Kt(e)||Bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ht(e)===n&&(n=n.ownerDocument.body),n}function Ji(e,t){const n=Pt(e);if(yn(e))return n;if(!Kt(e)){let i=re(e);for(;i&&!Ae(i);){if(Lt(i)&&!Fn(i))return i;i=re(i)}return n}let r=Jr(e,t);for(;r&&kc(r)&&Fn(r);)r=Jr(r,t);return r&&Ae(r)&&Fn(r)&&!mr(r)?n:r||Ic(e)||n}const Xc=async function(e){const t=this.getOffsetParent||Ji,n=this.getDimensions,r=await n(e.floating);return{reference:qc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zc(e){return Bt(e).direction==="rtl"}const Jc={convertOffsetParentRelativeRectToViewportRelativeRect:Wc,getDocumentElement:Ht,getClippingRect:Yc,getOffsetParent:Ji,getElementRects:Xc,getClientRects:zc,getDimensions:Gc,getScale:xe,isElement:Lt,isRTL:Zc};function Qi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qc(e,t){let n=null,r;const i=Ht(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:d,width:g,height:v}=u;if(a||t(),!g||!v)return;const p=Je(d),h=Je(i.clientWidth-(f+g)),y=Je(i.clientHeight-(d+v)),b=Je(f),C={rootMargin:-p+"px "+-h+"px "+-y+"px "+-b+"px",threshold:Tt(0,ne(1,l))||1};let S=!0;function N(O){const k=O[0].intersectionRatio;if(k!==l){if(!S)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!Qi(u,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(N,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,C)}n.observe(e)}return o(!0),s}function $c(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=wr(e),f=i||s?[...u?Le(u):[],...Le(t)]:[];f.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const d=u&&a?Qc(u,n):null;let g=-1,v=null;o&&(v=new ResizeObserver(b=>{let[E]=b;E&&E.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(t)})),n()}),u&&!l&&v.observe(u),v.observe(t));let p,h=l?ge(e):null;l&&y();function y(){const b=ge(e);h&&!Qi(h,b)&&n(),h=b,p=requestAnimationFrame(y)}return n(),()=>{var b;f.forEach(E=>{i&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),d?.(),(b=v)==null||b.disconnect(),v=null,l&&cancelAnimationFrame(p)}}const tl=Ec,el=Oc,nl=xc,rl=Pc,il=Sc,ol=bc,sl=Tc,al=(e,t,n)=>{const r=new Map,i={platform:Jc,...n},s={...i.platform,_c:r};return wc(e,t,{...i,platform:s})};function ce(e){return typeof e=="function"?e():e}function $i(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qr(e,t){const n=$i(e);return Math.round(t*n)/n}function $r(e){return{[`--bits-${e}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${e}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${e}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${e}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${e}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function cl(e){const t=e.whileElementsMounted,n=_(()=>ce(e.open)??!0),r=_(()=>ce(e.middleware)),i=_(()=>ce(e.transform)??!0),s=_(()=>ce(e.placement)??"bottom"),o=_(()=>ce(e.strategy)??"absolute"),a=_(()=>ce(e.sideOffset)??0),l=_(()=>ce(e.alignOffset)??0),u=e.reference;let f=B(0),d=B(0);const g=Wt(null);let v=B(qt(c(o))),p=B(qt(c(s))),h=B(qt({})),y=B(!1),b=!1;const E=_(()=>{const W=g.current?Qr(g.current,c(f)):c(f),F=g.current?Qr(g.current,c(d)):c(d);return c(i)?{position:c(v),left:"0",top:"0",transform:`translate(${W}px, ${F}px)`,...g.current&&$i(g.current)>=1.5&&{willChange:"transform"}}:{position:c(v),left:`${W}px`,top:`${F}px`}});let C;function S(){u.current===null||g.current===null||al(u.current,g.current,{middleware:c(r),placement:c(s),strategy:c(o)}).then(W=>{const F=u.current;if(ll(F)){m(h,{...c(h),hide:{...c(h).hide,referenceHidden:!0}},!0);return}if(!c(n)&&c(f)!==0&&c(d)!==0){const H=Math.max(Math.abs(c(a)),Math.abs(c(l)),15);if(W.x<=H&&W.y<=H)return}m(f,W.x,!0),m(d,W.y,!0),m(v,W.strategy,!0),m(p,W.placement,!0),m(h,W.middlewareData,!0),m(y,!0)})}function N(){typeof C=="function"&&(C(),C=void 0)}function O(){if(N(),t===void 0){S();return}c(n)&&(u.current===null||g.current===null||(C=t(u.current,g.current,S)))}function k(){c(n)||m(y,!1)}function j(){return[c(r),c(s),c(o),c(a),c(l),c(n)]}return vt(()=>{t===void 0&&c(n)&&S()}),vt(O),vt(()=>{if(t!==void 0){if(j(),!c(n)){b=!1;return}if(!c(y)){b=!1;return}if(!b){b=!0;return}S()}}),vt(k),vt(()=>N),{floating:g,reference:u,get strategy(){return c(v)},get placement(){return c(p)},get middlewareData(){return c(h)},get isPositioned(){return c(y)},get floatingStyles(){return c(E)},get update(){return S}}}function ll(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}const ul={top:"bottom",right:"left",bottom:"top",left:"right"},br=new we("Floating.Root"),ti=new we("Floating.Content"),xr=new we("Floating.Root");class dn{static create(t=!1){return t?xr.set(new dn):br.set(new dn)}anchorNode=Wt(null);customAnchorNode=Wt(null);triggerNode=Wt(null);constructor(){vt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class fn{static create(t,n=!1){return n?ti.set(new fn(t,xr.get())):ti.set(new fn(t,br.get()))}opts;root;contentRef=Wt(null);wrapperRef=Wt(null);arrowRef=Wt(null);contentAttachment=fe(this.contentRef);wrapperAttachment=fe(this.wrapperRef);arrowAttachment=fe(this.arrowRef);arrowId=Wt(hr());#t=_(()=>{if(typeof this.opts.style=="string")return Re(this.opts.style);if(!this.opts.style)return{}});#e=void 0;#n=new Fs(()=>this.arrowRef.current??void 0);#r=_(()=>this.#n?.width??0);#i=_(()=>this.#n?.height??0);#o=_(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=_(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=_(()=>c(this.#a).length>0);get hasExplicitBoundaries(){return c(this.#s)}set hasExplicitBoundaries(t){m(this.#s,t)}#c=_(()=>({padding:this.opts.collisionPadding.current,boundary:c(this.#a).filter(Qs),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return c(this.#c)}set detectOverflowOptions(t){m(this.#c,t)}#d=B(void 0);#u=B(void 0);#l=B(void 0);#h=B(void 0);#g=_(()=>[tl({mainAxis:this.opts.sideOffset.current+c(this.#i),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&el({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?sl():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&nl({...this.detectOverflowOptions}),rl({...this.detectOverflowOptions,apply:({rects:t,availableWidth:n,availableHeight:r})=>{const{width:i,height:s}=t.reference;m(this.#d,n,!0),m(this.#u,r,!0),m(this.#l,i,!0),m(this.#h,s,!0)}}),this.arrowRef.current&&ol({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),dl({arrowWidth:c(this.#r),arrowHeight:c(this.#i)}),this.opts.hideWhenDetached.current&&il({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return c(this.#g)}set middleware(t){m(this.#g,t)}floating;#v=_(()=>fl(this.floating.placement));get placedSide(){return c(this.#v)}set placedSide(t){m(this.#v,t)}#p=_(()=>hl(this.floating.placement));get placedAlign(){return c(this.#p)}set placedAlign(t){m(this.#p,t)}#f=_(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return c(this.#f)}set arrowX(t){m(this.#f,t)}#m=_(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return c(this.#m)}set arrowY(t){m(this.#m,t)}#y=_(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return c(this.#y)}set cannotCenterArrow(t){m(this.#y,t)}#w=B();get contentZIndex(){return c(this.#w)}set contentZIndex(t){m(this.#w,t,!0)}#b=_(()=>ul[this.placedSide]);get arrowBaseSide(){return c(this.#b)}set arrowBaseSide(t){m(this.#b,t)}#x=_(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${c(this.#d)}px`,"--bits-floating-available-height":`${c(this.#u)}px`,"--bits-floating-anchor-width":`${c(this.#l)}px`,"--bits-floating-anchor-height":`${c(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...c(this.#t)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return c(this.#x)}set wrapperProps(t){m(this.#x,t)}#S=_(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:fi({...c(this.#t)}),...this.contentAttachment}));get props(){return c(this.#S)}set props(t){m(this.#S,t)}#A=_(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return c(this.#A)}set arrowStyle(t){m(this.#A,t)}constructor(t,n){this.opts=t,this.root=n,this.#e=t.updatePositionStrategy,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),St(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=cl({strategy:()=>this.opts.strategy.current,placement:()=>c(this.#o),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>$c(...r,{animationFrame:this.#e?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),vt(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),St(()=>this.contentRef.current,r=>{if(!r||!this.opts.enabled.current)return;const i=Xn(r),s=i.requestAnimationFrame(()=>{if(this.contentRef.current!==r||!this.opts.enabled.current)return;const o=i.getComputedStyle(r).zIndex;o!==this.contentZIndex&&(this.contentZIndex=o)});return()=>{i.cancelAnimationFrame(s)}}),vt(()=>{this.floating.floating.current=this.wrapperRef.current})}}class hn{static create(t,n=!1){return n?new hn(t,xr.get()):new hn(t,br.get())}opts;root;constructor(t,n){this.opts=t,this.root=n,t.virtualEl&&t.virtualEl.current?n.triggerNode=li(t.virtualEl.current):n.triggerNode=t.ref}}function dl(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,f]=Sr(n),d={start:"0%",center:"50%",end:"100%"}[f],g=(i.arrow?.x??0)+a/2,v=(i.arrow?.y??0)+l/2;let p="",h="";return u==="bottom"?(p=o?d:`${g}px`,h=`${-l}px`):u==="top"?(p=o?d:`${g}px`,h=`${r.floating.height+l}px`):u==="right"?(p=`${-l}px`,h=o?d:`${v}px`):u==="left"&&(p=`${r.floating.width+l}px`,h=o?d:`${v}px`),{data:{x:p,y:h}}}}}function Sr(e){const[t,n="center"]=e.split("-");return[t,n]}function fl(e){return Sr(e)[0]}function hl(e){return Sr(e)[1]}function gl(e,t){ut(t,!0);let n=x(t,"tooltip",3,!1);dn.create(n());var r=L(),i=D(r);st(i,()=>t.children??pt),A(e,r),dt()}function vl(e,t){ut(t,!0);let n=x(t,"tooltip",3,!1);hn.create({id:T(()=>t.id),virtualEl:T(()=>t.virtualEl),ref:t.ref},n());var r=L(),i=D(r);st(i,()=>t.children??pt),A(e,r),dt()}function pl(e,t){ut(t,!0);let n=x(t,"side",3,"bottom"),r=x(t,"sideOffset",3,0),i=x(t,"align",3,"center"),s=x(t,"alignOffset",3,0),o=x(t,"arrowPadding",3,0),a=x(t,"avoidCollisions",3,!0),l=x(t,"collisionBoundary",19,()=>[]),u=x(t,"collisionPadding",3,0),f=x(t,"hideWhenDetached",3,!1),d=x(t,"onPlaced",3,()=>{}),g=x(t,"sticky",3,"partial"),v=x(t,"updatePositionStrategy",3,"optimized"),p=x(t,"strategy",3,"fixed"),h=x(t,"dir",3,"ltr"),y=x(t,"style",19,()=>({})),b=x(t,"wrapperId",19,hr),E=x(t,"customAnchor",3,null),C=x(t,"tooltip",3,!1);const S=fn.create({side:T(()=>n()),sideOffset:T(()=>r()),align:T(()=>i()),alignOffset:T(()=>s()),id:T(()=>t.id),arrowPadding:T(()=>o()),avoidCollisions:T(()=>a()),collisionBoundary:T(()=>l()),collisionPadding:T(()=>u()),hideWhenDetached:T(()=>f()),onPlaced:T(()=>d()),sticky:T(()=>g()),updatePositionStrategy:T(()=>v()),strategy:T(()=>p()),dir:T(()=>h()),style:T(()=>y()),enabled:T(()=>t.enabled),wrapperId:T(()=>b()),customAnchor:T(()=>E())},C()),N=_(()=>Xt(S.wrapperProps,{style:{pointerEvents:"auto"}}));var O=L(),k=D(O);st(k,()=>t.content??pt,()=>({props:S.props,wrapperProps:c(N)})),A(e,O),dt()}function ml(e,t){ut(t,!0),si(()=>{t.onPlaced?.()});var n=L(),r=D(n);st(r,()=>t.content??pt,()=>({props:{},wrapperProps:{}})),A(e,n),dt()}function yl(e,t){let n=x(t,"isStatic",3,!1),r=ie(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var i=L(),s=D(i);{var o=l=>{ml(l,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},a=l=>{pl(l,Mt({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};at(s,l=>{n()?l(o):l(a,!1)})}A(e,i)}var wl=K("<!> <!>",1);function to(e,t){ut(t,!0);let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"trapFocus",3,!0),i=x(t,"isValidEvent",3,()=>!1),s=x(t,"customAnchor",3,null),o=x(t,"isStatic",3,!1),a=x(t,"tooltip",3,!1),l=x(t,"contentPointerEvents",3,"auto"),u=ie(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);yl(e,{get isStatic(){return o()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get enabled(){return t.enabled},get tooltip(){return a()},content:(d,g)=>{let v=()=>g?.().props,p=()=>g?.().wrapperProps;var h=wl(),y=D(h);{var b=S=>{Kr(S,{get preventScroll(){return t.preventScroll}})},E=S=>{Kr(S,{get preventScroll(){return t.preventScroll}})};at(y,S=>{t.forceMount&&t.enabled?S(b):t.forceMount||S(E,1)})}var C=nt(y,2);tc(C,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(N,O)=>{let k=()=>O?.().props;$a(N,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(j,W)=>{Ja(j,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return i()},get enabled(){return t.enabled},get ref(){return t.ref},children:(I,H)=>{let q=()=>H?.().props;rc(I,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(X,J)=>{var z=L(),G=D(z);{let Z=_(()=>({props:Xt(u,v(),q(),k(),{style:{pointerEvents:l()}}),wrapperProps:p()}));st(G,()=>t.popper??pt,()=>c(Z))}A(X,z)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),A(d,h)},$$slots:{content:!0}}),dt()}function bl(e,t){let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"trapFocus",3,!0),i=x(t,"isValidEvent",3,()=>!1),s=x(t,"customAnchor",3,null),o=x(t,"isStatic",3,!1),a=ie(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=L(),u=D(l);{var f=d=>{to(d,Mt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>a))};at(u,d=>{t.shouldRender&&d(f)})}A(e,l)}function xl(e,t){let n=x(t,"interactOutsideBehavior",3,"close"),r=x(t,"trapFocus",3,!0),i=x(t,"isValidEvent",3,()=>!1),s=x(t,"customAnchor",3,null),o=x(t,"isStatic",3,!1),a=ie(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);to(e,Mt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside}},()=>a,{forceMount:!0}))}var Sl=K("<div><!></div>");function Al(e,t){const n=gn();ut(t,!0);let r=x(t,"ref",15,null),i=x(t,"id",19,()=>pn(n)),s=x(t,"disabled",3,!1),o=x(t,"onSelect",3,ct),a=x(t,"closeOnSelect",3,!0),l=ie(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const u=or.create({id:T(()=>i()),disabled:T(()=>s()),onSelect:T(()=>o()),ref:T(()=>r(),h=>r(h)),closeOnSelect:T(()=>a())}),f=_(()=>Xt(l,u.props));var d=L(),g=D(d);{var v=h=>{var y=L(),b=D(y);st(b,()=>t.child,()=>({props:c(f)})),A(h,y)},p=h=>{var y=Sl();ue(y,()=>({...c(f)}));var b=R(y);st(b,()=>t.children??pt),M(y),A(h,y)};at(g,h=>{t.child?h(v):h(p,!1)})}A(e,d),dt()}var El=K("<div><!></div>");function Ol(e,t){const n=gn();ut(t,!0);let r=x(t,"ref",15,null),i=x(t,"id",19,()=>pn(n)),s=ie(t,["$$slots","$$events","$$legacy","ref","id","child","children"]);const o=sr.create({id:T(()=>i()),ref:T(()=>r(),g=>r(g))}),a=_(()=>Xt(s,o.props));var l=L(),u=D(l);{var f=g=>{var v=L(),p=D(v);st(p,()=>t.child,()=>({props:c(a)})),A(g,v)},d=g=>{var v=El();ue(v,()=>({...c(a)}));var p=R(v);st(p,()=>t.children??pt),M(v),A(g,v)};at(u,g=>{t.child?g(f):g(d,!1)})}A(e,l),dt()}function Tl(e,t){ut(t,!0);let n=x(t,"open",15,!1),r=x(t,"dir",3,"ltr"),i=x(t,"onOpenChange",3,ct),s=x(t,"onOpenChangeComplete",3,ct),o=x(t,"_internal_variant",3,"dropdown-menu");const a=nr.create({variant:T(()=>o()),dir:T(()=>r()),onClose:()=>{n(!1),i()(!1)}});rr.create({open:T(()=>n(),l=>{n(l),i()(l)}),onOpenChangeComplete:T(()=>s())},a),gl(e,{children:(l,u)=>{var f=L(),d=D(f);st(d,()=>t.children??pt),A(l,f)},$$slots:{default:!0}}),dt()}var Pl=K("<div><div><!></div></div>"),Cl=K("<div><div><!></div></div>");function _l(e,t){const n=gn();ut(t,!0);let r=x(t,"id",19,()=>pn(n)),i=x(t,"ref",15,null),s=x(t,"loop",3,!0),o=x(t,"onInteractOutside",3,ct),a=x(t,"onEscapeKeydown",3,ct),l=x(t,"onCloseAutoFocus",3,ct),u=x(t,"forceMount",3,!1),f=x(t,"trapFocus",3,!1),d=ie(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const g=ir.create({id:T(()=>r()),loop:T(()=>s()),ref:T(()=>i(),S=>i(S)),onCloseAutoFocus:T(()=>l())}),v=_(()=>Xt(d,g.props));function p(S){if(g.handleInteractOutside(S),!S.defaultPrevented&&(o()(S),!S.defaultPrevented)){if(S.target&&S.target instanceof Element){const N=`[${g.parentMenu.root.getBitsAttr("sub-content")}]`;if(S.target.closest(N))return}g.parentMenu.onClose()}}function h(S){a()(S),!S.defaultPrevented&&g.parentMenu.onClose()}var y=L(),b=D(y);{var E=S=>{xl(S,Mt(()=>c(v),()=>g.popperProps,{get ref(){return g.opts.ref},get enabled(){return g.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:h,get trapFocus(){return f()},get loop(){return s()},forceMount:!0,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(O,k)=>{let j=()=>k?.().props,W=()=>k?.().wrapperProps;const F=_(()=>Xt(j(),{style:$r("dropdown-menu")},{style:t.style}));var I=L(),H=D(I);{var q=J=>{var z=L(),G=D(z);{let Z=_(()=>({props:c(F),wrapperProps:W(),...g.snippetProps}));st(G,()=>t.child,()=>c(Z))}A(J,z)},X=J=>{var z=Pl();ue(z,()=>({...W()}));var G=R(z);ue(G,()=>({...c(F)}));var Z=R(G);st(Z,()=>t.children??pt),M(G),M(z),A(J,z)};at(H,J=>{t.child?J(q):J(X,!1)})}A(O,I)},$$slots:{popper:!0}}))},C=S=>{bl(S,Mt(()=>c(v),()=>g.popperProps,{get ref(){return g.opts.ref},get open(){return g.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:h,get trapFocus(){return f()},get loop(){return s()},forceMount:!1,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(O,k)=>{let j=()=>k?.().props,W=()=>k?.().wrapperProps;const F=_(()=>Xt(j(),{style:$r("dropdown-menu")},{style:t.style}));var I=L(),H=D(I);{var q=J=>{var z=L(),G=D(z);{let Z=_(()=>({props:c(F),wrapperProps:W(),...g.snippetProps}));st(G,()=>t.child,()=>c(Z))}A(J,z)},X=J=>{var z=Cl();ue(z,()=>({...W()}));var G=R(z);ue(G,()=>({...c(F)}));var Z=R(G);st(Z,()=>t.children??pt),M(G),M(z),A(J,z)};at(H,J=>{t.child?J(q):J(X,!1)})}A(O,I)},$$slots:{popper:!0}}))};at(b,S=>{u()?S(E):u()||S(C,1)})}A(e,y),dt()}var kl=K("<button><!></button>");function Ml(e,t){const n=gn();ut(t,!0);let r=x(t,"id",19,()=>pn(n)),i=x(t,"ref",15,null),s=x(t,"disabled",3,!1),o=x(t,"type",3,"button"),a=ie(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=ar.create({id:T(()=>r()),disabled:T(()=>s()??!1),ref:T(()=>i(),f=>i(f))}),u=_(()=>Xt(a,l.props,{type:o()}));vl(e,{get id(){return r()},get ref(){return l.opts.ref},children:(f,d)=>{var g=L(),v=D(g);{var p=y=>{var b=L(),E=D(b);st(E,()=>t.child,()=>({props:c(u)})),A(y,b)},h=y=>{var b=kl();ue(b,()=>({...c(u)}));var E=R(b);st(E,()=>t.children??pt),M(b),A(y,b)};at(v,y=>{t.child?y(p):y(h,!1)})}A(f,g)},$$slots:{default:!0}}),dt()}const Fl=Tl,Rl=Ml,Dl=ua,Il=_l,ei=Al,Nl=Ol;function Rn(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 4v16"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}],["path",{d:"M9 20h6"}]];pe(e,Mt({name:"type"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Dn(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];pe(e,Mt({name:"calendar"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function In(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["circle",{cx:"12",cy:"12",r:"1"}]];pe(e,Mt({name:"circle-dot"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Nn(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];pe(e,Mt({name:"link"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Ll(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];pe(e,Mt({name:"tag"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Bl(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];pe(e,Mt({name:"check"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}function Wl(e,t){const n=ve(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m15 18-6-6 6-6"}]];pe(e,Mt({name:"chevron-left"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=L(),a=D(o);me(a,t,"default",{}),A(i,o)},$$slots:{default:!0}}))}var zl=K('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Vl=K('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),Kl=K('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Hl=K("<!> <!> <!>",1),Ul=K("<!> <!>",1),jl=K('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Yl=K('<button><span class="ip-status-dot svelte-x7sio8"></span> </button>'),Gl=K('<div class="ip-status-wrap svelte-x7sio8"><div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div> <div class="ip-status-dropdown svelte-x7sio8"></div></div>'),ql=K('<span class="ip-cal-wd svelte-x7sio8"> </span>'),Xl=K("<button> </button>"),Zl=K('<div class="ip-cal-week svelte-x7sio8"></div>'),Jl=K('<div class="ip-cal-wrap svelte-x7sio8"><span class="ip-date-text svelte-x7sio8"> </span> <div class="ip-cal-dropdown svelte-x7sio8"><div class="ip-cal-header svelte-x7sio8"><button class="ip-cal-nav svelte-x7sio8"><!></button> <span class="ip-cal-title svelte-x7sio8"> </span> <button class="ip-cal-nav svelte-x7sio8"><!></button></div> <div class="ip-cal-weekdays svelte-x7sio8"></div> <!></div></div>'),Ql=K('<span class="ip-badge svelte-x7sio8"> </span>'),$l=K('<button class="ip-wikilink-chip svelte-x7sio8"> </button>'),tu=K('<div class="ip-wikilink-group svelte-x7sio8"></div>'),eu=K('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),nu=K('<span class="ip-date-text svelte-x7sio8"> </span>'),ru=K('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),iu=K('<span class="ip-text-value svelte-x7sio8"> </span>'),ou=K('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),su=K('<div class="ip-row ip-add-row svelte-x7sio8"><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"><input class="ip-add-key-input svelte-x7sio8" type="text" placeholder="Property name"/></div> <div class="ip-value svelte-x7sio8"></div></div>'),au=K('<button class="ip-add-btn svelte-x7sio8"><!> <span>Add property</span></button>'),cu=K('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function _u(e,t){ut(t,!0);let n=x(t,"editable",3,!1);const r=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],i=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let s=B(null),o=B(!1),a=B(""),l=B(void 0);function u(P){switch(P.toLowerCase()){case"active":case"current":case"won":return"#3ecf8e";case"in-progress":case"open":return"#f0c246";case"inactive":case"lost":case"closed":case"former":return"#e54d4d";default:return"#5c5c66"}}function f(P){for(const w of Gn.repos){const rt=w.entities.find(Ct=>Ct.id===P);if(rt){zo(`/${w.name}/${rt.entityType}/${rt.id}`);return}}}function d(P){return typeof P.value=="string"?P.value:P.value[0]}function g(P){return/^https?:\/\//.test(P)}function v(P){try{return new Date(P).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return P}}let p=B(qt(new Date().getFullYear())),h=B(qt(new Date().getMonth()));const y=["Su","Mo","Tu","We","Th","Fr","Sa"],b=["January","February","March","April","May","June","July","August","September","October","November","December"];function E(P,w){const rt=new Date(P,w,1).getDay(),Ct=new Date(P,w+1,0).getDate(),oe=new Date(P,w,0).getDate(),xt=[];let bt=[];for(let Ft=rt-1;Ft>=0;Ft--){const Pe=oe-Ft,se=w===0?11:w-1,xn=w===0?P-1:P;bt.push({day:Pe,month:se,year:xn,outside:!0})}for(let Ft=1;Ft<=Ct;Ft++)bt.push({day:Ft,month:w,year:P,outside:!1}),bt.length===7&&(xt.push(bt),bt=[]);if(bt.length>0){const Ft=w===11?0:w+1,Pe=w===11?P+1:P;let se=1;for(;bt.length<7;)bt.push({day:se++,month:Ft,year:Pe,outside:!0});xt.push(bt)}return xt}function C(P){const w=new Date;return P.day===w.getDate()&&P.month===w.getMonth()&&P.year===w.getFullYear()}function S(P,w){const rt=w.slice(0,10).split("-");return P.year===+rt[0]&&P.month===+rt[1]-1&&P.day===+rt[2]}function N(){c(h)===0?(m(h,11),qe(p,-1)):qe(h,-1)}function O(){c(h)===11?(m(h,0),qe(p)):qe(h)}function k(P){try{const w=P.slice(0,10).split("-");m(p,+w[0]),m(h,+w[1]-1)}catch{const w=new Date;m(p,w.getFullYear(),!0),m(h,w.getMonth(),!0)}}function j(P){requestAnimationFrame(()=>{P.focus(),P.select()})}function W(P){!n()||P.type==="badge"||(P.type==="date"&&k(d(P)),m(s,P.key,!0))}function F(P,w){t.onedit&&t.onedit(P,w),m(s,null)}function I(P,w){const rt=`${w.year}-${String(w.month+1).padStart(2,"0")}-${String(w.day).padStart(2,"0")}`;t.onedit&&t.onedit(P,rt),m(s,null)}function H(P,w){t.ontypechange&&t.ontypechange(P,w)}function q(P){m(s,null),t.onremove&&t.onremove(P)}function X(){m(o,!0),m(a,""),requestAnimationFrame(()=>c(l)?.focus())}function J(){const P=c(a).trim();P&&t.onadd&&t.onadd(P,""),m(o,!1),m(a,"")}function z(){m(o,!1),m(a,"")}function G(P){P.key==="Enter"?(P.preventDefault(),J()):P.key==="Escape"&&z()}var Z=cu();De("click",Mo,()=>{m(s,null)});var At=R(Z);Yt(At,17,()=>t.properties,P=>P.key,(P,w)=>{const rt=_(()=>c(s)===c(w).key);var Ct=ou();let oe;var xt=R(Ct),bt=R(xt);{var Ft=$=>{var Q=L(),tt=D(Q);ae(tt,()=>Fl,(Et,Rt)=>{Rt(Et,{children:(_t,Dt)=>{var It=Ul(),Y=D(It);ae(Y,()=>Rl,(U,V)=>{V(U,{class:"ip-icon-trigger",children:(it,ot)=>{var et=L(),Ot=D(et);{var gt=ft=>{Dn(ft,{size:14})},Ut=ft=>{In(ft,{size:14})},jt=ft=>{Nn(ft,{size:14})},$t=ft=>{Rn(ft,{size:14})};at(Ot,ft=>{c(w).type==="date"?ft(gt):c(w).type==="status"?ft(Ut,1):c(w).type==="wikilink"?ft(jt,2):ft($t,!1)})}A(it,et)},$$slots:{default:!0}})});var kt=nt(Y,2);ae(kt,()=>Dl,(U,V)=>{V(U,{children:(it,ot)=>{var et=L(),Ot=D(et);ae(Ot,()=>Il,(gt,Ut)=>{Ut(gt,{class:"ip-menu-content",sideOffset:4,align:"start",children:(jt,$t)=>{var ft=Hl(),He=D(ft);Yt(He,17,()=>r,te,(Ce,Nt)=>{var je=L(),Ar=D(je);ae(Ar,()=>ei,(Ye,Ge)=>{Ge(Ye,{class:"ip-menu-item",onSelect:()=>H(c(w).key,c(Nt).type),children:(An,mu)=>{var Er=Vl(),En=D(Er),uo=R(En);{var fo=mt=>{Rn(mt,{size:13})},ho=mt=>{Dn(mt,{size:13})},go=mt=>{In(mt,{size:13})},vo=mt=>{Nn(mt,{size:13})};at(uo,mt=>{c(Nt).type==="text"?mt(fo):c(Nt).type==="date"?mt(ho,1):c(Nt).type==="status"?mt(go,2):c(Nt).type==="wikilink"&&mt(vo,3)})}M(En);var On=nt(En,2),po=R(On,!0);M(On);var mo=nt(On,2);{var yo=mt=>{var Tn=zl(),wo=R(Tn);Bl(wo,{size:12}),M(Tn),A(mt,Tn)};at(mo,mt=>{c(w).type===c(Nt).type&&mt(yo)})}yt(()=>ht(po,c(Nt).label)),A(An,Er)},$$slots:{default:!0}})}),A(Ce,je)});var Ue=nt(He,2);ae(Ue,()=>Nl,(Ce,Nt)=>{Nt(Ce,{class:"ip-menu-sep"})});var lo=nt(Ue,2);ae(lo,()=>ei,(Ce,Nt)=>{Nt(Ce,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>q(c(w).key),children:(je,Ar)=>{var Ye=Kl(),Ge=D(Ye),An=R(Ge);Io(An,{size:13}),M(Ge),Pn(2),A(je,Ye)},$$slots:{default:!0}})}),A(jt,ft)},$$slots:{default:!0}})}),A(it,et)},$$slots:{default:!0}})}),A(_t,It)},$$slots:{default:!0}})}),A($,Q)},Pe=$=>{var Q=L(),tt=D(Q);{var Et=Y=>{Dn(Y,{size:14})},Rt=Y=>{In(Y,{size:14})},_t=Y=>{Nn(Y,{size:14})},Dt=Y=>{Ll(Y,{size:14})},It=Y=>{Rn(Y,{size:14})};at(tt,Y=>{c(w).type==="date"?Y(Et):c(w).type==="status"?Y(Rt,1):c(w).type==="wikilink"?Y(_t,2):c(w).type==="badge"?Y(Dt,3):Y(It,!1)})}A($,Q)};at(bt,$=>{n()&&c(w).type!=="badge"?$(Ft):$(Pe,!1)})}M(xt);var se=nt(xt,2),xn=R(se,!0);M(se);var Sn=nt(se,2),ro=R(Sn);{var io=$=>{var Q=jl();Bn(Q),jo(Q,tt=>j?.(tt)),yt(tt=>Lo(Q,tt),[()=>d(c(w))]),De("blur",Q,tt=>{const Et=tt.currentTarget.value;Et!==d(c(w))&&t.onedit?.(c(w).key,Et),m(s,null)}),wt("keydown",Q,tt=>{tt.key==="Enter"?tt.currentTarget.blur():tt.key==="Escape"&&(tt.currentTarget.value=d(c(w)),m(s,null))}),A($,Q)},oo=$=>{var Q=Gl(),tt=R(Q),Et=R(tt);let Rt;var _t=nt(Et,2),Dt=R(_t,!0);M(_t),M(tt);var It=nt(tt,2);Yt(It,21,()=>i,te,(Y,kt)=>{var U=Yl();let V;var it=R(U);let ot;var et=nt(it);M(U),yt((Ot,gt)=>{V=Qe(U,1,"ip-status-option svelte-x7sio8",null,V,Ot),ot=_n(it,"",ot,gt),ht(et,` ${c(kt)??""}`)},[()=>({selected:d(c(w))===c(kt)}),()=>({background:u(c(kt))})]),wt("click",U,()=>F(c(w).key,c(kt))),A(Y,U)}),M(It),M(Q),yt((Y,kt)=>{Rt=_n(Et,"",Rt,Y),ht(Dt,kt)},[()=>({background:u(d(c(w)))}),()=>d(c(w))]),wt("click",Q,Y=>Y.stopPropagation()),A($,Q)},so=$=>{var Q=Jl(),tt=R(Q),Et=R(tt,!0);M(tt);var Rt=nt(tt,2),_t=R(Rt),Dt=R(_t),It=R(Dt);Wl(It,{size:14}),M(Dt);var Y=nt(Dt,2),kt=R(Y);M(Y);var U=nt(Y,2),V=R(U);No(V,{size:14}),M(U),M(_t);var it=nt(_t,2);Yt(it,21,()=>y,te,(et,Ot)=>{var gt=ql(),Ut=R(gt,!0);M(gt),yt(()=>ht(Ut,c(Ot))),A(et,gt)}),M(it);var ot=nt(it,2);Yt(ot,17,()=>E(c(p),c(h)),te,(et,Ot)=>{var gt=Zl();Yt(gt,21,()=>c(Ot),te,(Ut,jt)=>{var $t=Xl();let ft;var He=R($t,!0);M($t),yt(Ue=>{ft=Qe($t,1,"ip-cal-day svelte-x7sio8",null,ft,Ue),ht(He,c(jt).day)},[()=>({outside:c(jt).outside,today:C(c(jt)),selected:S(c(jt),d(c(w)))})]),wt("click",$t,()=>I(c(w).key,c(jt))),A(Ut,$t)}),M(gt),A(et,gt)}),M(Rt),M(Q),yt(et=>{ht(Et,et),ht(kt,`${b[c(h)]??""} ${c(p)??""}`)},[()=>v(d(c(w)))]),wt("click",Q,et=>et.stopPropagation()),wt("click",Dt,N),wt("click",U,O),A($,Q)},ao=$=>{{let Q=_(()=>Array.isArray(c(w).value));Zo($,{get value(){return c(w).value},get multi(){return c(Q)},onselect:tt=>{t.onedit?.(c(w).key,tt),m(s,null)},oncancel:()=>{m(s,null)}})}},co=$=>{var Q=L(),tt=D(Q);{var Et=U=>{var V=Ql(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>d(c(w))]),A(U,V)},Rt=U=>{var V=tu();Yt(V,21,()=>Array.isArray(c(w).value)?c(w).value:[c(w).value],te,(it,ot)=>{var et=$l(),Ot=R(et,!0);M(et),yt(()=>ht(Ot,c(ot))),wt("click",et,gt=>{gt.stopPropagation(),f(c(ot))}),A(it,et)}),M(V),A(U,V)},_t=U=>{var V=eu(),it=R(V);let ot;var et=nt(it,2),Ot=R(et,!0);M(et),M(V),yt((gt,Ut)=>{ot=_n(it,"",ot,gt),ht(Ot,Ut)},[()=>({background:u(d(c(w)))}),()=>d(c(w))]),A(U,V)},Dt=U=>{var V=nu(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>v(d(c(w)))]),A(U,V)},It=U=>{var V=ru(),it=R(V,!0);M(V),yt((ot,et)=>{Bo(V,"href",ot),ht(it,et)},[()=>d(c(w)),()=>d(c(w))]),wt("click",V,ot=>ot.stopPropagation()),A(U,V)},Y=_(()=>g(d(c(w)))),kt=U=>{var V=iu(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>d(c(w))]),A(U,V)};at(tt,U=>{c(w).type==="badge"?U(Et):c(w).type==="wikilink"?U(Rt,1):c(w).type==="status"?U(_t,2):c(w).type==="date"?U(Dt,3):c(Y)?U(It,4):U(kt,!1)})}A($,Q)};at(ro,$=>{c(rt)&&c(w).type==="text"?$(io):c(rt)&&c(w).type==="status"?$(oo,1):c(rt)&&c(w).type==="date"?$(so,2):c(rt)&&c(w).type==="wikilink"?$(ao,3):$(co,!1)})}M(Sn),M(Ct),yt(()=>{oe=Qe(Ct,1,"ip-row svelte-x7sio8",null,oe,{"ip-focused":c(rt)}),ht(xn,c(w).key)}),wt("click",xt,$=>$.stopPropagation()),wt("click",Sn,$=>{$.stopPropagation(),W(c(w))}),A(P,Ct)});var Te=nt(At,2);{var eo=P=>{var w=su(),rt=R(w),Ct=R(rt);Tr(Ct,{size:14}),M(rt);var oe=nt(rt,2),xt=R(oe);Bn(xt),Yn(xt,bt=>m(l,bt),()=>c(l)),M(oe),Pn(2),M(w),wt("keydown",xt,G),De("blur",xt,z),ci(xt,()=>c(a),bt=>m(a,bt)),A(P,w)},no=P=>{var w=au(),rt=R(w);Tr(rt,{size:14}),Pn(2),M(w),wt("click",w,Ct=>{Ct.stopPropagation(),X()}),A(P,w)};at(Te,P=>{c(o)?P(eo):n()&&P(no,1)})}M(Z),A(e,Z),dt()}ri(["click","keydown"]);var lu=K('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div></div>');function ku(e,t){ut(t,!0);let n=x(t,"readonly",3,!0),r=x(t,"resetKey",3,0);const i=Ln("theme");let s,o=null,a=t.content,l=!1;function u(g,v){return g.theme({"&":{backgroundColor:"transparent",color:"var(--color-text-primary)",fontSize:"15px",fontFamily:"var(--font-sans)"},".cm-content":{padding:"32px 40px",fontFamily:"var(--font-sans)",caretColor:"var(--color-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:v?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:v?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},".cm-header-1":{fontSize:"22px",fontWeight:"600"},".cm-header-2":{fontSize:"16px",fontWeight:"600"},".cm-header-3":{fontSize:"15px",fontWeight:"600"},".cm-formatting":{color:"var(--color-text-tertiary)",opacity:"0.5"},".cm-link":{color:"var(--color-link)",textDecoration:"none"}},{dark:v})}si(async()=>{const{EditorState:g}=await be(async()=>{const{EditorState:F}=await import("./DnlgZ_Tk.js");return{EditorState:F}},[],import.meta.url),{EditorView:v,keymap:p}=await be(async()=>{const{EditorView:F,keymap:I}=await import("./DtVH--hH.js").then(H=>H.i);return{EditorView:F,keymap:I}},__vite__mapDeps([0,1]),import.meta.url),{markdown:h}=await be(async()=>{const{markdown:F}=await import("./Dh_H7Owr.js");return{markdown:F}},__vite__mapDeps([2,1,0,3,4]),import.meta.url),{syntaxHighlighting:y,HighlightStyle:b}=await be(async()=>{const{syntaxHighlighting:F,HighlightStyle:I}=await import("./4QY4j-jX.js");return{syntaxHighlighting:F,HighlightStyle:I}},__vite__mapDeps([3,4,1,0]),import.meta.url),{tags:E}=await be(async()=>{const{tags:F}=await import("./CUzqHQY_.js").then(I=>I.i);return{tags:F}},[],import.meta.url),{livePreviewPlugin:C,livePreviewTheme:S}=await be(async()=>{const{livePreviewPlugin:F,livePreviewTheme:I}=await import("./aosHekRC.js");return{livePreviewPlugin:F,livePreviewTheme:I}},__vite__mapDeps([5,0,1,3,4]),import.meta.url),N=i.current==="dark",O=u(v,N),k=b.define([{tag:E.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),j=[h(),O,y(k),C,S,v.lineWrapping];n()&&j.push(g.readOnly.of(!0)),t.onchange&&j.push(v.updateListener.of(F=>{if(F.docChanged&&!l){const I=F.state.doc.toString();a=I,t.onchange(I)}})),j.push(v.domEventHandlers({click(F){const I=F.target;if(t.onwikilinkclick){const q=I.closest(".cm-live-wikilink");if(q){F.preventDefault();const X=q.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return X&&t.onwikilinkclick(X),!0}}const H=I.closest(".cm-live-link");if(H){const q=H.getAttribute("data-href");if(q)return F.preventDefault(),window.open(q,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&j.push(p.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const W=g.create({doc:t.content,extensions:j});o=new v({state:W,parent:s})}),vt(()=>{if(r(),o&&t.content!==a){a=t.content;const g=s.closest(".document-scroll"),v=g?.scrollTop??0;l=!0,o.dispatch({changes:{from:0,to:o.state.doc.length,insert:t.content}}),l=!1,g&&requestAnimationFrame(()=>{g.scrollTop=v})}}),Fo(()=>{o?.destroy()});var f=lu(),d=R(f);Yn(d,g=>s=g,()=>s),M(f),A(e,f),dt()}const uu=/^\d{4}-\d{2}-\d{2}/,du=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),fu=new Set(["entity_type","format"]),hu=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Mu(e,t){const n=[];for(const[r,i]of Object.entries(e)){if(hu.has(r)||i==null)continue;const s=gu(r,i);s&&n.push(s)}return n}function gu(e,t){if(fu.has(e))return{key:e,value:String(t).toUpperCase(),type:"badge"};if(e==="status")return{key:e,value:String(t),type:"status"};if(Array.isArray(t)){const i=t.map(String),s=i.some(a=>/^\[\[.+?\]\]$/.test(a)),o=i.map(a=>{const l=a.match(/^\[\[(.+?)\]\]$/);return l?l[1]:a});return s||o.every(a=>ni(a))?{key:e,value:o,type:"wikilink"}:{key:e,value:i.join(", "),type:"text"}}const n=String(t),r=n.match(/^\[\[(.+?)\]\]$/);return r?{key:e,value:r[1],type:"wikilink"}:uu.test(n)?{key:e,value:n,type:"date"}:du.has(n.toLowerCase())?{key:e,value:n,type:"status"}:ni(n)&&!n.includes(" ")?{key:e,value:n,type:"wikilink"}:{key:e,value:n,type:"text"}}function ni(e){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(e)&&e.includes("-")}const vu=800;function pu(){let e=B(!1),t=B(null),n=B(null),r=null,i=null,s=null,o=!1;function a(h,y,b,E){r&&r.repo===h&&r.type===y&&r.id===b?(E.data!==void 0&&(r.payload.data=E.data),E.content!==void 0&&(r.payload.content=E.content)):r={repo:h,type:y,id:b,payload:{...E}},i=null,u()}function l(h,y,b,E,C){i={repo:h,type:y,id:b,filePath:E,content:C},r=null,u()}function u(){s&&clearTimeout(s),s=setTimeout(f,vu)}async function f(){if(s=null,!o){if(r){const{repo:h,type:y,id:b,payload:E}=r;r=null,o=!0,m(e,!0),m(n,null);try{if(await Pr(h,y,b,E),m(t,new Date,!0),E.data?.name){const S=Gn.repos.find(N=>N.name===h)?.entities.find(N=>N.id===b);S&&(S.title=E.data.name)}d()}catch(C){m(n,C.message??"Save failed",!0),r={repo:h,type:y,id:b,payload:E}}finally{m(e,!1),o=!1,(r||i)&&f()}}else if(i){const{repo:h,type:y,id:b,filePath:E,content:C}=i;i=null,o=!0,m(e,!0),m(n,null);try{await Wo(h,y,b,E,C),m(t,new Date,!0),d()}catch(S){m(n,S.message??"Save failed",!0),i={repo:h,type:y,id:b,filePath:E,content:C}}finally{m(e,!1),o=!1,(r||i)&&f()}}}}function d(){Cr.refresh()}function g(){s&&(clearTimeout(s),s=null),(r||i)&&f()}async function v(h,y,b,E){m(e,!0),m(n,null);try{const C=await Pr(h,y,b,E);return m(t,new Date,!0),await Cr.refresh(),C}catch(C){return m(n,C.message??"Save failed",!0),null}finally{m(e,!1)}}function p(){m(n,null),m(t,null),r=null,i=null,s&&(clearTimeout(s),s=null)}return{get saving(){return c(e)},get lastSaved(){return c(t)},get error(){return c(n)},get hasPending(){return!!(r||i||o)},scheduleAutoSave:a,scheduleContentFileSave:l,flush:g,saveEntity:v,reset:p}}const Fu=pu();export{ku as C,_u as I,Fu as e,Mu as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const ut=1024;let qe=0;class L{constructor(e,t){this.from=e,this.to=t}}class A{constructor(e={}){this.id=qe++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=W.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}A.closedBy=new A({deserialize:l=>l.split(" ")});A.openedBy=new A({deserialize:l=>l.split(" ")});A.group=new A({deserialize:l=>l.split(" ")});A.isolate=new A({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});A.contextHash=new A({perNode:!0});A.lookAhead=new A({perNode:!0});A.mounted=new A({perNode:!0});class re{constructor(e,t,r,i=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[A.mounted.id]}}const Je=Object.create(null);class W{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):Je,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new W(e.name||"",t,e.id,r);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(A.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(A.group),n=-1;n<(i?i.length:0);n++){let s=t[n<0?r.name:i[n]];if(s)return s}}}}W.none=new W("",Object.create(null),0,8);class je{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let i=null;for(let n of e){let s=n(r);if(s){i||(i=Object.assign({},r.props));let o=s[1],a=s[0];a.combine&&a.id in i&&(o=a.combine(i[a.id],o)),i[a.id]=o}}t.push(i?new W(r.name,i,r.id,r.flags):r)}return new je(t)}}const he=new WeakMap,Ne=new WeakMap;var v;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays",l[l.EnterBracketed=16]="EnterBracketed"})(v||(v={}));class R{constructor(e,t,r,i,n){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,n&&n.length){this.props=Object.create(null);for(let[s,o]of n)this.props[typeof s=="number"?s:s.id]=o}}toString(){let e=re.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new ge(this.topNode,e)}cursorAt(e,t=0,r=0){let i=he.get(this)||this.topNode,n=new ge(i);return n.moveTo(e,t),he.set(this,n._tree),n}get topNode(){return new T(this,0,0,null)}resolve(e,t=0){let r=se(he.get(this)||this.topNode,e,t,!1);return he.set(this,r),r}resolveInner(e,t=0){let r=se(Ne.get(this)||this.topNode,e,t,!0);return Ne.set(this,r),r}resolveStack(e,t=0){return $e(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:n=this.length}=e,s=e.mode||0,o=(s&v.IncludeAnonymous)>0;for(let a=this.cursor(s|v.IncludeAnonymous);;){let u=!1;if(a.from<=n&&a.to>=i&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;u=!0}for(;u&&r&&(o||!a.type.isAnonymous)&&r(a),!a.nextSibling();){if(!a.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Ae(W.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new R(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new R(W.none,t,r,i)))}static build(e){return Ge(e)}}R.empty=new R(W.none,[],[],0);class ke{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ke(this.buffer,this.index)}}class X{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return W.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],i=this.set.types[t],n=i.name;if(/\W/.test(n)&&!i.isError&&(n=JSON.stringify(n)),e+=4,r==e)return n;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return n+"("+s.join(",")+")"}findChild(e,t,r,i,n){let{buffer:s}=this,o=-1;for(let a=e;a!=t&&!(Fe(n,i,s[a+1],s[a+2])&&(o=a,r>0));a=s[a+3]);return o}slice(e,t,r){let i=this.buffer,n=new Uint16Array(t-e),s=0;for(let o=e,a=0;o<t;){n[a++]=i[o++],n[a++]=i[o++]-r;let u=n[a++]=i[o++]-r;n[a++]=i[o++]-e,s=Math.max(s,u)}return new X(n,s,this.set)}}function Fe(l,e,t,r){switch(l){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function se(l,e,t,r){for(var i;l.from==l.to||(t<1?l.from>=e:l.from>e)||(t>-1?l.to<=e:l.to<e);){let s=!r&&l instanceof T&&l.index<0?null:l.parent;if(!s)return l;l=s}let n=r?0:v.IgnoreOverlays;if(r)for(let s=l,o=s.parent;o;s=o,o=s.parent)s instanceof T&&s.index<0&&((i=o.enter(e,t,n))===null||i===void 0?void 0:i.from)!=s.from&&(l=o);for(;;){let s=l.enter(e,t,n);if(!s)return l;l=s}}class De{cursor(e=0){return new ge(this,e)}getChild(e,t=null,r=null){let i=_e(this,e,t,r);return i.length?i[0]:null}getChildren(e,t=null,r=null){return _e(this,e,t,r)}resolve(e,t=0){return se(this,e,t,!1)}resolveInner(e,t=0){return se(this,e,t,!0)}matchContext(e){return be(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(r=t,t=i.prevSibling):t=i}return r}get node(){return this}get next(){return this.parent}}class T extends De{constructor(e,t,r,i){super(),this._tree=e,this.from=t,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,i,n=0){for(let s=this;;){for(let{children:o,positions:a}=s._tree,u=t>0?o.length:-1;e!=u;e+=t){let h=o[e],p=a[e]+s.from,c;if(!(!(n&v.EnterBracketed&&h instanceof R&&(c=re.get(h))&&!c.overlay&&c.bracketed&&r>=p&&r<=p+h.length)&&!Fe(i,r,p,p+h.length))){if(h instanceof X){if(n&v.ExcludeBuffers)continue;let y=h.findChild(0,h.buffer.length,t,r-p,i);if(y>-1)return new K(new Ke(s,h,e,p),null,y)}else if(n&v.IncludeAnonymous||!h.type.isAnonymous||ve(h)){let y;if(!(n&v.IgnoreMounts)&&(y=re.get(h))&&!y.overlay)return new T(y.tree,p,e,s);let w=new T(h,p,e,s);return n&v.IncludeAnonymous||!w.type.isAnonymous?w:w.nextChild(t<0?h.children.length-1:0,t,r,i,n)}}}if(n&v.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+t:e=t<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let i;if(!(r&v.IgnoreOverlays)&&(i=re.get(this._tree))&&i.overlay){let n=e-this.from,s=r&v.EnterBracketed&&i.bracketed;for(let{from:o,to:a}of i.overlay)if((t>0||s?o<=n:o<n)&&(t<0||s?a>=n:a>n))return new T(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function _e(l,e,t,r){let i=l.cursor(),n=[];if(!i.firstChild())return n;if(t!=null){for(let s=!1;!s;)if(s=i.type.is(t),!i.nextSibling())return n}for(;;){if(r!=null&&i.type.is(r))return n;if(i.type.is(e)&&n.push(i.node),!i.nextSibling())return r==null?n:[]}}function be(l,e,t=e.length-1){for(let r=l;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class Ke{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class K extends De{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,n=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return n<0?null:new K(this.context,this,n)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&v.ExcludeBuffers)return null;let{buffer:i}=this.context,n=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return n<0?null:new K(this.context,this,n)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new K(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new K(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,n=r.buffer[this.index+3];if(n>i){let s=r.buffer[this.index+1];e.push(r.slice(i,n,s)),t.push(0)}return new R(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Le(l){if(!l.length)return null;let e=0,t=l[0];for(let n=1;n<l.length;n++){let s=l[n];(s.from>t.from||s.to<t.to)&&(t=s,e=n)}let r=t instanceof T&&t.index<0?null:t.parent,i=l.slice();return r?i[e]=r:i.splice(e,1),new Ve(i,t)}class Ve{constructor(e,t){this.heads=e,this.node=t}get next(){return Le(this.heads)}}function $e(l,e,t){let r=l.resolveInner(e,t),i=null;for(let n=r instanceof T?r:r.context.parent;n;n=n.parent)if(n.index<0){let s=n.parent;(i||(i=[r])).push(s.resolve(e,t)),n=s}else{let s=re.get(n.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let o=new T(s.tree,s.overlay[0].from+n.from,-1,n);(i||(i=[r])).push(se(o,e,t,!1))}}return i?Le(i):r}class ge{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~v.EnterBracketed,e instanceof T)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof T?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,n=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return n<0?!1:(this.stack.push(this.index),this.yieldBuf(n))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&v.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&v.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&v.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let n=0;n<this.index;n++)if(i.buffer.buffer[n+3]<this.index)return!1;({index:t,parent:r}=i)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let n=t+e,s=e<0?-1:r._tree.children.length;n!=s;n+=e){let o=r._tree.children[n];if(this.mode&v.IncludeAnonymous||o instanceof X||!o.type.isAnonymous||ve(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,n=this.stack.length;n>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,r=n+1;break e}i=this.stack[--n]}for(let i=r;i<this.stack.length;i++)t=new K(this.buffer,t,this.stack[i]);return this.bufferNode=new K(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return be(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let i=e.length-1,n=this.stack.length-1;i>=0;n--){if(n<0)return be(this._tree,e,i);let s=r[t.buffer[this.stack[n]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function ve(l){return l.children.some(e=>e instanceof X||!e.type.isAnonymous||ve(e))}function Ge(l){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=1024,reused:n=[],minRepeatType:s=r.types.length}=l,o=Array.isArray(t)?new ke(t,t.length):t,a=r.types,u=0,h=0;function p(x,N,d,B,k,I){let{id:b,start:g,end:C,size:_}=o,O=h,$=u;if(_<0)if(o.next(),_==-1){let V=n[b];d.push(V),B.push(g-x);return}else if(_==-3){u=b;return}else if(_==-4){h=b;return}else throw new RangeError(`Unrecognized record size: ${_}`);let ie=a[b],ae,Y,Se=g-x;if(C-g<=i&&(Y=M(o.pos-N,k))){let V=new Uint16Array(Y.size-Y.skip),D=o.pos-Y.size,H=V.length;for(;o.pos>D;)H=E(Y.start,V,H);ae=new X(V,C-Y.start,r),Se=Y.start-x}else{let V=o.pos-_;o.next();let D=[],H=[],Z=b>=s?b:-1,te=0,fe=C;for(;o.pos>V;)Z>=0&&o.id==Z&&o.size>=0?(o.end<=fe-i&&(w(D,H,g,te,o.end,fe,Z,O,$),te=D.length,fe=o.end),o.next()):I>2500?c(g,V,D,H):p(g,V,D,H,Z,I+1);if(Z>=0&&te>0&&te<D.length&&w(D,H,g,te,g,fe,Z,O,$),D.reverse(),H.reverse(),Z>-1&&te>0){let Ce=y(ie,$);ae=Ae(ie,D,H,0,D.length,0,C-g,Ce,Ce)}else ae=P(ie,D,H,C-g,O-C,$)}d.push(ae),B.push(Se)}function c(x,N,d,B){let k=[],I=0,b=-1;for(;o.pos>N;){let{id:g,start:C,end:_,size:O}=o;if(O>4)o.next();else{if(b>-1&&C<b)break;b<0&&(b=_-i),k.push(g,C,_),I++,o.next()}}if(I){let g=new Uint16Array(I*4),C=k[k.length-2];for(let _=k.length-3,O=0;_>=0;_-=3)g[O++]=k[_],g[O++]=k[_+1]-C,g[O++]=k[_+2]-C,g[O++]=O;d.push(new X(g,k[2]-C,r)),B.push(C-x)}}function y(x,N){return(d,B,k)=>{let I=0,b=d.length-1,g,C;if(b>=0&&(g=d[b])instanceof R){if(!b&&g.type==x&&g.length==k)return g;(C=g.prop(A.lookAhead))&&(I=B[b]+g.length+C)}return P(x,d,B,k,I,N)}}function w(x,N,d,B,k,I,b,g,C){let _=[],O=[];for(;x.length>B;)_.push(x.pop()),O.push(N.pop()+d-k);x.push(P(r.types[b],_,O,I-k,g-I,C)),N.push(k-d)}function P(x,N,d,B,k,I,b){if(I){let g=[A.contextHash,I];b=b?[g].concat(b):[g]}if(k>25){let g=[A.lookAhead,k];b=b?[g].concat(b):[g]}return new R(x,N,d,B,b)}function M(x,N){let d=o.fork(),B=0,k=0,I=0,b=d.end-i,g={size:0,start:0,skip:0};e:for(let C=d.pos-x;d.pos>C;){let _=d.size;if(d.id==N&&_>=0){g.size=B,g.start=k,g.skip=I,I+=4,B+=4,d.next();continue}let O=d.pos-_;if(_<0||O<C||d.start<b)break;let $=d.id>=s?4:0,ie=d.start;for(d.next();d.pos>O;){if(d.size<0)if(d.size==-3||d.size==-4)$+=4;else break e;else d.id>=s&&($+=4);d.next()}k=ie,B+=_,I+=$}return(N<0||B==x)&&(g.size=B,g.start=k,g.skip=I),g.size>4?g:void 0}function E(x,N,d){let{id:B,start:k,end:I,size:b}=o;if(o.next(),b>=0&&B<s){let g=d;if(b>4){let C=o.pos-(b-4);for(;o.pos>C;)d=E(x,N,d)}N[--d]=g,N[--d]=I-x,N[--d]=k-x,N[--d]=B}else b==-3?u=B:b==-4&&(h=B);return d}let z=[],S=[];for(;o.pos>0;)p(l.start||0,l.bufferStart||0,z,S,-1,0);let F=(e=l.length)!==null&&e!==void 0?e:z.length?S[0]+z[0].length:0;return new R(a[l.topID],z.reverse(),S.reverse(),F)}const Be=new WeakMap;function de(l,e){if(!l.isAnonymous||e instanceof X||e.type!=l)return 1;let t=Be.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=l||!(r instanceof R)){t=1;break}t+=de(l,r)}Be.set(e,t)}return t}function Ae(l,e,t,r,i,n,s,o,a){let u=0;for(let w=r;w<i;w++)u+=de(l,e[w]);let h=Math.ceil(u*1.5/8),p=[],c=[];function y(w,P,M,E,z){for(let S=M;S<E;){let F=S,x=P[S],N=de(l,w[S]);for(S++;S<E;S++){let d=de(l,w[S]);if(N+d>=h)break;N+=d}if(S==F+1){if(N>h){let d=w[F];y(d.children,d.positions,0,d.children.length,P[F]+z);continue}p.push(w[F])}else{let d=P[S-1]+w[S-1].length-x;p.push(Ae(l,w,P,F,S,x,d,null,a))}c.push(x+z-n)}}return y(e,t,r,i,0),(o||a)(p,c,s)}class pt{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof K?this.setBuffer(e.context.buffer,e.index,t):e instanceof T&&this.map.set(e.tree,t)}get(e){return e instanceof K?this.getBuffer(e.context.buffer,e.index):e instanceof T?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class le{constructor(e,t,r,i,n=!1,s=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(n?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new le(0,e.length,e,0,!1,r)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],n=1,s=e.length?e[0]:null;for(let o=0,a=0,u=0;;o++){let h=o<t.length?t[o]:null,p=h?h.fromA:1e9;if(p-a>=r)for(;s&&s.from<p;){let c=s;if(a>=c.from||p<=c.to||u){let y=Math.max(c.from,a)-u,w=Math.min(c.to,p)-u;c=y>=w?null:new le(y,w,c.tree,c.offset+u,o>0,!!h)}if(c&&i.push(c),s.to>p)break;s=n<e.length?e[n++]:null}if(!h)break;a=h.toA,u=h.toA-h.toB}return i}}class ct{startParse(e,t,r){return typeof e=="string"&&(e=new Qe(e)),r=r?r.length?r.map(i=>new L(i.from,i.to)):[new L(0,0)]:[new L(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let n=i.advance();if(n)return n}}}class Qe{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function dt(l){return(e,t,r,i)=>new Ye(e,l,t,r,i)}class Ie{constructor(e,t,r,i,n,s){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=i,this.target=n,this.from=s}}function Pe(l){if(!l.length||l.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class Xe{constructor(e,t,r,i,n,s,o,a){this.parser=e,this.predicate=t,this.mounts=r,this.index=i,this.start=n,this.bracketed=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const xe=new A({perNode:!0});class Ye{constructor(e,t,r,i,n){this.nest=t,this.input=r,this.fragments=i,this.ranges=n,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new R(r.type,r.children,r.positions,r.length,r.propValues.concat([[xe,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[A.mounted.id]=new re(t,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new tt(this.fragments),t=null,r=null,i=new ge(new T(this.baseTree,this.ranges[0].from,0,null),v.IncludeAnonymous|v.IgnoreMounts);e:for(let n,s;;){let o=!0,a;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(t){let u=t.mounts.find(h=>h.frag.from<=i.from&&h.frag.to>=i.to&&h.mount.overlay);if(u)for(let h of u.mount.overlay){let p=h.from+u.pos,c=h.to+u.pos;p>=i.from&&c<=i.to&&!t.ranges.some(y=>y.from<c&&y.to>p)&&t.ranges.push({from:p,to:c})}}o=!1}else if(r&&(s=Ze(r.ranges,i.from,i.to)))o=s!=2;else if(!i.type.isAnonymous&&(n=this.nest(i,this.input))&&(i.from<i.to||!n.overlay)){i.tree||(et(i),t&&t.depth++,r&&r.depth++);let u=e.findMounts(i.from,n.parser);if(typeof n.overlay=="function")t=new Xe(n.parser,n.overlay,u,this.inner.length,i.from,!!n.bracketed,i.tree,t);else{let h=Ee(this.ranges,n.overlay||(i.from<i.to?[new L(i.from,i.to)]:[]));h.length&&Pe(h),(h.length||!n.overlay)&&this.inner.push(new Ie(n.parser,h.length?n.parser.startParse(this.input,Oe(u,h),h):n.parser.startParse(""),n.overlay?n.overlay.map(p=>new L(p.from-i.from,p.to-i.from)):null,!!n.bracketed,i.tree,h.length?h[0].from:i.from)),n.overlay?h.length&&(r={ranges:h,depth:0,prev:r}):o=!1}}else if(t&&(a=t.predicate(i))&&(a===!0&&(a=new L(i.from,i.to)),a.from<a.to)){let u=t.ranges.length-1;u>=0&&t.ranges[u].to==a.from?t.ranges[u]={from:t.ranges[u].from,to:a.to}:t.ranges.push(a)}if(o&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let u=Ee(this.ranges,t.ranges);u.length&&(Pe(u),this.inner.splice(t.index,0,new Ie(t.parser,t.parser.startParse(this.input,Oe(t.mounts,u),u),t.ranges.map(h=>new L(h.from-t.start,h.to-t.start)),t.bracketed,t.target,u[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function Ze(l,e,t){for(let r of l){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function Me(l,e,t,r,i,n){if(e<t){let s=l.buffer[e+1];r.push(l.slice(e,t,s)),i.push(s-n)}}function et(l){let{node:e}=l,t=[],r=e.context.buffer;do t.push(l.index),l.parent();while(!l.tree);let i=l.tree,n=i.children.indexOf(r),s=i.children[n],o=s.buffer,a=[n];function u(h,p,c,y,w,P){let M=t[P],E=[],z=[];Me(s,h,M,E,z,y);let S=o[M+1],F=o[M+2];a.push(E.length);let x=P?u(M+4,o[M+3],s.set.types[o[M]],S,F-S,P-1):e.toTree();return E.push(x),z.push(S-y),Me(s,o[M+3],p,E,z,y),new R(c,E,z,w)}i.children[n]=u(0,o.length,W.none,0,s.length,t.length-1);for(let h of a){let p=l.tree.children[h],c=l.tree.positions[h];l.yield(new T(p,c+l.from,h,l._tree))}}class ze{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(v.IncludeAnonymous|v.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,v.IgnoreOverlays|v.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof R)t=t.children[0];else break}return!1}}class tt{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(xe))!==null&&t!==void 0?t:r.to,this.inner=new ze(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(xe))!==null&&e!==void 0?e:t.to,this.inner=new ze(t.tree,-t.offset)}}findMounts(e,t){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let n=this.inner.cursor.node;n;n=n.parent){let s=(r=n.tree)===null||r===void 0?void 0:r.prop(A.mounted);if(s&&s.parser==t)for(let o=this.fragI;o<this.fragments.length;o++){let a=this.fragments[o];if(a.from>=n.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:n.from-a.offset,mount:s})}}}return i}}function Ee(l,e){let t=null,r=e;for(let i=1,n=0;i<l.length;i++){let s=l[i-1].to,o=l[i].from;for(;n<r.length;n++){let a=r[n];if(a.from>=o)break;a.to<=s||(t||(r=t=e.slice()),a.from<s?(t[n]=new L(a.from,s),a.to>o&&t.splice(n+1,0,new L(o,a.to))):a.to>o?t[n--]=new L(o,a.to):t.splice(n--,1))}}return r}function rt(l,e,t,r){let i=0,n=0,s=!1,o=!1,a=-1e9,u=[];for(;;){let h=i==l.length?1e9:s?l[i].to:l[i].from,p=n==e.length?1e9:o?e[n].to:e[n].from;if(s!=o){let c=Math.max(a,t),y=Math.min(h,p,r);c<y&&u.push(new L(c,y))}if(a=Math.min(h,p),a==1e9)break;h==a&&(s?(s=!1,i++):s=!0),p==a&&(o?(o=!1,n++):o=!0)}return u}function Oe(l,e){let t=[];for(let{pos:r,mount:i,frag:n}of l){let s=r+(i.overlay?i.overlay[0].from:0),o=s+i.tree.length,a=Math.max(n.from,s),u=Math.min(n.to,o);if(i.overlay){let h=i.overlay.map(c=>new L(c.from+r,c.to+r)),p=rt(e,h,a,u);for(let c=0,y=a;;c++){let w=c==p.length,P=w?u:p[c].from;if(P>y&&t.push(new le(y,P,i.tree,-s,n.from>=y||n.openStart,n.to<=P||n.openEnd)),w)break;y=p[c].to}}else t.push(new le(a,u,i.tree,-s,n.from>=s||n.openStart,n.to<=o||n.openEnd))}return t}let it=0;class j{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=it++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof j&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let i=new j(r,[],null,[]);if(i.set.push(i),t)for(let n of t.set)i.set.push(n);return i}static defineModifier(e){let t=new me(e);return r=>r.modified.indexOf(t)>-1?r:me.get(r.base||r,r.modified.concat(t).sort((i,n)=>i.id-n.id))}}let nt=0;class me{constructor(e){this.name=e,this.instances=[],this.id=nt++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(o=>o.base==e&&st(t,o.modified));if(r)return r;let i=[],n=new j(e.name,i,e,t);for(let o of t)o.instances.push(n);let s=lt(t);for(let o of e.set)if(!o.modified.length)for(let a of s)i.push(me.get(o,a));return n}}function st(l,e){return l.length==e.length&&l.every((t,r)=>t==e[r])}function lt(l){let e=[[]];for(let t=0;t<l.length;t++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(l[t]));return e.sort((t,r)=>r.length-t.length)}function ot(l){let e=Object.create(null);for(let t in l){let r=l[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let n=[],s=2,o=i;for(let p=0;;){if(o=="..."&&p>0&&p+3==i.length){s=1;break}let c=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!c)throw new RangeError("Invalid path: "+i);if(n.push(c[0]=="*"?"":c[0][0]=='"'?JSON.parse(c[0]):c[0]),p+=c[0].length,p==i.length)break;let y=i[p++];if(p==i.length&&y=="!"){s=0;break}if(y!="/")throw new RangeError("Invalid path: "+i);o=i.slice(p)}let a=n.length-1,u=n[a];if(!u)throw new RangeError("Invalid path: "+i);let h=new oe(r,s,a>0?n.slice(0,a):null);e[u]=h.sort(e[u])}}return We.add(e)}const We=new A({combine(l,e){let t,r,i;for(;l||e;){if(!l||e&&l.depth>=e.depth?(i=e,e=e.next):(i=l,l=l.next),t&&t.mode==i.mode&&!i.context&&!t.context)continue;let n=new oe(i.tags,i.mode,i.context);t?t.next=n:r=n,t=n}return r}});class oe{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}oe.empty=new oe([],2,null);function He(l,e){let t=Object.create(null);for(let n of l)if(!Array.isArray(n.tag))t[n.tag.id]=n.class;else for(let s of n.tag)t[s.id]=n.class;let{scope:r,all:i=null}=e||{};return{style:n=>{let s=i;for(let o of n)for(let a of o.set){let u=t[a.id];if(u){s=s?s+" "+u:u;break}}return s},scope:r}}function at(l,e){let t=null;for(let r of l){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function ft(l,e,t,r=0,i=l.length){let n=new ht(r,Array.isArray(e)?e:[e],t);n.highlightRange(l.cursor(),r,i,"",n.highlighters),n.flush(i)}class ht{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,n){let{type:s,from:o,to:a}=e;if(o>=r||a<=t)return;s.isTop&&(n=this.highlighters.filter(y=>!y.scope||y.scope(s)));let u=i,h=Ue(e)||oe.empty,p=at(n,h.tags);if(p&&(u&&(u+=" "),u+=p,h.mode==1&&(i+=(i?" ":"")+p)),this.startSpan(Math.max(t,o),u),h.opaque)return;let c=e.tree&&e.tree.prop(A.mounted);if(c&&c.overlay){let y=e.node.enter(c.overlay[0].from+o,1),w=this.highlighters.filter(M=>!M.scope||M.scope(c.tree.type)),P=e.firstChild();for(let M=0,E=o;;M++){let z=M<c.overlay.length?c.overlay[M]:null,S=z?z.from+o:a,F=Math.max(t,E),x=Math.min(r,S);if(F<x&&P)for(;e.from<x&&(this.highlightRange(e,F,x,i,n),this.startSpan(Math.min(x,e.to),u),!(e.to>=S||!e.nextSibling())););if(!z||S>r)break;E=z.to+o,E>t&&(this.highlightRange(y.cursor(),Math.max(t,z.from+o),Math.min(r,E),"",w),this.startSpan(Math.min(r,E),u))}P&&e.parent()}else if(e.firstChild()){c&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,n),this.startSpan(Math.min(r,e.to),u)}while(e.nextSibling());e.parent()}}}function Ue(l){let e=l.type.prop(We);for(;e&&e.context&&!l.matchContext(e.context);)e=e.next;return e||null}const f=j.define,ue=f(),G=f(),Te=f(G),Re=f(G),Q=f(),pe=f(Q),ye=f(Q),J=f(),ee=f(J),U=f(),q=f(),we=f(),ne=f(we),ce=f(),m={comment:ue,lineComment:f(ue),blockComment:f(ue),docComment:f(ue),name:G,variableName:f(G),typeName:Te,tagName:f(Te),propertyName:Re,attributeName:f(Re),className:f(G),labelName:f(G),namespace:f(G),macroName:f(G),literal:Q,string:pe,docString:f(pe),character:f(pe),attributeValue:f(pe),number:ye,integer:f(ye),float:f(ye),bool:f(Q),regexp:f(Q),escape:f(Q),color:f(Q),url:f(Q),keyword:U,self:f(U),null:f(U),atom:f(U),unit:f(U),modifier:f(U),operatorKeyword:f(U),controlKeyword:f(U),definitionKeyword:f(U),moduleKeyword:f(U),operator:q,derefOperator:f(q),arithmeticOperator:f(q),logicOperator:f(q),bitwiseOperator:f(q),compareOperator:f(q),updateOperator:f(q),definitionOperator:f(q),typeOperator:f(q),controlOperator:f(q),punctuation:we,separator:f(we),bracket:ne,angleBracket:f(ne),squareBracket:f(ne),paren:f(ne),brace:f(ne),content:J,heading:ee,heading1:f(ee),heading2:f(ee),heading3:f(ee),heading4:f(ee),heading5:f(ee),heading6:f(ee),contentSeparator:f(J),list:f(J),quote:f(J),emphasis:f(J),strong:f(J),link:f(J),monospace:f(J),strikethrough:f(J),inserted:f(),deleted:f(),changed:f(),invalid:f(),meta:ce,documentMeta:f(ce),annotation:f(ce),processingInstruction:f(ce),definition:j.defineModifier("definition"),constant:j.defineModifier("constant"),function:j.defineModifier("function"),standard:j.defineModifier("standard"),local:j.defineModifier("local"),special:j.defineModifier("special")};for(let l in m){let e=m[l];e instanceof j&&(e.name=l)}He([{tag:m.link,class:"tok-link"},{tag:m.heading,class:"tok-heading"},{tag:m.emphasis,class:"tok-emphasis"},{tag:m.strong,class:"tok-strong"},{tag:m.keyword,class:"tok-keyword"},{tag:m.atom,class:"tok-atom"},{tag:m.bool,class:"tok-bool"},{tag:m.url,class:"tok-url"},{tag:m.labelName,class:"tok-labelName"},{tag:m.inserted,class:"tok-inserted"},{tag:m.deleted,class:"tok-deleted"},{tag:m.literal,class:"tok-literal"},{tag:m.string,class:"tok-string"},{tag:m.number,class:"tok-number"},{tag:[m.regexp,m.escape,m.special(m.string)],class:"tok-string2"},{tag:m.variableName,class:"tok-variableName"},{tag:m.local(m.variableName),class:"tok-variableName tok-local"},{tag:m.definition(m.variableName),class:"tok-variableName tok-definition"},{tag:m.special(m.variableName),class:"tok-variableName2"},{tag:m.definition(m.propertyName),class:"tok-propertyName tok-definition"},{tag:m.typeName,class:"tok-typeName"},{tag:m.namespace,class:"tok-namespace"},{tag:m.className,class:"tok-className"},{tag:m.macroName,class:"tok-macroName"},{tag:m.propertyName,class:"tok-propertyName"},{tag:m.operator,class:"tok-operator"},{tag:m.comment,class:"tok-comment"},{tag:m.meta,class:"tok-meta"},{tag:m.invalid,class:"tok-invalid"},{tag:m.punctuation,class:"tok-punctuation"}]);const gt=Object.freeze(Object.defineProperty({__proto__:null,Tag:j,getStyleTags:Ue,highlightTree:ft,styleTags:ot,tagHighlighter:He,tags:m},Symbol.toStringTag,{value:"Module"}));export{ut as D,v as I,A as N,ct as P,R as T,le as a,W as b,m as c,j as d,je as e,pt as f,ft as h,gt as i,dt as p,ot as s,He as t};
|